// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using AAIntegration.SimmonsBank.API.Config; #nullable disable namespace AAIntegration.SimmonsBank.API.Migrations { [DbContext(typeof(DataContext))] [Migration("20240122173813_EnvelopeFundingMethodEntity")] partial class EnvelopeFundingMethodEntity { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.9") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Account", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Balance") .HasColumnType("numeric"); b.Property("CreatedOn") .HasColumnType("timestamp with time zone"); b.Property("CurrencyId") .HasColumnType("integer"); b.Property("ExternalAccountNumber") .IsRequired() .HasColumnType("text"); b.Property("InitialBalance") .HasColumnType("numeric"); b.Property("LastActivity") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("OwnerId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("CurrencyId"); b.HasIndex("OwnerId"); b.ToTable("Accounts"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassChange", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AutoclassRuleId") .HasColumnType("integer"); b.Property("Field") .HasColumnType("integer"); b.Property("Value") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("AutoclassRuleId"); b.ToTable("AutoclassChanges"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AutoclassRuleId") .HasColumnType("integer"); b.Property("CompareOperator") .HasColumnType("integer"); b.Property("TransactionField") .HasColumnType("integer"); b.Property("Value") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("AutoclassRuleId"); b.ToTable("AutoclassExpressions"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AccountId") .HasColumnType("integer"); b.Property("Enabled") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("AccountId"); b.ToTable("AutoclassRules"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.CurrencyType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Code") .IsRequired() .HasColumnType("text"); b.Property("DecimalPlaces") .HasColumnType("integer"); b.Property("Symbol") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("CurrencyTypes"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Envelope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AccountId") .HasColumnType("integer"); b.Property("Balance") .HasColumnType("numeric"); b.Property("Enabled") .HasColumnType("boolean"); b.Property("InitialBalance") .HasColumnType("numeric"); b.Property("IsPersistant") .HasColumnType("boolean"); b.Property("LastTriggeredOn") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Period") .HasColumnType("interval"); b.Property("Priority") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("AccountId"); b.ToTable("Envelopes"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.EnvelopeFundingMethod", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("EnvelopeId") .HasColumnType("integer"); b.Property("Mode") .HasColumnType("integer"); b.Property("Order") .HasColumnType("integer"); b.Property("PeriodsToLookback") .HasColumnType("integer"); b.Property("Value") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("EnvelopeId"); b.ToTable("EnvelopeFundingMethods"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Operation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AbsoluteValue") .HasColumnType("numeric"); b.Property("Enabled") .HasColumnType("boolean"); b.Property("HistoricLookbackDepth") .HasColumnType("integer"); b.Property("HistoricPeriod") .HasColumnType("interval"); b.Property("HistoricStatistic") .HasColumnType("integer"); b.Property("Mode") .HasColumnType("integer"); b.Property("Negative") .HasColumnType("boolean"); b.Property("Order") .HasColumnType("integer"); b.Property("Percentage") .HasColumnType("numeric"); b.HasKey("Id"); b.ToTable("Operations"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Transaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("numeric"); b.Property("CreatedOn") .HasColumnType("timestamp with time zone"); b.Property("CreditAccountId") .HasColumnType("integer"); b.Property("CreditEnvelopeId") .HasColumnType("integer"); b.Property("CurrencyTypeId") .HasColumnType("integer"); b.Property("Date") .HasColumnType("timestamp with time zone"); b.Property("DebitAccountId") .HasColumnType("integer"); b.Property("DebitEnvelopeId") .HasColumnType("integer"); b.Property("Description") .IsRequired() .HasColumnType("text"); b.Property("ExternalId") .IsRequired() .HasColumnType("text"); b.Property("IsPending") .HasColumnType("boolean"); b.Property("Notes") .IsRequired() .HasColumnType("text"); b.Property("OwnerId") .HasColumnType("integer"); b.Property("UpdatedOn") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("CreditAccountId"); b.HasIndex("CreditEnvelopeId"); b.HasIndex("CurrencyTypeId"); b.HasIndex("DebitAccountId"); b.HasIndex("DebitEnvelopeId"); b.HasIndex("OwnerId"); b.ToTable("Transactions"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("FirstName") .IsRequired() .HasColumnType("text"); b.Property("LastName") .IsRequired() .HasColumnType("text"); b.Property("PasswordHash") .IsRequired() .HasColumnType("text"); b.Property("Role") .HasColumnType("integer"); b.Property("Username") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Account", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.CurrencyType", "Currency") .WithMany() .HasForeignKey("CurrencyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("AAIntegration.SimmonsBank.API.Entities.User", "Owner") .WithMany("Accounts") .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Currency"); b.Navigation("Owner"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassChange", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", null) .WithMany("Changes") .HasForeignKey("AutoclassRuleId"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassExpression", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", null) .WithMany("Expressions") .HasForeignKey("AutoclassRuleId"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.Account", "Account") .WithMany() .HasForeignKey("AccountId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Account"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Envelope", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.Account", "Account") .WithMany("Envelopes") .HasForeignKey("AccountId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Account"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.EnvelopeFundingMethod", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.Envelope", "Envelope") .WithMany() .HasForeignKey("EnvelopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Envelope"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Transaction", b => { b.HasOne("AAIntegration.SimmonsBank.API.Entities.Account", "CreditAccount") .WithMany() .HasForeignKey("CreditAccountId"); b.HasOne("AAIntegration.SimmonsBank.API.Entities.Envelope", "CreditEnvelope") .WithMany() .HasForeignKey("CreditEnvelopeId"); b.HasOne("AAIntegration.SimmonsBank.API.Entities.CurrencyType", "CurrencyType") .WithMany() .HasForeignKey("CurrencyTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("AAIntegration.SimmonsBank.API.Entities.Account", "DebitAccount") .WithMany() .HasForeignKey("DebitAccountId"); b.HasOne("AAIntegration.SimmonsBank.API.Entities.Envelope", "DebitEnvelope") .WithMany() .HasForeignKey("DebitEnvelopeId"); b.HasOne("AAIntegration.SimmonsBank.API.Entities.User", "Owner") .WithMany() .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CreditAccount"); b.Navigation("CreditEnvelope"); b.Navigation("CurrencyType"); b.Navigation("DebitAccount"); b.Navigation("DebitEnvelope"); b.Navigation("Owner"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Account", b => { b.Navigation("Envelopes"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", b => { b.Navigation("Changes"); b.Navigation("Expressions"); }); modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.User", b => { b.Navigation("Accounts"); }); #pragma warning restore 612, 618 } } }