diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..3f0e003 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Wallet.Data/Seeders/Seed.cs b/Wallet.Data/Seeders/Seed.cs new file mode 100644 index 0000000..867881b --- /dev/null +++ b/Wallet.Data/Seeders/Seed.cs @@ -0,0 +1,82 @@ +namespace Wallet.Data.Seeders +{ + public class Seed + { + public List Roles { get; set; } = new(); + + public List Genders { get; set; } = new(); + + public List UserTypes { get; set; } = new(); + + public List TransactionTypes { get; set; } = new(); + + public List TransactionModes { get; set; } = new(); + + public List Bills { get; set; } = new(); + + public List BillModes { get; set; } = new(); + + public List Menus { get; set; } = new(); + + public List StampDutyCharges { get; set; } = new(); + + public SeedAdminUser AdminUser { get; set; } = new(); + } + + public class SeedAdminUser + { + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string UserName { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public string Role { get; set; } = string.Empty; + + public string UserType { get; set; } = string.Empty; + + public string Gender { get; set; } = string.Empty; + } + + public class SeedBill + { + public string Id { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public decimal Amount { get; set; } + } + + public class SeedBillMode + { + public string Id { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string BillId { get; set; } = string.Empty; + } + + public class SeedStampDutyCharge + { + public string Id { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public decimal Amount { get; set; } + } + + public class SeedMenu + { + public string Id { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public int OrderId { get; set; } + } +} \ No newline at end of file diff --git a/Wallet.Data/Seeders/SeedApplicationData.cs b/Wallet.Data/Seeders/SeedApplicationData.cs new file mode 100644 index 0000000..d24c4ef --- /dev/null +++ b/Wallet.Data/Seeders/SeedApplicationData.cs @@ -0,0 +1,247 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Wallet.Data.Seeders; +using Wallet.Entities.Models.Context; +using Wallet.Entities.Models.Domain; + +namespace WalletApi.Data.Seeders +{ + public static class SeedApplicationData + { + public static IServiceCollection BindSeedConfig(this IServiceCollection services, IConfiguration configuration) + { + Seed seed = new(); + + configuration.GetSection("Seed").Bind(seed); + + services.AddSingleton(seed); + + return services; + } + + public static async Task EnsurePopulated(IApplicationBuilder app) + { + using var scope = app.ApplicationServices.CreateScope(); + + Seed seed = scope.ServiceProvider.GetRequiredService(); + WalletDbContext context = scope.ServiceProvider.GetRequiredService(); + UserManager userManager = scope.ServiceProvider.GetRequiredService>(); + RoleManager roleManager = scope.ServiceProvider.GetRequiredService>(); + + await context.Database.MigrateAsync(); + + var strategy = context.Database.CreateExecutionStrategy(); + + await strategy.ExecuteAsync(async () => + { + await using IDbContextTransaction transaction = await context.Database.BeginTransactionAsync(); + + try + { + await SeedIfEmptyAsync(context.Genders, seed.Genders.Select(name => new Gender + { + Name = name, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.UserTypes, seed.UserTypes.Select(name => new UserType + { + Name = name, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.TransactionTypes, seed.TransactionTypes.Select(name => new TransactionType + { + Name = name, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.TransactionModes, seed.TransactionModes.Select(name => new TransactionMode + { + Name = name, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.Bills, seed.Bills.Select(bill => new Bill + { + Id = bill.Id, + Name = bill.Name, + Amount = bill.Amount, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.BillModes, seed.BillModes.Select(billMode => new BillMode + { + Id = billMode.Id, + Name = billMode.Name, + BillId = billMode.BillId, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedIfEmptyAsync(context.StampDutyCharges, seed.StampDutyCharges.Select(stampDutyCharge => new StampDutyCharge + { + Id = stampDutyCharge.Id, + Name = stampDutyCharge.Name, + Amount = stampDutyCharge.Amount, + Active = true + }), + context); + + await SeedIfEmptyAsync(context.Menus, seed.Menus.Select(menu => new Menu + { + Id = menu.Id, + Name = menu.Name, + OrderId = menu.OrderId, + CreatedBy = "seed", + UpdatedBy = "seed" + }), + context); + + await SeedRolesAsync(roleManager, seed); + + await SeedAdminUserAsync(context, userManager, seed); + + await transaction.CommitAsync(); + } + catch + { + await transaction.RollbackAsync(); + throw; + } + }); + } + + private static async Task SeedIfEmptyAsync(DbSet dbSet, IEnumerable entities, WalletDbContext context) where T : class + { + if (await dbSet.AnyAsync()) + return; + + List items = entities.ToList(); + + if (!items.Any()) + return; + + await dbSet.AddRangeAsync(items); + + //await context.SaveChangesAsync(); + } + + private static async Task SeedRolesAsync(RoleManager roleManager, Seed seed) + { + foreach (string role in seed.Roles) + { + if (await roleManager.RoleExistsAsync(role)) + continue; + + ApplicationRole applicationRole = new ApplicationRole + { + Name = role, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }; + + IdentityResult result = await roleManager.CreateAsync(applicationRole); + + if (!result.Succeeded) + { + throw new InvalidOperationException( + string.Join(", ", result.Errors.Select(x => x.Description))); + } + } + } + + private static async Task SeedAdminUserAsync(WalletDbContext context, UserManager userManager, Seed seed) + { + if (await userManager.Users.AnyAsync()) + return; + + SeedAdminUser adminSeed = seed.AdminUser; + + UserType userType = await context.UserTypes.FirstOrDefaultAsync(x => x.Name == adminSeed.UserType); + + if (userType == null) + throw new InvalidOperationException($"User type '{adminSeed.UserType}' was not found."); + + ApplicationUser user = new ApplicationUser + { + FirstName = adminSeed.FirstName, + LastName = adminSeed.LastName, + Email = adminSeed.Email, + UserName = adminSeed.UserName, + PhoneNumber = adminSeed.PhoneNumber, + UserTypeId = userType.Id, + Active = true, + EmailConfirmed = true, + PhoneNumberConfirmed = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }; + + IdentityResult createUser = await userManager.CreateAsync(user, adminSeed.Password); + + if (!createUser.Succeeded) + { + throw new InvalidOperationException( + string.Join(", ", createUser.Errors.Select(x => x.Description))); + } + + IdentityResult addToRole = await userManager.AddToRoleAsync(user, adminSeed.Role); + + if (!addToRole.Succeeded) + { + throw new InvalidOperationException( + string.Join(", ", addToRole.Errors.Select(x => x.Description))); + } + + await SeedAdminStaffAsync(context, user, adminSeed); + } + + private static async Task SeedAdminStaffAsync(WalletDbContext context, ApplicationUser user, SeedAdminUser adminSeed) + { + if (await context.Staff.AnyAsync(x => x.UserId == user.Id)) + return; + + Gender gender = await context.Genders.FirstOrDefaultAsync(x => x.Name == adminSeed.Gender); + + if (gender == null) + throw new InvalidOperationException($"Gender '{adminSeed.Gender}' was not found."); + + context.Staff.Add(new Staff + { + Id = Guid.NewGuid().ToString(), + UserId = user.Id, + Email = user.Email ?? string.Empty, + PhoneNumber = user.PhoneNumber ?? string.Empty, + Gender = gender, + Active = true, + CreatedBy = "seed", + UpdatedBy = "seed" + }); + + await context.SaveChangesAsync(); + } + } +} \ No newline at end of file diff --git a/Wallet.Data/Wallet.Data.csproj b/Wallet.Data/Wallet.Data.csproj index d9cf544..649ec5a 100644 --- a/Wallet.Data/Wallet.Data.csproj +++ b/Wallet.Data/Wallet.Data.csproj @@ -8,7 +8,14 @@ - + + + + + + + + diff --git a/Wallet.Entities/Data/AirTimeSeed.cs b/Wallet.Entities/Data/AirTimeSeed.cs deleted file mode 100644 index ff2e75e..0000000 --- a/Wallet.Entities/Data/AirTimeSeed.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using Wallet.Entities.Models.Domain; - -namespace Wallet.Entities.Data -{ - class AirTimeSeed : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.HasData( - new AirTime - { - Id = Guid.Parse("1DA5EB5F-04CC-4F0E-AFA6-52B3C78BEDF9"), - NetworkProvider = "Mtn", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }, - new AirTime - { - Id = Guid.Parse("D584F98C-4A22-482D-BC9E-C1899AEDCC57"), - NetworkProvider = "Airtel", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }); - } - } -} diff --git a/Wallet.Entities/Data/BillPaymentSeed.cs b/Wallet.Entities/Data/BillPaymentSeed.cs deleted file mode 100644 index bb9fdb3..0000000 --- a/Wallet.Entities/Data/BillPaymentSeed.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using Wallet.Entities.Models.Domain; - -namespace Wallet.Entities.Data -{ - class BillPaymentSeed : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.HasData( - new Bill - { - Id = Guid.Parse("F1179901-AF52-4774-B8E5-76E76B55C8C5"), - BillName = "DSTV", - Amount = 6500, - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }, - new Bill - { - Id = Guid.Parse("637C3058-F4C2-45AA-A30C-301CC5D2D101"), - BillName = "GOTV", - Amount = 3000, - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }); - } - } -} diff --git a/Wallet.Entities/Data/DataSeed.cs b/Wallet.Entities/Data/DataSeed.cs deleted file mode 100644 index fa47809..0000000 --- a/Wallet.Entities/Data/DataSeed.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; - -namespace Wallet.Entities.Data -{ - public class DataSeed : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.HasData( - new Models.Domain.NetworkData - { - Id = Guid.Parse("CE185A95-533E-425C-ADF4-A5770766564B"), - NetworkProvider = "Mtn", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }, - new Models.Domain.NetworkData - { - Id = Guid.Parse("9806F26B-E013-4DFF-812A-AFBA47D2FBE0"), - NetworkProvider = "Airtel", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }); - } - } -} diff --git a/Wallet.Entities/Data/RoleSeed.cs b/Wallet.Entities/Data/RoleSeed.cs deleted file mode 100644 index 39e735b..0000000 --- a/Wallet.Entities/Data/RoleSeed.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using Wallet.Entities.Models.Domain; - -namespace Wallet.Entities.Data -{ - public class RoleSeed : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.HasData( - new Role - { - Name = "Admin", - NormalizedName = "ADMIN", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }, - new Role - { - Name = "Manager", - NormalizedName = "MANAGER", - CreatedAt = DateTime.Now, - UpdatedAt = DateTime.Now - }); - } - } -} diff --git a/Wallet.Entities/Dto/Request/DepositTransactionDto.cs b/Wallet.Entities/Dto/Request/DepositTransactionDto.cs index 32ec9fc..fee3cff 100644 --- a/Wallet.Entities/Dto/Request/DepositTransactionDto.cs +++ b/Wallet.Entities/Dto/Request/DepositTransactionDto.cs @@ -7,15 +7,13 @@ namespace Wallet.Entities.Dto.Request { public class DepositTransactionDto { - public TransactionType TransactionType { get; set; } - public TransactionMode TransactionMode { get; set; } public string NetworkProvider { get; set; } public string BillName { get; set; } public string UserId { get; set; } public string PhoneNumber { get; set; } [ForeignKey(nameof(UserId))] - public User User { get; set; } + public ApplicationUser User { get; set; } [Column(TypeName = "decimal(38,2)")] public decimal Amount { get; set; } @@ -26,4 +24,4 @@ public class DepositTransactionDto public string SenderWalletId { get; set; } public DateTime TimeStamp { get; set; } } -} +} \ No newline at end of file diff --git a/Wallet.Entities/Mapper/MappingProfile.cs b/Wallet.Entities/Mapper/MappingProfile.cs index aae3a9b..e0967ea 100644 --- a/Wallet.Entities/Mapper/MappingProfile.cs +++ b/Wallet.Entities/Mapper/MappingProfile.cs @@ -11,26 +11,20 @@ public class MappingProfile : Profile public MappingProfile() { //Create User - CreateMap(); + CreateMap(); + - CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); - - CreateMap(); + + CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); - + //CreateMap() // .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.User.Email)); @@ -39,23 +33,21 @@ public MappingProfile() .ForPath(dest => dest.User.Email, opt => opt.MapFrom(src => src.Email)); // Update Staff and Customer by Put - CreateMap (); + CreateMap(); // Get all staff and Get staff by Id - CreateMap () - .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.LastName} {src.FirstName}")) + CreateMap() + .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.User.LastName} {src.User.FirstName}")) .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.User.Email)) .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.PhoneNumber)) - .ForMember(dest => dest.Address, opt => opt.MapFrom(src => - $"{src.Address.PlotNo} {src.Address.StreetName} {src.Address.State} {src.Address.Nationality}")); + .ForMember(dest => dest.Address, opt => opt.MapFrom(src => $"{src.Address.PlotNo} {src.Address.StreetName} {src.Address.State} {src.Address.Nationality}")); // Get Staff by Email - CreateMap() - .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.Staff.LastName} {src.Staff.FirstName}")) + CreateMap() + .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.Staff.User.LastName} {src.Staff.User.FirstName}")) .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Email)) .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.Staff.PhoneNumber)) - .ForMember(dest => dest.Address, opt => opt.MapFrom(src => - $"{src.Staff.Address.PlotNo} {src.Staff.Address.StreetName} {src.Staff.Address.State} {src.Staff.Address.Nationality}")); + .ForMember(dest => dest.Address, opt => opt.MapFrom(src => $"{src.Staff.Address.PlotNo} {src.Staff.Address.StreetName} {src.Staff.Address.State} {src.Staff.Address.Nationality}")); // Uodate Customer by Patch CreateMap() @@ -63,35 +55,26 @@ public MappingProfile() // Get all Customer and Get Customer by Id CreateMap() - .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.LastName} {src.FirstName}")) + .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.User.LastName} {src.User.FirstName}")) .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.User.Email)) .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.PhoneNumber)) - .ForMember(dest => dest.WalletNo, opt => opt.MapFrom(src => src.Wallet.WalletNo)) - .ForMember(dest => dest.WalletBalance, opt => opt.MapFrom(src => src.Wallet.Balance)) - .ForMember(dest => dest.Address, opt => opt.MapFrom(src => - $"{src.Address.PlotNo} {src.Address.StreetName} {src.Address.State} {src.Address.Nationality}")); + .ForMember(dest => dest.Address, opt => opt.MapFrom(src => $"{src.Address.PlotNo} {src.Address.StreetName} {src.Address.State} {src.Address.Nationality}")); // Get Customer by Email - CreateMap() - .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.Customer.LastName} {src.Customer.FirstName}")) + CreateMap() + .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.Customer.User.LastName} {src.Customer.User.FirstName}")) .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Email)) .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.Customer.PhoneNumber)) - .ForMember(dest => dest.WalletNo, opt => opt.MapFrom(src => src.Customer.Wallet.WalletNo)) - .ForMember(dest => dest.WalletBalance, opt => opt.MapFrom(src => src.Customer.Wallet.Balance)) - .ForMember(dest => dest.Address, opt => opt.MapFrom(src => - $"{src.Customer.Address.PlotNo} {src.Customer.Address.StreetName} {src.Customer.Address.State} {src.Customer.Address.Nationality}")); + .ForMember(dest => dest.Address, opt => opt.MapFrom(src => $"{src.Customer.Address.PlotNo} {src.Customer.Address.StreetName} {src.Customer.Address.State} {src.Customer.Address.Nationality}")); // Get Customer by Walletno CreateMap() - .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.Customer.LastName} {src.Customer.FirstName}")) - .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Customer.User.Email)) - .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.Customer.PhoneNumber)) - .ForMember(dest => dest.WalletNo, opt => opt.MapFrom(src => src.WalletNo)) - .ForMember(dest => dest.WalletBalance, opt => opt.MapFrom(src => src.Balance)) - .ForMember(dest => dest.Address, opt => opt.MapFrom(src => - $"{src.Customer.Address.PlotNo} {src.Customer.Address.StreetName} {src.Customer.Address.State} {src.Customer.Address.Nationality}")); - - + .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.User.LastName} {src.User.FirstName}")) + .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.User.Email)) + .ForMember(dest => dest.PhoneNumber, opt => opt.MapFrom(src => src.User.PhoneNumber)) + .ForMember(dest => dest.WalletNo, opt => opt.MapFrom(src => src.WalletNumber)) + .ForMember(dest => dest.WalletBalance, opt => opt.MapFrom(src => src.Balance)); + //.ForMember(dest => dest.Address, opt => opt.MapFrom(src => $"{.Address.PlotNo} {src.Customer.Address.StreetName} {src.Customer.Address.State} {src.User.Address.Nationality}")); } } -} +} \ No newline at end of file diff --git a/Wallet.Entities/Models/Context/WalletDbContext.cs b/Wallet.Entities/Models/Context/WalletDbContext.cs index 2deb095..ebfb74c 100644 --- a/Wallet.Entities/Models/Context/WalletDbContext.cs +++ b/Wallet.Entities/Models/Context/WalletDbContext.cs @@ -1,39 +1,36 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using System; using System.Threading; using System.Threading.Tasks; -using Wallet.Entities.Data; using Wallet.Entities.Interfaces; using Wallet.Entities.Models.Domain; namespace Wallet.Entities.Models.Context { - public class WalletDbContext : IdentityDbContext + public class WalletDbContext : IdentityDbContext, ApplicationRoleClaim, IdentityUserToken> { public WalletDbContext(DbContextOptions options) : base(options) { } - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - //modelBuilder.ApplyConfiguration(new RoleSeed()); - //modelBuilder.ApplyConfiguration(new AirTimeSeed()); - //modelBuilder.ApplyConfiguration(new DataSeed()); - //modelBuilder.ApplyConfiguration(new BillPaymentSeed()); - - modelBuilder.Entity() - .HasOne(a => a.Address) - .WithOne(b => b.Staff) - .OnDelete(DeleteBehavior.Cascade); - - modelBuilder.Entity() - .HasOne(a => a.Address) - .WithOne(b => b.Customer) - .OnDelete(DeleteBehavior.Cascade); - } + public DbSet
Address { get; set; } + public DbSet Bills { get; set; } + public DbSet Customers { get; set; } + public DbSet Transactions { get; set; } + public DbSet Staff { get; set; } + public DbSet Menus { get; set; } + public DbSet StampDutyCharges { get; set; } + public DbSet TransactionStampDutyCharges { get; set; } + public DbSet Wallets { get; set; } + public DbSet ProfilePictures { get; set; } + public DbSet Genders { get; set; } + public DbSet UserTypes { get; set; } + public DbSet BillModes { get; set; } + public DbSet TransactionTypes { get; set; } + public DbSet TransactionModes { get; set; } public override int SaveChanges(bool acceptAllChangesOnSuccess) { @@ -75,17 +72,100 @@ private void OnBeforeSaving() } } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + foreach (var entity in modelBuilder.Model.GetEntityTypes()) + { - public DbSet
Address { get; set; } - public DbSet AirTimes { get; set; } - public DbSet Bills { get; set; } - public DbSet Customers { get; set; } - public DbSet Data { get; set; } - public DbSet Transactions { get; set; } - public DbSet StaffProfile { get; set; } - public DbSet StampDutyCharges { get; set; } - public DbSet TransactionStampDutyCharges { get; set; } - public DbSet Wallets { get; set; } - public DbSet ProfilePictures { get; set; } + foreach (var property in entity.GetProperties()) + { + if (property.ClrType == typeof(string)) + { + if (property.IsKey() || property.IsForeignKey() || property.IsIndex()) + { + property.SetColumnType("varchar(256)"); + continue; + } + else + { + property.SetColumnType("varchar(MAX)"); + } + } + } + } + + modelBuilder.Entity(b => + { + b.HasOne(x => x.User) + .WithMany() + .HasForeignKey(x => x.UserId) + .IsRequired(); + + b.HasOne(x => x.Role) + .WithMany(x => x.UserRoles) + .HasForeignKey(x => x.RoleId) + .IsRequired(); + }); + + modelBuilder.Entity(b => + { + b.HasOne(x => x.Role) + .WithMany(x => x.RoleClaims) + .HasForeignKey(x => x.RoleId) + .IsRequired(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity
(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + }); + } } -} +} \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Address.cs b/Wallet.Entities/Models/Domain/Address.cs index c08a058..3b98e51 100644 --- a/Wallet.Entities/Models/Domain/Address.cs +++ b/Wallet.Entities/Models/Domain/Address.cs @@ -1,26 +1,29 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Interfaces; namespace Wallet.Entities.Models.Domain { public class Address : ITracker { - [Key] - public Guid Id { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(45)] + public string UserId { get; set; } public int? PlotNo { get; set; } public string? StreetName { get; set; } public string? City { get; set; } public string? State { get; set; } public string? Nationality { get; set; } - public Guid? CustomerId { get; set; } - public Guid? StaffId { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } public bool Active { get; set; } - public virtual Customer Customer { get; set; } - public virtual Staff Staff { get; set; } + public virtual ApplicationUser User { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/ApplicationRole.cs b/Wallet.Entities/Models/Domain/ApplicationRole.cs new file mode 100644 index 0000000..a9e63ec --- /dev/null +++ b/Wallet.Entities/Models/Domain/ApplicationRole.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Identity; +using System; +using System.Collections.Generic; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class ApplicationRole : IdentityRole, ITracker + { + public bool Active { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + public virtual ICollection UserRoles { get; set; } + public virtual ICollection RoleClaims { get; set; } + } +} \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/ApplicationRoleClaim.cs b/Wallet.Entities/Models/Domain/ApplicationRoleClaim.cs new file mode 100644 index 0000000..fae69af --- /dev/null +++ b/Wallet.Entities/Models/Domain/ApplicationRoleClaim.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using System; +using System.ComponentModel.DataAnnotations; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class ApplicationRoleClaim : IdentityRoleClaim, ITracker + { + public bool Active { get; set; } = true; + + [Unicode(false)] + [MaxLength(36)] + public string? MenuId { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + public virtual Menu Menu { get; set; } + public virtual ApplicationRole Role { get; set; } + } +} diff --git a/Wallet.Entities/Models/Domain/ApplicationUser.cs b/Wallet.Entities/Models/Domain/ApplicationUser.cs new file mode 100644 index 0000000..e17d25d --- /dev/null +++ b/Wallet.Entities/Models/Domain/ApplicationUser.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Identity; +using System; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class ApplicationUser : IdentityUser, ITracker + { + public string LastName { get; set; } + public string FirstName { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + public bool Active { get; set; } + public int UserTypeId { get; set; } + public virtual Staff Staff { get; set; } + public virtual Wallet Wallet { get; set; } + public virtual Customer Customer { get; set; } + public virtual UserType UserType { get; set; } + } +} \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Role.cs b/Wallet.Entities/Models/Domain/ApplicationUserClaim.cs similarity index 68% rename from Wallet.Entities/Models/Domain/Role.cs rename to Wallet.Entities/Models/Domain/ApplicationUserClaim.cs index cfc4e0c..c4b8e53 100644 --- a/Wallet.Entities/Models/Domain/Role.cs +++ b/Wallet.Entities/Models/Domain/ApplicationUserClaim.cs @@ -4,12 +4,14 @@ namespace Wallet.Entities.Models.Domain { - public class Role : IdentityRole, ITracker + public class ApplicationUserClaim : IdentityUserClaim, ITracker { public bool Active { get; set; } + public string? MenuId { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } + public virtual Menu Menu { get; set; } } -} \ No newline at end of file +} diff --git a/Wallet.Entities/Models/Domain/User.cs b/Wallet.Entities/Models/Domain/ApplicationUserRole.cs similarity index 65% rename from Wallet.Entities/Models/Domain/User.cs rename to Wallet.Entities/Models/Domain/ApplicationUserRole.cs index cf188a0..2b9d993 100644 --- a/Wallet.Entities/Models/Domain/User.cs +++ b/Wallet.Entities/Models/Domain/ApplicationUserRole.cs @@ -4,15 +4,14 @@ namespace Wallet.Entities.Models.Domain { - public class User : IdentityUser, ITracker + public class ApplicationUserRole : IdentityUserRole, ITracker { - public bool IsActive{ get; set; } + public bool Active { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } - public bool Active { get; set; } - public virtual Staff Staff { get; set; } - public virtual Customer Customer { get; set; } + public virtual ApplicationUser User { get; set; } + public virtual ApplicationRole Role { get; set; } } -} \ No newline at end of file +} diff --git a/Wallet.Entities/Models/Domain/Bill.cs b/Wallet.Entities/Models/Domain/Bill.cs index 27f2fef..bf72cf1 100644 --- a/Wallet.Entities/Models/Domain/Bill.cs +++ b/Wallet.Entities/Models/Domain/Bill.cs @@ -1,4 +1,7 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Interfaces; @@ -7,9 +10,12 @@ namespace Wallet.Entities.Models.Domain { public class Bill : ITracker { - [Key] - public Guid Id { get; set; } - public string BillName { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } [Column(TypeName = "decimal(38,2)")] public decimal Amount { get; set; } @@ -18,5 +24,6 @@ public class Bill : ITracker public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } + public virtual ICollection BillMode { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/BillMode.cs b/Wallet.Entities/Models/Domain/BillMode.cs new file mode 100644 index 0000000..215c072 --- /dev/null +++ b/Wallet.Entities/Models/Domain/BillMode.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class BillMode : ITracker + { + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } + public string BillId { get; set; } + public bool Active { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + public virtual Bill Bill { get; set; } + } +} \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Customer.cs b/Wallet.Entities/Models/Domain/Customer.cs index 6208f2b..74d3e49 100644 --- a/Wallet.Entities/Models/Domain/Customer.cs +++ b/Wallet.Entities/Models/Domain/Customer.cs @@ -1,5 +1,7 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Enumerators; using Wallet.Entities.Interfaces; @@ -7,20 +9,28 @@ namespace Wallet.Entities.Models.Domain { public class Customer : ITracker { - [Key] - public Guid Id { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(45)] + public string UserId { get; set; } + + [Unicode(false)] + [MaxLength(18)] public string PhoneNumber { get; set; } - public Gender Gender { get; set; } + + [Unicode(false)] + [MaxLength(60)] + public string Email { get; set; } + public int GenderId { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public bool Active { get; set; } - public string UserId { get; set; } - public virtual User User { get; set; } - public virtual Wallet Wallet { get; set; } + public Gender Gender { get; set; } public virtual Address Address { get; set; } + public virtual ApplicationUser User { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/AirTime.cs b/Wallet.Entities/Models/Domain/Gender.cs similarity index 62% rename from Wallet.Entities/Models/Domain/AirTime.cs rename to Wallet.Entities/Models/Domain/Gender.cs index f972a7d..230ca62 100644 --- a/Wallet.Entities/Models/Domain/AirTime.cs +++ b/Wallet.Entities/Models/Domain/Gender.cs @@ -1,18 +1,21 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; using Wallet.Entities.Interfaces; namespace Wallet.Entities.Models.Domain { - public class AirTime : ITracker + public class Gender : ITracker { - [Key] - public Guid Id { get; set; } - public string NetworkProvider { get; set; } + public int Id { get; set; } + + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } + public bool Active { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } - public bool Active { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Menu.cs b/Wallet.Entities/Models/Domain/Menu.cs new file mode 100644 index 0000000..705f1ef --- /dev/null +++ b/Wallet.Entities/Models/Domain/Menu.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class Menu :ITracker + { + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(25)] + public string Name { get; set; } + public int OrderId { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + public IList? Claims { get; set; } + } +} diff --git a/Wallet.Entities/Models/Domain/ProfilePicture.cs b/Wallet.Entities/Models/Domain/ProfilePicture.cs index 6764164..4b18ffb 100644 --- a/Wallet.Entities/Models/Domain/ProfilePicture.cs +++ b/Wallet.Entities/Models/Domain/ProfilePicture.cs @@ -1,14 +1,20 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace Wallet.Entities.Models.Domain { public class ProfilePicture { - [Key] - public Guid Id { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(45)] + public string UserId { get; set; } public string Picture { get; set; } public bool Active { get; set; } - public Guid UserId { get; set; } + public ApplicationUser User { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Staff.cs b/Wallet.Entities/Models/Domain/Staff.cs index 7dc1401..49fab34 100644 --- a/Wallet.Entities/Models/Domain/Staff.cs +++ b/Wallet.Entities/Models/Domain/Staff.cs @@ -1,5 +1,7 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Enumerators; using Wallet.Entities.Interfaces; @@ -7,19 +9,27 @@ namespace Wallet.Entities.Models.Domain { public class Staff : ITracker { - [Key] - public Guid Id { get; set; } - public string LastName { get; set; } - public string FirstName { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(45)] + public string UserId { get; set; } + + [Unicode(false)] + [MaxLength(18)] public string PhoneNumber { get; set; } + + [Unicode(false)] + [MaxLength(60)] + public string Email { get; set; } public Gender Gender { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } public bool Active { get; set; } - public string UserId { get; set; } - public virtual User User { get; set; } - public virtual Address Address { get; set; } + public virtual Address? Address { get; set; } + public virtual ApplicationUser User { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/StampDutyCharge.cs b/Wallet.Entities/Models/Domain/StampDutyCharge.cs index 1271256..351cd56 100644 --- a/Wallet.Entities/Models/Domain/StampDutyCharge.cs +++ b/Wallet.Entities/Models/Domain/StampDutyCharge.cs @@ -6,12 +6,11 @@ namespace Wallet.Entities.Models.Domain { public class StampDutyCharge { - [Key] - public Guid Id { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } public string Name { get; set; } - public bool Active { get; set; } - [Column(TypeName = "decimal(38,2)")] public decimal Amount { get; set; } + public bool Active { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/Transaction.cs b/Wallet.Entities/Models/Domain/Transaction.cs index 6f72a1f..4567245 100644 --- a/Wallet.Entities/Models/Domain/Transaction.cs +++ b/Wallet.Entities/Models/Domain/Transaction.cs @@ -1,33 +1,35 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Wallet.Entities.Enumerators; - namespace Wallet.Entities.Models.Domain { public class Transaction { [Key] public Guid Id { get; set; } - public TransactionType TransactionType { get; set; } - public TransactionMode TransactionMode { get; set; } - public string NetworkProvider { get; set; } - public string BillName { get; set; } - public string PhoneNumber { get; set; } + public int TransactionTypeId { get; set; } + public int TransactionModeId { get; set; } + + [Unicode(false)] + [MaxLength(18)] + public string? PhoneNumber { get; set; } + public string? BillModeId { get; set; } [Column(TypeName = "decimal(38,2)")] public decimal Amount { get; set; } [Column(TypeName = "decimal(38,2)")] - public decimal StampDuty { get; set; } - public string ReceiverWalletId { get; set; } - public string SenderWalletId { get; set; } + public decimal? StampDuty { get; set; } + public string SenderAccount { get; set; } public DateTime TimeStamp { get; set; } - public Guid CustomerId { get; set; } - public string StampDutyId { get; set; } + public string? StampDutyChargeId { get; set; } public bool Active { get; set; } - - //[ForeignKey(nameof(CustomerId))] - public virtual Customer Customer { get; set; } + public string WalletId { get; set; } + public virtual Wallet Wallet { get; set; } + public virtual BillMode BillMode { get; set; } + public virtual StampDutyCharge StampDutyCharge { get; set; } + public virtual TransactionType TransactionType { get; set; } + public virtual TransactionMode TransactionMode { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/TransactionMode.cs b/Wallet.Entities/Models/Domain/TransactionMode.cs new file mode 100644 index 0000000..af812da --- /dev/null +++ b/Wallet.Entities/Models/Domain/TransactionMode.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.ComponentModel.DataAnnotations; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class TransactionMode : ITracker + { + public int Id { get; set; } + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } + public bool Active { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + } +} diff --git a/Wallet.Entities/Models/Domain/TransactionStampDutyCharge.cs b/Wallet.Entities/Models/Domain/TransactionStampDutyCharge.cs index 2b615ba..12c742b 100644 --- a/Wallet.Entities/Models/Domain/TransactionStampDutyCharge.cs +++ b/Wallet.Entities/Models/Domain/TransactionStampDutyCharge.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Enumerators; @@ -7,17 +8,21 @@ namespace Wallet.Entities.Models.Domain { public class TransactionStampDutyCharge { - [Key] - public Guid Id { get; set; } - public TransactionMode TransactionMode { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } + + [Unicode(false)] + [MaxLength(45)] + public string UserId { get; set; } [Column(TypeName = "decimal(38,2)")] - public decimal StampDuty { get; set; } + public decimal Amount { get; set; } + public string StampDutyId { get; set; } public DateTime TimeStamp { get; set; } - public Guid CustomerId { get; set; } public bool Active { get; set; } - - //[ForeignKey(nameof(CustomerId))] - public virtual Customer Customer { get; set; } + public string WalletId { get; set; } + public virtual Wallet Wallet { get; set; } + public virtual ApplicationUser User { get; set; } + public virtual StampDutyCharge StampDuty { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Models/Domain/TransactionType.cs b/Wallet.Entities/Models/Domain/TransactionType.cs new file mode 100644 index 0000000..2a7adee --- /dev/null +++ b/Wallet.Entities/Models/Domain/TransactionType.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.ComponentModel.DataAnnotations; +using Wallet.Entities.Interfaces; + +namespace Wallet.Entities.Models.Domain +{ + public class TransactionType : ITracker + { + public int Id { get; set; } + + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } + public bool Active { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + public string CreatedBy { get; set; } + public string UpdatedBy { get; set; } + } +} diff --git a/Wallet.Entities/Models/Domain/NetworkData.cs b/Wallet.Entities/Models/Domain/UserType.cs similarity index 55% rename from Wallet.Entities/Models/Domain/NetworkData.cs rename to Wallet.Entities/Models/Domain/UserType.cs index 36aa717..1ba6b22 100644 --- a/Wallet.Entities/Models/Domain/NetworkData.cs +++ b/Wallet.Entities/Models/Domain/UserType.cs @@ -1,18 +1,21 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.ComponentModel.DataAnnotations; using Wallet.Entities.Interfaces; namespace Wallet.Entities.Models.Domain { - public class NetworkData : ITracker + public class UserType :ITracker { - [Key] - public Guid Id { get; set; } - public string NetworkProvider { get; set; } - public bool IsDeletd { get; set; } + public int Id { get; set; } + + [Unicode(false)] + [MaxLength(20)] + public string Name { get; set; } + public bool Active { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } } -} \ No newline at end of file +} diff --git a/Wallet.Entities/Models/Domain/Wallet.cs b/Wallet.Entities/Models/Domain/Wallet.cs index b12bd05..71958c3 100644 --- a/Wallet.Entities/Models/Domain/Wallet.cs +++ b/Wallet.Entities/Models/Domain/Wallet.cs @@ -1,4 +1,6 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Wallet.Entities.Interfaces; @@ -7,20 +9,26 @@ namespace Wallet.Entities.Models.Domain { public class Wallet : ITracker { - [Key] - public Guid Id { get; set; } + [Column(TypeName = "varchar(256)")] + public string Id { get; set; } [MaxLength(10), MinLength(10)] - public string WalletNo { get; set; } - public Guid CustomerId { get; set; } + public string WalletNumber { get; set; } + [Unicode(false)] + [MaxLength(45)] + public string? UserId { get; set; } + [Column(TypeName = "decimal(38,2)")] public decimal Balance { get; set; } - public bool Active { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } - public virtual Customer Customer { get; set; } + public bool Active { get; set; } + public virtual ApplicationUser User { get; set; } + public virtual ICollection Transactions { get; set; } + public virtual ICollection StampDutyCharges { get; set; } + public virtual ICollection TransactionStampDutyCharges { get; set; } } } \ No newline at end of file diff --git a/Wallet.Entities/Wallet.Entities.csproj b/Wallet.Entities/Wallet.Entities.csproj index 7f829a6..985fa14 100644 --- a/Wallet.Entities/Wallet.Entities.csproj +++ b/Wallet.Entities/Wallet.Entities.csproj @@ -6,9 +6,20 @@ + + + + + + + + + + + diff --git a/Wallet.Services/Interfaces/IAirTimeService.cs b/Wallet.Services/Interfaces/IAirTimeService.cs deleted file mode 100644 index db984ce..0000000 --- a/Wallet.Services/Interfaces/IAirTimeService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.JsonPatch; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.GobalMessage; -using Wallet.Entities.Models.Domain; - -namespace Wallet.Services.Interfaces -{ - public interface IAirTimeService - { - IEnumerable GetTotalNumberOfAirTime(); - Task DeleteAirTimeByName(string name); - Task EditAirTime(Guid Id, JsonPatchDocument model); - Task AddAirTime(CreateNetworkProviderDto model); - Task ToggleAirTimeStatus(Guid airTimeId); - Task DeleteAirTimeById(Guid airTimeId); - } -} diff --git a/Wallet.Services/Interfaces/ICustomerService.cs b/Wallet.Services/Interfaces/ICustomerService.cs index cb57675..eb7764f 100644 --- a/Wallet.Services/Interfaces/ICustomerService.cs +++ b/Wallet.Services/Interfaces/ICustomerService.cs @@ -10,16 +10,16 @@ namespace Wallet.Services.Interfaces public interface ICustomerService { Task CreateCustomer(UsersCreateRequestDto model); - Task DeleteCustomerById(Guid id); - Task UpdateCustomerAddress(Guid customerId, UpdateAddressDto model); - Task PatchCustomerAddress(Guid customerId, JsonPatchDocument model); - Task UpdateCustomer(Guid id, JsonPatchDocument model); + Task DeleteCustomerById(string id); + Task UpdateCustomerAddress(string customerId, UpdateAddressDto model); + Task PatchCustomerAddress(string customerId, JsonPatchDocument model); + Task UpdateCustomer(string id, JsonPatchDocument model); Task> GetAllCustomers(); Task> GetAllDeletedCustomers(); - Task GetCustomer(Guid id); + Task GetCustomer(string id); Task GetCustomerByEmail(string email); - Task SoftDeleteCustomer(Guid id); - Task UnDeleteCustomer(Guid id); + Task SoftDeleteCustomer(string id); + Task UnDeleteCustomer(string id); Task GetCustomerByWalletNo(string WalletNo); } } diff --git a/Wallet.Services/Interfaces/IDataService.cs b/Wallet.Services/Interfaces/IDataService.cs deleted file mode 100644 index dc0af3e..0000000 --- a/Wallet.Services/Interfaces/IDataService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.AspNetCore.JsonPatch; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.GobalMessage; - -namespace Wallet.Services.Interfaces -{ - public interface IDataService - { - Task AddData(CreateNetworkProviderDto model); - Task EditData(Guid Id, JsonPatchDocument model); - Task DeleteDataByName(string name); - IEnumerable GetTotalNumberOfData(); - } -} diff --git a/Wallet.Services/Interfaces/IRoleservice.cs b/Wallet.Services/Interfaces/IRoleservice.cs index cd4e20b..416fd31 100644 --- a/Wallet.Services/Interfaces/IRoleservice.cs +++ b/Wallet.Services/Interfaces/IRoleservice.cs @@ -18,7 +18,7 @@ public interface IRoleService Task AddUserToRole(UserRoleDto request); Task RemoveUserFromRole(UserRoleDto request); Task> GetUserRoles(string userName); - IEnumerable GetTotalNumberOfRoles(); + IEnumerable GetTotalNumberOfRoles(); Task> GetAllRoles(); } -} +} \ No newline at end of file diff --git a/Wallet.Services/Interfaces/ISelectService.cs b/Wallet.Services/Interfaces/ISelectService.cs index ea0844a..971b710 100644 --- a/Wallet.Services/Interfaces/ISelectService.cs +++ b/Wallet.Services/Interfaces/ISelectService.cs @@ -6,10 +6,6 @@ namespace Wallet.Services.Interfaces { public interface ISelectService { - Task> GetAllAirTime(); - Task> GetAllBills(); - - Task> GetAllData(); } } diff --git a/Wallet.Services/Interfaces/IStaffService.cs b/Wallet.Services/Interfaces/IStaffService.cs index b78145d..f91d8b5 100644 --- a/Wallet.Services/Interfaces/IStaffService.cs +++ b/Wallet.Services/Interfaces/IStaffService.cs @@ -11,13 +11,13 @@ namespace Wallet.Services.Interfaces public interface IStaffService { Task CreateStaff(UsersCreateRequestDto model); - Task UpdateStaffAddress(Guid staffId, UpdateAddressDto model); + Task UpdateStaffAddress(string staffId, UpdateAddressDto model); Task> GetAllStaff(); - Task GetStaff(Guid id); + Task GetStaff(string id); IEnumerable GetTotalNumberOfStaff(); - Task DeleteStaffById(Guid id); + Task DeleteStaffById(string id); Task GetStaffByEmail(string email); - Task UpdateStaff(Guid id, JsonPatchDocument model); - Task PatchStaffAddress(Guid staffId, JsonPatchDocument model); + Task UpdateStaff(string id, JsonPatchDocument model); + Task PatchStaffAddress(string staffId, JsonPatchDocument model); } } diff --git a/Wallet.Services/Services/AirTimeService.cs b/Wallet.Services/Services/AirTimeService.cs deleted file mode 100644 index dc0b9f2..0000000 --- a/Wallet.Services/Services/AirTimeService.cs +++ /dev/null @@ -1,112 +0,0 @@ -using AutoMapper; -using Microsoft.AspNetCore.JsonPatch; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Wallet.Data.Interfaces; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.GobalMessage; -using Wallet.Entities.Models.Domain; -using Wallet.Services.Interfaces; -namespace Wallet.Services.Services -{ - public class AirTimeService : IAirTimeService - { - private readonly IServiceFactory _serviceFactory; - private readonly IMapper _mapper; - private readonly IRepository _airTimeRepo; - private readonly IUnitOfWork _unitOfWork; - - public AirTimeService(IServiceFactory serviceFactory) - { - _serviceFactory = serviceFactory; - _unitOfWork = _serviceFactory.GetServices(); - _airTimeRepo = _unitOfWork.GetRepository(); - _mapper = _serviceFactory.GetServices(); - } - - public IEnumerable GetTotalNumberOfAirTime() - { - return _airTimeRepo.GetAll(); - } - - public async Task AddAirTime(CreateNetworkProviderDto model) - { - var existingAirTime = await _airTimeRepo.GetSingleByAsync(a => a.NetworkProvider == model.NetworkProvider.Trim().ToLower()); - if (existingAirTime != null) - return new Response(false, "Network Provider name already Exist"); - - var airTimeDdto = _mapper.Map(model); - - await _airTimeRepo.AddAsync(airTimeDdto); - - return new Response(true, $" AiiTime {model.NetworkProvider} has been created Successfully!"); - } - - public async Task EditAirTime(Guid Id, JsonPatchDocument model) - { - var airTime = await _airTimeRepo.GetByIdAsync(Id); - - if (airTime is null) - return new Response(false, "ArTime does not Exist"); - - var airTimeDto = new PatchNetworkProviderDto - { - NetworkProvider = airTime.NetworkProvider - }; - - model.ApplyTo(airTimeDto); - - _mapper.Map(airTimeDto, airTime); - - _airTimeRepo.Update(airTime); - - return new Response(true, $"AirTime Updated Successfully, see Details below \nNetwork Name : {airTime.NetworkProvider}"); - } - - public async Task DeleteAirTimeByName(string name) - { - var airTime = await _airTimeRepo.GetSingleByAsync(a => a.NetworkProvider == name.Trim().ToLower()); - - if (airTime is null) - return new Response(false, "AirTime does not Exist"); - - _airTimeRepo.Delete(airTime); - - return new Response(true, $"AirTime with Name {airTime.NetworkProvider} has been deleted Successfully"); - } - - public async Task DeleteAirTimeById(Guid airTimeId) - { - AirTime airTime = await _airTimeRepo.GetSingleByAsync(a => a.Id == airTimeId); - - if (airTime is null) - return new Response(false, $"AirTime with Id {airTimeId} does not Exist"); - - _airTimeRepo.Delete(airTime); - - return new Response(true, $"AirTime with Name {airTime.NetworkProvider} has been deleted Successfully"); - } - - public async Task ToggleAirTimeStatus(Guid airTimeId) - { - AirTime airTime = await _airTimeRepo.GetSingleByAsync(a => a.Id == airTimeId); - - if (airTime is null) - return new Response(false, $"AirTime with Id {airTimeId} does not Exist"); - - airTime.Active = !airTime.Active; - - await _airTimeRepo.UpdateAsync(airTime); - - if(airTime.Active == true) - { - return new Response(true, $"AirTime with Name {airTime.NetworkProvider} has been deleted Successfully"); - } - else - { - return new Response(true, $"AirTime with Name {airTime.NetworkProvider} has been activated Successfully"); - } - } - } -} diff --git a/Wallet.Services/Services/AuthenticationService.cs b/Wallet.Services/Services/AuthenticationService.cs index c746eba..27e0c6e 100644 --- a/Wallet.Services/Services/AuthenticationService.cs +++ b/Wallet.Services/Services/AuthenticationService.cs @@ -15,7 +15,7 @@ namespace Wallet.Services.Services { public class AuthenticationService : IAuthenticationService { - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly IServiceFactory _serviceFactory; private readonly IUnitOfWork _unitOfWork; private readonly IMapper _mapper; @@ -23,10 +23,9 @@ public class AuthenticationService : IAuthenticationService public AuthenticationService(IServiceFactory serviceFactory) { _serviceFactory = serviceFactory; - _userManager = _serviceFactory.GetServices>(); + _userManager = _serviceFactory.GetServices>(); _mapper = _serviceFactory.GetServices(); _mapper = _serviceFactory.GetServices(); } - } -} +} \ No newline at end of file diff --git a/Wallet.Services/Services/BackgroundTaskService.cs b/Wallet.Services/Services/BackgroundTaskService.cs index 1e8be67..0ca93c9 100644 --- a/Wallet.Services/Services/BackgroundTaskService.cs +++ b/Wallet.Services/Services/BackgroundTaskService.cs @@ -13,7 +13,7 @@ namespace Wallet.Services.Services { public class BackgroundTaskService : IHostedService, IDisposable { - private readonly IRepository _userRepo; + private readonly IRepository _userRepo; private readonly IServiceFactory _serviceFactory; private readonly IUnitOfWork _unitOfWork; private readonly ILoggerMessage _logger; @@ -23,7 +23,7 @@ public BackgroundTaskService(IServiceFactory serviceFactory) { _serviceFactory = serviceFactory; _unitOfWork = _serviceFactory.GetServices(); - _userRepo = _unitOfWork.GetRepository(); + _userRepo = _unitOfWork.GetRepository(); _logger = serviceFactory.GetServices(); } @@ -73,4 +73,4 @@ private async void DeleteUsersWithUnconfirmedEmail(object state) } } } -} +} \ No newline at end of file diff --git a/Wallet.Services/Services/BillService.cs b/Wallet.Services/Services/BillService.cs index a3f5345..9daa31a 100644 --- a/Wallet.Services/Services/BillService.cs +++ b/Wallet.Services/Services/BillService.cs @@ -28,7 +28,7 @@ public BillService(IServiceFactory serviceFactory) public async Task AddBill(CreateBillDto model) { - var existingBill = await _billRepo.GetSingleByAsync(b => b.BillName == model.BillName.Trim().ToLower()); + var existingBill = await _billRepo.GetSingleByAsync(b => b.Name == model.BillName.Trim().ToLower()); if (existingBill != null) return new Response(false, "Bill Name already Exist"); @@ -48,7 +48,7 @@ public async Task EditBill(Guid Id, JsonPatchDocument mo var billDto = new PatchBillDto { - BillName = bill.BillName, + BillName = bill.Name, Amount = bill.Amount }; @@ -58,19 +58,19 @@ public async Task EditBill(Guid Id, JsonPatchDocument mo _billRepo.Update(bill); - return new Response(true, $"Bill Updated Successfully, see Details below\nBill Name : {bill.BillName} \nAmount : {bill.Amount}"); + return new Response(true, $"Bill Updated Successfully, see Details below\nBill Name : {bill.Name} \nAmount : {bill.Amount}"); } public async Task DeleteBillByName(string name) { - var bill = await _billRepo.GetSingleByAsync(b => b.BillName == name.Trim().ToLower()); + var bill = await _billRepo.GetSingleByAsync(b => b.Name == name.Trim().ToLower()); if (bill is null) return new Response(false, "Bill does not Exist"); _billRepo.Delete(bill); - return new Response(true, $"Bill with Name {bill.BillName} And Amount {bill.Amount} has been deleted Successfully"); + return new Response(true, $"Bill with Name {bill.Name} And Amount {bill.Amount} has been deleted Successfully"); } public IEnumerable GetTotalNumberOfBills() @@ -78,4 +78,4 @@ public IEnumerable GetTotalNumberOfBills() return _billRepo.GetAll(); } } -} +} \ No newline at end of file diff --git a/Wallet.Services/Services/CustomerService.cs b/Wallet.Services/Services/CustomerService.cs index c4b7d7f..5691b65 100644 --- a/Wallet.Services/Services/CustomerService.cs +++ b/Wallet.Services/Services/CustomerService.cs @@ -15,7 +15,7 @@ namespace Wallet.Services.Services { public class CustomerService : ICustomerService { - private readonly IRepository _userRepo; + private readonly IRepository _userRepo; private readonly IRepository _customerRepo; private readonly IRepository
_addressRepo; private readonly IRepository _walletRepo; @@ -29,7 +29,7 @@ public CustomerService(IServiceFactory serviceFactory) _unitOfWork = _serviceFactory.GetServices(); _customerRepo = _unitOfWork.GetRepository(); _addressRepo = _unitOfWork.GetRepository
(); - _userRepo = _unitOfWork.GetRepository(); + _userRepo = _unitOfWork.GetRepository(); _walletRepo = _unitOfWork.GetRepository(); _mapper = _serviceFactory.GetServices(); } @@ -50,22 +50,19 @@ public async Task CreateCustomer(UsersCreateRequestDto model) { UserId = userId, PhoneNumber = model.PhoneNumber, - LastName = model.LastName, - FirstName = model.FirstName, - Gender = model.Gender }; await _customerRepo.AddAsync(customer); - + await CreateCustomerAddress(customer); await CreateCustomerAccount(customer); - + return $"Customer with email {model.Email} was created successfully"; } private async Task CreateCustomerAddress(Customer customer) { - Address address = new() { CustomerId = customer.Id }; + Address address = new() { UserId = customer.UserId}; await _addressRepo.AddAsync(address); } @@ -73,10 +70,9 @@ private async Task CreateCustomerAccount(Customer customer) { Entities.Models.Domain.Wallet wallet = new() { - WalletNo = WalletIdGenerator.GenerateWalletId(), + WalletNumber = WalletIdGenerator.GenerateWalletId(), Balance = 0, Active = true, - CustomerId = customer.Id }; await _walletRepo.AddAsync(wallet); } @@ -93,9 +89,9 @@ public async Task DeleteCustomerById(Guid id) return $"Customer deleted successfully"; } - public async Task UpdateCustomerAddress(Guid customerId, UpdateAddressDto model) + public async Task UpdateCustomerAddress(string customerId, UpdateAddressDto model) { - Address customer = await _addressRepo.GetSingleByAsync(x => x.CustomerId == customerId); + Address customer = await _addressRepo.GetSingleByAsync(x => x.UserId == customerId); if (customer == null) return $"Customer with id {customerId} does not exist"; @@ -107,12 +103,12 @@ public async Task UpdateCustomerAddress(Guid customerId, UpdateAddressDt return "Address updated successfully"; } - public async Task PatchCustomerAddress(Guid customerId, JsonPatchDocument model) + public async Task PatchCustomerAddress(string userId, JsonPatchDocument model) { - Address customer = await _addressRepo.GetSingleByAsync(x => x.CustomerId == customerId); + Address customer = await _addressRepo.GetSingleByAsync(x => x.UserId == userId); if (customer == null) - return $"Customer with id {customerId} does not exist"; + return $"Customer with id {userId} does not exist"; UpdateAddressDto updateAddress = new() { @@ -134,7 +130,7 @@ public async Task PatchCustomerAddress(Guid customerId, JsonPatchDocumen return $"staff updated successfully"; } - public async Task UpdateCustomer(Guid id, JsonPatchDocument model) + public async Task UpdateCustomer(string id, JsonPatchDocument model) { Customer customer = await _customerRepo.GetSingleByAsync(s => s.Id == id, include: s => s.Include(u => u.User)); @@ -144,8 +140,6 @@ public async Task UpdateCustomer(Guid id, JsonPatchDocument UpdateCustomer(Guid id, JsonPatchDocument> GetAllCustomers() { IEnumerable all = await _customerRepo.GetByAsync(x => x.Active == false, - include: x => x.Include(u => u.User).Include(a => a.Address).Include(w => w.Wallet)); + include: x => x.Include(u => u.User).Include(a => a.Address)); return _mapper.Map>(all); } - public async Task GetCustomer(Guid id) + public async Task GetCustomer(string id) { Customer customer = await _customerRepo.GetSingleByAsync(x => x.Id == id && x.Active == false, - include: x => x.Include(x => x.Address).Include(x => x.User).Include(x => x.Wallet)); + include: x => x.Include(x => x.Address).Include(x => x.User)); if (customer == null) throw new InvalidOperationException("Customer not found"); @@ -188,9 +182,9 @@ public async Task GetCustomer(Guid id) public async Task GetCustomerByEmail(string email) { - User user = await _userRepo.GetSingleByAsync(u => u.Email == email && u.Customer.Active == false, + ApplicationUser user = await _userRepo.GetSingleByAsync(u => u.Email == email && u.Customer.Active == false, include: u => u.Include(s => s.Customer).ThenInclude(a => a.Address) - .Include(x => x.Customer).ThenInclude(x => x.Wallet)); + .Include(x => x.Customer)); if (user == null) throw new InvalidOperationException("User not found"); @@ -198,60 +192,58 @@ public async Task GetCustomerByEmail(string email) return _mapper.Map(user); } - public async Task SoftDeleteCustomer(Guid id) + public async Task SoftDeleteCustomer(string id) { - Customer customer = await _customerRepo.GetSingleByAsync(x => x.Id == id, include: x => x.Include(w => w.Wallet)); + Customer customer = await _customerRepo.GetSingleByAsync(x => x.Id == id); if (customer is null) return $"customer with Id {id} does not exist"; customer.Active = true; - customer.Wallet.Active = false; - + await _customerRepo.UpdateAsync(customer); - await _walletRepo.UpdateAsync(customer.Wallet); - + await _unitOfWork.SaveChangesAsync(); return "Customer Deleted successfully"; } - public async Task UnDeleteCustomer(Guid id) + public async Task UnDeleteCustomer(string id) { - Customer customer = await _customerRepo.GetSingleByAsync(x => x.Id == id, include: x => x.Include(w => w.Wallet)); + Customer customer = await _customerRepo.GetSingleByAsync(x => x.Id == id); if (customer is null) return $"customer with Id {id} does not exist"; customer.Active = false; - customer.Wallet.Active = true; - + await _customerRepo.UpdateAsync(customer); - await _walletRepo.UpdateAsync(customer.Wallet); - - await _unitOfWork.SaveChangesAsync(); - + return "Customer UnDeleted successfully"; } public async Task> GetAllDeletedCustomers() { IEnumerable all = await _customerRepo.GetByAsync(x => x.Active == true, - include: x => x.Include(u => u.User).Include(a => a.Address).Include(w => w.Wallet)); + include: x => x.Include(u => u.User).Include(a => a.Address)); return _mapper.Map>(all); } public async Task GetCustomerByWalletNo(string WalletNo) { - Entities.Models.Domain.Wallet wallet = await _walletRepo.GetSingleByAsync(u => u.WalletNo == WalletNo, - include: u => u.Include(s => s.Customer).ThenInclude(a => a.Address) - .Include(e => e.Customer.User)); + Entities.Models.Domain.Wallet wallet = await _walletRepo.GetSingleByAsync(u => u.WalletNumber == WalletNo, + include: u => u.Include(e => e.User)); if (wallet == null) throw new InvalidOperationException("User not found"); return _mapper.Map(wallet); } + + public Task DeleteCustomerById(string id) + { + throw new NotImplementedException(); + } } } diff --git a/Wallet.Services/Services/DataService.cs b/Wallet.Services/Services/DataService.cs deleted file mode 100644 index 21c9c28..0000000 --- a/Wallet.Services/Services/DataService.cs +++ /dev/null @@ -1,79 +0,0 @@ -using AutoMapper; -using Microsoft.AspNetCore.JsonPatch; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Wallet.Data.Interfaces; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.GobalMessage; -using Wallet.Services.Interfaces; - -namespace Wallet.Services.Services -{ - public class DataService : IDataService - { - private readonly IServiceFactory _serviceFactory; - private readonly IMapper _mapper; - private readonly IRepository _dataRepo; - private readonly IUnitOfWork _unitOfWork; - - public DataService(IServiceFactory serviceFactory) - { - _serviceFactory = serviceFactory; - _unitOfWork = _serviceFactory.GetServices(); - _dataRepo = _unitOfWork.GetRepository(); - _mapper = _serviceFactory.GetServices(); - } - - public async Task AddData(CreateNetworkProviderDto model) - { - var existingData = await _dataRepo.GetSingleByAsync(predicate: d => d.NetworkProvider == model.NetworkProvider.Trim().ToLower()); - if (existingData != null) - return new Response(false, "Network Provider name already Exist"); - - var dataDto = _mapper.Map(model); - - await _dataRepo.AddAsync(dataDto); - - return new Response(true, $"Network Provider Name {model.NetworkProvider} has been added Successfully!"); - } - - public async Task EditData(Guid Id, JsonPatchDocument model) - { - var data = await _dataRepo.GetByIdAsync(Id); - - if (data is null) - return new Response(false, "Data does not Exist"); - - var dataDto = new PatchNetworkProviderDto - { - NetworkProvider = data.NetworkProvider - }; - - model.ApplyTo(dataDto); - - _mapper.Map(dataDto, data); - - _dataRepo.Update(data); - - return new Response(true, $"Data Updated Successfully, see Details below \nNetwork Name : {data.NetworkProvider}"); - } - - public async Task DeleteDataByName(string name) - { - var data = await _dataRepo.GetSingleByAsync(d => d.NetworkProvider == name.Trim().ToLower()); - - if (data is null) - return new Response(false, "Data does not Exist"); - - _dataRepo.Delete(data); - - return new Response(true, $"Data with Name {data.NetworkProvider} has been deleted Successfully"); - } - - public IEnumerable GetTotalNumberOfData() - { - return _dataRepo.GetAll(); - } - } -} diff --git a/Wallet.Services/Services/RoleService.cs b/Wallet.Services/Services/RoleService.cs index 6cbdc5d..048fb52 100644 --- a/Wallet.Services/Services/RoleService.cs +++ b/Wallet.Services/Services/RoleService.cs @@ -19,11 +19,11 @@ namespace Wallet.Services.Services { public class RoleService : IRoleService { - private readonly UserManager _userManager; - private readonly RoleManager _roleManager; + private readonly UserManager _userManager; + private readonly RoleManager _roleManager; private readonly IServiceFactory _serviceFactory; private readonly IMapper _mapper; - private readonly IRepository _roleRepo; + private readonly IRepository _roleRepo; private readonly IUnitOfWork _unitOfWork; private readonly ILoggerMessage _logger; @@ -31,9 +31,9 @@ public RoleService(IServiceFactory serviceFactory) { _serviceFactory = serviceFactory; _unitOfWork = _serviceFactory.GetServices(); - _userManager = _serviceFactory.GetServices>(); - _roleManager = _serviceFactory.GetServices>(); - _roleRepo = _unitOfWork.GetRepository(); + _userManager = _serviceFactory.GetServices>(); + _roleManager = _serviceFactory.GetServices>(); + _roleRepo = _unitOfWork.GetRepository(); _mapper = _serviceFactory.GetServices(); _logger = serviceFactory.GetServices(); } @@ -58,7 +58,7 @@ public async Task CreateRole(RoleDto request) if (roleExists != null) throw new InvalidOperationException($"Role with name {request.Name} already exist"); - var roleToCreate = _mapper.Map(request); + var roleToCreate = _mapper.Map(request); var result = await _roleManager.CreateAsync(roleToCreate); if (!result.Succeeded) @@ -123,7 +123,7 @@ public async Task> GetAllRoles() return rolesDto; } - public IEnumerable GetTotalNumberOfRoles() + public IEnumerable GetTotalNumberOfRoles() { return _roleRepo.GetAll(); } @@ -160,4 +160,4 @@ public async Task RemoveUserFromRole(UserRoleDto request) return $"{request.UserName} removed from Role {request.Name} successfully"; } } -} +} \ No newline at end of file diff --git a/Wallet.Services/Services/SelectService.cs b/Wallet.Services/Services/SelectService.cs index 6c1f6bb..3f6eb86 100644 --- a/Wallet.Services/Services/SelectService.cs +++ b/Wallet.Services/Services/SelectService.cs @@ -21,15 +21,6 @@ public SelectService(IServiceFactory serviceFactory) _mapper = _serviceFactory.GetServices(); } - public async Task> GetAllAirTime() - { - IEnumerable allAirTime = await _unitOfWork.GetRepository().GetAllAsync(); - - IEnumerable airTimeResponse = _mapper.Map>(allAirTime); - - return airTimeResponse; - } - public async Task> GetAllBills() { IEnumerable allBills = await _unitOfWork.GetRepository().GetAllAsync(); @@ -38,14 +29,5 @@ public async Task> GetAllBills() return billsResponse; } - - public async Task> GetAllData() - { - IEnumerable allData = await _unitOfWork.GetRepository().GetAllAsync(); - - IEnumerable dataResponse = _mapper.Map>(allData); - - return dataResponse; - } } } diff --git a/Wallet.Services/Services/StaffService.cs b/Wallet.Services/Services/StaffService.cs index 4988272..9d57678 100644 --- a/Wallet.Services/Services/StaffService.cs +++ b/Wallet.Services/Services/StaffService.cs @@ -16,11 +16,11 @@ public class StaffService : IStaffService { private readonly IRepository _staffRepo; private readonly IRepository
_addressRepo; - private readonly IRepository _userRepo; + private readonly IRepository _userRepo; private readonly IMapper _mapper; private readonly IServiceFactory _serviceFactory; private readonly IUnitOfWork _unitOfWork; - + public StaffService(IServiceFactory serviceFactory) { @@ -28,7 +28,7 @@ public StaffService(IServiceFactory serviceFactory) _unitOfWork = _serviceFactory.GetServices(); _staffRepo = _unitOfWork.GetRepository(); _addressRepo = _unitOfWork.GetRepository
(); - _userRepo = _unitOfWork.GetRepository(); + _userRepo = _unitOfWork.GetRepository(); _mapper = _serviceFactory.GetServices(); } @@ -47,33 +47,31 @@ public async Task CreateStaff(UsersCreateRequestDto model) { UserId = userId, PhoneNumber = model.PhoneNumber, - LastName = model.LastName, - FirstName = model.FirstName, - Gender = model.Gender + //Gender = model.Gender }; await _staffRepo.AddAsync(staff); await CreateStaffAddress(staff); - + return $"Staff with email {model.Email} was created successfully"; } private async Task CreateStaffAddress(Staff staff) { - Address address = new() { StaffId = staff.Id }; + Address address = new() { UserId = staff.UserId }; await _addressRepo.AddAsync(address); } - + public async Task> GetAllStaff() - { + { var all = await _staffRepo.GetAllAndInclude(x => x.Address, x => x.User); return _mapper.Map>(all); } - public async Task UpdateStaffAddress(Guid staffId, UpdateAddressDto model) + public async Task UpdateStaffAddress(string staffId, UpdateAddressDto model) { - var staff = await _addressRepo.GetSingleByAsync(x => x.StaffId == staffId); + var staff = await _addressRepo.GetSingleByAsync(x => x.UserId == staffId); if (staff == null) return $"staff with id {staffId} does not exist"; @@ -84,9 +82,9 @@ public async Task UpdateStaffAddress(Guid staffId, UpdateAddressDto mode return "Address updated successfully"; } - public async Task UpdateStaff(Guid id, JsonPatchDocument model) + public async Task UpdateStaff(string id, JsonPatchDocument model) { - Staff staff = await _staffRepo.GetSingleByAsync(s => s.Id == id, + Staff staff = await _staffRepo.GetSingleByAsync(s => s.Id == id, include: s => s.Include(u => u.User)); if (staff == null) @@ -94,8 +92,6 @@ public async Task UpdateStaff(Guid id, JsonPatchDocument UpdateStaffDto updateStaff = new() { - LastName = staff.LastName, - FirstName = staff.FirstName, Email = staff.User.Email, MobileNo = staff.PhoneNumber }; @@ -117,7 +113,7 @@ public async Task UpdateStaff(Guid id, JsonPatchDocument return $"staff with email {staff.User.Email} updated successfully"; } - public async Task GetStaff(Guid id) + public async Task GetStaff(string id) { var staff = await _staffRepo.GetSingleByAsync(x => x.Id == id, include: x => x.Include(x => x.Address).Include(x => x.User)); @@ -132,10 +128,10 @@ public IEnumerable GetTotalNumberOfStaff() return _staffRepo.GetAll(); } - public async Task DeleteStaffById(Guid id) + public async Task DeleteStaffById(string id) { Staff staff = await _staffRepo.GetByIdAsync(id); - + if (staff == null) return $"Staff with id {id} does not exist"; @@ -146,7 +142,7 @@ public async Task DeleteStaffById(Guid id) public async Task GetStaffByEmail(string email) { - User user = await _userRepo.GetSingleByAsync(u => u.Email == email, + ApplicationUser user = await _userRepo.GetSingleByAsync(u => u.Email == email, include: u => u.Include(s => s.Staff).ThenInclude(a => a.Address)); if (user == null) @@ -156,9 +152,9 @@ public async Task GetStaffByEmail(string email) } - public async Task PatchStaffAddress(Guid staffId, JsonPatchDocument model) + public async Task PatchStaffAddress(string staffId, JsonPatchDocument model) { - var staff = await _addressRepo.GetSingleByAsync(x => x.StaffId == staffId); + var staff = await _addressRepo.GetSingleByAsync(x => x.UserId == staffId); if (staff == null) return $"staff with id {staffId} does not exist"; @@ -182,6 +178,5 @@ public async Task PatchStaffAddress(Guid staffId, JsonPatchDocument _transactionRepo; private readonly IRepository _walletRepo; private readonly IRepository _billRepo; - private readonly IRepository _airTimeRepo; private readonly IServiceFactory _serviceFactory; private readonly IUnitOfWork _unitOfWork; @@ -28,7 +27,6 @@ public TransactionService(IServiceFactory serviceFactory) _walletRepo = _unitOfWork.GetRepository(); _transactionRepo = _unitOfWork.GetRepository(); _billRepo = _unitOfWork.GetRepository(); - _airTimeRepo = _unitOfWork.GetRepository(); } public async Task Deposit(DepositDto model) @@ -38,7 +36,7 @@ public async Task Deposit(DepositDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.WalletID); + var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.WalletID); if (wallet == null) return new Response(false, "Wallet No does not exist, check and try again"); @@ -53,10 +51,10 @@ public async Task Deposit(DepositDto model) { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Credit, - ReceiverWalletId = wallet.WalletNo, - TransactionMode = TransactionMode.Deposit, - CustomerId = wallet.CustomerId + //TransactionType = TransactionType.Credit, + //ReceiverWalletId = wallet.WalletNumber, + //TransactionMode = TransactionMode.Deposit, + //CustomerId = wallet.CustomerId }; await _transactionRepo.AddAsync(deposit); await _unitOfWork.SaveChangesAsync(); @@ -70,7 +68,7 @@ public async Task Withdraw(WithdrawalDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.WalletID); + var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.WalletID); if (wallet == null) return new Response(false, "Please, indicate your Wallet Account"); @@ -89,10 +87,10 @@ public async Task Withdraw(WithdrawalDto model) { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Debit, - ReceiverWalletId = wallet.WalletNo, - TransactionMode = TransactionMode.Withdraw, - CustomerId = wallet.CustomerId + //TransactionType = TransactionType.Debit, + //ReceiverWalletId = wallet.WalletNumber, + //TransactionMode = TransactionMode.Withdraw, + //CustomerId = wallet.CustomerId }; await _transactionRepo.AddAsync(withdraw); await _unitOfWork.SaveChangesAsync(); @@ -105,11 +103,11 @@ public async Task Transfer(TransferDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var senderWallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.SenderWalletID); + var senderWallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.SenderWalletID); if (senderWallet == null) return new Response(false, "Please, Indicate Sending Wallet"); - var receiverWallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.ReceiverWalletID); + var receiverWallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.ReceiverWalletID); if (receiverWallet == null) return new Response(false, "Please, Indicate Recipient Wallet"); @@ -134,25 +132,25 @@ public async Task Transfer(TransferDto model) { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Debit, - SenderWalletId = senderWallet.WalletNo, - TransactionMode = TransactionMode.Transfer, - CustomerId = senderWallet.CustomerId + //TransactionType = TransactionType.Debit, + //SenderWalletId = senderWallet.WalletNumber, + //TransactionMode = TransactionMode.Transfer, + //CustomerId = senderWallet.CustomerId }; var transferReceiver = new Transaction() { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Credit, - ReceiverWalletId = receiverWallet.WalletNo, - TransactionMode = TransactionMode.Transfer, - CustomerId = receiverWallet.CustomerId + //TransactionType = TransactionType.Credit, + //ReceiverWalletId = receiverWallet.WalletNumber, + //TransactionMode = TransactionMode.Transfer, + //CustomerId = receiverWallet.CustomerId }; await _transactionRepo.AddAsync(transferReceiver); await _unitOfWork.SaveChangesAsync(); - return new Response(true, $"Your Transfer of {model.Amount} to {receiverWallet.WalletNo} was Successful! \nYour new Wallet Ballance is {senderWallet.Balance}" ); + return new Response(true, $"Your Transfer of {model.Amount} to {receiverWallet.WalletNumber} was Successful! \nYour new Wallet Ballance is {senderWallet.Balance}" ); } public async Task PayBill(PayBillDto model) @@ -160,11 +158,11 @@ public async Task PayBill(PayBillDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.WalletId); + var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.WalletId); if (wallet == null) return new Response(false, "Please, indicate your Wallet Account"); - var bill = await _billRepo.GetSingleByAsync(a => a.BillName == model.Bill.Trim().ToLower()); + var bill = await _billRepo.GetSingleByAsync(a => a.Name == model.Bill.Trim().ToLower()); if (bill == null) return new Response(false, "Please, indicate The Bill you want to pay for"); @@ -182,17 +180,17 @@ public async Task PayBill(PayBillDto model) { Amount = bill.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Debit, - SenderWalletId = wallet.WalletNo, - TransactionMode = TransactionMode.Bill, - BillName = bill.BillName, + //TransactionType = TransactionType.Debit, + //SenderWalletId = wallet.WalletNumber, + //TransactionMode = TransactionMode.Bill, + //BillName = bill.Name, StampDuty = 100, - CustomerId = wallet.CustomerId + //CustomerId = wallet.CustomerId }; await _transactionRepo.AddAsync(billPayment); await _unitOfWork.SaveChangesAsync(); - return new Response(true, $"Your {bill.BillName} payment of {bill.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); + return new Response(true, $"Your {bill.Name} payment of {bill.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); } @@ -201,14 +199,10 @@ public async Task BuyAirTime(BuyAirTimeDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.WalletId); + var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.WalletId); if (wallet == null) return new Response(false, "Please, indicate your Wallet Account"); - var airTime = await _airTimeRepo.GetSingleByAsync(a => a.NetworkProvider == model.NetworkProvider.Trim().ToLower()); - if (airTime == null) - return new Response(false, "Please, indicate the Network Provider"); - if (!wallet.Active) return new Response(false, "Your Account is not Active for now"); if (model.Amount < 50) return new Response(false, "You cannot buy AirTme below 50"); @@ -224,17 +218,17 @@ public async Task BuyAirTime(BuyAirTimeDto model) { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Debit, - SenderWalletId = wallet.WalletNo, - PhoneNumber = model.PhoneNumber, - NetworkProvider = airTime.NetworkProvider, - TransactionMode = TransactionMode.AirTime, - CustomerId = wallet.CustomerId + //TransactionType = TransactionType.Debit, + //SenderWalletId = wallet.WalletNumber, + //PhoneNumber = model.PhoneNumber, + //NetworkProvider = airTime.NetworkProvider, + //TransactionMode = TransactionMode.AirTime, + //CustomerId = wallet.CustomerId }; await _transactionRepo.AddAsync(airTimePurchase); await _unitOfWork.SaveChangesAsync(); - return new Response(true, $"Your AirTime Purchase of {airTime.NetworkProvider} {model.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); + return new Response(true, $"Your AirTime Purchase of {model.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); } public async Task BuyData(BuyDataDto model) @@ -242,14 +236,10 @@ public async Task BuyData(BuyDataDto model) if (model == null) return new Response(false, "Please, indicate your Wallet No"); - var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNo == model.WalletId); + var wallet = await _walletRepo.GetSingleByAsync(a => a.WalletNumber == model.WalletId); if (wallet == null) return new Response(false, "Please, indicate your Wallet Account"); - var data = await _airTimeRepo.GetSingleByAsync(a => a.NetworkProvider == model.NetworkProvider.Trim().ToLower()); - if (data == null) - return new Response(false, "Please, indicate the Network Provider"); - if (!wallet.Active) return new Response(false, "Your Account is not Active for now"); if (model.Amount < 50) return new Response(false, "You cannot buy Data below 50"); @@ -265,17 +255,17 @@ public async Task BuyData(BuyDataDto model) { Amount = model.Amount, TimeStamp = DateTime.Now, - TransactionType = TransactionType.Debit, - SenderWalletId = wallet.WalletNo, - PhoneNumber = model.PhoneNumber, - NetworkProvider = data.NetworkProvider, - TransactionMode = TransactionMode.Data, - CustomerId = wallet.CustomerId + //TransactionType = TransactionType.Debit, + //SenderWalletId = wallet.WalletNumber, + //PhoneNumber = model.PhoneNumber, + //NetworkProvider = data.NetworkProvider, + //TransactionMode = TransactionMode.Data, + //CustomerId = wallet.CustomerId }; await _transactionRepo.AddAsync(dataPurchase); await _unitOfWork.SaveChangesAsync(); - return new Response(true, $"Your Data Purchase of {data.NetworkProvider} {model.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); + return new Response(true, $"Your Data Purchase of {model.Amount} was Successful! \nYour new Wallet Ballance is {wallet.Balance}"); } public IEnumerable GetTramsctionByAUser(string id) diff --git a/Wallet.Services/Services/UserService.cs b/Wallet.Services/Services/UserService.cs index 17fff89..309fbfe 100644 --- a/Wallet.Services/Services/UserService.cs +++ b/Wallet.Services/Services/UserService.cs @@ -17,8 +17,8 @@ namespace Wallet.Services.Services { public class UserService : IUserService { - private readonly UserManager _userManager; - private readonly RoleManager _roleManager; + private readonly UserManager _userManager; + private readonly RoleManager _roleManager; private readonly IMapper _mapper; private readonly IServiceFactory _serviceFactory; private readonly IUnitOfWork _unitOfWork; @@ -28,8 +28,8 @@ public UserService(IServiceFactory serviceFactory) { _serviceFactory = serviceFactory; _unitOfWork = _serviceFactory.GetServices(); - _userManager = _serviceFactory.GetServices>(); - _roleManager = _serviceFactory.GetServices>(); + _userManager = _serviceFactory.GetServices>(); + _roleManager = _serviceFactory.GetServices>(); _mapper = _serviceFactory.GetServices(); } @@ -40,11 +40,11 @@ public async Task CreateUser(CreateUserDto model) if (existingEmail != null) throw new UserExistException(model.Email); - User userNameExists = await _userManager.FindByNameAsync(model.UserName); + ApplicationUser userNameExists = await _userManager.FindByNameAsync(model.UserName); if (userNameExists != null) return $"Username {model.UserName} already exists"; - var user = _mapper.Map(model); + var user = _mapper.Map(model); user.EmailConfirmed = true; var password = "123456"; @@ -56,7 +56,7 @@ public async Task CreateUser(CreateUserDto model) if (!_roleManager.RoleExistsAsync(model.Role).Result) { - var role = new Role { Name = model.Role }; + var role = new ApplicationRole { Name = model.Role }; var roleResult = _roleManager.CreateAsync(role).Result; if (!roleResult.Succeeded) throw new InvalidOperationException($"Role creation failed"); @@ -155,4 +155,4 @@ public async Task> GetUserClaims(string email return dto; } } -} +} \ No newline at end of file diff --git a/WalletApi/Authentication/AuthenticationManager.cs b/WalletApi/Authentication/AuthenticationManager.cs index b89ffcf..52b3f12 100644 --- a/WalletApi/Authentication/AuthenticationManager.cs +++ b/WalletApi/Authentication/AuthenticationManager.cs @@ -14,10 +14,10 @@ namespace WalletApi.Authentication { public class AuthenticationManager : IAuthenticationManager { - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly IConfiguration _configuration; - private User _user; - public AuthenticationManager(UserManager userManager, IConfiguration configuration) + private ApplicationUser _user; + public AuthenticationManager(UserManager userManager, IConfiguration configuration) { _userManager = userManager; _configuration = configuration; diff --git a/WalletApi/Controllers/AirTimeController.cs b/WalletApi/Controllers/AirTimeController.cs deleted file mode 100644 index cfe1d77..0000000 --- a/WalletApi/Controllers/AirTimeController.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.AspNetCore.JsonPatch; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Linq; -using System.Threading.Tasks; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.Enumerators; -using Wallet.Entities.GobalMessage; -using Wallet.Services.Interfaces; -using WalletApi.ActionFilters; - -namespace WalletApi.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class AirTimeController : ControllerBase - { - private readonly IAirTimeService _airTimeService; - public AirTimeController(IAirTimeService airTimeService) - { - _airTimeService = airTimeService; - } - - [HttpPost("create-airtime")] - [ServiceFilter(typeof(ModelStateValidation))] - public async Task AddAirTime([FromBody] CreateNetworkProviderDto model) - { - var result = await _airTimeService.AddAirTime(model); - - if (result.Success) - return Ok(result.Message); - - return BadRequest(result.Message); - } - - [HttpPatch("edit-airtime")] - [ServiceFilter(typeof(ModelStateValidation))] - public async Task EditAirTime(Guid Id, JsonPatchDocument model) - { - var airTime = await _airTimeService.EditAirTime(Id, model); - - if (airTime.Success) - return Ok(airTime.Message); - - return BadRequest(airTime.Message); - } - - [HttpDelete("delete-airtime-by-name")] - public async Task DeleteAirTimeByName(string name) - { - var airTime = await _airTimeService.DeleteAirTimeByName(name); - - if (airTime.Success) - return Ok(airTime.Message); - - return BadRequest(airTime.Message); - } - - //[HttpGet("total-number-of-airTime")] - //public IActionResult GetTotalNumberOfAirTime() - //{ - // var numberOfAirTime = _airTimeService.GetTotalNumberOfAirTime().Count(); - - // if (numberOfAirTime <= 0) - // return BadRequest(new ErrorDetails { Status = ResponseStatus.NOT_FOUND, Message = $"0 AirTime found" }); - - // return Ok($"{numberOfAirTime} AirTime"); - //} - } -} diff --git a/WalletApi/Controllers/Authentication.cs b/WalletApi/Controllers/Authentication.cs index 7b7c482..39383af 100644 --- a/WalletApi/Controllers/Authentication.cs +++ b/WalletApi/Controllers/Authentication.cs @@ -16,11 +16,11 @@ namespace WalletApi.Controllers public class Authentication : ControllerBase { private readonly ILoggerMessage _logger; - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly IAuthenticationManager _authManager; private readonly IUserService _userService; - public Authentication(ILoggerMessage logger, UserManager userManager, IAuthenticationManager authManager, IUserService userService) + public Authentication(ILoggerMessage logger, UserManager userManager, IAuthenticationManager authManager, IUserService userService) { _logger = logger; _userManager = userManager; @@ -51,7 +51,5 @@ public async Task CreateUser([FromBody] CreateUserDto model) return Ok(user); } - - } } diff --git a/WalletApi/Controllers/BaseController.cs b/WalletApi/Controllers/BaseController.cs index dc10334..d16c5c4 100644 --- a/WalletApi/Controllers/BaseController.cs +++ b/WalletApi/Controllers/BaseController.cs @@ -15,14 +15,14 @@ namespace WalletApi.Controllers [Produces("application/json")] public class BaseController : ControllerBase { - protected readonly UserManager _userManager; + protected readonly UserManager _userManager; public BaseController() { } - public BaseController(UserManager userManager) + public BaseController(UserManager userManager) { _userManager = userManager; } @@ -74,7 +74,7 @@ public OkObjectResult Invalid() } [ApiExplorerSettings(IgnoreApi = true)] - public async Task GetCurrentUserAsync() + public async Task GetCurrentUserAsync() { return await _userManager.GetUserAsync(HttpContext.User); } @@ -82,7 +82,7 @@ public async Task GetCurrentUserAsync() [ApiExplorerSettings(IgnoreApi = true)] public async Task GetUserIdAsync() { - User user = await GetCurrentUserAsync(); + ApplicationUser user = await GetCurrentUserAsync(); return user.Id; } @@ -104,4 +104,4 @@ public OkObjectResult Error() return base.Ok(response); } } -} +} \ No newline at end of file diff --git a/WalletApi/Controllers/CustomerController.cs b/WalletApi/Controllers/CustomerController.cs index d6cd46a..d5d6268 100644 --- a/WalletApi/Controllers/CustomerController.cs +++ b/WalletApi/Controllers/CustomerController.cs @@ -46,7 +46,7 @@ public async Task GetAllDeletedStaff() } [HttpGet("customer-by-id")] - public async Task GetCustomerById(Guid id) + public async Task GetCustomerById(string id) { var customer = await _customerService.GetCustomer(id); @@ -80,7 +80,7 @@ public async Task CreateCustomer([FromBody] UsersCreateRequestDto [HttpPatch("update-customer")] [ServiceFilter(typeof(ModelStateValidation))] - public async Task UpdateStaff(Guid Id, JsonPatchDocument model) + public async Task UpdateStaff(string Id, JsonPatchDocument model) { string customer = await _customerService.UpdateCustomer(Id, model); @@ -89,7 +89,7 @@ public async Task UpdateStaff(Guid Id, JsonPatchDocument UpdateCustomerAddress([FromQuery] Guid customerId, UpdateAddressDto model) + public async Task UpdateCustomerAddress([FromQuery] string customerId, UpdateAddressDto model) { var customer = await _customerService.UpdateCustomerAddress(customerId, model); @@ -98,7 +98,7 @@ public async Task UpdateCustomerAddress([FromQuery] Guid customer [HttpPatch("patch-customer-address")] [ServiceFilter(typeof(ModelStateValidation))] - public async Task PatchCustomerAddress(Guid Id, JsonPatchDocument model) + public async Task PatchCustomerAddress(string Id, JsonPatchDocument model) { string customer = await _customerService.PatchCustomerAddress(Id, model); @@ -106,7 +106,7 @@ public async Task PatchCustomerAddress(Guid Id, JsonPatchDocument } [HttpPut("undelete-customer")] - public async Task UnDeleteCustomer([FromQuery] Guid id) + public async Task UnDeleteCustomer([FromQuery] string id) { var customer = await _customerService.UnDeleteCustomer(id); @@ -114,7 +114,7 @@ public async Task UnDeleteCustomer([FromQuery] Guid id) } [HttpDelete("soft-delete-customer")] - public async Task SoftDeleteCustomer([FromQuery] Guid id) + public async Task SoftDeleteCustomer([FromQuery] string id) { var customer = await _customerService.SoftDeleteCustomer(id); @@ -122,11 +122,11 @@ public async Task SoftDeleteCustomer([FromQuery] Guid id) } [HttpDelete("delete-customer-by-id")] - public async Task DeleteCustomer([FromQuery] Guid id) + public async Task DeleteCustomer([FromQuery] string id) { var customer = await _customerService.DeleteCustomerById(id); return Ok(customer); } } -} +} \ No newline at end of file diff --git a/WalletApi/Controllers/DataController.cs b/WalletApi/Controllers/DataController.cs deleted file mode 100644 index e49b841..0000000 --- a/WalletApi/Controllers/DataController.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.AspNetCore.JsonPatch; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Linq; -using System.Threading.Tasks; -using Wallet.Entities.Dto.Request; -using Wallet.Entities.Enumerators; -using Wallet.Entities.GobalMessage; -using Wallet.Services.Interfaces; -using WalletApi.ActionFilters; - -namespace WalletApi.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class DataController : ControllerBase - { - private readonly IDataService _dataService; - - public DataController(IDataService dataService) - { - _dataService = dataService; - } - - [HttpPost("create-data")] - [ServiceFilter(typeof(ModelStateValidation))] - public async Task AddData([FromBody] CreateNetworkProviderDto model) - { - var result = await _dataService.AddData(model); - - if (result.Success) - return Ok(result.Message); - - return BadRequest(result.Message); - } - - [HttpPatch("edit-data")] - public async Task EditData(Guid Id, JsonPatchDocument model) - { - var data = await _dataService.EditData(Id, model); - - if (data.Success) - return Ok(data.Message); - - return BadRequest(data.Message); - } - - [HttpDelete("delete-data-by-name")] - public async Task DeleteDataByName(string name) - { - var data = await _dataService.DeleteDataByName(name); - - if (data.Success) - return Ok(data.Message); - - return BadRequest(data.Message); - } - - [HttpGet("total-number-of-data")] - public IActionResult GetTotalNumberOfData() - { - var numberOfData = _dataService.GetTotalNumberOfData().Count(); - - if (numberOfData <= 0) - return BadRequest(new ErrorDetails { Status = ResponseStatus.NOT_FOUND, Message = $"0 Data found" }); - - return Ok($"{numberOfData} Data"); - } - } -} diff --git a/WalletApi/Controllers/SelectController.cs b/WalletApi/Controllers/SelectController.cs index 6641df2..130168d 100644 --- a/WalletApi/Controllers/SelectController.cs +++ b/WalletApi/Controllers/SelectController.cs @@ -1,11 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using Wallet.Entities.Dto.Response; -using Wallet.Entities.GobalMessage; using Wallet.Services.Interfaces; -using Wallet.Services.Services; namespace WalletApi.Controllers { @@ -19,25 +16,11 @@ public SelectController(ISelectService selectService) _selectService = selectService; } - [HttpGet("all-airTime", Name = "get-all-air-time")] - public async Task GetAllAirTime() - { - IEnumerable response = await _selectService.GetAllAirTime(); - return Ok(response); - } - [HttpGet("all-bills", Name = "get-all-bills")] public async Task GetAllBills() { IEnumerable response = await _selectService.GetAllBills(); return Ok(response); } - - [HttpGet("all-data", Name = "get-all-data")] - public async Task GetAllData() - { - IEnumerable response = await _selectService.GetAllData(); - return Ok(response); - } } } \ No newline at end of file diff --git a/WalletApi/Controllers/StaffController.cs b/WalletApi/Controllers/StaffController.cs index 14483d4..c5f5297 100644 --- a/WalletApi/Controllers/StaffController.cs +++ b/WalletApi/Controllers/StaffController.cs @@ -36,7 +36,7 @@ public async Task GetAllStaff() [HttpGet("staff-by-id")] - public async Task GetStaffById(Guid id) + public async Task GetStaffById(string id) { var staff = await _staffService.GetStaff(id); @@ -62,7 +62,7 @@ public async Task CreateStaff([FromQuery] UsersCreateRequestDto m [HttpPut("update-staff-address")] [ServiceFilter(typeof(ModelStateValidation))] - public async Task UpdateStaffAddress([FromQuery] Guid staffId, UpdateAddressDto model) + public async Task UpdateStaffAddress([FromQuery] string staffId, UpdateAddressDto model) { var staff = await _staffService.UpdateStaffAddress(staffId, model); @@ -71,7 +71,7 @@ public async Task UpdateStaffAddress([FromQuery] Guid staffId, Up [HttpPatch("update-staff")] [ServiceFilter(typeof(ModelStateValidation))] - public async Task UpdateStaff(Guid Id, JsonPatchDocument model) + public async Task UpdateStaff(string Id, JsonPatchDocument model) { string staff = await _staffService.UpdateStaff(Id, model); @@ -80,7 +80,7 @@ public async Task UpdateStaff(Guid Id, JsonPatchDocument PatchStaffAddress(Guid Id, JsonPatchDocument model) + public async Task PatchStaffAddress(string Id, JsonPatchDocument model) { string staff = await _staffService.PatchStaffAddress(Id, model); @@ -99,12 +99,11 @@ public IActionResult GetTotalNumberOfStaff() } [HttpDelete("delete-staff-by-id")] - public async Task DeleteStaff([FromQuery] Guid id) + public async Task DeleteStaff([FromQuery] string id) { var staff = await _staffService.DeleteStaffById(id); return Ok(staff); } - } -} +} \ No newline at end of file diff --git a/WalletApi/Data/SeedAdmin.cs b/WalletApi/Data/SeedAdmin.cs index 8c3f0fa..72cb77e 100644 --- a/WalletApi/Data/SeedAdmin.cs +++ b/WalletApi/Data/SeedAdmin.cs @@ -25,12 +25,12 @@ public static async void EnsurePopulated(IApplicationBuilder app) var userManager = app.ApplicationServices .CreateScope().ServiceProvider - .GetRequiredService>(); + .GetRequiredService>(); var user = await userManager.FindByNameAsync(AdminUser); if (user != null) return; - user = new User + user = new ApplicationUser { Email = "admin@domain.com", UserName = "Admin", PhoneNumber = "090-123-4090", EmailConfirmed = true, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now }; var createUser = await userManager.CreateAsync(user, AdminPassword); diff --git a/WalletApi/Data/SeedRole.cs b/WalletApi/Data/SeedRole.cs index 605794e..4e4b4a6 100644 --- a/WalletApi/Data/SeedRole.cs +++ b/WalletApi/Data/SeedRole.cs @@ -13,7 +13,7 @@ namespace WalletApi.Data { public static class SeedRole { - private static RoleManager _roleManager; + private static RoleManager _roleManager; public static async void EnsurePopulated(IApplicationBuilder app) { @@ -24,7 +24,7 @@ public static async void EnsurePopulated(IApplicationBuilder app) _roleManager = app.ApplicationServices .CreateScope().ServiceProvider - .GetRequiredService>(); + .GetRequiredService>(); await Create("SuperAdmin"); } @@ -33,7 +33,7 @@ private static async Task Create(string name) { if (!await _roleManager.RoleExistsAsync(name)) { - var role = new Role { Name = name, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now }; + var role = new ApplicationRole { Name = name, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now }; await _roleManager.CreateAsync(role); } } diff --git a/WalletApi/Data/SeedingAdmin.cs b/WalletApi/Data/SeedingAdmin.cs index b16b9e7..318b43c 100644 --- a/WalletApi/Data/SeedingAdmin.cs +++ b/WalletApi/Data/SeedingAdmin.cs @@ -20,7 +20,7 @@ public SeedingAdmin(WalletDbContext context) public async void SeedAdminUser() { - var user = new User + var user = new ApplicationUser { UserName = "Admin", NormalizedUserName = "ADMIN", @@ -33,19 +33,19 @@ public async void SeedAdminUser() SecurityStamp = Guid.NewGuid().ToString() }; - var roleStore = new RoleStore(_context); + var roleStore = new RoleStore(_context); if (!_context.Roles.Any(r => r.Name == "admin")) { - await roleStore.CreateAsync(new Role { Name = "admin", NormalizedName = "admin" }); + await roleStore.CreateAsync(new ApplicationRole { Name = "admin", NormalizedName = "admin" }); } if (!_context.Users.Any(u => u.UserName == user.UserName)) { - var password = new PasswordHasher(); + var password = new PasswordHasher(); var hashed = password.HashPassword(user, "password"); user.PasswordHash = hashed; - var userStore = new UserStore(_context); + var userStore = new UserStore(_context); await userStore.CreateAsync(user); await userStore.AddToRoleAsync(user, "admin"); } diff --git a/WalletApi/Middlewares/ServiceExtensions.cs b/WalletApi/Middlewares/ServiceExtensions.cs index 23b368d..2efe43b 100644 --- a/WalletApi/Middlewares/ServiceExtensions.cs +++ b/WalletApi/Middlewares/ServiceExtensions.cs @@ -5,11 +5,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; using Wallet.Data.Implementation; using Wallet.Data.Interfaces; using Wallet.Entities.Models.Context; @@ -37,7 +33,6 @@ public static void ConfigureIISIntegration(this IServiceCollection services) => public static void ConfigureLoggerService(this IServiceCollection services) => services.AddScoped(); - public static IServiceCollection AddRepositories(this IServiceCollection services) { services.AddTransient(); @@ -46,15 +41,13 @@ public static IServiceCollection AddRepositories(this IServiceCollection service services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddScoped(); - //services.AddHostedService(); + services.AddHostedService(); return services; } @@ -68,7 +61,7 @@ public static IServiceCollection AddDBConnection(this IServiceCollection service )); - services.AddIdentity(o => + services.AddIdentity(o => { o.Password.RequireDigit = false; o.Password.RequireLowercase = false; @@ -107,6 +100,5 @@ public static void ConfigureJWT(this IServiceCollection services, IConfiguration }; }); } - } -} +} \ No newline at end of file diff --git a/WalletApi/Migrations/20220329232119_Modified_Models.Designer.cs b/WalletApi/Migrations/20220329232119_Modified_Models.Designer.cs deleted file mode 100644 index b6dd2d7..0000000 --- a/WalletApi/Migrations/20220329232119_Modified_Models.Designer.cs +++ /dev/null @@ -1,662 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220329232119_Modified_Models")] - partial class Modified_Models - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3131), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3359) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3554), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3556) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(725), - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1039) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1236), - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1238) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6434), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6717) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6928), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6931) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "9978d84f-a18d-43dc-b18f-eb54836164de", - ConcurrencyStamp = "989f76c2-300d-449f-a4ff-31351094957a", - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(6736), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7487) - }, - new - { - Id = "304f996d-685e-4c90-952b-fa3e846cd116", - ConcurrencyStamp = "7b0c3af1-0a6f-44b9-b00c-9ae87035c11e", - CreatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7773), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7776) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("nvarchar(max)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220329232119_Modified_Models.cs b/WalletApi/Migrations/20220329232119_Modified_Models.cs deleted file mode 100644 index 923ed78..0000000 --- a/WalletApi/Migrations/20220329232119_Modified_Models.cs +++ /dev/null @@ -1,471 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Modified_Models : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AirTimes", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - NetworkProvider = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AirTimes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - FullName = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - EmailConfirmed = table.Column(type: "bit", nullable: false), - PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), - SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumberConfirmed = table.Column(type: "bit", nullable: false), - TwoFactorEnabled = table.Column(type: "bit", nullable: false), - LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), - LockoutEnabled = table.Column(type: "bit", nullable: false), - AccessFailedCount = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Bills", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - BillName = table.Column(type: "nvarchar(max)", nullable: true), - Amount = table.Column(type: "decimal(38,2)", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Bills", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Data", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - NetworkProvider = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Data", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "StampDutyCharges", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(max)", nullable: true), - Amount = table.Column(type: "decimal(38,2)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_StampDutyCharges", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Wallets", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - WalletNo = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), - CustomerId = table.Column(type: "nvarchar(max)", nullable: true), - Balance = table.Column(type: "decimal(38,2)", nullable: false), - IsActive = table.Column(type: "bit", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Wallets", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RoleId = table.Column(type: "nvarchar(450)", nullable: false), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "nvarchar(450)", nullable: false), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), - ProviderKey = table.Column(type: "nvarchar(450)", nullable: false), - ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "nvarchar(450)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(type: "nvarchar(450)", nullable: false), - RoleId = table.Column(type: "nvarchar(450)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(type: "nvarchar(450)", nullable: false), - LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AspNetUserTokens_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Customers", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - FullName = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - UserId = table.Column(type: "nvarchar(450)", nullable: true), - WallettId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Customers", x => x.Id); - table.ForeignKey( - name: "FK_Customers_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Customers_Wallets_WallettId", - column: x => x.WallettId, - principalTable: "Wallets", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Transactions", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TransactionType = table.Column(type: "int", nullable: false), - TransactionMode = table.Column(type: "int", nullable: false), - NetworkProvider = table.Column(type: "nvarchar(max)", nullable: true), - BillName = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - Amount = table.Column(type: "decimal(38,2)", nullable: false), - StampDuty = table.Column(type: "decimal(38,2)", nullable: false), - ReceiverWalletId = table.Column(type: "nvarchar(max)", nullable: true), - SenderWalletId = table.Column(type: "nvarchar(max)", nullable: true), - TimeStamp = table.Column(type: "datetime2", nullable: false), - CustomerId = table.Column(type: "uniqueidentifier", nullable: false), - StampDutyId = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Transactions", x => x.Id); - table.ForeignKey( - name: "FK_Transactions_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "TransactionStampDutyCharges", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TransactionMode = table.Column(type: "int", nullable: false), - StampDuty = table.Column(type: "decimal(38,2)", nullable: false), - TimeStamp = table.Column(type: "datetime2", nullable: false), - CustomerId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TransactionStampDutyCharges", x => x.Id); - table.ForeignKey( - name: "FK_TransactionStampDutyCharges_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.InsertData( - table: "AirTimes", - columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3131), null, "Mtn", new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3359), null }, - { new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3554), null, "Airtel", new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3556), null } - }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "9978d84f-a18d-43dc-b18f-eb54836164de", "989f76c2-300d-449f-a4ff-31351094957a", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(6736), null, "Admin", "ADMIN", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7487), null }, - { "304f996d-685e-4c90-952b-fa3e846cd116", "7b0c3af1-0a6f-44b9-b00c-9ae87035c11e", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7773), null, "Manager", "MANAGER", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7776), null } - }); - - migrationBuilder.InsertData( - table: "Bills", - columns: new[] { "Id", "Amount", "BillName", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), 6500m, "DSTV", new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(725), null, new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1039), null }, - { new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), 3000m, "GOTV", new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1236), null, new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1238), null } - }); - - migrationBuilder.InsertData( - table: "Data", - columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { new Guid("ce185a95-533e-425c-adf4-a5770766564b"), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6434), null, "Mtn", new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6717), null }, - { new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6928), null, "Airtel", new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6931), null } - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true, - filter: "[NormalizedName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true, - filter: "[NormalizedUserName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Customers_UserId", - table: "Customers", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Customers_WallettId", - table: "Customers", - column: "WallettId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Transactions_CustomerId", - table: "Transactions", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_TransactionStampDutyCharges_CustomerId", - table: "TransactionStampDutyCharges", - column: "CustomerId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AirTimes"); - - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "Bills"); - - migrationBuilder.DropTable( - name: "Data"); - - migrationBuilder.DropTable( - name: "StampDutyCharges"); - - migrationBuilder.DropTable( - name: "Transactions"); - - migrationBuilder.DropTable( - name: "TransactionStampDutyCharges"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "Customers"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - - migrationBuilder.DropTable( - name: "Wallets"); - } - } -} diff --git a/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.Designer.cs b/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.Designer.cs deleted file mode 100644 index 185a86f..0000000 --- a/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.Designer.cs +++ /dev/null @@ -1,659 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331203608_Removed_FullName_from_User_Table")] - partial class Removed_FullName_from_User_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(3883), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4064) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4223), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4224) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9462), - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9650) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9806), - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9807) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6760), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6919) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7072), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7073) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "ea103df2-d931-439a-ad99-6564bf05d0fd", - ConcurrencyStamp = "bffba74c-3993-434b-88ba-0ee44d0fafd2", - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4339), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4658) - }, - new - { - Id = "1048213a-f434-46d4-be70-f7cf7280cd45", - ConcurrencyStamp = "74bb73b6-4952-44f4-ba64-0a7785322f1a", - CreatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4907), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4909) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.cs b/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.cs deleted file mode 100644 index 3dff0b2..0000000 --- a/WalletApi/Migrations/20220331203608_Removed_FullName_from_User_Table.cs +++ /dev/null @@ -1,164 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Removed_FullName_from_User_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "304f996d-685e-4c90-952b-fa3e846cd116"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "9978d84f-a18d-43dc-b18f-eb54836164de"); - - migrationBuilder.DropColumn( - name: "FullName", - table: "AspNetUsers"); - - migrationBuilder.AlterColumn( - name: "CustomerId", - table: "Wallets", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(string), - oldType: "nvarchar(max)", - oldNullable: true); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(3883), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4064) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4223), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4224) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "ea103df2-d931-439a-ad99-6564bf05d0fd", "bffba74c-3993-434b-88ba-0ee44d0fafd2", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4339), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4658), null }, - { "1048213a-f434-46d4-be70-f7cf7280cd45", "74bb73b6-4952-44f4-ba64-0a7785322f1a", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4907), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4909), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9806), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9807) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9462), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9650) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7072), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7073) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6760), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6919) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "1048213a-f434-46d4-be70-f7cf7280cd45"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "ea103df2-d931-439a-ad99-6564bf05d0fd"); - - migrationBuilder.AlterColumn( - name: "CustomerId", - table: "Wallets", - type: "nvarchar(max)", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uniqueidentifier"); - - migrationBuilder.AddColumn( - name: "FullName", - table: "AspNetUsers", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3131), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3359) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3554), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(3556) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "9978d84f-a18d-43dc-b18f-eb54836164de", "989f76c2-300d-449f-a4ff-31351094957a", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(6736), null, "Admin", "ADMIN", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7487), null }, - { "304f996d-685e-4c90-952b-fa3e846cd116", "7b0c3af1-0a6f-44b9-b00c-9ae87035c11e", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7773), null, "Manager", "MANAGER", new DateTime(2022, 3, 30, 0, 21, 19, 366, DateTimeKind.Local).AddTicks(7776), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1236), new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1238) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(725), new DateTime(2022, 3, 30, 0, 21, 19, 369, DateTimeKind.Local).AddTicks(1039) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6928), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6931) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6434), new DateTime(2022, 3, 30, 0, 21, 19, 368, DateTimeKind.Local).AddTicks(6717) }); - } - } -} diff --git a/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.Designer.cs b/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.Designer.cs deleted file mode 100644 index 5e5b91e..0000000 --- a/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.Designer.cs +++ /dev/null @@ -1,698 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331213202_Added_Staff_And_Address_Table")] - partial class Added_Staff_And_Address_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3537), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3881) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4126), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4129) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1387), - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1610) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1821), - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1823) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7387), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7662) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7925), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7927) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "b716d882-afeb-4609-a5ca-e05baeb3386e", - ConcurrencyStamp = "2c790b34-9672-44be-af88-e7e8b7c24c89", - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9060), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9462) - }, - new - { - Id = "7a94c00e-b0db-4c09-85a0-d816133b4ac6", - ConcurrencyStamp = "7c3187e3-8095-4dc5-af54-05425494f6d4", - CreatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9766), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9768) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.cs b/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.cs deleted file mode 100644 index 6c2fcb4..0000000 --- a/WalletApi/Migrations/20220331213202_Added_Staff_And_Address_Table.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Added_Staff_And_Address_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "1048213a-f434-46d4-be70-f7cf7280cd45"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "ea103df2-d931-439a-ad99-6564bf05d0fd"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "Customers", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.CreateTable( - name: "Address", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PlotNo = table.Column(type: "int", nullable: false), - StreetName = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - State = table.Column(type: "nvarchar(max)", nullable: true), - Nationality = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Address", x => x.Id); - }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3537), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3881) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4126), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4129) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "b716d882-afeb-4609-a5ca-e05baeb3386e", "2c790b34-9672-44be-af88-e7e8b7c24c89", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9060), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9462), null }, - { "7a94c00e-b0db-4c09-85a0-d816133b4ac6", "7c3187e3-8095-4dc5-af54-05425494f6d4", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9766), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9768), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1821), new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1823) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1387), new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1610) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7925), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7927) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7387), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7662) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId"); - - //migrationBuilder.AddForeignKey( - // name: "FK_Customers_Address_AddressId", - // table: "Customers", - // column: "AddressId", - // principalTable: "Address", - // principalColumn: "Id", - // onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropForeignKey( - // name: "FK_Customers_Address_AddressId", - // table: "Customers"); - - migrationBuilder.DropTable( - name: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "7a94c00e-b0db-4c09-85a0-d816133b4ac6"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "b716d882-afeb-4609-a5ca-e05baeb3386e"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "Customers"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(3883), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4064) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4223), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(4224) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "ea103df2-d931-439a-ad99-6564bf05d0fd", "bffba74c-3993-434b-88ba-0ee44d0fafd2", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4339), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4658), null }, - { "1048213a-f434-46d4-be70-f7cf7280cd45", "74bb73b6-4952-44f4-ba64-0a7785322f1a", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4907), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 21, 36, 7, 603, DateTimeKind.Local).AddTicks(4909), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9806), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9807) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9462), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(9650) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7072), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(7073) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6760), new DateTime(2022, 3, 31, 21, 36, 7, 604, DateTimeKind.Local).AddTicks(6919) }); - } - } -} diff --git a/WalletApi/Migrations/20220331215641_Removed_Address_Table.Designer.cs b/WalletApi/Migrations/20220331215641_Removed_Address_Table.Designer.cs deleted file mode 100644 index 05df7fc..0000000 --- a/WalletApi/Migrations/20220331215641_Removed_Address_Table.Designer.cs +++ /dev/null @@ -1,659 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331215641_Removed_Address_Table")] - partial class Removed_Address_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4625), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4987) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5351), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5355) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4601), - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4857) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5087), - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5089) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9614), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9942) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(233), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(237) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "4dbb1cb7-9c4a-4815-acc5-0d8009e94a0f", - ConcurrencyStamp = "53efd5cf-3a9c-4e13-bab4-b52c90b8f4a9", - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8534), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8969) - }, - new - { - Id = "377367e1-c761-407e-8ef2-b1db70271872", - ConcurrencyStamp = "be15b4d7-9ff1-492d-ba13-7ac11711373a", - CreatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9247), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9250) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331215641_Removed_Address_Table.cs b/WalletApi/Migrations/20220331215641_Removed_Address_Table.cs deleted file mode 100644 index f1717e8..0000000 --- a/WalletApi/Migrations/20220331215641_Removed_Address_Table.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Removed_Address_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - - migrationBuilder.DropTable( - name: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "7a94c00e-b0db-4c09-85a0-d816133b4ac6"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "b716d882-afeb-4609-a5ca-e05baeb3386e"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "Customers"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4625), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4987) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5351), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5355) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "4dbb1cb7-9c4a-4815-acc5-0d8009e94a0f", "53efd5cf-3a9c-4e13-bab4-b52c90b8f4a9", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8534), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8969), null }, - { "377367e1-c761-407e-8ef2-b1db70271872", "be15b4d7-9ff1-492d-ba13-7ac11711373a", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9247), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9250), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5087), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5089) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4601), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4857) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(233), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(237) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9614), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9942) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "377367e1-c761-407e-8ef2-b1db70271872"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4dbb1cb7-9c4a-4815-acc5-0d8009e94a0f"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "Customers", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.CreateTable( - name: "Address", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - City = table.Column(type: "nvarchar(max)", nullable: true), - Nationality = table.Column(type: "nvarchar(max)", nullable: true), - PlotNo = table.Column(type: "int", nullable: false), - State = table.Column(type: "nvarchar(max)", nullable: true), - StreetName = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Address", x => x.Id); - }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3537), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(3881) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4126), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(4129) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "b716d882-afeb-4609-a5ca-e05baeb3386e", "2c790b34-9672-44be-af88-e7e8b7c24c89", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9060), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9462), null }, - { "7a94c00e-b0db-4c09-85a0-d816133b4ac6", "7c3187e3-8095-4dc5-af54-05425494f6d4", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9766), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 22, 32, 1, 517, DateTimeKind.Local).AddTicks(9768), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1821), new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1823) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1387), new DateTime(2022, 3, 31, 22, 32, 1, 520, DateTimeKind.Local).AddTicks(1610) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7925), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7927) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7387), new DateTime(2022, 3, 31, 22, 32, 1, 519, DateTimeKind.Local).AddTicks(7662) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId"); - - - } - } -} diff --git a/WalletApi/Migrations/20220331222508_Address_Table.Designer.cs b/WalletApi/Migrations/20220331222508_Address_Table.Designer.cs deleted file mode 100644 index 96f2b86..0000000 --- a/WalletApi/Migrations/20220331222508_Address_Table.Designer.cs +++ /dev/null @@ -1,696 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331222508_Address_Table")] - partial class Address_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(1991), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2285) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2471), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2473) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(21), - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(178) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(326), - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(327) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(5962), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6139) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6288), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6289) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "99b4fb24-028c-41f0-bf05-c3c6ca6e5990", - ConcurrencyStamp = "bbd8d6d2-d29e-4e7c-b819-857cef75aa11", - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8009), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8615) - }, - new - { - Id = "0ba8e0a4-7117-49e0-a239-0d853dfc22e4", - ConcurrencyStamp = "bcb4184c-b6de-4695-a28c-c529e6f18006", - CreatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9270), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9272) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithMany() - .HasForeignKey("AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331222508_Address_Table.cs b/WalletApi/Migrations/20220331222508_Address_Table.cs deleted file mode 100644 index cd07c5c..0000000 --- a/WalletApi/Migrations/20220331222508_Address_Table.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Address_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "377367e1-c761-407e-8ef2-b1db70271872"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4dbb1cb7-9c4a-4815-acc5-0d8009e94a0f"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "Customers", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.CreateTable( - name: "Address", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PlotNo = table.Column(type: "int", nullable: false), - StreetName = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - State = table.Column(type: "nvarchar(max)", nullable: true), - Nationality = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Address", x => x.Id); - }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(1991), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2285) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2471), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2473) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "99b4fb24-028c-41f0-bf05-c3c6ca6e5990", "bbd8d6d2-d29e-4e7c-b819-857cef75aa11", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8009), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8615), null }, - { "0ba8e0a4-7117-49e0-a239-0d853dfc22e4", "bcb4184c-b6de-4695-a28c-c529e6f18006", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9270), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9272), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(326), new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(327) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(21), new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(178) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6288), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6289) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(5962), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6139) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId"); - - migrationBuilder.AddForeignKey( - name: "FK_Customers_Address_AddressId", - table: "Customers", - column: "AddressId", - principalTable: "Address", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Customers_Address_AddressId", - table: "Customers"); - - migrationBuilder.DropTable( - name: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "0ba8e0a4-7117-49e0-a239-0d853dfc22e4"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "99b4fb24-028c-41f0-bf05-c3c6ca6e5990"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "Customers"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4625), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(4987) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5351), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(5355) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "4dbb1cb7-9c4a-4815-acc5-0d8009e94a0f", "53efd5cf-3a9c-4e13-bab4-b52c90b8f4a9", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8534), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(8969), null }, - { "377367e1-c761-407e-8ef2-b1db70271872", "be15b4d7-9ff1-492d-ba13-7ac11711373a", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9247), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 22, 56, 40, 892, DateTimeKind.Local).AddTicks(9250), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5087), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(5089) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4601), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(4857) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(233), new DateTime(2022, 3, 31, 22, 56, 40, 896, DateTimeKind.Local).AddTicks(237) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9614), new DateTime(2022, 3, 31, 22, 56, 40, 895, DateTimeKind.Local).AddTicks(9942) }); - } - } -} diff --git a/WalletApi/Migrations/20220331223956_Address_Table_Edit.Designer.cs b/WalletApi/Migrations/20220331223956_Address_Table_Edit.Designer.cs deleted file mode 100644 index d650b4f..0000000 --- a/WalletApi/Migrations/20220331223956_Address_Table_Edit.Designer.cs +++ /dev/null @@ -1,706 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331223956_Address_Table_Edit")] - partial class Address_Table_Edit - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5199), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5405) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5580), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5582) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(2935), - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3103) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3313), - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3314) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(8808), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9035) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9186), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9188) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "eb912cd4-cd95-4b45-9412-a6de00d6b9a7", - ConcurrencyStamp = "7cba6282-9e65-430c-a4ec-dbccb1e46a5f", - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2306), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2603) - }, - new - { - Id = "c07b4c67-2db9-44f5-89e8-cebe95d26cb6", - ConcurrencyStamp = "47fc3213-33d5-4320-9aba-13ed00040c48", - CreatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2789), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2790) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331223956_Address_Table_Edit.cs b/WalletApi/Migrations/20220331223956_Address_Table_Edit.cs deleted file mode 100644 index 03c11f0..0000000 --- a/WalletApi/Migrations/20220331223956_Address_Table_Edit.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Address_Table_Edit : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "0ba8e0a4-7117-49e0-a239-0d853dfc22e4"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "99b4fb24-028c-41f0-bf05-c3c6ca6e5990"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5199), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5405) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5580), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5582) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "eb912cd4-cd95-4b45-9412-a6de00d6b9a7", "7cba6282-9e65-430c-a4ec-dbccb1e46a5f", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2306), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2603), null }, - { "c07b4c67-2db9-44f5-89e8-cebe95d26cb6", "47fc3213-33d5-4320-9aba-13ed00040c48", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2789), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2790), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3313), new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3314) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(2935), new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3103) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9186), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9188) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(8808), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9035) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId", - unique: true, - filter: "[AddressId] IS NOT NULL"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "c07b4c67-2db9-44f5-89e8-cebe95d26cb6"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "eb912cd4-cd95-4b45-9412-a6de00d6b9a7"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "Address"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(1991), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2285) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2471), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(2473) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "99b4fb24-028c-41f0-bf05-c3c6ca6e5990", "bbd8d6d2-d29e-4e7c-b819-857cef75aa11", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8009), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(8615), null }, - { "0ba8e0a4-7117-49e0-a239-0d853dfc22e4", "bcb4184c-b6de-4695-a28c-c529e6f18006", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9270), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 25, 7, 975, DateTimeKind.Local).AddTicks(9272), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(326), new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(327) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(21), new DateTime(2022, 3, 31, 23, 25, 7, 978, DateTimeKind.Local).AddTicks(178) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6288), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6289) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(5962), new DateTime(2022, 3, 31, 23, 25, 7, 977, DateTimeKind.Local).AddTicks(6139) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId"); - } - } -} diff --git a/WalletApi/Migrations/20220331224849_Staff_Table.Designer.cs b/WalletApi/Migrations/20220331224849_Staff_Table.Designer.cs deleted file mode 100644 index 5268f05..0000000 --- a/WalletApi/Migrations/20220331224849_Staff_Table.Designer.cs +++ /dev/null @@ -1,771 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331224849_Staff_Table")] - partial class Staff_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3097), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3289) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3474), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3476) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8757), - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8927) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9086), - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9087) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WallettId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WallettId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5755), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5923) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6075), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6077) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "38598db6-a09d-4981-8365-e4ca9dab3445", - ConcurrencyStamp = "388465b5-2cf3-4a4f-951a-ac58a23d1adb", - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(576), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(918) - }, - new - { - Id = "518262ad-d7c0-471b-adfb-e59d2431b216", - ConcurrencyStamp = "7f9664ec-ecdd-4883-990b-506a2abb9674", - CreatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1183), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1185) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WallettId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "AddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331224849_Staff_Table.cs b/WalletApi/Migrations/20220331224849_Staff_Table.cs deleted file mode 100644 index 00af2c7..0000000 --- a/WalletApi/Migrations/20220331224849_Staff_Table.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Staff_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "c07b4c67-2db9-44f5-89e8-cebe95d26cb6"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "eb912cd4-cd95-4b45-9412-a6de00d6b9a7"); - - migrationBuilder.AddColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.CreateTable( - name: "StaffProfile", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - FullName = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - AddressId = table.Column(type: "uniqueidentifier", nullable: false), - UserId = table.Column(type: "nvarchar(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_StaffProfile", x => x.Id); - table.ForeignKey( - name: "FK_StaffProfile_Address_AddressId", - column: x => x.AddressId, - principalTable: "Address", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_StaffProfile_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3097), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3289) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3474), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3476) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "38598db6-a09d-4981-8365-e4ca9dab3445", "388465b5-2cf3-4a4f-951a-ac58a23d1adb", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(576), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(918), null }, - { "518262ad-d7c0-471b-adfb-e59d2431b216", "7f9664ec-ecdd-4883-990b-506a2abb9674", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1183), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1185), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9086), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9087) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8757), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8927) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6075), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6077) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5923) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile", - column: "AddressId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "StaffProfile"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "38598db6-a09d-4981-8365-e4ca9dab3445"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "518262ad-d7c0-471b-adfb-e59d2431b216"); - - migrationBuilder.DropColumn( - name: "StaffId", - table: "Address"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5199), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5405) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5580), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(5582) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "eb912cd4-cd95-4b45-9412-a6de00d6b9a7", "7cba6282-9e65-430c-a4ec-dbccb1e46a5f", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2306), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2603), null }, - { "c07b4c67-2db9-44f5-89e8-cebe95d26cb6", "47fc3213-33d5-4320-9aba-13ed00040c48", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2789), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 39, 56, 315, DateTimeKind.Local).AddTicks(2790), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3313), new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3314) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(2935), new DateTime(2022, 3, 31, 23, 39, 56, 317, DateTimeKind.Local).AddTicks(3103) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9186), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9188) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(8808), new DateTime(2022, 3, 31, 23, 39, 56, 316, DateTimeKind.Local).AddTicks(9035) }); - } - } -} diff --git a/WalletApi/Migrations/20220331225117_Edited_Customer_Table.Designer.cs b/WalletApi/Migrations/20220331225117_Edited_Customer_Table.Designer.cs deleted file mode 100644 index 336cf14..0000000 --- a/WalletApi/Migrations/20220331225117_Edited_Customer_Table.Designer.cs +++ /dev/null @@ -1,771 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220331225117_Edited_Customer_Table")] - partial class Edited_Customer_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3101), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3296) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3457), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3459) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(8838), - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9005) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9156), - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9158) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(5841), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6016) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6169), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6171) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "9c750465-7a6c-476c-910e-4f4f236ded08", - ConcurrencyStamp = "4d4f09d7-4696-4ec8-88a6-6e1b73f3475b", - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(3737), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4035) - }, - new - { - Id = "2845b59f-e5c0-4dfd-8b46-3130dae4197f", - ConcurrencyStamp = "54b2358e-c103-4686-8ca4-59e3c23b7ef1", - CreatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4233), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4235) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "AddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220331225117_Edited_Customer_Table.cs b/WalletApi/Migrations/20220331225117_Edited_Customer_Table.cs deleted file mode 100644 index be02ee8..0000000 --- a/WalletApi/Migrations/20220331225117_Edited_Customer_Table.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Edited_Customer_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Customers_Wallets_WallettId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "38598db6-a09d-4981-8365-e4ca9dab3445"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "518262ad-d7c0-471b-adfb-e59d2431b216"); - - migrationBuilder.RenameColumn( - name: "WallettId", - table: "Customers", - newName: "WalletId"); - - migrationBuilder.RenameIndex( - name: "IX_Customers_WallettId", - table: "Customers", - newName: "IX_Customers_WalletId"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3101), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3296) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3457), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3459) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "9c750465-7a6c-476c-910e-4f4f236ded08", "4d4f09d7-4696-4ec8-88a6-6e1b73f3475b", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(3737), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4035), null }, - { "2845b59f-e5c0-4dfd-8b46-3130dae4197f", "54b2358e-c103-4686-8ca4-59e3c23b7ef1", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4233), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4235), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9156), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9158) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(8838), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9005) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6169), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6171) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(5841), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6016) }); - - migrationBuilder.AddForeignKey( - name: "FK_Customers_Wallets_WalletId", - table: "Customers", - column: "WalletId", - principalTable: "Wallets", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Customers_Wallets_WalletId", - table: "Customers"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "2845b59f-e5c0-4dfd-8b46-3130dae4197f"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "9c750465-7a6c-476c-910e-4f4f236ded08"); - - migrationBuilder.RenameColumn( - name: "WalletId", - table: "Customers", - newName: "WallettId"); - - migrationBuilder.RenameIndex( - name: "IX_Customers_WalletId", - table: "Customers", - newName: "IX_Customers_WallettId"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3097), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3289) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3474), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(3476) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "38598db6-a09d-4981-8365-e4ca9dab3445", "388465b5-2cf3-4a4f-951a-ac58a23d1adb", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(576), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(918), null }, - { "518262ad-d7c0-471b-adfb-e59d2431b216", "7f9664ec-ecdd-4883-990b-506a2abb9674", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1183), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 48, 49, 23, DateTimeKind.Local).AddTicks(1185), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9086), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(9087) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8757), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(8927) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6075), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(6077) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 3, 31, 23, 48, 49, 24, DateTimeKind.Local).AddTicks(5923) }); - - migrationBuilder.AddForeignKey( - name: "FK_Customers_Wallets_WallettId", - table: "Customers", - column: "WallettId", - principalTable: "Wallets", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.Designer.cs b/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.Designer.cs deleted file mode 100644 index d60449d..0000000 --- a/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.Designer.cs +++ /dev/null @@ -1,769 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220401122140_Removed_ForeignKey_Customer_Table")] - partial class Removed_ForeignKey_Customer_Table - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(287), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(758) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1180), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1185) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2280), - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2567) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2817), - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2820) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7020), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7385) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7677), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7680) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "67802be3-98c8-4cb7-9ee4-e5b639bb148a", - ConcurrencyStamp = "b3e75703-db7e-4cfb-9760-482c5d60e585", - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(2507), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3008) - }, - new - { - Id = "4a8af085-247a-4e8a-89b3-e5698fa7cc11", - ConcurrencyStamp = "d09bf0e5-e674-41f6-895f-fc49d82091c5", - CreatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3329), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3333) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId1") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId1"); - - b.HasIndex("UserId"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithMany() - .HasForeignKey("AddressId1"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.cs b/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.cs deleted file mode 100644 index 4ffe1ed..0000000 --- a/WalletApi/Migrations/20220401122140_Removed_ForeignKey_Customer_Table.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Removed_ForeignKey_Customer_Table : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_StaffProfile_Address_AddressId", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "2845b59f-e5c0-4dfd-8b46-3130dae4197f"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "9c750465-7a6c-476c-910e-4f4f236ded08"); - - migrationBuilder.AddColumn( - name: "AddressId1", - table: "StaffProfile", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(287), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(758) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1180), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1185) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "67802be3-98c8-4cb7-9ee4-e5b639bb148a", "b3e75703-db7e-4cfb-9760-482c5d60e585", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(2507), null, "Admin", "ADMIN", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3008), null }, - { "4a8af085-247a-4e8a-89b3-e5698fa7cc11", "d09bf0e5-e674-41f6-895f-fc49d82091c5", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3329), null, "Manager", "MANAGER", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3333), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2817), new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2820) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2280), new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2567) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7677), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7680) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7020), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7385) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId1", - table: "StaffProfile", - column: "AddressId1"); - - migrationBuilder.AddForeignKey( - name: "FK_StaffProfile_Address_AddressId1", - table: "StaffProfile", - column: "AddressId1", - principalTable: "Address", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_StaffProfile_Address_AddressId1", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_AddressId1", - table: "StaffProfile"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4a8af085-247a-4e8a-89b3-e5698fa7cc11"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "67802be3-98c8-4cb7-9ee4-e5b639bb148a"); - - migrationBuilder.DropColumn( - name: "AddressId1", - table: "StaffProfile"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3101), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3296) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3457), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(3459) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "9c750465-7a6c-476c-910e-4f4f236ded08", "4d4f09d7-4696-4ec8-88a6-6e1b73f3475b", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(3737), null, "Admin", "ADMIN", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4035), null }, - { "2845b59f-e5c0-4dfd-8b46-3130dae4197f", "54b2358e-c103-4686-8ca4-59e3c23b7ef1", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4233), null, "Manager", "MANAGER", new DateTime(2022, 3, 31, 23, 51, 16, 810, DateTimeKind.Local).AddTicks(4235), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9156), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9158) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(8838), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(9005) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6169), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6171) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(5841), new DateTime(2022, 3, 31, 23, 51, 16, 811, DateTimeKind.Local).AddTicks(6016) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile", - column: "AddressId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_StaffProfile_Address_AddressId", - table: "StaffProfile", - column: "AddressId", - principalTable: "Address", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.Designer.cs b/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.Designer.cs deleted file mode 100644 index de7b0c3..0000000 --- a/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.Designer.cs +++ /dev/null @@ -1,769 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220401135618_Made_Address_Table_Nullable")] - partial class Made_Address_Table_Nullable - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(4690), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5097) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5387), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5390) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(1987), - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2159) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2321), - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2323) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8769), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8950) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9110), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9112) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "f7c16468-8dd9-4f58-b29b-50db714d300d", - ConcurrencyStamp = "39ee5aa5-5f75-496a-a650-a0be36990bbe", - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(872), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1315) - }, - new - { - Id = "4d414dfe-6f9c-4bd8-a964-df1afaa725bd", - ConcurrencyStamp = "a6094ea1-1f8b-400b-9941-15c255a1389e", - CreatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1669), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1673) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId1") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId1"); - - b.HasIndex("UserId"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithMany() - .HasForeignKey("AddressId1"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.cs b/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.cs deleted file mode 100644 index 2d22f1d..0000000 --- a/WalletApi/Migrations/20220401135618_Made_Address_Table_Nullable.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Made_Address_Table_Nullable : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4a8af085-247a-4e8a-89b3-e5698fa7cc11"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "67802be3-98c8-4cb7-9ee4-e5b639bb148a"); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uniqueidentifier"); - - migrationBuilder.AlterColumn( - name: "PlotNo", - table: "Address", - type: "int", - nullable: true, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "CustomerId", - table: "Address", - type: "uniqueidentifier", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uniqueidentifier"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(4690), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5097) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5387), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5390) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "f7c16468-8dd9-4f58-b29b-50db714d300d", "39ee5aa5-5f75-496a-a650-a0be36990bbe", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(872), null, "Admin", "ADMIN", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1315), null }, - { "4d414dfe-6f9c-4bd8-a964-df1afaa725bd", "a6094ea1-1f8b-400b-9941-15c255a1389e", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1669), null, "Manager", "MANAGER", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1673), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2321), new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2323) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(1987), new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2159) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9110), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9112) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8769), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8950) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4d414dfe-6f9c-4bd8-a964-df1afaa725bd"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "f7c16468-8dd9-4f58-b29b-50db714d300d"); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uniqueidentifier", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "PlotNo", - table: "Address", - type: "int", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "int", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CustomerId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uniqueidentifier", - oldNullable: true); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(287), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(758) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1180), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(1185) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "67802be3-98c8-4cb7-9ee4-e5b639bb148a", "b3e75703-db7e-4cfb-9760-482c5d60e585", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(2507), null, "Admin", "ADMIN", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3008), null }, - { "4a8af085-247a-4e8a-89b3-e5698fa7cc11", "d09bf0e5-e674-41f6-895f-fc49d82091c5", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3329), null, "Manager", "MANAGER", new DateTime(2022, 4, 1, 13, 21, 39, 823, DateTimeKind.Local).AddTicks(3333), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2817), new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2820) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2280), new DateTime(2022, 4, 1, 13, 21, 39, 826, DateTimeKind.Local).AddTicks(2567) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7677), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7680) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7020), new DateTime(2022, 4, 1, 13, 21, 39, 825, DateTimeKind.Local).AddTicks(7385) }); - } - } -} diff --git a/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.Designer.cs b/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.Designer.cs deleted file mode 100644 index 82ae267..0000000 --- a/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.Designer.cs +++ /dev/null @@ -1,773 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220403155619_Removed_AddressId_From_Staff")] - partial class Removed_AddressId_From_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.10") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(6925), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7110) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7264), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7266) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2649), - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2801) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2940), - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2942) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9672), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9844) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9996), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9998) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - - b.HasData( - new - { - Id = "a9208264-95d8-4d5a-abb5-a2237ca03cf9", - ConcurrencyStamp = "3ec88781-2079-42ea-a14e-578b1bf3737d", - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(6698), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7185) - }, - new - { - Id = "a37beef7-53df-44dd-ba36-5e5291415e60", - ConcurrencyStamp = "9c9fcff2-1f42-442e-8ada-120a1d07c59b", - CreatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7392), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7394) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.cs b/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.cs deleted file mode 100644 index e145d13..0000000 --- a/WalletApi/Migrations/20220403155619_Removed_AddressId_From_Staff.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace WalletApi.Migrations -{ - public partial class Removed_AddressId_From_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_StaffProfile_Address_AddressId1", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_AddressId1", - table: "StaffProfile"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "4d414dfe-6f9c-4bd8-a964-df1afaa725bd"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "f7c16468-8dd9-4f58-b29b-50db714d300d"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "StaffProfile"); - - migrationBuilder.DropColumn( - name: "AddressId1", - table: "StaffProfile"); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(6925), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7110) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7264), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7266) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "a9208264-95d8-4d5a-abb5-a2237ca03cf9", "3ec88781-2079-42ea-a14e-578b1bf3737d", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(6698), null, "Admin", "ADMIN", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7185), null }, - { "a37beef7-53df-44dd-ba36-5e5291415e60", "9c9fcff2-1f42-442e-8ada-120a1d07c59b", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7392), null, "Manager", "MANAGER", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7394), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2940), new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2942) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2649), new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2801) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9996), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9998) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9672), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9844) }); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "a37beef7-53df-44dd-ba36-5e5291415e60"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "a9208264-95d8-4d5a-abb5-a2237ca03cf9"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "StaffProfile", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "AddressId1", - table: "StaffProfile", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(4690), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5097) }); - - migrationBuilder.UpdateData( - table: "AirTimes", - keyColumn: "Id", - keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5387), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(5390) }); - - migrationBuilder.InsertData( - table: "AspNetRoles", - columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { "f7c16468-8dd9-4f58-b29b-50db714d300d", "39ee5aa5-5f75-496a-a650-a0be36990bbe", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(872), null, "Admin", "ADMIN", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1315), null }, - { "4d414dfe-6f9c-4bd8-a964-df1afaa725bd", "a6094ea1-1f8b-400b-9941-15c255a1389e", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1669), null, "Manager", "MANAGER", new DateTime(2022, 4, 1, 14, 56, 18, 497, DateTimeKind.Local).AddTicks(1673), null } - }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2321), new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2323) }); - - migrationBuilder.UpdateData( - table: "Bills", - keyColumn: "Id", - keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(1987), new DateTime(2022, 4, 1, 14, 56, 18, 499, DateTimeKind.Local).AddTicks(2159) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9110), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(9112) }); - - migrationBuilder.UpdateData( - table: "Data", - keyColumn: "Id", - keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - columns: new[] { "CreatedAt", "UpdatedAt" }, - values: new object[] { new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8769), new DateTime(2022, 4, 1, 14, 56, 18, 498, DateTimeKind.Local).AddTicks(8950) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId1", - table: "StaffProfile", - column: "AddressId1"); - - migrationBuilder.AddForeignKey( - name: "FK_StaffProfile_Address_AddressId1", - table: "StaffProfile", - column: "AddressId1", - principalTable: "Address", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.Designer.cs b/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.Designer.cs deleted file mode 100644 index 9f332a8..0000000 --- a/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.Designer.cs +++ /dev/null @@ -1,791 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220415190206_Staff_Delete_Cascade")] - partial class Staff_Delete_Cascade - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5077), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5078) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5298), - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5300) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303), - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5161), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5163) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "018dd14d-b73e-47a5-802f-49d19bbf774e", - ConcurrencyStamp = "74a66f36-3609-48ab-8481-a027fc492765", - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4697), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4724) - }, - new - { - Id = "b830ac33-f7c0-459d-8ed6-649f9adb4030", - ConcurrencyStamp = "c87a2388-575f-45d4-81cd-853c0fb6e699", - CreatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.cs b/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.cs deleted file mode 100644 index 977dff4..0000000 --- a/WalletApi/Migrations/20220415190206_Staff_Delete_Cascade.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Staff_Delete_Cascade : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_Customers_UserId", - table: "Customers"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "a37beef7-53df-44dd-ba36-5e5291415e60"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "a9208264-95d8-4d5a-abb5-a2237ca03cf9"); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uniqueidentifier", - oldNullable: true); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5077), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5078) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "018dd14d-b73e-47a5-802f-49d19bbf774e", "74a66f36-3609-48ab-8481-a027fc492765", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4697), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4724), null }, - // { "b830ac33-f7c0-459d-8ed6-649f9adb4030", "c87a2388-575f-45d4-81cd-853c0fb6e699", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5298), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5300) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5161), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5163) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile", - column: "UserId", - unique: true, - filter: "[UserId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Customers_UserId", - table: "Customers", - column: "UserId", - unique: true, - filter: "[UserId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_Customers_UserId", - table: "Customers"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "018dd14d-b73e-47a5-802f-49d19bbf774e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "b830ac33-f7c0-459d-8ed6-649f9adb4030"); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uniqueidentifier"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(6925), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7110) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7264), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(7266) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "a37beef7-53df-44dd-ba36-5e5291415e60", "9c9fcff2-1f42-442e-8ada-120a1d07c59b", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7392), null, "Manager", "MANAGER", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7394), null }, - // { "a9208264-95d8-4d5a-abb5-a2237ca03cf9", "3ec88781-2079-42ea-a14e-578b1bf3737d", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(6698), null, "Admin", "ADMIN", new DateTime(2022, 4, 3, 16, 56, 18, 966, DateTimeKind.Local).AddTicks(7185), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2940), new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2942) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2649), new DateTime(2022, 4, 3, 16, 56, 18, 968, DateTimeKind.Local).AddTicks(2801) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9996), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9998) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9672), new DateTime(2022, 4, 3, 16, 56, 18, 967, DateTimeKind.Local).AddTicks(9844) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Customers_UserId", - table: "Customers", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.Designer.cs b/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.Designer.cs deleted file mode 100644 index ee3fa7a..0000000 --- a/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.Designer.cs +++ /dev/null @@ -1,791 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220415201411_Changed_FullName_To_FirstName")] - partial class Changed_FullName_To_FirstName - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6709), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6710) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812), - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6814), - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6815) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6764), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6765) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "83138db4-4d77-4ed6-8a2b-7adfec2fcc7a", - ConcurrencyStamp = "1908bedc-4165-42fa-a1d6-bf1a92167fa3", - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6531), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6547) - }, - new - { - Id = "8afd8579-0221-4508-b767-3538c83e49ad", - ConcurrencyStamp = "9298fb83-e1a1-4a62-98b0-b180417bc6a6", - CreatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6562), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6563) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.cs b/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.cs deleted file mode 100644 index a95d38b..0000000 --- a/WalletApi/Migrations/20220415201411_Changed_FullName_To_FirstName.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Changed_FullName_To_FirstName : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "018dd14d-b73e-47a5-802f-49d19bbf774e"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "b830ac33-f7c0-459d-8ed6-649f9adb4030"); - - migrationBuilder.RenameColumn( - name: "FullName", - table: "StaffProfile", - newName: "FirstName"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6709), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6710) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "83138db4-4d77-4ed6-8a2b-7adfec2fcc7a", "1908bedc-4165-42fa-a1d6-bf1a92167fa3", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6531), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6547), null }, - // { "8afd8579-0221-4508-b767-3538c83e49ad", "9298fb83-e1a1-4a62-98b0-b180417bc6a6", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6562), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6563), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6814), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6815) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6764), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6765) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "83138db4-4d77-4ed6-8a2b-7adfec2fcc7a"); - - migrationBuilder.DeleteData( - table: "AspNetRoles", - keyColumn: "Id", - keyValue: "8afd8579-0221-4508-b767-3538c83e49ad"); - - migrationBuilder.RenameColumn( - name: "FirstName", - table: "StaffProfile", - newName: "FullName"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5077), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5078) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5084) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "018dd14d-b73e-47a5-802f-49d19bbf774e", "74a66f36-3609-48ab-8481-a027fc492765", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4697), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4724), null }, - // { "b830ac33-f7c0-459d-8ed6-649f9adb4030", "c87a2388-575f-45d4-81cd-853c0fb6e699", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(4729), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5303) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5298), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5300) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5168) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5161), new DateTime(2022, 4, 15, 20, 2, 6, 62, DateTimeKind.Local).AddTicks(5163) }); - } - } -} diff --git a/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.Designer.cs b/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.Designer.cs deleted file mode 100644 index 5585e0c..0000000 --- a/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.Designer.cs +++ /dev/null @@ -1,794 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220415202109_Addeded_LastName_To_Staff")] - partial class Addeded_LastName_To_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8396), - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8397) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8399), - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8400) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("WalletId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AddressId") - .IsUnique() - .HasFilter("[AddressId] IS NOT NULL"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.HasIndex("WalletId") - .IsUnique(); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8328), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8329) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8330), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8331) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "37b75c9d-94af-4f55-a317-e173d4f11c4e", - ConcurrencyStamp = "e4d476d2-5f61-4d27-aa3d-1021737dbd30", - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8077), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8088) - }, - new - { - Id = "c23a4b92-6bc4-49f5-a929-5b61a88ca47b", - ConcurrencyStamp = "fc92ca81-ac7e-4223-ba56-4742c4a453ee", - CreatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8092), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8093) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "WalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.cs b/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.cs deleted file mode 100644 index bb89246..0000000 --- a/WalletApi/Migrations/20220415202109_Addeded_LastName_To_Staff.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Addeded_LastName_To_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "83138db4-4d77-4ed6-8a2b-7adfec2fcc7a"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "8afd8579-0221-4508-b767-3538c83e49ad"); - - migrationBuilder.AddColumn( - name: "LastName", - table: "StaffProfile", - type: "nvarchar(max)", - nullable: true); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "37b75c9d-94af-4f55-a317-e173d4f11c4e", "e4d476d2-5f61-4d27-aa3d-1021737dbd30", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8077), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8088), null }, - // { "c23a4b92-6bc4-49f5-a929-5b61a88ca47b", "fc92ca81-ac7e-4223-ba56-4742c4a453ee", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8092), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8093), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8399), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8400) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8396), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8397) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8330), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8331) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8328), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8329) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "37b75c9d-94af-4f55-a317-e173d4f11c4e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "c23a4b92-6bc4-49f5-a929-5b61a88ca47b"); - - migrationBuilder.DropColumn( - name: "LastName", - table: "StaffProfile"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6709), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6710) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6712) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "83138db4-4d77-4ed6-8a2b-7adfec2fcc7a", "1908bedc-4165-42fa-a1d6-bf1a92167fa3", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6531), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6547), null }, - // { "8afd8579-0221-4508-b767-3538c83e49ad", "9298fb83-e1a1-4a62-98b0-b180417bc6a6", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6562), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6563), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6814), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6815) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6812) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6764), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6765) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762), new DateTime(2022, 4, 15, 21, 14, 11, 451, DateTimeKind.Local).AddTicks(6762) }); - } - } -} diff --git a/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.Designer.cs b/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.Designer.cs deleted file mode 100644 index e971b39..0000000 --- a/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.Designer.cs +++ /dev/null @@ -1,788 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220416200006_Removed_ForeignKey_Reference_From_Customer")] - partial class Removed_ForeignKey_Reference_From_Customer - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2366), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2367) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2370), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2370) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2470), - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2471) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2473), - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2473) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FullName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2418), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2420) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2421), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2422) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "9413e8b8-4914-4665-8288-1a0a5414f0fc", - ConcurrencyStamp = "d18efcf2-83a9-4ffd-b8af-516a0ebfc66f", - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2208), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2217) - }, - new - { - Id = "347e1ca3-1bdd-4ac9-8aaa-86c284fe2e9e", - ConcurrencyStamp = "7f6beef0-b211-4e4e-a995-508a5473803f", - CreatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2223), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2223) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.cs b/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.cs deleted file mode 100644 index 8e22bad..0000000 --- a/WalletApi/Migrations/20220416200006_Removed_ForeignKey_Reference_From_Customer.cs +++ /dev/null @@ -1,247 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Removed_ForeignKey_Reference_From_Customer : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Customers_Address_AddressId", - table: "Customers"); - - migrationBuilder.DropForeignKey( - name: "FK_Customers_Wallets_WalletId", - table: "Customers"); - - migrationBuilder.DropIndex( - name: "IX_Customers_AddressId", - table: "Customers"); - - migrationBuilder.DropIndex( - name: "IX_Customers_WalletId", - table: "Customers"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "37b75c9d-94af-4f55-a317-e173d4f11c4e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "c23a4b92-6bc4-49f5-a929-5b61a88ca47b"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "Customers"); - - migrationBuilder.DropColumn( - name: "WalletId", - table: "Customers"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2366), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2367) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2370), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2370) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "347e1ca3-1bdd-4ac9-8aaa-86c284fe2e9e", "7f6beef0-b211-4e4e-a995-508a5473803f", new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2223), null, "Manager", "MANAGER", new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2223), null }, - // { "9413e8b8-4914-4665-8288-1a0a5414f0fc", "d18efcf2-83a9-4ffd-b8af-516a0ebfc66f", new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2208), null, "Admin", "ADMIN", new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2217), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2473), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2473) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2470), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2471) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2421), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2422) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2418), new DateTime(2022, 4, 16, 21, 0, 6, 99, DateTimeKind.Local).AddTicks(2420) }); - - migrationBuilder.CreateIndex( - name: "IX_Wallets_CustomerId", - table: "Wallets", - column: "CustomerId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Address_CustomerId", - table: "Address", - column: "CustomerId", - unique: true, - filter: "[CustomerId] IS NOT NULL"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address", - column: "CustomerId", - principalTable: "Customers", - principalColumn: "Id"); - - //migrationBuilder.AddForeignKey( - // name: "FK_Wallets_Customers_CustomerId", - // table: "Wallets", - // column: "CustomerId", - // principalTable: "Customers", - // principalColumn: "Id", - // onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address"); - - migrationBuilder.DropForeignKey( - name: "FK_Wallets_Customers_CustomerId", - table: "Wallets"); - - migrationBuilder.DropIndex( - name: "IX_Wallets_CustomerId", - table: "Wallets"); - - migrationBuilder.DropIndex( - name: "IX_Address_CustomerId", - table: "Address"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "347e1ca3-1bdd-4ac9-8aaa-86c284fe2e9e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "9413e8b8-4914-4665-8288-1a0a5414f0fc"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "Customers", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.AddColumn( - name: "WalletId", - table: "Customers", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8270) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8272) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "37b75c9d-94af-4f55-a317-e173d4f11c4e", "e4d476d2-5f61-4d27-aa3d-1021737dbd30", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8077), null, "Admin", "ADMIN", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8088), null }, - // { "c23a4b92-6bc4-49f5-a929-5b61a88ca47b", "fc92ca81-ac7e-4223-ba56-4742c4a453ee", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8092), null, "Manager", "MANAGER", new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8093), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8399), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8400) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8396), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8397) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8330), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8331) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8328), new DateTime(2022, 4, 15, 21, 21, 9, 460, DateTimeKind.Local).AddTicks(8329) }); - - migrationBuilder.CreateIndex( - name: "IX_Customers_AddressId", - table: "Customers", - column: "AddressId", - unique: true, - filter: "[AddressId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Customers_WalletId", - table: "Customers", - column: "WalletId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_Customers_Address_AddressId", - table: "Customers", - column: "AddressId", - principalTable: "Address", - principalColumn: "Id"); - - //migrationBuilder.AddForeignKey( - // name: "FK_Customers_Wallets_WalletId", - // table: "Customers", - // column: "WalletId", - // principalTable: "Wallets", - // principalColumn: "Id", - // onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.Designer.cs b/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.Designer.cs deleted file mode 100644 index af09f5a..0000000 --- a/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.Designer.cs +++ /dev/null @@ -1,794 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220416202225_Added_New_Properties_To_Customer")] - partial class Added_New_Properties_To_Customer - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6695), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6696) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6698), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6699) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6854), - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6855) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6857), - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6858) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6791), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6793) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6794), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6794) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "ab76d494-8784-4f34-ad07-b64d6ce11e5c", - ConcurrencyStamp = "c9bc35f3-5ce4-4c74-af37-430a4fdb8dc5", - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6344), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6358) - }, - new - { - Id = "32257101-11a4-4cfe-b698-e9e333e8c519", - ConcurrencyStamp = "78151a75-b37f-4d8b-981f-aeffb6969158", - CreatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6362), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6363) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.cs b/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.cs deleted file mode 100644 index 61d7f80..0000000 --- a/WalletApi/Migrations/20220416202225_Added_New_Properties_To_Customer.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_New_Properties_To_Customer : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "FullName", - table: "Customers", - newName: "LastName"); - - migrationBuilder.AddColumn( - name: "FirstName", - table: "Customers", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "Customers", - type: "bit", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FirstName", - table: "Customers"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "Customers"); - - migrationBuilder.RenameColumn( - name: "LastName", - table: "Customers", - newName: "FullName"); - } - } -} diff --git a/WalletApi/Migrations/20220417100251_Address_Table_No_Null.Designer.cs b/WalletApi/Migrations/20220417100251_Address_Table_No_Null.Designer.cs deleted file mode 100644 index 8cdd0b1..0000000 --- a/WalletApi/Migrations/20220417100251_Address_Table_No_Null.Designer.cs +++ /dev/null @@ -1,793 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417100251_Address_Table_No_Null")] - partial class Address_Table_No_Null - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique(); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3946), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3948) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3951), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3952) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4121), - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4122) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4125), - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4126) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4043), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4045) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "3a7561ce-54af-45ab-8638-0ac5ed7a0a6e", - ConcurrencyStamp = "07a3bc3e-43fe-4e13-a7e7-f6bf333ec7f1", - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3693), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3709) - }, - new - { - Id = "4819077d-e76b-4f3f-b228-cf207880200e", - ConcurrencyStamp = "6c7f20f7-4d4a-4f6b-894d-c76a8370cc94", - CreatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3715), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3716) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417100251_Address_Table_No_Null.cs b/WalletApi/Migrations/20220417100251_Address_Table_No_Null.cs deleted file mode 100644 index 050e2fa..0000000 --- a/WalletApi/Migrations/20220417100251_Address_Table_No_Null.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Address_Table_No_Null : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "32257101-11a4-4cfe-b698-e9e333e8c519"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "ab76d494-8784-4f34-ad07-b64d6ce11e5c"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3946), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3948) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3951), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3952) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "3a7561ce-54af-45ab-8638-0ac5ed7a0a6e", "07a3bc3e-43fe-4e13-a7e7-f6bf333ec7f1", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3693), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3709), null }, - // { "4819077d-e76b-4f3f-b228-cf207880200e", "6c7f20f7-4d4a-4f6b-894d-c76a8370cc94", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3715), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3716), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4125), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4126) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4121), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4122) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4043), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4045) }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "3a7561ce-54af-45ab-8638-0ac5ed7a0a6e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "4819077d-e76b-4f3f-b228-cf207880200e"); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6695), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6696) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6698), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6699) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "32257101-11a4-4cfe-b698-e9e333e8c519", "78151a75-b37f-4d8b-981f-aeffb6969158", new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6362), null, "Manager", "MANAGER", new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6363), null }, - // { "ab76d494-8784-4f34-ad07-b64d6ce11e5c", "c9bc35f3-5ce4-4c74-af37-430a4fdb8dc5", new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6344), null, "Admin", "ADMIN", new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6358), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6857), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6858) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6854), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6855) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6794), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6794) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6791), new DateTime(2022, 4, 16, 21, 22, 25, 424, DateTimeKind.Local).AddTicks(6793) }); - } - } -} diff --git a/WalletApi/Migrations/20220417101228_Address_Table_Null.Designer.cs b/WalletApi/Migrations/20220417101228_Address_Table_Null.Designer.cs deleted file mode 100644 index 7660672..0000000 --- a/WalletApi/Migrations/20220417101228_Address_Table_Null.Designer.cs +++ /dev/null @@ -1,785 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417101228_Address_Table_Null")] - partial class Address_Table_Null - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2483), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2485) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2488), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2489) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2679), - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2681) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2684), - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2685) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2584), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2585) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2588), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2589) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "b77c7a08-c9a7-453f-a79c-1566fa5f5a27", - ConcurrencyStamp = "b3cfadcd-8161-4806-bae8-a15ffdc9e97c", - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2256), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2273) - }, - new - { - Id = "a2ddaa4a-d48f-4867-8ab2-63ba8d8c4055", - ConcurrencyStamp = "2ac53f3f-06b3-4c2d-bdf8-85609d5f5add", - CreatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") - .WithMany() - .HasForeignKey("AddressId"); - - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417101228_Address_Table_Null.cs b/WalletApi/Migrations/20220417101228_Address_Table_Null.cs deleted file mode 100644 index ed57f65..0000000 --- a/WalletApi/Migrations/20220417101228_Address_Table_Null.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Address_Table_Null : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "3a7561ce-54af-45ab-8638-0ac5ed7a0a6e"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "4819077d-e76b-4f3f-b228-cf207880200e"); - - migrationBuilder.DropColumn( - name: "StaffId", - table: "Address"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "StaffProfile", - type: "uniqueidentifier", - nullable: true); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2483), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2485) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2488), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2489) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "a2ddaa4a-d48f-4867-8ab2-63ba8d8c4055", "2ac53f3f-06b3-4c2d-bdf8-85609d5f5add", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280), null }, - // { "b77c7a08-c9a7-453f-a79c-1566fa5f5a27", "b3cfadcd-8161-4806-bae8-a15ffdc9e97c", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2256), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2273), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2684), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2685) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2679), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2681) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2588), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2589) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2584), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2585) }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile", - column: "AddressId"); - - //migrationBuilder.AddForeignKey( - // name: "FK_StaffProfile_Address_AddressId", - // table: "StaffProfile", - // column: "AddressId", - // principalTable: "Address", - // principalColumn: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_StaffProfile_Address_AddressId", - table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "a2ddaa4a-d48f-4867-8ab2-63ba8d8c4055"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "b77c7a08-c9a7-453f-a79c-1566fa5f5a27"); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "StaffProfile"); - - migrationBuilder.AddColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3946), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3948) }); - - //migrationBuilder.UpdateData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3951), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3952) }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "3a7561ce-54af-45ab-8638-0ac5ed7a0a6e", "07a3bc3e-43fe-4e13-a7e7-f6bf333ec7f1", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3693), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3709), null }, - // { "4819077d-e76b-4f3f-b228-cf207880200e", "6c7f20f7-4d4a-4f6b-894d-c76a8370cc94", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3715), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(3716), null } - // }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4125), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4126) }); - - //migrationBuilder.UpdateData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4121), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4122) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4048) }); - - //migrationBuilder.UpdateData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - // columns: new[] { "CreatedAt", "UpdatedAt" }, - // values: new object[] { new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4043), new DateTime(2022, 4, 17, 11, 2, 51, 189, DateTimeKind.Local).AddTicks(4045) }); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true); - - //migrationBuilder.AddForeignKey( - // name: "FK_Address_StaffProfile_StaffId", - // table: "Address", - // column: "StaffId", - // principalTable: "StaffProfile", - // principalColumn: "Id", - // onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.Designer.cs b/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.Designer.cs deleted file mode 100644 index b809f18..0000000 --- a/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.Designer.cs +++ /dev/null @@ -1,720 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417112501_Added_StaffId_To_Address")] - partial class Added_StaffId_To_Address - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", null) - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId"); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.cs b/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.cs deleted file mode 100644 index 2827e1b..0000000 --- a/WalletApi/Migrations/20220417112501_Added_StaffId_To_Address.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_StaffId_To_Address : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropForeignKey( - // name: "FK_StaffProfile_Address_AddressId", - // table: "StaffProfile"); - - migrationBuilder.DropIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile"); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9")); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57")); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "a2ddaa4a-d48f-4867-8ab2-63ba8d8c4055"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "b77c7a08-c9a7-453f-a79c-1566fa5f5a27"); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101")); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b")); - - migrationBuilder.DropColumn( - name: "AddressId", - table: "StaffProfile"); - - migrationBuilder.AddColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - //migrationBuilder.AddForeignKey( - // name: "FK_Address_StaffProfile_StaffId", - // table: "Address", - // column: "StaffId", - // principalTable: "StaffProfile", - // principalColumn: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropForeignKey( - // name: "FK_Address_StaffProfile_StaffId", - // table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - migrationBuilder.DropColumn( - name: "StaffId", - table: "Address"); - - migrationBuilder.AddColumn( - name: "AddressId", - table: "StaffProfile", - type: "uniqueidentifier", - nullable: true); - - //migrationBuilder.InsertData( - // table: "AirTimes", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2483), null, "Mtn", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2485), null }, - // { new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2488), null, "Airtel", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2489), null } - // }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "a2ddaa4a-d48f-4867-8ab2-63ba8d8c4055", "2ac53f3f-06b3-4c2d-bdf8-85609d5f5add", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2280), null }, - // { "b77c7a08-c9a7-453f-a79c-1566fa5f5a27", "b3cfadcd-8161-4806-bae8-a15ffdc9e97c", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2256), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2273), null } - // }); - - //migrationBuilder.InsertData( - // table: "Bills", - // columns: new[] { "Id", "Amount", "BillName", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), 3000m, "GOTV", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2684), null, new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2685), null }, - // { new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), 6500m, "DSTV", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2679), null, new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2681), null } - // }); - - //migrationBuilder.InsertData( - // table: "Data", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2588), null, "Airtel", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2589), null }, - // { new Guid("ce185a95-533e-425c-adf4-a5770766564b"), new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2584), null, "Mtn", new DateTime(2022, 4, 17, 11, 12, 28, 1, DateTimeKind.Local).AddTicks(2585), null } - // }); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_AddressId", - table: "StaffProfile", - column: "AddressId"); - - //migrationBuilder.AddForeignKey( - // name: "FK_StaffProfile_Address_AddressId", - // table: "StaffProfile", - // column: "AddressId", - // principalTable: "Address", - // principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.Designer.cs b/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.Designer.cs deleted file mode 100644 index 9b19086..0000000 --- a/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.Designer.cs +++ /dev/null @@ -1,792 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417121847_Removed_DeleteCascade_In_Address")] - partial class Removed_DeleteCascade_In_Address - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - - b.HasData( - new - { - Id = new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042) - }, - new - { - Id = new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - - b.HasData( - new - { - Id = new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), - Amount = 6500m, - BillName = "DSTV", - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9162), - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9164) - }, - new - { - Id = new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), - Amount = 3000m, - BillName = "GOTV", - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9166), - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9167) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - - b.HasData( - new - { - Id = new Guid("ce185a95-533e-425c-adf4-a5770766564b"), - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9117), - NetworkProvider = "Mtn", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9118) - }, - new - { - Id = new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9119), - NetworkProvider = "Airtel", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9120) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - - b.HasData( - new - { - Id = "5a983c37-816e-4ed4-95e3-580c095f7c75", - ConcurrencyStamp = "0c2dee79-a1c7-47d7-be9b-3b3e02e1c41c", - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8885), - Name = "Admin", - NormalizedName = "ADMIN", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8896) - }, - new - { - Id = "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6", - ConcurrencyStamp = "50a4ceb4-eea6-4296-ba5d-143386880aa5", - CreatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), - Name = "Manager", - NormalizedName = "MANAGER", - UpdatedAt = new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901) - }); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId"); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.cs b/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.cs deleted file mode 100644 index 8e1252a..0000000 --- a/WalletApi/Migrations/20220417121847_Removed_DeleteCascade_In_Address.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Removed_DeleteCascade_In_Address : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.InsertData( - // table: "AirTimes", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null }, - // { new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null } - // }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "5a983c37-816e-4ed4-95e3-580c095f7c75", "0c2dee79-a1c7-47d7-be9b-3b3e02e1c41c", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8885), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8896), null }, - // { "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6", "50a4ceb4-eea6-4296-ba5d-143386880aa5", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null } - // }); - - //migrationBuilder.InsertData( - // table: "Bills", - // columns: new[] { "Id", "Amount", "BillName", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), 3000m, "GOTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9166), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9167), null }, - // { new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), 6500m, "DSTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9162), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9164), null } - // }); - - //migrationBuilder.InsertData( - // table: "Data", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9119), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9120), null }, - // { new Guid("ce185a95-533e-425c-adf4-a5770766564b"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9117), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9118), null } - // }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9")); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57")); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "5a983c37-816e-4ed4-95e3-580c095f7c75"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6"); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101")); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b")); - } - } -} diff --git a/WalletApi/Migrations/20220417171413_Added_DeleteCascade_In_Address.cs b/WalletApi/Migrations/20220417171413_Added_DeleteCascade_In_Address.cs deleted file mode 100644 index cc4db51..0000000 --- a/WalletApi/Migrations/20220417171413_Added_DeleteCascade_In_Address.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_DeleteCascade_In_Address : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9")); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57")); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "5a983c37-816e-4ed4-95e3-580c095f7c75"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6"); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101")); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b")); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - oldClrType: typeof(Guid), - oldType: "uniqueidentifier", - oldNullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.DropIndex( - name: "IX_Address_StaffId", - table: "Address"); - - migrationBuilder.AlterColumn( - name: "StaffId", - table: "Address", - type: "uniqueidentifier", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uniqueidentifier"); - - //migrationBuilder.InsertData( - // table: "AirTimes", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null }, - // { new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null } - // }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "5a983c37-816e-4ed4-95e3-580c095f7c75", "0c2dee79-a1c7-47d7-be9b-3b3e02e1c41c", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8885), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8896), null }, - // { "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6", "50a4ceb4-eea6-4296-ba5d-143386880aa5", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null } - // }); - - //migrationBuilder.InsertData( - // table: "Bills", - // columns: new[] { "Id", "Amount", "BillName", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), 3000m, "GOTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9166), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9167), null }, - // { new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), 6500m, "DSTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9162), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9164), null } - // }); - - //migrationBuilder.InsertData( - // table: "Data", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9119), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9120), null }, - // { new Guid("ce185a95-533e-425c-adf4-a5770766564b"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9117), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9118), null } - // }); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.Designer.cs b/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.Designer.cs deleted file mode 100644 index c3a2af8..0000000 --- a/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.Designer.cs +++ /dev/null @@ -1,607 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417185606_Drop_Address_And_Staff")] - partial class Drop_Address_And_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.cs b/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.cs deleted file mode 100644 index 25d08cd..0000000 --- a/WalletApi/Migrations/20220417185606_Drop_Address_And_Staff.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Drop_Address_And_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Address"); - - migrationBuilder.DropTable( - name: "StaffProfile"); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9")); - - //migrationBuilder.DeleteData( - // table: "AirTimes", - // keyColumn: "Id", - // keyValue: new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57")); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "5a983c37-816e-4ed4-95e3-580c095f7c75"); - - //migrationBuilder.DeleteData( - // table: "AspNetRoles", - // keyColumn: "Id", - // keyValue: "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6"); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101")); - - //migrationBuilder.DeleteData( - // table: "Bills", - // keyColumn: "Id", - // keyValue: new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0")); - - //migrationBuilder.DeleteData( - // table: "Data", - // keyColumn: "Id", - // keyValue: new Guid("ce185a95-533e-425c-adf4-a5770766564b")); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "StaffProfile", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - UserId = table.Column(type: "nvarchar(450)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - FirstName = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - LastName = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_StaffProfile", x => x.Id); - table.ForeignKey( - name: "FK_StaffProfile_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Address", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - CustomerId = table.Column(type: "uniqueidentifier", nullable: true), - StaffId = table.Column(type: "uniqueidentifier", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - Nationality = table.Column(type: "nvarchar(max)", nullable: true), - PlotNo = table.Column(type: "int", nullable: true), - State = table.Column(type: "nvarchar(max)", nullable: true), - StreetName = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Address", x => x.Id); - table.ForeignKey( - name: "FK_Address_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Address_StaffProfile_StaffId", - column: x => x.StaffId, - principalTable: "StaffProfile", - principalColumn: "Id"); - }); - - //migrationBuilder.InsertData( - // table: "AirTimes", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("1da5eb5f-04cc-4f0e-afa6-52b3c78bedf9"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9042), null }, - // { new Guid("d584f98c-4a22-482d-bc9e-c1899aedcc57"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9044), null } - // }); - - //migrationBuilder.InsertData( - // table: "AspNetRoles", - // columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "CreatedBy", "Name", "NormalizedName", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { "5a983c37-816e-4ed4-95e3-580c095f7c75", "0c2dee79-a1c7-47d7-be9b-3b3e02e1c41c", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8885), null, "Admin", "ADMIN", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8896), null }, - // { "e8b25f23-f93d-4224-8223-9ba5a0f2c1f6", "50a4ceb4-eea6-4296-ba5d-143386880aa5", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null, "Manager", "MANAGER", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(8901), null } - // }); - - //migrationBuilder.InsertData( - // table: "Bills", - // columns: new[] { "Id", "Amount", "BillName", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("637c3058-f4c2-45aa-a30c-301cc5d2d101"), 3000m, "GOTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9166), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9167), null }, - // { new Guid("f1179901-af52-4774-b8e5-76e76b55c8c5"), 6500m, "DSTV", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9162), null, new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9164), null } - // }); - - //migrationBuilder.InsertData( - // table: "Data", - // columns: new[] { "Id", "CreatedAt", "CreatedBy", "NetworkProvider", "UpdatedAt", "UpdatedBy" }, - // values: new object[,] - // { - // { new Guid("9806f26b-e013-4dff-812a-afba47d2fbe0"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9119), null, "Airtel", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9120), null }, - // { new Guid("ce185a95-533e-425c-adf4-a5770766564b"), new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9117), null, "Mtn", new DateTime(2022, 4, 17, 13, 18, 47, 316, DateTimeKind.Local).AddTicks(9118), null } - // }); - - migrationBuilder.CreateIndex( - name: "IX_Address_CustomerId", - table: "Address", - column: "CustomerId", - unique: true, - filter: "[CustomerId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile", - column: "UserId", - unique: true, - filter: "[UserId] IS NOT NULL"); - } - } -} diff --git a/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.Designer.cs b/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.Designer.cs deleted file mode 100644 index 69099a6..0000000 --- a/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.Designer.cs +++ /dev/null @@ -1,722 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417192208_Add_Address_And_Staff")] - partial class Add_Address_And_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId"); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.cs b/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.cs deleted file mode 100644 index 87d5577..0000000 --- a/WalletApi/Migrations/20220417192208_Add_Address_And_Staff.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Add_Address_And_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "StaffProfile", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - LastName = table.Column(type: "nvarchar(max)", nullable: true), - FirstName = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), - UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false), - UserId = table.Column(type: "nvarchar(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_StaffProfile", x => x.Id); - table.ForeignKey( - name: "FK_StaffProfile_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Address", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PlotNo = table.Column(type: "int", nullable: true), - StreetName = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - State = table.Column(type: "nvarchar(max)", nullable: true), - Nationality = table.Column(type: "nvarchar(max)", nullable: true), - CustomerId = table.Column(type: "uniqueidentifier", nullable: true), - StaffId = table.Column(type: "uniqueidentifier", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Address", x => x.Id); - table.ForeignKey( - name: "FK_Address_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Address_StaffProfile_StaffId", - column: x => x.StaffId, - principalTable: "StaffProfile", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_Address_CustomerId", - table: "Address", - column: "CustomerId", - unique: true, - filter: "[CustomerId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Address_StaffId", - table: "Address", - column: "StaffId", - unique: true, - filter: "[StaffId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_StaffProfile_UserId", - table: "StaffProfile", - column: "UserId", - unique: true, - filter: "[UserId] IS NOT NULL"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Address"); - - migrationBuilder.DropTable( - name: "StaffProfile"); - } - } -} diff --git a/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.Designer.cs b/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.Designer.cs deleted file mode 100644 index d57ac43..0000000 --- a/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.Designer.cs +++ /dev/null @@ -1,723 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417194200_Add_DeleteCascade_for_Staff")] - partial class Add_DeleteCascade_for_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.cs b/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.cs deleted file mode 100644 index 68eb517..0000000 --- a/WalletApi/Migrations/20220417194200_Add_DeleteCascade_for_Staff.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Add_DeleteCascade_for_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.Designer.cs b/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.Designer.cs deleted file mode 100644 index 8a048de..0000000 --- a/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.Designer.cs +++ /dev/null @@ -1,722 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417195350_Remove_DeleteCascade_for_Staff")] - partial class Remove_DeleteCascade_for_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId"); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.cs b/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.cs deleted file mode 100644 index 1b73d85..0000000 --- a/WalletApi/Migrations/20220417195350_Remove_DeleteCascade_for_Staff.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Remove_DeleteCascade_for_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.Designer.cs b/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.Designer.cs deleted file mode 100644 index 6bcca37..0000000 --- a/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.Designer.cs +++ /dev/null @@ -1,723 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417200134_ReAdded_DeleteCascade_for_Staff")] - partial class ReAdded_DeleteCascade_for_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId"); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.cs b/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.cs deleted file mode 100644 index bfba154..0000000 --- a/WalletApi/Migrations/20220417200134_ReAdded_DeleteCascade_for_Staff.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class ReAdded_DeleteCascade_for_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_StaffProfile_StaffId", - table: "Address", - column: "StaffId", - principalTable: "StaffProfile", - principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.Designer.cs b/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.Designer.cs deleted file mode 100644 index d46ecce..0000000 --- a/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.Designer.cs +++ /dev/null @@ -1,724 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220417204732_Added_DeleteCascade_To_Customer")] - partial class Added_DeleteCascade_To_Customer - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.cs b/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.cs deleted file mode 100644 index 7e5aaff..0000000 --- a/WalletApi/Migrations/20220417204732_Added_DeleteCascade_To_Customer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_DeleteCascade_To_Customer : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address", - column: "CustomerId", - principalTable: "Customers", - principalColumn: "Id", - onDelete:ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address"); - - migrationBuilder.AddForeignKey( - name: "FK_Address_Customers_CustomerId", - table: "Address", - column: "CustomerId", - principalTable: "Customers", - principalColumn: "Id"); - } - } -} diff --git a/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.Designer.cs b/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.Designer.cs deleted file mode 100644 index a5a7d9c..0000000 --- a/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.Designer.cs +++ /dev/null @@ -1,724 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220419101941_Removed_ForeignKey_from_Transaction")] - partial class Removed_ForeignKey_from_Transaction - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.cs b/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.cs deleted file mode 100644 index a6e03cf..0000000 --- a/WalletApi/Migrations/20220419101941_Removed_ForeignKey_from_Transaction.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Removed_ForeignKey_from_Transaction : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.Designer.cs b/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.Designer.cs deleted file mode 100644 index ad06bab..0000000 --- a/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.Designer.cs +++ /dev/null @@ -1,742 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220523140601_Added_Gender_For_Customers_And_Staff")] - partial class Added_Gender_For_Customers_And_Staff - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.cs b/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.cs deleted file mode 100644 index 10fdb53..0000000 --- a/WalletApi/Migrations/20220523140601_Added_Gender_For_Customers_And_Staff.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_Gender_For_Customers_And_Staff : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.AddColumn( - // name: "Gender", - // table: "StaffProfile", - // type: "int", - // nullable: false, - // defaultValue: 0); - - migrationBuilder.AddColumn( - name: "Gender", - table: "Customers", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "CreatedAt", - table: "Address", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "CreatedBy", - table: "Address", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "UpdatedAt", - table: "Address", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "UpdatedBy", - table: "Address", - type: "nvarchar(max)", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropColumn( - // name: "Gender", - // table: "StaffProfile"); - - migrationBuilder.DropColumn( - name: "Gender", - table: "Customers"); - - migrationBuilder.DropColumn( - name: "CreatedAt", - table: "Address"); - - migrationBuilder.DropColumn( - name: "CreatedBy", - table: "Address"); - - migrationBuilder.DropColumn( - name: "UpdatedAt", - table: "Address"); - - migrationBuilder.DropColumn( - name: "UpdatedBy", - table: "Address"); - } - } -} diff --git a/WalletApi/Migrations/20220523202039_Added_ProfilePicture.Designer.cs b/WalletApi/Migrations/20220523202039_Added_ProfilePicture.Designer.cs deleted file mode 100644 index 6eeedc2..0000000 --- a/WalletApi/Migrations/20220523202039_Added_ProfilePicture.Designer.cs +++ /dev/null @@ -1,759 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220523202039_Added_ProfilePicture")] - partial class Added_ProfilePicture - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Picture") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("ProfilePictures"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220523202039_Added_ProfilePicture.cs b/WalletApi/Migrations/20220523202039_Added_ProfilePicture.cs deleted file mode 100644 index f2266cc..0000000 --- a/WalletApi/Migrations/20220523202039_Added_ProfilePicture.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_ProfilePicture : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ProfilePictures", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Picture = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProfilePictures", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ProfilePictures"); - } - } -} diff --git a/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.Designer.cs b/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.Designer.cs deleted file mode 100644 index 6e1de04..0000000 --- a/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.Designer.cs +++ /dev/null @@ -1,777 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20220629103302_Added_IsDeleted_To_Tables")] - partial class Added_IsDeleted_To_Tables - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeletd") - .HasColumnType("bit"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeletd") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeletd") - .HasColumnType("bit"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Picture") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("ProfilePictures"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.cs b/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.cs deleted file mode 100644 index 2d8a58d..0000000 --- a/WalletApi/Migrations/20220629103302_Added_IsDeleted_To_Tables.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - public partial class Added_IsDeleted_To_Tables : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsActive", - table: "StampDutyCharges", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsDeletd", - table: "Data", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsDeletd", - table: "Bills", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "AspNetUsers", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "AspNetRoles", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsDeletd", - table: "AirTimes", - type: "bit", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsActive", - table: "StampDutyCharges"); - - migrationBuilder.DropColumn( - name: "IsDeletd", - table: "Data"); - - migrationBuilder.DropColumn( - name: "IsDeletd", - table: "Bills"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "AspNetUsers"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "AspNetRoles"); - - migrationBuilder.DropColumn( - name: "IsDeletd", - table: "AirTimes"); - } - } -} diff --git a/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.Designer.cs b/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.Designer.cs deleted file mode 100644 index 70dbbde..0000000 --- a/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.Designer.cs +++ /dev/null @@ -1,793 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Wallet.Entities.Models.Context; - -#nullable disable - -namespace WalletApi.Migrations -{ - [DbContext(typeof(WalletDbContext))] - [Migration("20250130154348_Added_Active_To_Entities")] - partial class Added_Active_To_Entities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); - - b.Property("PlotNo") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); - - b.Property("State") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); - - b.HasIndex("StaffId") - .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); - - b.ToTable("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AirTimes"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Bills"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeletd") - .HasColumnType("bit"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Data"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("Picture") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("ProfilePictures"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("StaffProfile"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("StampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("Amount") - .HasColumnType("decimal(38,2)"); - - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.Property("TransactionType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("StampDuty") - .HasColumnType("decimal(38,2)"); - - b.Property("TimeStamp") - .HasColumnType("datetime2"); - - b.Property("TransactionMode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("TransactionStampDutyCharges"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("Balance") - .HasColumnType("decimal(38,2)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("WalletNo") - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId") - .IsUnique(); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Customer") - .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") - .WithOne("Staff") - .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => - { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => - { - b.Navigation("Address"); - - b.Navigation("Wallet"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => - { - b.Navigation("Address"); - }); - - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => - { - b.Navigation("Customer"); - - b.Navigation("Staff"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.cs b/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.cs deleted file mode 100644 index 907b44b..0000000 --- a/WalletApi/Migrations/20250130154348_Added_Active_To_Entities.cs +++ /dev/null @@ -1,143 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace WalletApi.Migrations -{ - /// - public partial class Added_Active_To_Entities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "IsActive", - table: "Wallets", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsActive", - table: "StampDutyCharges", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsDeleted", - table: "StaffProfile", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsDeleted", - table: "Customers", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsDeletd", - table: "Bills", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsActive", - table: "AspNetRoles", - newName: "Active"); - - migrationBuilder.RenameColumn( - name: "IsDeletd", - table: "AirTimes", - newName: "Active"); - - migrationBuilder.AddColumn( - name: "Active", - table: "TransactionStampDutyCharges", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Active", - table: "Transactions", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Active", - table: "ProfilePictures", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Active", - table: "AspNetUsers", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Active", - table: "Address", - type: "bit", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Active", - table: "TransactionStampDutyCharges"); - - migrationBuilder.DropColumn( - name: "Active", - table: "Transactions"); - - migrationBuilder.DropColumn( - name: "Active", - table: "ProfilePictures"); - - migrationBuilder.DropColumn( - name: "Active", - table: "AspNetUsers"); - - migrationBuilder.DropColumn( - name: "Active", - table: "Address"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "Wallets", - newName: "IsActive"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "StampDutyCharges", - newName: "IsActive"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "StaffProfile", - newName: "IsDeleted"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "Customers", - newName: "IsDeleted"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "Bills", - newName: "IsDeletd"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "AspNetRoles", - newName: "IsActive"); - - migrationBuilder.RenameColumn( - name: "Active", - table: "AirTimes", - newName: "IsDeletd"); - } - } -} diff --git a/WalletApi/Migrations/20260703191547_InitialCreate.Designer.cs b/WalletApi/Migrations/20260703191547_InitialCreate.Designer.cs new file mode 100644 index 0000000..a141a49 --- /dev/null +++ b/WalletApi/Migrations/20260703191547_InitialCreate.Designer.cs @@ -0,0 +1,1212 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Wallet.Entities.Models.Context; + +#nullable disable + +namespace WalletApi.Migrations +{ + [DbContext(typeof(WalletDbContext))] + [Migration("20260703191547_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("ProviderKey") + .HasColumnType("varchar(256)"); + + b.Property("ProviderDisplayName") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("Name") + .HasColumnType("varchar(256)"); + + b.Property("Value") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("City") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Nationality") + .HasColumnType("varchar(MAX)"); + + b.Property("PlotNo") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("varchar(MAX)"); + + b.Property("StreetName") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Address"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("NetworkProvider") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("AirTimes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasMaxLength(36) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .HasColumnType("varchar(MAX)"); + + b.Property("LastName") + .HasColumnType("varchar(MAX)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumber") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("varchar(MAX)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("UserTypeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("UserTypeId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Bills"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("BillId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("BillId"); + + b.ToTable("BillModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Customers"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Gender", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Claims") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(25) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("OrderId") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Menus"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.NetworkData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("IsDeletd") + .HasColumnType("bit"); + + b.Property("NetworkProvider") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Data"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Picture") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ProfilePictures"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Staff"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("Name") + .HasColumnType("varchar(MAX)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("WalletId"); + + b.ToTable("StampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("BillModeId") + .HasColumnType("varchar(256)"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("SenderAccount") + .HasColumnType("varchar(MAX)"); + + b.Property("StampDuty") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyChargeId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("TransactionModeId") + .HasColumnType("int"); + + b.Property("TransactionTypeId") + .HasColumnType("int"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("BillModeId"); + + b.HasIndex("StampDutyChargeId"); + + b.HasIndex("TransactionModeId"); + + b.HasIndex("TransactionTypeId"); + + b.HasIndex("WalletId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionMode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("StampDutyId"); + + b.HasIndex("UserId"); + + b.HasIndex("WalletId"); + + b.ToTable("TransactionStampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.UserType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("UserTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Balance") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletNumber") + .HasMaxLength(10) + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("RoleClaims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.HasOne("Wallet.Entities.Models.Domain.UserType", "UserType") + .WithMany() + .HasForeignKey("UserTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UserType"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Bill", "Bill") + .WithMany("BillMode") + .HasForeignKey("BillId"); + + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Customer") + .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Staff") + .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Wallet", null) + .WithMany("StampDutyCharges") + .HasForeignKey("WalletId"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.HasOne("Wallet.Entities.Models.Domain.BillMode", "BillMode") + .WithMany() + .HasForeignKey("BillModeId"); + + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDutyCharge") + .WithMany() + .HasForeignKey("StampDutyChargeId"); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionMode", "TransactionMode") + .WithMany() + .HasForeignKey("TransactionModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionType", "TransactionType") + .WithMany() + .HasForeignKey("TransactionTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("Transactions") + .HasForeignKey("WalletId"); + + b.Navigation("BillMode"); + + b.Navigation("StampDutyCharge"); + + b.Navigation("TransactionMode"); + + b.Navigation("TransactionType"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDuty") + .WithMany() + .HasForeignKey("StampDutyId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("TransactionStampDutyCharges") + .HasForeignKey("WalletId"); + + b.Navigation("StampDuty"); + + b.Navigation("User"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Navigation("RoleClaims"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Navigation("Customer"); + + b.Navigation("Staff"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Navigation("BillMode"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Navigation("StampDutyCharges"); + + b.Navigation("TransactionStampDutyCharges"); + + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WalletApi/Migrations/20260703191547_InitialCreate.cs b/WalletApi/Migrations/20260703191547_InitialCreate.cs new file mode 100644 index 0000000..4c7ff24 --- /dev/null +++ b/WalletApi/Migrations/20260703191547_InitialCreate.cs @@ -0,0 +1,844 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WalletApi.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AirTimes", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + NetworkProvider = table.Column(type: "varchar(MAX)", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AirTimes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetRoles", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Name = table.Column(type: "varchar(MAX)", maxLength: 256, nullable: true), + NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Bills", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + Amount = table.Column(type: "decimal(38,2)", nullable: false), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Bills", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Data", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + NetworkProvider = table.Column(type: "varchar(MAX)", nullable: true), + IsDeletd = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Data", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Genders", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Genders", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Menus", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 25, nullable: true), + OrderId = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Claims = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Menus", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TransactionModes", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TransactionModes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TransactionTypes", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TransactionTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "UserTypes", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UserTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BillModes", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Name = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 20, nullable: true), + BillId = table.Column(type: "varchar(256)", nullable: true), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BillModes", x => x.Id); + table.ForeignKey( + name: "FK_BillModes_Bills_BillId", + column: x => x.BillId, + principalTable: "Bills", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AspNetRoleClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Active = table.Column(type: "bit", nullable: false), + MenuId = table.Column(type: "varchar(256)", unicode: false, maxLength: 36, nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + RoleId = table.Column(type: "varchar(256)", nullable: false), + ClaimType = table.Column(type: "varchar(MAX)", nullable: true), + ClaimValue = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetRoleClaims_Menus_MenuId", + column: x => x.MenuId, + principalTable: "Menus", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + LastName = table.Column(type: "varchar(MAX)", nullable: true), + FirstName = table.Column(type: "varchar(MAX)", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false), + UserTypeId = table.Column(type: "int", nullable: false), + UserName = table.Column(type: "varchar(MAX)", maxLength: 256, nullable: true), + NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + Email = table.Column(type: "varchar(MAX)", maxLength: 256, nullable: true), + NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + EmailConfirmed = table.Column(type: "bit", nullable: false), + PasswordHash = table.Column(type: "varchar(MAX)", nullable: true), + SecurityStamp = table.Column(type: "varchar(MAX)", nullable: true), + ConcurrencyStamp = table.Column(type: "varchar(MAX)", nullable: true), + PhoneNumber = table.Column(type: "varchar(MAX)", nullable: true), + PhoneNumberConfirmed = table.Column(type: "bit", nullable: false), + TwoFactorEnabled = table.Column(type: "bit", nullable: false), + LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), + LockoutEnabled = table.Column(type: "bit", nullable: false), + AccessFailedCount = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUsers_UserTypes_UserTypeId", + column: x => x.UserTypeId, + principalTable: "UserTypes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Address", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + PlotNo = table.Column(type: "int", nullable: true), + StreetName = table.Column(type: "varchar(MAX)", nullable: true), + City = table.Column(type: "varchar(MAX)", nullable: true), + State = table.Column(type: "varchar(MAX)", nullable: true), + Nationality = table.Column(type: "varchar(MAX)", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Address", x => x.Id); + table.ForeignKey( + name: "FK_Address_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Active = table.Column(type: "bit", nullable: false), + MenuId = table.Column(type: "varchar(256)", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UserId = table.Column(type: "varchar(256)", nullable: false), + ClaimType = table.Column(type: "varchar(MAX)", nullable: true), + ClaimValue = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUserClaims_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetUserClaims_Menus_MenuId", + column: x => x.MenuId, + principalTable: "Menus", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserLogins", + columns: table => new + { + LoginProvider = table.Column(type: "varchar(256)", nullable: false), + ProviderKey = table.Column(type: "varchar(256)", nullable: false), + ProviderDisplayName = table.Column(type: "varchar(MAX)", nullable: true), + UserId = table.Column(type: "varchar(256)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_AspNetUserLogins_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserRoles", + columns: table => new + { + UserId = table.Column(type: "varchar(256)", nullable: false), + RoleId = table.Column(type: "varchar(256)", nullable: false), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserTokens", + columns: table => new + { + UserId = table.Column(type: "varchar(256)", nullable: false), + LoginProvider = table.Column(type: "varchar(256)", nullable: false), + Name = table.Column(type: "varchar(256)", nullable: false), + Value = table.Column(type: "varchar(MAX)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AspNetUserTokens_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ProfilePictures", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + Picture = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ProfilePictures", x => x.Id); + table.ForeignKey( + name: "FK_ProfilePictures_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Wallets", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + WalletNumber = table.Column(type: "varchar(MAX)", maxLength: 10, nullable: true), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + Balance = table.Column(type: "decimal(38,2)", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Wallets", x => x.Id); + table.ForeignKey( + name: "FK_Wallets_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Customers", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + PhoneNumber = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 18, nullable: true), + Email = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 60, nullable: true), + GenderId = table.Column(type: "int", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + Active = table.Column(type: "bit", nullable: false), + AddressId = table.Column(type: "varchar(256)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Customers", x => x.Id); + table.ForeignKey( + name: "FK_Customers_Address_AddressId", + column: x => x.AddressId, + principalTable: "Address", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Customers_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Customers_Genders_GenderId", + column: x => x.GenderId, + principalTable: "Genders", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Staff", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + PhoneNumber = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 18, nullable: true), + Email = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 60, nullable: true), + GenderId = table.Column(type: "int", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "varchar(MAX)", nullable: true), + UpdatedBy = table.Column(type: "varchar(MAX)", nullable: true), + Active = table.Column(type: "bit", nullable: false), + AddressId = table.Column(type: "varchar(256)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Staff", x => x.Id); + table.ForeignKey( + name: "FK_Staff_Address_AddressId", + column: x => x.AddressId, + principalTable: "Address", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Staff_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Staff_Genders_GenderId", + column: x => x.GenderId, + principalTable: "Genders", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "StampDutyCharges", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Name = table.Column(type: "varchar(MAX)", nullable: true), + Amount = table.Column(type: "decimal(38,2)", nullable: false), + Active = table.Column(type: "bit", nullable: false), + WalletId = table.Column(type: "varchar(256)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_StampDutyCharges", x => x.Id); + table.ForeignKey( + name: "FK_StampDutyCharges_Wallets_WalletId", + column: x => x.WalletId, + principalTable: "Wallets", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Transactions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TransactionTypeId = table.Column(type: "int", nullable: false), + TransactionModeId = table.Column(type: "int", nullable: false), + PhoneNumber = table.Column(type: "varchar(MAX)", unicode: false, maxLength: 18, nullable: true), + BillModeId = table.Column(type: "varchar(256)", nullable: true), + Amount = table.Column(type: "decimal(38,2)", nullable: false), + StampDuty = table.Column(type: "decimal(38,2)", nullable: true), + SenderAccount = table.Column(type: "varchar(MAX)", nullable: true), + TimeStamp = table.Column(type: "datetime2", nullable: false), + StampDutyChargeId = table.Column(type: "varchar(256)", nullable: true), + Active = table.Column(type: "bit", nullable: false), + WalletId = table.Column(type: "varchar(256)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Transactions", x => x.Id); + table.ForeignKey( + name: "FK_Transactions_BillModes_BillModeId", + column: x => x.BillModeId, + principalTable: "BillModes", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Transactions_StampDutyCharges_StampDutyChargeId", + column: x => x.StampDutyChargeId, + principalTable: "StampDutyCharges", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Transactions_TransactionModes_TransactionModeId", + column: x => x.TransactionModeId, + principalTable: "TransactionModes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Transactions_TransactionTypes_TransactionTypeId", + column: x => x.TransactionTypeId, + principalTable: "TransactionTypes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Transactions_Wallets_WalletId", + column: x => x.WalletId, + principalTable: "Wallets", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "TransactionStampDutyCharges", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + UserId = table.Column(type: "varchar(256)", unicode: false, maxLength: 45, nullable: true), + Amount = table.Column(type: "decimal(38,2)", nullable: false), + StampDutyId = table.Column(type: "varchar(256)", nullable: true), + TimeStamp = table.Column(type: "datetime2", nullable: false), + Active = table.Column(type: "bit", nullable: false), + WalletId = table.Column(type: "varchar(256)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TransactionStampDutyCharges", x => x.Id); + table.ForeignKey( + name: "FK_TransactionStampDutyCharges_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_TransactionStampDutyCharges_StampDutyCharges_StampDutyId", + column: x => x.StampDutyId, + principalTable: "StampDutyCharges", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_TransactionStampDutyCharges_Wallets_WalletId", + column: x => x.WalletId, + principalTable: "Wallets", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_Address_UserId", + table: "Address", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_MenuId", + table: "AspNetRoleClaims", + column: "MenuId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true, + filter: "[NormalizedName] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_MenuId", + table: "AspNetUserClaims", + column: "MenuId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_UserId", + table: "AspNetUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserLogins_UserId", + table: "AspNetUserLogins", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserRoles_RoleId", + table: "AspNetUserRoles", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "AspNetUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUsers_UserTypeId", + table: "AspNetUsers", + column: "UserTypeId"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true, + filter: "[NormalizedUserName] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_BillModes_BillId", + table: "BillModes", + column: "BillId"); + + migrationBuilder.CreateIndex( + name: "IX_Customers_AddressId", + table: "Customers", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Customers_GenderId", + table: "Customers", + column: "GenderId"); + + migrationBuilder.CreateIndex( + name: "IX_Customers_UserId", + table: "Customers", + column: "UserId", + unique: true, + filter: "[UserId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_ProfilePictures_UserId", + table: "ProfilePictures", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Staff_AddressId", + table: "Staff", + column: "AddressId"); + + migrationBuilder.CreateIndex( + name: "IX_Staff_GenderId", + table: "Staff", + column: "GenderId"); + + migrationBuilder.CreateIndex( + name: "IX_Staff_UserId", + table: "Staff", + column: "UserId", + unique: true, + filter: "[UserId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_StampDutyCharges_WalletId", + table: "StampDutyCharges", + column: "WalletId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_BillModeId", + table: "Transactions", + column: "BillModeId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_StampDutyChargeId", + table: "Transactions", + column: "StampDutyChargeId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_TransactionModeId", + table: "Transactions", + column: "TransactionModeId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_TransactionTypeId", + table: "Transactions", + column: "TransactionTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Transactions_WalletId", + table: "Transactions", + column: "WalletId"); + + migrationBuilder.CreateIndex( + name: "IX_TransactionStampDutyCharges_StampDutyId", + table: "TransactionStampDutyCharges", + column: "StampDutyId"); + + migrationBuilder.CreateIndex( + name: "IX_TransactionStampDutyCharges_UserId", + table: "TransactionStampDutyCharges", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_TransactionStampDutyCharges_WalletId", + table: "TransactionStampDutyCharges", + column: "WalletId"); + + migrationBuilder.CreateIndex( + name: "IX_Wallets_UserId", + table: "Wallets", + column: "UserId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AirTimes"); + + migrationBuilder.DropTable( + name: "AspNetRoleClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserLogins"); + + migrationBuilder.DropTable( + name: "AspNetUserRoles"); + + migrationBuilder.DropTable( + name: "AspNetUserTokens"); + + migrationBuilder.DropTable( + name: "Customers"); + + migrationBuilder.DropTable( + name: "Data"); + + migrationBuilder.DropTable( + name: "ProfilePictures"); + + migrationBuilder.DropTable( + name: "Staff"); + + migrationBuilder.DropTable( + name: "Transactions"); + + migrationBuilder.DropTable( + name: "TransactionStampDutyCharges"); + + migrationBuilder.DropTable( + name: "Menus"); + + migrationBuilder.DropTable( + name: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "Address"); + + migrationBuilder.DropTable( + name: "Genders"); + + migrationBuilder.DropTable( + name: "BillModes"); + + migrationBuilder.DropTable( + name: "TransactionModes"); + + migrationBuilder.DropTable( + name: "TransactionTypes"); + + migrationBuilder.DropTable( + name: "StampDutyCharges"); + + migrationBuilder.DropTable( + name: "Bills"); + + migrationBuilder.DropTable( + name: "Wallets"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + + migrationBuilder.DropTable( + name: "UserTypes"); + } + } +} diff --git a/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.Designer.cs b/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.Designer.cs new file mode 100644 index 0000000..f4aeaa9 --- /dev/null +++ b/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.Designer.cs @@ -0,0 +1,1212 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Wallet.Entities.Models.Context; + +#nullable disable + +namespace WalletApi.Migrations +{ + [DbContext(typeof(WalletDbContext))] + [Migration("20260705004235_Removed_Airtime_Table")] + partial class Removed_Airtime_Table + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("ProviderKey") + .HasColumnType("varchar(256)"); + + b.Property("ProviderDisplayName") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("Name") + .HasColumnType("varchar(256)"); + + b.Property("Value") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("City") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Nationality") + .HasColumnType("varchar(MAX)"); + + b.Property("PlotNo") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("varchar(MAX)"); + + b.Property("StreetName") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Address"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NetworkProvider") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AirTime"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasMaxLength(36) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .HasColumnType("varchar(MAX)"); + + b.Property("LastName") + .HasColumnType("varchar(MAX)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumber") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("varchar(MAX)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("UserTypeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("UserTypeId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Bills"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("BillId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("BillId"); + + b.ToTable("BillModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Customers"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Gender", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Claims") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(25) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("OrderId") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Menus"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.NetworkData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeletd") + .HasColumnType("bit"); + + b.Property("NetworkProvider") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("NetworkData"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Picture") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ProfilePictures"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Staff"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("Name") + .HasColumnType("varchar(MAX)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("WalletId"); + + b.ToTable("StampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("BillModeId") + .HasColumnType("varchar(256)"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("SenderAccount") + .HasColumnType("varchar(MAX)"); + + b.Property("StampDuty") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyChargeId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("TransactionModeId") + .HasColumnType("int"); + + b.Property("TransactionTypeId") + .HasColumnType("int"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("BillModeId"); + + b.HasIndex("StampDutyChargeId"); + + b.HasIndex("TransactionModeId"); + + b.HasIndex("TransactionTypeId"); + + b.HasIndex("WalletId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionMode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("StampDutyId"); + + b.HasIndex("UserId"); + + b.HasIndex("WalletId"); + + b.ToTable("TransactionStampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.UserType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("UserTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Balance") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletNumber") + .HasMaxLength(10) + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("RoleClaims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.HasOne("Wallet.Entities.Models.Domain.UserType", "UserType") + .WithMany() + .HasForeignKey("UserTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UserType"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Bill", "Bill") + .WithMany("BillMode") + .HasForeignKey("BillId"); + + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Customer") + .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Staff") + .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Wallet", null) + .WithMany("StampDutyCharges") + .HasForeignKey("WalletId"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.HasOne("Wallet.Entities.Models.Domain.BillMode", "BillMode") + .WithMany() + .HasForeignKey("BillModeId"); + + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDutyCharge") + .WithMany() + .HasForeignKey("StampDutyChargeId"); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionMode", "TransactionMode") + .WithMany() + .HasForeignKey("TransactionModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionType", "TransactionType") + .WithMany() + .HasForeignKey("TransactionTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("Transactions") + .HasForeignKey("WalletId"); + + b.Navigation("BillMode"); + + b.Navigation("StampDutyCharge"); + + b.Navigation("TransactionMode"); + + b.Navigation("TransactionType"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDuty") + .WithMany() + .HasForeignKey("StampDutyId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("TransactionStampDutyCharges") + .HasForeignKey("WalletId"); + + b.Navigation("StampDuty"); + + b.Navigation("User"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Navigation("RoleClaims"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Navigation("Customer"); + + b.Navigation("Staff"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Navigation("BillMode"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Navigation("StampDutyCharges"); + + b.Navigation("TransactionStampDutyCharges"); + + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.cs b/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.cs new file mode 100644 index 0000000..d6d90b7 --- /dev/null +++ b/WalletApi/Migrations/20260705004235_Removed_Airtime_Table.cs @@ -0,0 +1,178 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WalletApi.Migrations +{ + /// + public partial class Removed_Airtime_Table : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_Data", + table: "Data"); + + migrationBuilder.DropPrimaryKey( + name: "PK_AirTimes", + table: "AirTimes"); + + migrationBuilder.RenameTable( + name: "Data", + newName: "NetworkData"); + + migrationBuilder.RenameTable( + name: "AirTimes", + newName: "AirTime"); + + migrationBuilder.AlterColumn( + name: "UpdatedBy", + table: "NetworkData", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NetworkProvider", + table: "NetworkData", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + table: "NetworkData", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UpdatedBy", + table: "AirTime", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NetworkProvider", + table: "AirTime", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + table: "AirTime", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(MAX)", + oldNullable: true); + + migrationBuilder.AddPrimaryKey( + name: "PK_NetworkData", + table: "NetworkData", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_AirTime", + table: "AirTime", + column: "Id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_NetworkData", + table: "NetworkData"); + + migrationBuilder.DropPrimaryKey( + name: "PK_AirTime", + table: "AirTime"); + + migrationBuilder.RenameTable( + name: "NetworkData", + newName: "Data"); + + migrationBuilder.RenameTable( + name: "AirTime", + newName: "AirTimes"); + + migrationBuilder.AlterColumn( + name: "UpdatedBy", + table: "Data", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NetworkProvider", + table: "Data", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + table: "Data", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UpdatedBy", + table: "AirTimes", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NetworkProvider", + table: "AirTimes", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + table: "AirTimes", + type: "varchar(MAX)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AddPrimaryKey( + name: "PK_Data", + table: "Data", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_AirTimes", + table: "AirTimes", + column: "Id"); + } + } +} diff --git a/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.Designer.cs b/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.Designer.cs new file mode 100644 index 0000000..dcc17ed --- /dev/null +++ b/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.Designer.cs @@ -0,0 +1,1158 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Wallet.Entities.Models.Context; + +#nullable disable + +namespace WalletApi.Migrations +{ + [DbContext(typeof(WalletDbContext))] + [Migration("20260706131221_Made_UserId_Nullable_In_Wallet")] + partial class Made_UserId_Nullable_In_Wallet + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("ProviderKey") + .HasColumnType("varchar(256)"); + + b.Property("ProviderDisplayName") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("Name") + .HasColumnType("varchar(256)"); + + b.Property("Value") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("City") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Nationality") + .HasColumnType("varchar(MAX)"); + + b.Property("PlotNo") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("varchar(MAX)"); + + b.Property("StreetName") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Address"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasMaxLength(36) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .HasColumnType("varchar(MAX)"); + + b.Property("LastName") + .HasColumnType("varchar(MAX)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumber") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("varchar(MAX)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("UserTypeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("UserTypeId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Bills"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("BillId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("BillId"); + + b.ToTable("BillModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Customers"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Gender", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Claims") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(25) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("OrderId") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("Menus"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Picture") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ProfilePictures"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Staff"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("Name") + .HasColumnType("varchar(MAX)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("WalletId"); + + b.ToTable("StampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("BillModeId") + .HasColumnType("varchar(256)"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("SenderAccount") + .HasColumnType("varchar(MAX)"); + + b.Property("StampDuty") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyChargeId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("TransactionModeId") + .HasColumnType("int"); + + b.Property("TransactionTypeId") + .HasColumnType("int"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("BillModeId"); + + b.HasIndex("StampDutyChargeId"); + + b.HasIndex("TransactionModeId"); + + b.HasIndex("TransactionTypeId"); + + b.HasIndex("WalletId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionMode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") + .HasColumnType("decimal(38,2)"); + + b.Property("StampDutyId") + .HasColumnType("varchar(256)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("StampDutyId"); + + b.HasIndex("UserId"); + + b.HasIndex("WalletId"); + + b.ToTable("TransactionStampDutyCharges"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("TransactionTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.UserType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.ToTable("UserTypes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Balance") + .HasColumnType("decimal(38,2)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletNumber") + .HasMaxLength(10) + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("RoleClaims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.HasOne("Wallet.Entities.Models.Domain.UserType", "UserType") + .WithMany() + .HasForeignKey("UserTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UserType"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Menu"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Bill", "Bill") + .WithMany("BillMode") + .HasForeignKey("BillId"); + + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Customer") + .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Staff") + .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); + + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Wallet", null) + .WithMany("StampDutyCharges") + .HasForeignKey("WalletId"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => + { + b.HasOne("Wallet.Entities.Models.Domain.BillMode", "BillMode") + .WithMany() + .HasForeignKey("BillModeId"); + + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDutyCharge") + .WithMany() + .HasForeignKey("StampDutyChargeId"); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionMode", "TransactionMode") + .WithMany() + .HasForeignKey("TransactionModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionType", "TransactionType") + .WithMany() + .HasForeignKey("TransactionTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("Transactions") + .HasForeignKey("WalletId"); + + b.Navigation("BillMode"); + + b.Navigation("StampDutyCharge"); + + b.Navigation("TransactionMode"); + + b.Navigation("TransactionType"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDuty") + .WithMany() + .HasForeignKey("StampDutyId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("TransactionStampDutyCharges") + .HasForeignKey("WalletId"); + + b.Navigation("StampDuty"); + + b.Navigation("User"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithOne("Wallet") + .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => + { + b.Navigation("RoleClaims"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Navigation("Customer"); + + b.Navigation("Staff"); + + b.Navigation("Wallet"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => + { + b.Navigation("BillMode"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => + { + b.Navigation("StampDutyCharges"); + + b.Navigation("TransactionStampDutyCharges"); + + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.cs b/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.cs new file mode 100644 index 0000000..7b77046 --- /dev/null +++ b/WalletApi/Migrations/20260706131221_Made_UserId_Nullable_In_Wallet.cs @@ -0,0 +1,79 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WalletApi.Migrations +{ + /// + public partial class Made_UserId_Nullable_In_Wallet : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AirTime"); + + migrationBuilder.DropTable( + name: "NetworkData"); + + migrationBuilder.DropIndex( + name: "IX_Wallets_UserId", + table: "Wallets"); + + migrationBuilder.CreateIndex( + name: "IX_Wallets_UserId", + table: "Wallets", + column: "UserId", + unique: true, + filter: "[UserId] IS NOT NULL"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Wallets_UserId", + table: "Wallets"); + + migrationBuilder.CreateTable( + name: "AirTime", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + Active = table.Column(type: "bit", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), + NetworkProvider = table.Column(type: "nvarchar(max)", nullable: true), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AirTime", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "NetworkData", + columns: table => new + { + Id = table.Column(type: "varchar(256)", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), + IsDeletd = table.Column(type: "bit", nullable: false), + NetworkProvider = table.Column(type: "nvarchar(max)", nullable: true), + UpdatedAt = table.Column(type: "datetime2", nullable: false), + UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_NetworkData", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_Wallets_UserId", + table: "Wallets", + column: "UserId"); + } + } +} diff --git a/WalletApi/Migrations/WalletDbContextModelSnapshot.cs b/WalletApi/Migrations/WalletDbContextModelSnapshot.cs index f69b969..e38ca3f 100644 --- a/WalletApi/Migrations/WalletDbContextModelSnapshot.cs +++ b/WalletApi/Migrations/WalletDbContextModelSnapshot.cs @@ -22,201 +22,355 @@ protected override void BuildModel(ModelBuilder modelBuilder) SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + b.Property("ProviderKey") + .HasColumnType("varchar(256)"); - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + b.Property("ProviderDisplayName") + .HasColumnType("varchar(MAX)"); - b.Property("RoleId") + b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("varchar(256)"); - b.HasKey("Id"); + b.HasKey("LoginProvider", "ProviderKey"); - b.HasIndex("RoleId"); + b.HasIndex("UserId"); - b.ToTable("AspNetRoleClaims", (string)null); + b.ToTable("AspNetUserLogins", (string)null); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.Property("Id") + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("LoginProvider") + .HasColumnType("varchar(256)"); + + b.Property("Name") + .HasColumnType("varchar(256)"); + + b.Property("Value") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + { + b.Property("Id") .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("City") + .HasColumnType("varchar(MAX)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Nationality") + .HasColumnType("varchar(MAX)"); + + b.Property("PlotNo") .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("State") + .HasColumnType("varchar(MAX)"); - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + b.Property("StreetName") + .HasColumnType("varchar(MAX)"); - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); b.HasKey("Id"); b.HasIndex("UserId"); - b.ToTable("AspNetUserClaims", (string)null); + b.ToTable("Address"); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); + b.Property("Id") + .HasColumnType("varchar(256)"); - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); + b.Property("Active") + .HasColumnType("bit"); - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); + b.Property("CreatedAt") + .HasColumnType("datetime2"); - b.HasKey("LoginProvider", "ProviderKey"); + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); - b.HasIndex("UserId"); + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); - b.ToTable("AspNetUserLogins", (string)null); - }); + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); + b.Property("UpdatedAt") + .HasColumnType("datetime2"); - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); - b.HasKey("UserId", "RoleId"); + b.HasKey("Id"); - b.HasIndex("RoleId"); + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); - b.ToTable("AspNetUserRoles", (string)null); + b.ToTable("AspNetRoles", (string)null); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("Name") - .HasColumnType("nvarchar(450)"); + b.Property("Active") + .HasColumnType("bit"); - b.Property("Value") - .HasColumnType("nvarchar(max)"); + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); - b.HasKey("UserId", "LoginProvider", "Name"); + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); - b.ToTable("AspNetUserTokens", (string)null); + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("MenuId") + .HasMaxLength(36) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(256)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + b.Property("Id") + .HasColumnType("varchar(256)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); b.Property("Active") .HasColumnType("bit"); - b.Property("City") - .HasColumnType("nvarchar(max)"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("varchar(MAX)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); - b.Property("Nationality") - .HasColumnType("nvarchar(max)"); + b.Property("EmailConfirmed") + .HasColumnType("bit"); - b.Property("PlotNo") - .HasColumnType("int"); + b.Property("FirstName") + .HasColumnType("varchar(MAX)"); - b.Property("StaffId") - .HasColumnType("uniqueidentifier"); + b.Property("LastName") + .HasColumnType("varchar(MAX)"); - b.Property("State") - .HasColumnType("nvarchar(max)"); + b.Property("LockoutEnabled") + .HasColumnType("bit"); - b.Property("StreetName") - .HasColumnType("nvarchar(max)"); + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumber") + .HasColumnType("varchar(MAX)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("varchar(MAX)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(MAX)"); + + b.Property("UserTypeId") + .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex("CustomerId") - .IsUnique() - .HasFilter("[CustomerId] IS NOT NULL"); + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); - b.HasIndex("StaffId") + b.HasIndex("NormalizedUserName") .IsUnique() - .HasFilter("[StaffId] IS NOT NULL"); + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); - b.ToTable("Address", (string)null); + b.HasIndex("UserTypeId"); + + b.ToTable("AspNetUsers", (string)null); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.AirTime", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Active") .HasColumnType("bit"); + b.Property("ClaimType") + .HasColumnType("varchar(MAX)"); + + b.Property("ClaimValue") + .HasColumnType("varchar(MAX)"); + b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); + b.Property("MenuId") + .HasColumnType("varchar(256)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(256)"); b.HasKey("Id"); - b.ToTable("AirTimes", (string)null); + b.HasIndex("MenuId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(256)"); + + b.Property("RoleId") + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(256)"); b.Property("Active") .HasColumnType("bit"); @@ -224,212 +378,269 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Amount") .HasColumnType("decimal(38,2)"); - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.ToTable("Bills", (string)null); + b.ToTable("Bills"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + b.Property("Id") + .HasColumnType("varchar(256)"); b.Property("Active") .HasColumnType("bit"); + b.Property("BillId") + .HasColumnType("varchar(256)"); + b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("Gender") - .HasColumnType("int"); - - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.HasIndex("UserId") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); + b.HasIndex("BillId"); - b.ToTable("Customers", (string)null); + b.ToTable("BillModes"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Data", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("varchar(256)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); - b.Property("IsDeletd") - .HasColumnType("bit"); + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); + b.Property("GenderId") + .HasColumnType("int"); + + b.Property("PhoneNumber") + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); b.HasKey("Id"); - b.ToTable("Data", (string)null); + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("Customers"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Gender", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Active") .HasColumnType("bit"); - b.Property("Picture") - .HasColumnType("nvarchar(max)"); + b.Property("CreatedAt") + .HasColumnType("datetime2"); - b.Property("UserId") - .HasColumnType("uniqueidentifier"); + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.ToTable("ProfilePictures", (string)null); + b.ToTable("Genders"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Role", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Menu", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Active") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() + b.Property("Claims") .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasMaxLength(25) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + b.Property("OrderId") + .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); + b.ToTable("Menus"); + }); - b.ToTable("AspNetRoles", (string)null); + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Picture") + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ProfilePictures"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(256)"); b.Property("Active") .HasColumnType("bit"); + b.Property("AddressId") + .HasColumnType("varchar(256)"); + b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); + b.Property("Email") + .HasMaxLength(60) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); - b.Property("Gender") + b.Property("GenderId") .HasColumnType("int"); - b.Property("LastName") - .HasColumnType("nvarchar(max)"); - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); b.HasKey("Id"); + b.HasIndex("AddressId"); + + b.HasIndex("GenderId"); + b.HasIndex("UserId") .IsUnique() .HasFilter("[UserId] IS NOT NULL"); - b.ToTable("StaffProfile", (string)null); + b.ToTable("Staff"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(256)"); b.Property("Active") .HasColumnType("bit"); @@ -438,11 +649,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("decimal(38,2)"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); b.HasKey("Id"); - b.ToTable("StampDutyCharges", (string)null); + b.HasIndex("WalletId"); + + b.ToTable("StampDutyCharges"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => @@ -457,162 +673,191 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Amount") .HasColumnType("decimal(38,2)"); - b.Property("BillName") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); - - b.Property("NetworkProvider") - .HasColumnType("nvarchar(max)"); + b.Property("BillModeId") + .HasColumnType("varchar(256)"); b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("ReceiverWalletId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(18) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); - b.Property("SenderWalletId") - .HasColumnType("nvarchar(max)"); + b.Property("SenderAccount") + .HasColumnType("varchar(MAX)"); - b.Property("StampDuty") + b.Property("StampDuty") .HasColumnType("decimal(38,2)"); - b.Property("StampDutyId") - .HasColumnType("nvarchar(max)"); + b.Property("StampDutyChargeId") + .HasColumnType("varchar(256)"); b.Property("TimeStamp") .HasColumnType("datetime2"); - b.Property("TransactionMode") + b.Property("TransactionModeId") .HasColumnType("int"); - b.Property("TransactionType") + b.Property("TransactionTypeId") .HasColumnType("int"); + b.Property("WalletId") + .HasColumnType("varchar(256)"); + b.HasKey("Id"); - b.HasIndex("CustomerId"); + b.HasIndex("BillModeId"); + + b.HasIndex("StampDutyChargeId"); + + b.HasIndex("TransactionModeId"); + + b.HasIndex("TransactionTypeId"); - b.ToTable("Transactions", (string)null); + b.HasIndex("WalletId"); + + b.ToTable("Transactions"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionMode", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Active") .HasColumnType("bit"); - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); - b.Property("StampDuty") + b.HasKey("Id"); + + b.ToTable("TransactionModes"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(256)"); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Amount") .HasColumnType("decimal(38,2)"); + b.Property("StampDutyId") + .HasColumnType("varchar(256)"); + b.Property("TimeStamp") .HasColumnType("datetime2"); - b.Property("TransactionMode") - .HasColumnType("int"); + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); + + b.Property("WalletId") + .HasColumnType("varchar(256)"); b.HasKey("Id"); - b.HasIndex("CustomerId"); + b.HasIndex("StampDutyId"); + + b.HasIndex("UserId"); + + b.HasIndex("WalletId"); - b.ToTable("TransactionStampDutyCharges", (string)null); + b.ToTable("TransactionStampDutyCharges"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionType", b => { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("int"); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("Active") .HasColumnType("bit"); - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("varchar(MAX)"); - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); - b.Property("LockoutEnabled") - .HasColumnType("bit"); + b.Property("UpdatedAt") + .HasColumnType("datetime2"); - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + b.Property("UpdatedBy") + .HasColumnType("varchar(MAX)"); - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + b.HasKey("Id"); - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + b.ToTable("TransactionTypes"); + }); - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); + modelBuilder.Entity("Wallet.Entities.Models.Domain.UserType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("PhoneNumberConfirmed") + b.Property("Active") .HasColumnType("bit"); - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); + b.Property("CreatedAt") + .HasColumnType("datetime2"); - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + b.Property("CreatedBy") + .HasColumnType("varchar(MAX)"); + + b.Property("Name") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers", (string)null); + b.ToTable("UserTypes"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(256)"); b.Property("Active") .HasColumnType("bit"); @@ -624,165 +869,285 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("CreatedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("uniqueidentifier"); + .HasColumnType("varchar(MAX)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") - .HasColumnType("nvarchar(max)"); + .HasColumnType("varchar(MAX)"); + + b.Property("UserId") + .HasMaxLength(45) + .IsUnicode(false) + .HasColumnType("varchar(256)"); - b.Property("WalletNo") + b.Property("WalletNumber") .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasColumnType("varchar(MAX)"); b.HasKey("Id"); - b.HasIndex("CustomerId") - .IsUnique(); + b.HasIndex("UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); - b.ToTable("Wallets", (string)null); + b.ToTable("Wallets"); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) .WithMany() - .HasForeignKey("RoleId") + .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("Wallet.Entities.Models.Domain.User", null) + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => { - b.HasOne("Wallet.Entities.Models.Domain.User", null) + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .HasForeignKey("UserId"); + + b.Navigation("User"); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRoleClaim", b => { - b.HasOne("Wallet.Entities.Models.Domain.Role", null) + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("RoleClaims") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Wallet.Entities.Models.Domain.User", null) + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.HasOne("Wallet.Entities.Models.Domain.UserType", "UserType") .WithMany() - .HasForeignKey("UserId") + .HasForeignKey("UserTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.Navigation("UserType"); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserClaim", b => { - b.HasOne("Wallet.Entities.Models.Domain.User", null) + b.HasOne("Wallet.Entities.Models.Domain.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.Navigation("Menu"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Address", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUserRole", b => { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "CustomerId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Wallet.Entities.Models.Domain.ApplicationRole", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("Wallet.Entities.Models.Domain.Staff", "Staff") - .WithOne("Address") - .HasForeignKey("Wallet.Entities.Models.Domain.Address", "StaffId") - .OnDelete(DeleteBehavior.Cascade); + b.Navigation("Role"); - b.Navigation("Customer"); + b.Navigation("User"); + }); - b.Navigation("Staff"); + modelBuilder.Entity("Wallet.Entities.Models.Domain.BillMode", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Bill", "Bill") + .WithMany("BillMode") + .HasForeignKey("BillId"); + + b.Navigation("Bill"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") .WithOne("Customer") .HasForeignKey("Wallet.Entities.Models.Domain.Customer", "UserId"); + b.Navigation("Address"); + + b.Navigation("Gender"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ProfilePicture", b => + { + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + b.Navigation("User"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => { - b.HasOne("Wallet.Entities.Models.Domain.User", "User") + b.HasOne("Wallet.Entities.Models.Domain.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("Wallet.Entities.Models.Domain.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") .WithOne("Staff") .HasForeignKey("Wallet.Entities.Models.Domain.Staff", "UserId"); + b.Navigation("Address"); + + b.Navigation("Gender"); + b.Navigation("User"); }); + modelBuilder.Entity("Wallet.Entities.Models.Domain.StampDutyCharge", b => + { + b.HasOne("Wallet.Entities.Models.Domain.Wallet", null) + .WithMany("StampDutyCharges") + .HasForeignKey("WalletId"); + }); + modelBuilder.Entity("Wallet.Entities.Models.Domain.Transaction", b => { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") + b.HasOne("Wallet.Entities.Models.Domain.BillMode", "BillMode") + .WithMany() + .HasForeignKey("BillModeId"); + + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDutyCharge") + .WithMany() + .HasForeignKey("StampDutyChargeId"); + + b.HasOne("Wallet.Entities.Models.Domain.TransactionMode", "TransactionMode") .WithMany() - .HasForeignKey("CustomerId") + .HasForeignKey("TransactionModeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.Navigation("Customer"); + b.HasOne("Wallet.Entities.Models.Domain.TransactionType", "TransactionType") + .WithMany() + .HasForeignKey("TransactionTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("Transactions") + .HasForeignKey("WalletId"); + + b.Navigation("BillMode"); + + b.Navigation("StampDutyCharge"); + + b.Navigation("TransactionMode"); + + b.Navigation("TransactionType"); + + b.Navigation("Wallet"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.TransactionStampDutyCharge", b => { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") + b.HasOne("Wallet.Entities.Models.Domain.StampDutyCharge", "StampDuty") .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .HasForeignKey("StampDutyId"); - b.Navigation("Customer"); + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.HasOne("Wallet.Entities.Models.Domain.Wallet", "Wallet") + .WithMany("TransactionStampDutyCharges") + .HasForeignKey("WalletId"); + + b.Navigation("StampDuty"); + + b.Navigation("User"); + + b.Navigation("Wallet"); }); modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => { - b.HasOne("Wallet.Entities.Models.Domain.Customer", "Customer") + b.HasOne("Wallet.Entities.Models.Domain.ApplicationUser", "User") .WithOne("Wallet") - .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .HasForeignKey("Wallet.Entities.Models.Domain.Wallet", "UserId"); - b.Navigation("Customer"); + b.Navigation("User"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Customer", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationRole", b => { - b.Navigation("Address"); + b.Navigation("RoleClaims"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Wallet.Entities.Models.Domain.ApplicationUser", b => + { + b.Navigation("Customer"); + + b.Navigation("Staff"); b.Navigation("Wallet"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.Staff", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Bill", b => { - b.Navigation("Address"); + b.Navigation("BillMode"); }); - modelBuilder.Entity("Wallet.Entities.Models.Domain.User", b => + modelBuilder.Entity("Wallet.Entities.Models.Domain.Wallet", b => { - b.Navigation("Customer"); + b.Navigation("StampDutyCharges"); - b.Navigation("Staff"); + b.Navigation("TransactionStampDutyCharges"); + + b.Navigation("Transactions"); }); #pragma warning restore 612, 618 } diff --git a/WalletApi/Startup.cs b/WalletApi/Startup.cs index 6e1b238..e66daf5 100644 --- a/WalletApi/Startup.cs +++ b/WalletApi/Startup.cs @@ -16,8 +16,9 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using Wallet.Entities.Mapper; +//using Wallet.Entities.Mapper; using Wallet.Entities.Models.Context; +using WalletApi.Data.Seeders; using Wallet.Logger; using WalletApi.ActionFilters; using WalletApi.Authentication; @@ -61,12 +62,13 @@ public void ConfigureServices(IServiceCollection services) services.ConfigureIISIntegration(); services.ConfigureLoggerService(); services.AddDBConnection(Configuration); + services.BindSeedConfig(Configuration); services.AddScoped(); services.ConfigureJWT(Configuration); services.AddScoped(); services.AddScoped(); services.AddScoped(); - services.AddAutoMapper(typeof(MappingProfile)); + //services.AddAutoMapper(typeof(MappingProfile)); services.AddAuthentication(); services.AddControllers(setupAction => @@ -129,6 +131,8 @@ public void ConfigureServices(IServiceCollection services) // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerMessage logger) { + SeedApplicationData.EnsurePopulated(app).GetAwaiter().GetResult(); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -182,8 +186,10 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerM //SeedRole.EnsurePopulated(app); //SeedAdmin.EnsurePopulated(app); //SeedUser.EnsurePopulated(app); + + SeedApplicationData.EnsurePopulated(app).GetAwaiter().GetResult(); } public partial class Program { } } -} +} \ No newline at end of file diff --git a/WalletApi/WalletApi.csproj b/WalletApi/WalletApi.csproj index 3379070..15d43ca 100644 --- a/WalletApi/WalletApi.csproj +++ b/WalletApi/WalletApi.csproj @@ -21,12 +21,16 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/WalletApi/appsettings.json b/WalletApi/appsettings.json index f2218f5..f1cf614 100644 --- a/WalletApi/appsettings.json +++ b/WalletApi/appsettings.json @@ -40,5 +40,135 @@ ] }, + "Seed": { + "Roles": [ + "Admin", + "Staff", + "Customer" + ], + "Genders": [ + "Male", + "Female" + ], + "UserTypes": [ + "Staff", + "Customer" + ], + "TransactionTypes": [ + "Credit", + "Debit" + ], + "TransactionModes": [ + "Wallet Transfer", + "Airtime", + "Data", + "Bill Payment" + ], + "Bills": [ + { + "Id": "bill-electricity", + "Name": "Electricity", + "Amount": 0 + }, + { + "Id": "bill-tv", + "Name": "TV", + "Amount": 0 + }, + { + "Id": "bill-internet", + "Name": "Internet", + "Amount": 0 + } + ], + "BillModes": [ + { + "Id": "bill-mode-electricity-prepaid", + "Name": "Prepaid", + "BillId": "bill-electricity" + }, + { + "Id": "bill-mode-electricity-postpaid", + "Name": "Postpaid", + "BillId": "bill-electricity" + }, + { + "Id": "bill-mode-tv-subscription", + "Name": "Subscription", + "BillId": "bill-tv" + }, + { + "Id": "bill-mode-internet-subscription", + "Name": "Subscription", + "BillId": "bill-internet" + } + ], + "StampDutyCharges": [ + { + "Id": "stamp-duty-default", + "Name": "Default Stamp Duty", + "Amount": 50.00 + } + ], + "Menus": [ + { + "Id": "menu-dashboard", + "Name": "Dashboard", + "OrderId": 1 + }, + { + "Id": "menu-users", + "Name": "Users", + "OrderId": 2 + }, + { + "Id": "menu-customers", + "Name": "Customers", + "OrderId": 3 + }, + { + "Id": "menu-wallets", + "Name": "Wallets", + "OrderId": 4 + }, + { + "Id": "menu-transactions", + "Name": "Transactions", + "OrderId": 5 + }, + { + "Id": "menu-bills", + "Name": "Bills", + "OrderId": 6 + }, + { + "Id": "menu-airtime", + "Name": "Airtime", + "OrderId": 7 + }, + { + "Id": "menu-data", + "Name": "Data", + "OrderId": 8 + }, + { + "Id": "menu-settings", + "Name": "Settings", + "OrderId": 9 + } + ], + "AdminUser": { + "FirstName": "System", + "LastName": "Admin", + "Email": "admin@walletapi.com", + "UserName": "admin@walletapi.com", + "PhoneNumber": "08000000000", + "Password": "Admin@12345", + "Role": "Admin", + "UserType": "Staff", + "Gender": "Male" + } + }, + "AllowedHosts": "*" }