using Microsoft.EntityFrameworkCore;
using Back.Data.Models;

namespace TaxPayer.Infrastructure.Persistence
{
    public class SqlDbContext : DbContext
    {
        public SqlDbContext(DbContextOptions<SqlDbContext> options) : base(options)
        {
        }
        #region Table
        public DbSet<BillType> BillTypes { get; set; }
        public DbSet<Fild> Filds { get; set; }
        public DbSet<FildMode> FildModes { get; set; }
        public DbSet<FildModeInPattern> FildModeInPattern { get; set; }
        public DbSet<Pattern> Patterns { get; set; }
        public DbSet<Coding> Codings { get; set; }
        public DbSet<SpecialCondition> SpecialConditions { get; set; }
        public DbSet<Company> Companies { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<CalculationType> CalculationTypes { get; set; }
        public DbSet<Permission> Permissions { get; set; }
        public DbSet<PermissionPeriod> PermissionPeriods { get; set; }
        public DbSet<RolUser> RolUsers { get; set; }
        public DbSet<Customer> Customers { get; set; }
        public DbSet<CODUnit> CODUnits { get; set; }
        public DbSet<CODItem> CODItems { get; set; }
        public DbSet<Invoice> Invoices { get; set; }
        public DbSet<InvoiceItem> InvoiceItems { get; set; }
        public DbSet<InvoicePayment> InvoicePayments { get; set; }
        public DbSet<PermissionUser> PermissionUsers { get; set; }
        public DbSet<InvoiceStatusChang> InvoiceStatusChangs { get; set; }
        public DbSet<VerificationCode> VerificationCodes { get; set; }
        public DbSet<Pricing> Pricing { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderItem> OrderItems { get; set; }
        public DbSet<Notification> Notifications { get; set; }
        public DbSet<Question> Questions { get; set; }
        public DbSet<QuestionCategory> QuestionCategories { get; set; }
        public DbSet<Blog> Blogs { get; set; }
        public DbSet<Ticket> Tickets { get; set; }
        public DbSet<SubTicket> SubTickets { get; set; }
        public DbSet<OrderDiscountCode> OrderDiscountCodes { get; set; }
        public DbSet<TiceketUnknownPeople> TiceketUnknownPeoples { get; set; }
        public DbSet<SaleLead> SaleLeads { get; set; }
        public DbSet<UserNotfi> UserNotifis { get; set; }
        #endregion
        //public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
        //{
        //    foreach (var entry in ChangeTracker.Entries<EntityBase>())
        //    {
        //        switch (entry.State)
        //        {
        //            case EntityState.Added:
        //                entry.Entity.CreateDate = "";
        //                entry.Entity.CreatedBy = "mohammad";
        //                break;
        //            case EntityState.Modified:
        //                entry.Entity.ModifiedDate = "";
        //                entry.Entity.LastModifiedBy = "mohammad";
        //                break;
        //        }
        //    }

        //    return base.SaveChangesAsync(cancellationToken);
        //}
    }
}
