using ReallifeGamemode.Server.Business;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace ReallifeGamemode.Server.Entities
{
    public class BusinessBankAccount : IBankAccount
    {
        [NotMapped]
        private int _balance;

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public int Balance
        {
            get => _balance;
            set
            {
                _balance = value;
                BusinessManager.GetBusiness(BusinessId).Update(value);
            }
        }

        public int BusinessId { get; set; }
    }
}
