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

#nullable disable

namespace Passenger.Data.Migrations
{
    [DbContext(typeof(PassengerDbContext))]
    partial class PassengerDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.2")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Passenger.Passengers.Models.Passenger", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid")
                        .HasColumnName("id");

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

                    b.Property<long?>("CreatedBy")
                        .HasColumnType("bigint")
                        .HasColumnName("created_by");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("boolean")
                        .HasColumnName("is_deleted");

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

                    b.Property<long?>("LastModifiedBy")
                        .HasColumnType("bigint")
                        .HasColumnName("last_modified_by");

                    b.Property<string>("PassengerType")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnType("text")
                        .HasDefaultValue("Unknown")
                        .HasColumnName("passenger_type");

                    b.Property<long>("Version")
                        .IsConcurrencyToken()
                        .HasColumnType("bigint")
                        .HasColumnName("version");

                    b.HasKey("Id")
                        .HasName("pk_passenger");

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

            modelBuilder.Entity("Passenger.Passengers.Models.Passenger", b =>
                {
                    b.OwnsOne("Passenger.Passengers.ValueObjects.Age", "Age", b1 =>
                        {
                            b1.Property<Guid>("PassengerId")
                                .HasColumnType("uuid")
                                .HasColumnName("id");

                            b1.Property<int>("Value")
                                .HasMaxLength(3)
                                .HasColumnType("integer")
                                .HasColumnName("age");

                            b1.HasKey("PassengerId")
                                .HasName("pk_passenger");

                            b1.ToTable("passenger");

                            b1.WithOwner()
                                .HasForeignKey("PassengerId")
                                .HasConstraintName("fk_passenger_passenger_id");
                        });

                    b.OwnsOne("Passenger.Passengers.ValueObjects.Name", "Name", b1 =>
                        {
                            b1.Property<Guid>("PassengerId")
                                .HasColumnType("uuid")
                                .HasColumnName("id");

                            b1.Property<string>("Value")
                                .IsRequired()
                                .HasMaxLength(50)
                                .HasColumnType("character varying(50)")
                                .HasColumnName("name");

                            b1.HasKey("PassengerId")
                                .HasName("pk_passenger");

                            b1.ToTable("passenger");

                            b1.WithOwner()
                                .HasForeignKey("PassengerId")
                                .HasConstraintName("fk_passenger_passenger_id");
                        });

                    b.OwnsOne("Passenger.Passengers.ValueObjects.PassportNumber", "PassportNumber", b1 =>
                        {
                            b1.Property<Guid>("PassengerId")
                                .HasColumnType("uuid")
                                .HasColumnName("id");

                            b1.Property<string>("Value")
                                .IsRequired()
                                .HasMaxLength(10)
                                .HasColumnType("character varying(10)")
                                .HasColumnName("passport_number");

                            b1.HasKey("PassengerId")
                                .HasName("pk_passenger");

                            b1.ToTable("passenger");

                            b1.WithOwner()
                                .HasForeignKey("PassengerId")
                                .HasConstraintName("fk_passenger_passenger_id");
                        });

                    b.Navigation("Age");

                    b.Navigation("Name")
                        .IsRequired();

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