stylist / backend / Stylist.Data / Migrations / StylistContextModelSnapshot.cs
StylistContextModelSnapshot.cs
Raw
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Stylist.Data.Models;

#nullable disable

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

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Stylist.Data.Models.Entities.Hairdresser", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ImageUrl")
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Hairdressers");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            ImageUrl = "https://hayat.ba/wp-content/uploads/2023/09/baka-mare-srecko.jpg",
                            Name = "Mare Friz"
                        },
                        new
                        {
                            Id = 2,
                            ImageUrl = "https://media.licdn.com/dms/image/C4D03AQHL-3hSlUDlBQ/profile-displayphoto-shrink_800_800/0/1657973397140?e=2147483647&v=beta&t=e3QL6yqT7GqvXFRjOXw4trVOvCqNOOYZD_xzzMT1U38",
                            Name = "Ante Ludi Friz"
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.HairdresserService", b =>
                {
                    b.Property<int>("HairdresserId")
                        .HasColumnType("integer");

                    b.Property<int>("ServiceId")
                        .HasColumnType("integer");

                    b.HasKey("HairdresserId", "ServiceId");

                    b.HasIndex("ServiceId");

                    b.ToTable("HairdresserServices");

                    b.HasData(
                        new
                        {
                            HairdresserId = 1,
                            ServiceId = 1
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.MainService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("MainServices");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Name = "Kratko sisanje"
                        },
                        new
                        {
                            Id = 2,
                            Name = "Pranje kose"
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Reservation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<TimeOnly>("Ends")
                        .HasColumnType("time without time zone");

                    b.Property<string>("Note")
                        .HasColumnType("text");

                    b.Property<double>("Price")
                        .HasColumnType("double precision");

                    b.Property<int>("ScheduleId")
                        .HasColumnType("integer");

                    b.Property<int>("ServiceId")
                        .HasColumnType("integer");

                    b.Property<TimeOnly>("Starts")
                        .HasColumnType("time without time zone");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("ScheduleId");

                    b.HasIndex("ServiceId");

                    b.HasIndex("UserId");

                    b.ToTable("Reservations");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Ends = new TimeOnly(10, 20, 0),
                            Note = "moze malo krace",
                            Price = 10.199999999999999,
                            ScheduleId = 1,
                            ServiceId = 1,
                            Starts = new TimeOnly(8, 0, 0),
                            UserId = 1
                        },
                        new
                        {
                            Id = 2,
                            Ends = new TimeOnly(10, 40, 0),
                            Note = "moze malo krace",
                            Price = 10.199999999999999,
                            ScheduleId = 1,
                            ServiceId = 1,
                            Starts = new TimeOnly(10, 20, 0),
                            UserId = 1
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Review", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Comment")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp without time zone");

                    b.Property<int>("Rating")
                        .HasColumnType("integer");

                    b.Property<int>("ReservationId")
                        .HasColumnType("integer");

                    b.Property<int>("SalonId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

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

                    b.HasIndex("SalonId");

                    b.ToTable("Reviews");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Comment = "super trac",
                            Date = new DateTime(2024, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            Rating = 4,
                            ReservationId = 1,
                            SalonId = 1
                        },
                        new
                        {
                            Id = 2,
                            Comment = "super trac 2",
                            Date = new DateTime(2024, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            Rating = 5,
                            ReservationId = 2,
                            SalonId = 1
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Salon", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

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

                    b.Property<string>("AdressUrl")
                        .HasColumnType("text");

                    b.Property<string>("Description")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)");

                    b.Property<int>("Gender")
                        .HasColumnType("integer");

                    b.Property<string>("ImageUrls")
                        .HasColumnType("text");

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

                    b.Property<string>("PhoneNumber")
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<string>("WebsiteUrl")
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.HasKey("Id");

                    b.ToTable("Salons");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Adress = "ul. Antofagaste 12",
                            AdressUrl = "https://www.google.com/maps/place//data=!4m2!3m1!1s0x13355da6fb3e8f57:0xbb9c2e8f457892a0?sa=X&ved=2ahUKEwjk1sPi1c2DAxXsFhAIHRRUCIkQ4kB6BAgAEAA",
                            Description = "Description",
                            Gender = 1,
                            ImageUrls = "slike",
                            Name = "Mare frizerka",
                            PhoneNumber = "123123",
                            WebsiteUrl = "https://www.google.hr"
                        },
                        new
                        {
                            Id = 2,
                            Adress = "ul. Antofagaste 12",
                            AdressUrl = "https://www.google.com/maps/place//data=!4m2!3m1!1s0x13355da6fb3e8f57:0xbb9c2e8f457892a0?sa=X&ved=2ahUKEwjk1sPi1c2DAxXsFhAIHRRUCIkQ4kB6BAgAEAA",
                            Description = "Description",
                            Gender = 0,
                            ImageUrls = "slike",
                            Name = "Mare i frizeri",
                            PhoneNumber = "123123",
                            WebsiteUrl = "https://www.google.hr"
                        },
                        new
                        {
                            Id = 3,
                            Adress = "ul. Maticica Ludog 12",
                            AdressUrl = "https://www.google.com/maps/place//data=!4m2!3m1!1s0x13355da6fb3e8f57:0xbb9c2e8f457892a0?sa=X&ved=2ahUKEwjk1sPi1c2DAxXsFhAIHRRUCIkQ4kB6BAgAEAA",
                            Description = "Description",
                            Gender = 2,
                            ImageUrls = "slike",
                            Name = "Mare i ludaci sa skal",
                            PhoneNumber = "123123",
                            WebsiteUrl = "https://www.google.hr"
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Schedule", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("Ends")
                        .HasColumnType("timestamp without time zone");

                    b.Property<int>("HairdresserId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("Starts")
                        .HasColumnType("timestamp without time zone");

                    b.HasKey("Id");

                    b.HasIndex("HairdresserId");

                    b.ToTable("Schedules");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Ends = new DateTime(2024, 1, 15, 16, 0, 0, 0, DateTimeKind.Unspecified),
                            HairdresserId = 1,
                            Starts = new DateTime(2024, 1, 15, 8, 0, 0, 0, DateTimeKind.Unspecified)
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Service", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Description")
                        .HasColumnType("text");

                    b.Property<int>("Duration")
                        .HasColumnType("integer");

                    b.Property<int>("Gender")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<double>("Price")
                        .HasColumnType("double precision");

                    b.Property<int>("SalonId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SalonId");

                    b.ToTable("Services");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Description = "Sisanje i pranje kose jako jako dobro i malo traceva",
                            Duration = 10,
                            Gender = 1,
                            Name = "Kratko sisanje",
                            Price = 10.199999999999999,
                            SalonId = 1
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.ServiceMainService", b =>
                {
                    b.Property<int>("ServiceId")
                        .HasColumnType("integer");

                    b.Property<int>("MainServiceId")
                        .HasColumnType("integer");

                    b.HasKey("ServiceId", "MainServiceId");

                    b.HasIndex("MainServiceId");

                    b.ToTable("ServiceMainServices");

                    b.HasData(
                        new
                        {
                            ServiceId = 1,
                            MainServiceId = 1
                        },
                        new
                        {
                            ServiceId = 1,
                            MainServiceId = 2
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

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

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

                    b.Property<int?>("Gender")
                        .HasColumnType("integer");

                    b.Property<string>("ImageUrl")
                        .HasColumnType("text");

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

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

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("text");

                    b.Property<int>("Role")
                        .HasColumnType("integer");

                    b.Property<string>("UserName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Users");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            Email = "mate@gmail.com",
                            FirstName = "mate",
                            Gender = 1,
                            ImageUrl = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTaH3HHWUg9doerWjizPgSdAa_mRfzNWtXQQR-MiADXfw&s",
                            LastName = "matic",
                            Password = "123mate",
                            PhoneNumber = "1234567890",
                            Role = 1,
                            UserName = "mate123"
                        },
                        new
                        {
                            Id = 2,
                            Email = "sime@gmail.com",
                            FirstName = "sime",
                            Gender = 1,
                            ImageUrl = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTaH3HHWUg9doerWjizPgSdAa_mRfzNWtXQQR-MiADXfw&s",
                            LastName = "simic",
                            Password = "123mate",
                            PhoneNumber = "1234567890",
                            Role = 1,
                            UserName = "sime213"
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.WorkingHour", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("ClosingHour")
                        .HasColumnType("timestamp without time zone");

                    b.Property<bool>("IsWorkingDay")
                        .HasColumnType("boolean");

                    b.Property<DateTime>("OpeningHour")
                        .HasColumnType("timestamp without time zone");

                    b.Property<int>("SalonId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SalonId");

                    b.ToTable("WorkingHours");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            ClosingHour = new DateTime(2024, 1, 10, 14, 0, 0, 0, DateTimeKind.Unspecified),
                            IsWorkingDay = true,
                            OpeningHour = new DateTime(2024, 1, 10, 8, 0, 0, 0, DateTimeKind.Unspecified),
                            SalonId = 1
                        },
                        new
                        {
                            Id = 2,
                            ClosingHour = new DateTime(2024, 1, 10, 14, 0, 0, 0, DateTimeKind.Unspecified),
                            IsWorkingDay = true,
                            OpeningHour = new DateTime(2024, 1, 10, 8, 0, 0, 0, DateTimeKind.Unspecified),
                            SalonId = 2
                        },
                        new
                        {
                            Id = 3,
                            ClosingHour = new DateTime(2024, 1, 10, 14, 0, 0, 0, DateTimeKind.Unspecified),
                            IsWorkingDay = false,
                            OpeningHour = new DateTime(2024, 1, 10, 8, 0, 0, 0, DateTimeKind.Unspecified),
                            SalonId = 3
                        });
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.HairdresserService", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Hairdresser", "Hairdresser")
                        .WithMany("HairdresserServices")
                        .HasForeignKey("HairdresserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Stylist.Data.Models.Entities.Service", "Service")
                        .WithMany("HairdresserServices")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Hairdresser");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Reservation", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Schedule", "Schedule")
                        .WithMany("Reservations")
                        .HasForeignKey("ScheduleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Stylist.Data.Models.Entities.Service", "Service")
                        .WithMany("Reservations")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Stylist.Data.Models.Entities.User", "User")
                        .WithMany("Reservations")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Schedule");

                    b.Navigation("Service");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Review", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Reservation", "Reservation")
                        .WithOne("Review")
                        .HasForeignKey("Stylist.Data.Models.Entities.Review", "ReservationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Stylist.Data.Models.Entities.Salon", "Salon")
                        .WithMany("Reviews")
                        .HasForeignKey("SalonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Reservation");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Schedule", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Hairdresser", "Hairdresser")
                        .WithMany("Schedules")
                        .HasForeignKey("HairdresserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Service", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Salon", "Salon")
                        .WithMany("Services")
                        .HasForeignKey("SalonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.ServiceMainService", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.MainService", "MainService")
                        .WithMany("ServiceMainServices")
                        .HasForeignKey("MainServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Stylist.Data.Models.Entities.Service", "Service")
                        .WithMany("ServiceMainServices")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MainService");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.WorkingHour", b =>
                {
                    b.HasOne("Stylist.Data.Models.Entities.Salon", "Salon")
                        .WithMany("WorkingHours")
                        .HasForeignKey("SalonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Hairdresser", b =>
                {
                    b.Navigation("HairdresserServices");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.MainService", b =>
                {
                    b.Navigation("ServiceMainServices");
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Reservation", b =>
                {
                    b.Navigation("Review");
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Salon", b =>
                {
                    b.Navigation("Reviews");

                    b.Navigation("Services");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.Schedule", b =>
                {
                    b.Navigation("Reservations");
                });

            modelBuilder.Entity("Stylist.Data.Models.Entities.Service", b =>
                {
                    b.Navigation("HairdresserServices");

                    b.Navigation("Reservations");

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

            modelBuilder.Entity("Stylist.Data.Models.Entities.User", b =>
                {
                    b.Navigation("Reservations");
                });
#pragma warning restore 612, 618
        }
    }
}