523 lines
18 KiB
C#
Raw Normal View History

// <auto-generated />
using System;
using System.Collections.Generic;
using AAIntegration.SimmonsBank.API.Config;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AAIntegration.SimmonsBank.API.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240224133139_UserApiKey")]
partial class UserApiKey
{
/// <inheritdoc />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("Balance")
.HasColumnType("numeric");
b.Property<DateTime>("CreatedOn")
.HasColumnType("timestamp with time zone");
b.Property<int>("CurrencyId")
.HasColumnType("integer");
b.Property<string>("ExternalAccountNumber")
.IsRequired()
.HasColumnType("text");
b.Property<decimal>("InitialBalance")
.HasColumnType("numeric");
b.Property<DateTime>("LastActivity")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("UserId")
.HasColumnType("integer");
b.Property<decimal>("VirtualBalance")
.HasColumnType("numeric");
b.HasKey("Id");
b.HasIndex("CurrencyId");
b.HasIndex("UserId");
b.ToTable("Accounts");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassChange", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("AutoclassRuleId")
.HasColumnType("integer");
b.Property<int>("Field")
.HasColumnType("integer");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AutoclassRuleId");
b.ToTable("AutoclassChanges");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassExpression", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("AutoclassRuleId")
.HasColumnType("integer");
b.Property<int>("CompareOperator")
.HasColumnType("integer");
b.Property<int>("TransactionField")
.HasColumnType("integer");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AutoclassRuleId");
b.ToTable("AutoclassExpressions");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.AutoclassRule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("integer");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AccountId");
b.ToTable("AutoclassRules");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.CurrencyType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("text");
b.Property<int>("DecimalPlaces")
.HasColumnType("integer");
b.Property<string>("Symbol")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("CurrencyTypes");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Envelope", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("integer");
b.Property<decimal>("Balance")
.HasColumnType("numeric");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<decimal>("InitialBalance")
.HasColumnType("numeric");
b.Property<bool>("IsPersistant")
.HasColumnType("boolean");
b.Property<DateTime?>("LastTriggeredOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<TimeSpan>("Period")
.HasColumnType("interval");
b.Property<int>("Priority")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AccountId");
b.ToTable("Envelopes");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.EnvelopeFundingMethod", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("EnvelopeId")
.HasColumnType("integer");
b.Property<int>("Mode")
.HasColumnType("integer");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<int>("PeriodsToLookback")
.HasColumnType("integer");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("EnvelopeId");
b.ToTable("EnvelopeFundingMethods");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Operation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("AbsoluteValue")
.HasColumnType("numeric");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<int>("HistoricLookbackDepth")
.HasColumnType("integer");
b.Property<TimeSpan>("HistoricPeriod")
.HasColumnType("interval");
b.Property<int>("HistoricStatistic")
.HasColumnType("integer");
b.Property<int>("Mode")
.HasColumnType("integer");
b.Property<bool>("Negative")
.HasColumnType("boolean");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<decimal>("Percentage")
.HasColumnType("numeric");
b.HasKey("Id");
b.ToTable("Operations");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.Transaction", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<DateTime>("CreatedOn")
.HasColumnType("timestamp with time zone");
b.Property<int?>("CreditAccountId")
.HasColumnType("integer");
b.Property<int?>("CreditEnvelopeId")
.HasColumnType("integer");
b.Property<int>("CurrencyTypeId")
.HasColumnType("integer");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<int?>("DebitAccountId")
.HasColumnType("integer");
b.Property<int?>("DebitEnvelopeId")
.HasColumnType("integer");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsEnvelopeFundingTransaction")
.HasColumnType("boolean");
b.Property<bool>("IsPending")
.HasColumnType("boolean");
b.Property<string>("Notes")
.IsRequired()
.HasColumnType("text");
b.Property<List<string>>("Tags")
.HasColumnType("text[]");
b.Property<DateTime>("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.ToTable("Transactions");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ApiKey")
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.Property<string>("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", null)
.WithMany("Accounts")
.HasForeignKey("UserId");
b.Navigation("Currency");
});
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("FundingMethods")
.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.Navigation("CreditAccount");
b.Navigation("CreditEnvelope");
b.Navigation("CurrencyType");
b.Navigation("DebitAccount");
b.Navigation("DebitEnvelope");
});
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.Envelope", b =>
{
b.Navigation("FundingMethods");
});
modelBuilder.Entity("AAIntegration.SimmonsBank.API.Entities.User", b =>
{
b.Navigation("Accounts");
});
#pragma warning restore 612, 618
}
}
}