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

namespace backstage.Models.Users
{
    public class User
    {
        public int id { get; set; }
        public int uid { get; set; }
        public string name { get; set; }
        public string name_en { get; set; }
        public string username { get; set; }

        //登入用
        public string pwd { get; set; }
        //新增使用者用
        public string password { get; set; }
        public string newPassword { get; set; }

        public List<emaildata> email { get; set; }
        public int locked { get; set; }
        public DateTime created_date { get; set; }
        public DateTime creation_date { get; set; }
        public DateTime birthdate { get; set; }
        public int enabled { get; set; } = 1;
     
        public string marital_status { get; set; }
        public string gender { get; set; }
        public string education { get; set; }
        public string natid { get; set; }
        public string lang { get; set; } = "zhg";
        //判斷是否為admin
        public bool isAdmin { get; set; } = false;
        public int[] admin_rold_id { get; set; } = new int [1];//最高權限

        //=========Fields=========
        public List<int> masks{get;set;}
        public string masksText { get; set; }
        public string masksSettingText { get; set; }
        public int allow_decrypt { get; set; }
        public int allow_new { get; set; }
        public int allow_update { get; set; }
        public int allow_del { get; set; }
        public int default_mask_id { get; set; }

    }


public class emaildata
    {
        public int id { get; set; }

        public string email { get; set; }
        public string type { get; set; }


    }
    public class phonedata
    {
        public int id { get; set; }

        public string phone { get; set; }
        public string type { get; set; }


    }
    public class UserLogin
    {
        //public int Id { get; set; }

        public int r { get; set; }

        public string token { get; set; }
        public string m { get; set; }
        public string flags { get; set; }

    }
    public class GetUserResponse
    {
        //user/list response
        public int r { get; set; }
        public string m { get; set; }

        public User user { get; set; }

        public List<emaildata> email { get; set; }
    }
    public class UserResponse
    {
        //user/list response
        public int r { get; set; }
        public string m { get; set; }
        public int userCount { get; set; }
        public List<User> Users { get; set; }
        public User user { get; set; }

        ////User/add response
        //public string uid { get; set; }
        //public string code_time { get; set; }
        //public List<Object> verifyEmail { get; set; }
        //public string flags { get; set; }
    }
    public class UserAddResponse
    {
        //user/list response
        public int r { get; set; }
        public Object m { get; set; }


        //User/add response
        public string uid { get; set; }
        public string code_time { get; set; }
        public List<Object> verifyEmail { get; set; }
        public string flags { get; set; }
    }




}
