using backstage.Models.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace backstage.Models.TokenVault
{
    public class TokenVault

    {
        public int vault_id { get; set; }
        public int merchant_id { get; set; }

        public string name { get; set; }
        public string url { get; set; }
        public string desc { get; set; }
        public int type { get; set; }
        public int enabled { get; set; }
        public DateTime created { get; set; }
        public int tokenCount { get; set; }
        public int userCount { get; set; }


    }
    public class TokenVaultForCreate

    {
        public int type { get; set; } = 1;
        public int merchant_id { get; set; }

        public string name { get; set; }
        public string url { get; set; } = "";
        public string description { get; set; }


    }
    public class TokenVaultResponse
    {
        public int r { get; set; }
        public string m { get; set; }
        public string flags { get; set; }
        //public int count { get; set; }
        public List<TokenVault> info { get; set; }
    }

    public class Field
    {
        public int id { get; set; }
        public string name { get; set; }
        public string desc { get; set; }
        public string format_exp { get; set; }
        public int Enabled { get; set; }
        public string key_id { get; set; }
        public List<User> users { get; set; }
        public List<Mask> masks { get; set; }
    }

    public class FieldForCreate
    {
        public int merchant_id { get; set; }
        public int vault_id { get; set; }
        public string name { get; set; }
        public string desc { get; set; }
        public string format_exp { get; set; }
        public int enabled { get; set; }
       
    }

    public class FieldsResponse
    {
        public int r { get; set; }
        public string m { get; set; }
        public string flags { get; set; }
        public List<string> failInfo { get; set; }
    
        //public int count { get; set; }
        public List<Field> fields { get; set; }
    }


    public class Mask
    {
        public int id { get; set; }
        public int type { get; set; }//0:資料遮罩 *號  , 1:資料亂碼 相同格式 數字或文字替換
        public int is_unique { get; set; }
        public string setting { get; set; }
       
    }

}
