// <auto-generated />
using System;
using Extrudex.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Extrudex.Infrastructure.Data.Migrations
{
    [DbContext(typeof(ExtrudexDbContext))]
    [Migration("20260426184329_AddUsageLogTable")]
    partial class AddUsageLogTable
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.3")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Extrudex.Domain.Entities.AmsSlot", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<Guid>("AmsUnitId")
                        .HasColumnType("uuid")
                        .HasColumnName("ams_unit_id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<decimal?>("RemainingWeightG")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("remaining_weight_g");

                    b.Property<Guid?>("SpoolId")
                        .HasColumnType("uuid")
                        .HasColumnName("spool_id");

                    b.Property<int>("TrayIndex")
                        .HasColumnType("integer")
                        .HasColumnName("tray_index");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("SpoolId")
                        .HasDatabaseName("ix_ams_slots_spool_id");

                    b.HasIndex("AmsUnitId", "TrayIndex")
                        .IsUnique()
                        .HasDatabaseName("ix_ams_slots_ams_unit_id_tray_index");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.AmsUnit", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<Guid>("PrinterId")
                        .HasColumnType("uuid")
                        .HasColumnName("printer_id");

                    b.Property<int>("UnitIndex")
                        .HasColumnType("integer")
                        .HasColumnName("unit_index");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("PrinterId", "UnitIndex")
                        .IsUnique()
                        .HasDatabaseName("ix_ams_units_printer_id_unit_index");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialBase", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<decimal>("DensityGperCm3")
                        .HasPrecision(10, 4)
                        .HasColumnType("numeric(10,4)")
                        .HasColumnName("density_g_per_cm3");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)")
                        .HasColumnName("name");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique()
                        .HasDatabaseName("ix_material_bases_name");

                    b.ToTable("material_bases", (string)null);

                    b.HasData(
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000001"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(6535),
                            DensityGperCm3 = 1.24m,
                            Name = "PLA",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(6535)
                        },
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000002"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7016),
                            DensityGperCm3 = 1.27m,
                            Name = "PETG",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7016)
                        },
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000003"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7027),
                            DensityGperCm3 = 1.04m,
                            Name = "ABS",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7028)
                        },
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000004"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7034),
                            DensityGperCm3 = 1.07m,
                            Name = "ASA",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7035)
                        },
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000005"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7042),
                            DensityGperCm3 = 1.21m,
                            Name = "TPU",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7042)
                        },
                        new
                        {
                            Id = new Guid("10000000-0000-0000-0000-000000000006"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7049),
                            DensityGperCm3 = 1.14m,
                            Name = "Nylon",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7049)
                        });
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialFinish", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<Guid>("MaterialBaseId")
                        .HasColumnType("uuid")
                        .HasColumnName("material_base_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)")
                        .HasColumnName("name");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("MaterialBaseId", "Name")
                        .IsUnique()
                        .HasDatabaseName("ix_material_finishes_material_base_id_name");

                    b.ToTable("material_finishes", (string)null);

                    b.HasData(
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000001"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7291),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7292)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000002"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7453),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Matte",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7453)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000003"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7461),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Silk",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7461)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000004"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7468),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Glitter",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7468)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000005"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7474),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Marble",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7474)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000006"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7480),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Sparkle",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7481)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000007"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7487),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7487)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000008"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7493),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
                            Name = "Matte",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7493)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000009"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7500),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
                            Name = "Silk",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7500)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000010"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7507),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7507)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000011"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7513),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
                            Name = "Matte",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7513)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000012"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7519),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7520)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000013"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7526),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
                            Name = "Matte",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7526)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000014"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7532),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000005"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7532)
                        },
                        new
                        {
                            Id = new Guid("20000000-0000-0000-0000-000000000015"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7538),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
                            Name = "Basic",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7539)
                        });
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialModifier", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<Guid>("MaterialBaseId")
                        .HasColumnType("uuid")
                        .HasColumnName("material_base_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)")
                        .HasColumnName("name");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("MaterialBaseId", "Name")
                        .IsUnique()
                        .HasDatabaseName("ix_material_modifiers_material_base_id_name");

                    b.ToTable("material_modifiers", (string)null);

                    b.HasData(
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000001"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7690),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Carbon Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7690)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000002"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7838),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Glass Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7838)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000003"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7846),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Wood Fill",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7846)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000004"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7853),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000001"),
                            Name = "Glow-in-the-Dark",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7853)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000005"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7859),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
                            Name = "Carbon Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7859)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000006"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7865),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000002"),
                            Name = "Glass Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7866)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000007"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7872),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
                            Name = "Carbon Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7872)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000008"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7878),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000003"),
                            Name = "Glass Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7879)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000009"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7885),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000004"),
                            Name = "Carbon Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7885)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000010"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7891),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
                            Name = "Carbon Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7891)
                        },
                        new
                        {
                            Id = new Guid("30000000-0000-0000-0000-000000000011"),
                            CreatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7898),
                            MaterialBaseId = new Guid("10000000-0000-0000-0000-000000000006"),
                            Name = "Glass Fiber",
                            UpdatedAt = new DateTime(2026, 4, 26, 18, 43, 28, 895, DateTimeKind.Utc).AddTicks(7898)
                        });
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.PrintJob", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("completed_at");

                    b.Property<decimal?>("CostPerPrint")
                        .HasPrecision(10, 4)
                        .HasColumnType("numeric(10,4)")
                        .HasColumnName("cost_per_print");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<string>("DataSource")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("data_source");

                    b.Property<decimal>("FilamentDiameterAtPrintMm")
                        .HasPrecision(6, 3)
                        .HasColumnType("numeric(6,3)")
                        .HasColumnName("filament_diameter_at_print_mm");

                    b.Property<string>("GcodeFilePath")
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)")
                        .HasColumnName("gcode_file_path");

                    b.Property<decimal>("GramsDerived")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("grams_derived");

                    b.Property<decimal>("MaterialDensityAtPrint")
                        .HasPrecision(10, 4)
                        .HasColumnType("numeric(10,4)")
                        .HasColumnName("material_density_at_print");

                    b.Property<decimal>("MmExtruded")
                        .HasPrecision(12, 2)
                        .HasColumnType("numeric(12,2)")
                        .HasColumnName("mm_extruded");

                    b.Property<string>("Notes")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("notes");

                    b.Property<string>("PrintName")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("print_name");

                    b.Property<Guid>("PrinterId")
                        .HasColumnType("uuid")
                        .HasColumnName("printer_id");

                    b.Property<Guid>("SpoolId")
                        .HasColumnType("uuid")
                        .HasColumnName("spool_id");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("started_at");

                    b.Property<string>("Status")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasDefaultValue("Queued")
                        .HasColumnName("status");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("DataSource")
                        .HasDatabaseName("ix_print_jobs_data_source");

                    b.HasIndex("PrinterId")
                        .HasDatabaseName("ix_print_jobs_printer_id");

                    b.HasIndex("SpoolId")
                        .HasDatabaseName("ix_print_jobs_spool_id");

                    b.HasIndex("Status")
                        .HasDatabaseName("ix_print_jobs_status");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.Printer", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("ApiKey")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("api_key");

                    b.Property<string>("ConnectionType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("connection_type");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<string>("HostnameOrIp")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("hostname_or_ip");

                    b.Property<bool>("IsActive")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("is_active");

                    b.Property<DateTime?>("LastSeenAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("last_seen_at");

                    b.Property<string>("Manufacturer")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("manufacturer");

                    b.Property<string>("Model")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("model");

                    b.Property<string>("MqttPassword")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("mqtt_password");

                    b.Property<bool>("MqttUseTls")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("mqtt_use_tls");

                    b.Property<string>("MqttUsername")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("mqtt_username");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("name");

                    b.Property<int>("Port")
                        .HasColumnType("integer")
                        .HasColumnName("port");

                    b.Property<string>("PrinterType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("printer_type");

                    b.Property<string>("Status")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasDefaultValue("Offline")
                        .HasColumnName("status");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.HasKey("Id");

                    b.HasIndex("ConnectionType")
                        .HasDatabaseName("ix_printers_connection_type");

                    b.HasIndex("IsActive")
                        .HasDatabaseName("ix_printers_is_active");

                    b.HasIndex("PrinterType")
                        .HasDatabaseName("ix_printers_printer_type");

                    b.HasIndex("Status")
                        .HasDatabaseName("ix_printers_status");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.Spool", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<string>("Brand")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("brand");

                    b.Property<string>("ColorHex")
                        .IsRequired()
                        .HasMaxLength(7)
                        .HasColumnType("character varying(7)")
                        .HasColumnName("color_hex");

                    b.Property<string>("ColorName")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("color_name");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<decimal>("FilamentDiameterMm")
                        .HasPrecision(6, 3)
                        .HasColumnType("numeric(6,3)")
                        .HasColumnName("filament_diameter_mm");

                    b.Property<bool>("IsActive")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("is_active");

                    b.Property<Guid>("MaterialBaseId")
                        .HasColumnType("uuid")
                        .HasColumnName("material_base_id");

                    b.Property<Guid>("MaterialFinishId")
                        .HasColumnType("uuid")
                        .HasColumnName("material_finish_id");

                    b.Property<Guid?>("MaterialModifierId")
                        .HasColumnType("uuid")
                        .HasColumnName("material_modifier_id");

                    b.Property<DateTime?>("PurchaseDate")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("purchase_date");

                    b.Property<decimal?>("PurchasePrice")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("purchase_price");

                    b.Property<string>("SpoolSerial")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)")
                        .HasColumnName("spool_serial");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<decimal>("WeightRemainingGrams")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("weight_remaining_grams");

                    b.Property<decimal>("WeightTotalGrams")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("weight_total_grams");

                    b.HasKey("Id");

                    b.HasIndex("IsActive")
                        .HasDatabaseName("ix_spools_is_active");

                    b.HasIndex("MaterialBaseId")
                        .HasDatabaseName("ix_spools_material_base_id");

                    b.HasIndex("MaterialFinishId")
                        .HasDatabaseName("ix_spools_material_finish_id");

                    b.HasIndex("MaterialModifierId")
                        .HasDatabaseName("ix_spools_material_modifier_id");

                    b.HasIndex("SpoolSerial")
                        .IsUnique()
                        .HasDatabaseName("ix_spools_spool_serial");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.UsageLog", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<string>("DataSource")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("data_source");

                    b.Property<decimal>("GramsUsed")
                        .HasPrecision(10, 2)
                        .HasColumnType("numeric(10,2)")
                        .HasColumnName("grams_used");

                    b.Property<decimal?>("MmExtruded")
                        .HasPrecision(12, 2)
                        .HasColumnType("numeric(12,2)")
                        .HasColumnName("mm_extruded");

                    b.Property<string>("Notes")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)")
                        .HasColumnName("notes");

                    b.Property<Guid?>("PrintJobId")
                        .HasColumnType("uuid")
                        .HasColumnName("print_job_id");

                    b.Property<Guid?>("PrinterId")
                        .HasColumnType("uuid")
                        .HasColumnName("printer_id");

                    b.Property<Guid>("SpoolId")
                        .HasColumnType("uuid")
                        .HasColumnName("spool_id");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("now() at time zone 'utc'");

                    b.Property<DateTime>("UsageTimestamp")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("usage_timestamp");

                    b.HasKey("Id");

                    b.HasIndex("DataSource")
                        .HasDatabaseName("ix_usage_logs_data_source");

                    b.HasIndex("PrintJobId")
                        .HasDatabaseName("ix_usage_logs_print_job_id");

                    b.HasIndex("PrinterId")
                        .HasDatabaseName("ix_usage_logs_printer_id");

                    b.HasIndex("SpoolId")
                        .HasDatabaseName("ix_usage_logs_spool_id");

                    b.HasIndex("UsageTimestamp")
                        .HasDatabaseName("ix_usage_logs_usage_timestamp");

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

            modelBuilder.Entity("Extrudex.Domain.Entities.AmsSlot", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.AmsUnit", "AmsUnit")
                        .WithMany("Slots")
                        .HasForeignKey("AmsUnitId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_ams_slots_ams_unit");

                    b.HasOne("Extrudex.Domain.Entities.Spool", "Spool")
                        .WithMany("AmsSlots")
                        .HasForeignKey("SpoolId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_ams_slots_spool");

                    b.Navigation("AmsUnit");

                    b.Navigation("Spool");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.AmsUnit", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.Printer", "Printer")
                        .WithMany("AmsUnits")
                        .HasForeignKey("PrinterId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("fk_ams_units_printer");

                    b.Navigation("Printer");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialFinish", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.MaterialBase", "MaterialBase")
                        .WithMany("Finishes")
                        .HasForeignKey("MaterialBaseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_material_finishes_material_base");

                    b.Navigation("MaterialBase");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialModifier", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.MaterialBase", "MaterialBase")
                        .WithMany("Modifiers")
                        .HasForeignKey("MaterialBaseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_material_modifiers_material_base");

                    b.Navigation("MaterialBase");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.PrintJob", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.Printer", "Printer")
                        .WithMany("PrintJobs")
                        .HasForeignKey("PrinterId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_print_jobs_printer");

                    b.HasOne("Extrudex.Domain.Entities.Spool", "Spool")
                        .WithMany("PrintJobs")
                        .HasForeignKey("SpoolId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_print_jobs_spool");

                    b.Navigation("Printer");

                    b.Navigation("Spool");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.Spool", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.MaterialBase", "MaterialBase")
                        .WithMany("Spools")
                        .HasForeignKey("MaterialBaseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_spools_material_base");

                    b.HasOne("Extrudex.Domain.Entities.MaterialFinish", "MaterialFinish")
                        .WithMany("Spools")
                        .HasForeignKey("MaterialFinishId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_spools_material_finish");

                    b.HasOne("Extrudex.Domain.Entities.MaterialModifier", "MaterialModifier")
                        .WithMany("Spools")
                        .HasForeignKey("MaterialModifierId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_spools_material_modifier");

                    b.Navigation("MaterialBase");

                    b.Navigation("MaterialFinish");

                    b.Navigation("MaterialModifier");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.UsageLog", b =>
                {
                    b.HasOne("Extrudex.Domain.Entities.PrintJob", "PrintJob")
                        .WithMany()
                        .HasForeignKey("PrintJobId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_usage_logs_print_job");

                    b.HasOne("Extrudex.Domain.Entities.Printer", "Printer")
                        .WithMany()
                        .HasForeignKey("PrinterId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .HasConstraintName("fk_usage_logs_printer");

                    b.HasOne("Extrudex.Domain.Entities.Spool", "Spool")
                        .WithMany()
                        .HasForeignKey("SpoolId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired()
                        .HasConstraintName("fk_usage_logs_spool");

                    b.Navigation("PrintJob");

                    b.Navigation("Printer");

                    b.Navigation("Spool");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.AmsUnit", b =>
                {
                    b.Navigation("Slots");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialBase", b =>
                {
                    b.Navigation("Finishes");

                    b.Navigation("Modifiers");

                    b.Navigation("Spools");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialFinish", b =>
                {
                    b.Navigation("Spools");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.MaterialModifier", b =>
                {
                    b.Navigation("Spools");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.Printer", b =>
                {
                    b.Navigation("AmsUnits");

                    b.Navigation("PrintJobs");
                });

            modelBuilder.Entity("Extrudex.Domain.Entities.Spool", b =>
                {
                    b.Navigation("AmsSlots");

                    b.Navigation("PrintJobs");
                });
#pragma warning restore 612, 618
        }
    }
}
