// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PolyTrader.Modules.Accounting.Persistence;

#nullable disable

namespace PolyTrader.Modules.Accounting.Persistence.Migrations
{
    [DbContext(typeof(AccountingDbContext))]
    partial class AccountingDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.13")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);

            modelBuilder.Entity("PolyTrader.Modules.Accounting.Models.FxRate", b =>
                {
                    b.Property<DateTime>("Date")
                        .HasColumnType("date");

                    b.Property<string>("Source")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<decimal>("UsdToEur")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.HasKey("Date");

                    b.ToTable("acc_fx_rates", (string)null);
                });

            modelBuilder.Entity("PolyTrader.Modules.Accounting.Models.IngestRun", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<bool>("Backfill")
                        .HasColumnType("tinyint(1)");

                    b.Property<decimal?>("BalanceAnchorUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<decimal?>("BalanceDeltaUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<int>("DuplicateEntries")
                        .HasColumnType("int");

                    b.Property<DateTime?>("FinishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("FromTimestamp")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal?>("LedgerNetUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<int>("NewEntries")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Success")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("Id");

                    b.HasIndex("AccountId", "StartedAt");

                    b.ToTable("acc_ingest_runs", (string)null);
                });

            modelBuilder.Entity("PolyTrader.Modules.Accounting.Models.LedgerEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<string>("EventType")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<decimal>("FeeUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<decimal>("GrossUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<string>("IdempotencyKey")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<long>("IngestBatchId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("IngestedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("LogIndex")
                        .HasColumnType("int");

                    b.Property<string>("MarketSlug")
                        .IsRequired()
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<decimal>("NetUsdc")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<string>("Outcome")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<decimal>("PriceUsdc")
                        .HasPrecision(18, 6)
                        .HasColumnType("decimal(18,6)");

                    b.Property<string>("Side")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("varchar(10)");

                    b.Property<decimal>("Size")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<string>("Source")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("TokenId")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("TxHash")
                        .IsRequired()
                        .HasMaxLength(80)
                        .HasColumnType("varchar(80)");

                    b.HasKey("Id");

                    b.HasIndex("EventType");

                    b.HasIndex("IdempotencyKey")
                        .IsUnique();

                    b.HasIndex("AccountId", "Timestamp");

                    b.ToTable("acc_ledger", (string)null);
                });

            modelBuilder.Entity("PolyTrader.Modules.Accounting.Models.RawSnapshot", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CapturedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<long>("IngestRunId")
                        .HasColumnType("bigint");

                    b.Property<string>("Json")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("SourceKind")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.HasKey("Id");

                    b.HasIndex("IngestRunId");

                    b.ToTable("acc_raw", (string)null);
                });
#pragma warning restore 612, 618
        }
    }
}
