﻿using SQLite.Net.Attributes;

namespace Currency.Plugin.Models
{
    public class CurrencyUserModel
    {
        [PrimaryKey, AutoIncrement]
        public int Id { get; set; }
        public string NickName { get; set; }
        public string ChannelName { get; set; }
        public int TotalCurrency { get; set; }
        public int UsedCurrency { get; set; }

        [Ignore]
        public int AvailableAmount => (TotalCurrency - UsedCurrency);

        public bool CanAfford(int amount)
        {
            return (AvailableAmount - amount) >= 0;
        }
    }
}
