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

#nullable disable

namespace Monitoring.Infrastructure.Data.Migrations
{
    [DbContext(typeof(DataContext))]
    [Migration("20251103232733_AddedAlarmScope")]
    partial class AddedAlarmScope
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.10")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("AssetAssetGroup", b =>
                {
                    b.Property<Guid>("AssetsId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("GroupsId")
                        .HasColumnType("uuid");

                    b.HasKey("AssetsId", "GroupsId");

                    b.HasIndex("GroupsId");

                    b.ToTable("AssetAssetGroup");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Access", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetGroupId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("MemberId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AssetGroupId");

                    b.HasIndex("MemberId", "AssetGroupId")
                        .IsUnique();

                    b.ToTable("Accesses");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AlarmResetComment", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("OrganizationId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("OrganizationId");

                    b.ToTable("AlarmResetComments");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AlarmResetCommentTranslate", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CommentId")
                        .HasColumnType("uuid");

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

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

                    b.HasKey("Id");

                    b.HasIndex("CommentId");

                    b.ToTable("AlarmResetCommentTranslates");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Area", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

                    b.Property<int>("Index")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0);

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

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

                    b.HasKey("Id");

                    b.HasIndex("AssetId", "Index")
                        .IsUnique();

                    b.ToTable("Areas");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("OrganizationId")
                        .HasColumnType("uuid");

                    b.Property<Guid?>("ParentId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("OrganizationId");

                    b.HasIndex("ParentId");

                    b.ToTable("AssetGroups");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AssetManagement.Asset", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

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

                    b.Property<string>("Imei")
                        .IsRequired()
                        .HasMaxLength(16)
                        .HasColumnType("character varying(16)")
                        .HasColumnName("Imei");

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

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

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

                    b.Property<Guid>("OrganizationId")
                        .HasColumnType("uuid");

                    b.Property<byte[]>("RowVersion")
                        .IsConcurrencyToken()
                        .IsRequired()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("bytea")
                        .HasColumnName("RowVersion");

                    b.Property<Guid?>("ServiceOrganizationId")
                        .HasColumnType("uuid");

                    b.ComplexProperty<Dictionary<string, object>>("Address", "Monitoring.Core.Domain.AssetManagement.Asset.Address#Address", b1 =>
                        {
                            b1.IsRequired();

                            b1.Property<string>("Apartment")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("Apartment");

                            b1.Property<string>("Building")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("Building");

                            b1.Property<string>("City")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("City");

                            b1.Property<string>("Country")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("Country");

                            b1.Property<string>("GateCode")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("GateCode");

                            b1.Property<string>("House")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("House");

                            b1.Property<string>("IntercomCode")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("IntercomCode");

                            b1.Property<string>("Region")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("Region");

                            b1.Property<string>("Street")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("Street");
                        });

                    b.ComplexProperty<Dictionary<string, object>>("Coordinates", "Monitoring.Core.Domain.AssetManagement.Asset.Coordinates#Coordinates", b1 =>
                        {
                            b1.IsRequired();

                            b1.Property<float?>("Latitude")
                                .HasColumnType("real")
                                .HasColumnName("Latitude");

                            b1.Property<float?>("Longitude")
                                .HasColumnType("real")
                                .HasColumnName("Longitude");
                        });

                    b.ComplexProperty<Dictionary<string, object>>("Owner", "Monitoring.Core.Domain.AssetManagement.Asset.Owner#Owner", b1 =>
                        {
                            b1.IsRequired();

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

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

                            b1.Property<string>("Phone1")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("OwnerPhone1");

                            b1.Property<string>("Phone2")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("OwnerPhone2");
                        });

                    b.ComplexProperty<Dictionary<string, object>>("Passwords", "Monitoring.Core.Domain.AssetManagement.Asset.Passwords#Passwords", b1 =>
                        {
                            b1.IsRequired();

                            b1.Property<string>("DuressPassword")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("DuressPassword");

                            b1.Property<string>("IdentificationPassword")
                                .IsRequired()
                                .HasMaxLength(100)
                                .HasColumnType("character varying(100)")
                                .HasColumnName("IdentificationPassword");
                        });

                    b.HasKey("Id");

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

                    b.HasIndex("OrganizationId");

                    b.HasIndex("ServiceOrganizationId");

                    b.ToTable("Assets");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AssetStatus.AssetStatus", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

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

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.HasIndex("Timestamp");

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

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

            modelBuilder.Entity("Monitoring.Core.Domain.CallManagement.Call", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CallerId")
                        .HasColumnType("uuid");

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

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

                    b.Property<Guid>("ResponsiblePersonId")
                        .HasColumnType("uuid");

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

                    b.HasKey("Id");

                    b.HasIndex("AlarmId");

                    b.HasIndex("CallerId");

                    b.HasIndex("ResponsiblePersonId");

                    b.ToTable("Calls");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CameraManagement.Camera", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<string>("Address")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.ToTable("Cameras");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CameraManagement.CameraView", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CameraId")
                        .HasColumnType("uuid");

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

                    b.Property<DateTime>("EndVideo")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("StartVideo")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AlarmId");

                    b.HasIndex("CameraId", "DateTime");

                    b.HasIndex("UserId", "DateTime");

                    b.ToTable("CameraViews");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckList", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmScopeId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("TemplateId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AlarmScopeId");

                    b.HasIndex("TemplateId");

                    b.ToTable("CheckLists");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListItem", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CheckListId")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("TemplateId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("CheckListId");

                    b.HasIndex("TemplateId");

                    b.ToTable("CheckListItems");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplate", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.HasKey("Id");

                    b.ToTable("CheckListTemplates");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItem", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CheckListTemplateId")
                        .HasColumnType("uuid");

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

                    b.HasKey("Id");

                    b.HasIndex("CheckListTemplateId");

                    b.ToTable("CheckListTemplateItems");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItemTranslation", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("ItemId")
                        .HasColumnType("uuid");

                    b.Property<string>("LanguageCode")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

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

                    b.HasKey("Id");

                    b.HasIndex("ItemId", "LanguageCode")
                        .IsUnique();

                    b.ToTable("CheckListTemplateItemTranslations");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Alarm", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("EventId")
                        .HasColumnType("uuid");

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

                    b.Property<Guid?>("ScopeId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("ZoneId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("EventId");

                    b.HasIndex("ScopeId");

                    b.HasIndex("ZoneId");

                    b.ToTable("Alarms");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmReset", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmId")
                        .HasColumnType("uuid");

                    b.Property<string>("Comment")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<DateTime>("ResetAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid>("ResetById")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AlarmId");

                    b.HasIndex("ResetById");

                    b.ToTable("AlarmResets");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmScope", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.ToTable("AlarmScopes");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmScopeStatusChanging", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmScopeId")
                        .HasColumnType("uuid");

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

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

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AlarmScopeId");

                    b.HasIndex("UserId");

                    b.ToTable("AlarmScopeStatusHistory");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Event", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("CodeId")
                        .HasColumnType("uuid");

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

                    b.Property<DateTime>("ReceivedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid");

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

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.HasIndex("CodeId");

                    b.HasIndex("UserId");

                    b.ToTable("Events");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.EventCode", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("Group");

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

                    b.ToTable("EventCodes");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Fault", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("EventId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("ZoneId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("EventId");

                    b.HasIndex("ZoneId");

                    b.ToTable("Faults");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.FireDepartmentManagement.AlarmFireDepartmentDispatch", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AlarmId")
                        .HasColumnType("uuid");

                    b.Property<string>("Comment")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<Guid>("DepartmentId")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("SenderId")
                        .HasColumnType("uuid");

                    b.Property<DateTime>("SentAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("AlarmId");

                    b.HasIndex("SenderId");

                    b.ToTable("AlarmFireDepartmentDispatches");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.FireDepartmentManagement.FireDepartment", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

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

                    b.HasKey("Id");

                    b.ToTable("FireDepartments");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.FireDepartmentManagement.FireDepartmentAccess", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("DepartmentId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("DepartmentId");

                    b.HasIndex("UserId", "DepartmentId")
                        .IsUnique();

                    b.ToTable("FireDepartmentAccesses");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.LockedEventCode", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("EventCodeId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("EventCodeId");

                    b.HasIndex("AssetId", "EventCodeId")
                        .IsUnique();

                    b.ToTable("LockedEventCodes");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Member", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("OrganizationId")
                        .HasColumnType("uuid");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("OrganizationId", "UserId")
                        .IsUnique();

                    b.ToTable("Members");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.OrganizationManagement.Organization", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

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

                    b.HasKey("Id");

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

                    b.ToTable("Organizations");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Photo", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.ToTable("Photos");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.RefreshToken", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<DateTime>("ExpiryDate")
                        .HasColumnType("timestamp with time zone");

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

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

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

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("RefreshTokens");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.ReportManagement.Report", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<string>("Data")
                        .IsRequired()
                        .HasColumnType("jsonb");

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

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

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("Reports");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.ResponsiblePerson", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

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

                    b.Property<string>("Note")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

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

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

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.ToTable("ResponsiblePersons");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Role", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

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

                    b.HasKey("Id");

                    b.ToTable("Roles");

                    b.HasData(
                        new
                        {
                            Id = new Guid("60782519-2571-4153-9010-312463165300"),
                            Name = "Administrator",
                            UpperCaseName = "ADMINISTRATOR"
                        },
                        new
                        {
                            Id = new Guid("06e83f0a-28f4-470e-be61-b732029406db"),
                            Name = "Manager",
                            UpperCaseName = "MANAGER"
                        },
                        new
                        {
                            Id = new Guid("23b97497-89fa-4778-bbfe-692b5a82eaec"),
                            Name = "Watcher",
                            UpperCaseName = "WATCHER"
                        },
                        new
                        {
                            Id = new Guid("6e7c3d9f-7d6a-4d0c-8c9b-7c0d0e8f9f8f"),
                            Name = "Visitor",
                            UpperCaseName = "VISITOR"
                        });
                });

            modelBuilder.Entity("Monitoring.Core.Domain.ServiceOrganizationManagement.ServiceOrganization", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<byte[]>("TimeStamp")
                        .IsRequired()
                        .HasColumnType("bytea");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Monitoring.Core.Domain.TokenManagement.Token", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

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

                    b.Property<Guid>("OrganizationId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("OrganizationId");

                    b.ToTable("Tokens");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.User", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("RoleId")
                        .HasColumnType("uuid");

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

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

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("Users");

                    b.HasData(
                        new
                        {
                            Id = new Guid("e9bf7e86-fbe3-4c28-b6cc-b27dc62684df"),
                            PasswordHash = "$2a$11$KqE5dEUpwM1gV6l3UBT3euaWU9DWR/4GPtuaddS/7rO/JMU9raFbO",
                            RoleId = new Guid("60782519-2571-4153-9010-312463165300"),
                            UpperCaseUsername = "ADMIN",
                            Username = "admin"
                        });
                });

            modelBuilder.Entity("Monitoring.Core.Domain.UserLogManagement.UserLog", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AssetId")
                        .HasColumnType("uuid");

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

                    b.Property<string>("Information")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("AssetId");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("UserId");

                    b.ToTable("UserLogs");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.UserSettingsManagement.UserSettings", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid?>("AssetGroupId")
                        .HasColumnType("uuid");

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

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

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

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

                    b.ToTable("UserSettings");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Zone", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<Guid>("AreaId")
                        .HasColumnType("uuid");

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

                    b.Property<int>("Index")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0);

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

                    b.HasKey("Id");

                    b.HasIndex("AreaId", "Index")
                        .IsUnique();

                    b.ToTable("Zones");
                });

            modelBuilder.Entity("AssetAssetGroup", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", null)
                        .WithMany()
                        .HasForeignKey("AssetsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", null)
                        .WithMany()
                        .HasForeignKey("GroupsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Access", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", "AssetGroup")
                        .WithMany("Accesses")
                        .HasForeignKey("AssetGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.Member", "Member")
                        .WithMany("Accesses")
                        .HasForeignKey("MemberId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AssetGroup");

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

            modelBuilder.Entity("Monitoring.Core.Domain.AlarmResetComment", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.OrganizationManagement.Organization", "Organization")
                        .WithMany("AlarmResetComments")
                        .HasForeignKey("OrganizationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.AlarmResetCommentTranslate", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AlarmResetComment", "Comment")
                        .WithMany("Translates")
                        .HasForeignKey("CommentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.Area", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("Areas")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.OrganizationManagement.Organization", "Organization")
                        .WithMany("AssetGroups")
                        .HasForeignKey("OrganizationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", "Parent")
                        .WithMany("Children")
                        .HasForeignKey("ParentId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Organization");

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

            modelBuilder.Entity("Monitoring.Core.Domain.AssetManagement.Asset", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.OrganizationManagement.Organization", "Organization")
                        .WithMany("Assets")
                        .HasForeignKey("OrganizationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.ServiceOrganizationManagement.ServiceOrganization", "ServiceOrganization")
                        .WithMany("Assets")
                        .HasForeignKey("ServiceOrganizationId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Organization");

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

            modelBuilder.Entity("Monitoring.Core.Domain.AssetStatus.AssetStatus", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", null)
                        .WithMany()
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CallManagement.Call", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Alarm", "Alarm")
                        .WithMany()
                        .HasForeignKey("AlarmId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "Caller")
                        .WithMany()
                        .HasForeignKey("CallerId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.ResponsiblePerson", "ResponsiblePerson")
                        .WithMany()
                        .HasForeignKey("ResponsiblePersonId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Alarm");

                    b.Navigation("Caller");

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

            modelBuilder.Entity("Monitoring.Core.Domain.CameraManagement.Camera", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany()
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.CameraManagement.CameraView", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Alarm", "Alarm")
                        .WithMany()
                        .HasForeignKey("AlarmId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.CameraManagement.Camera", "Camera")
                        .WithMany()
                        .HasForeignKey("CameraId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Alarm");

                    b.Navigation("Camera");

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

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckList", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.AlarmScope", "AlarmScope")
                        .WithMany("CheckLists")
                        .HasForeignKey("AlarmScopeId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.CheckListManagement.CheckListTemplate", "Template")
                        .WithMany()
                        .HasForeignKey("TemplateId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("AlarmScope");

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

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListItem", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.CheckListManagement.CheckList", "CheckList")
                        .WithMany("Items")
                        .HasForeignKey("CheckListId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItem", "Template")
                        .WithMany()
                        .HasForeignKey("TemplateId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("CheckList");

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

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItem", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.CheckListManagement.CheckListTemplate", "CheckListTemplate")
                        .WithMany("Items")
                        .HasForeignKey("CheckListTemplateId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItemTranslation", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItem", "Item")
                        .WithMany("Translations")
                        .HasForeignKey("ItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Alarm", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Event", "Event")
                        .WithMany("Alarms")
                        .HasForeignKey("EventId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.EventManagement.AlarmScope", "Scope")
                        .WithMany("Alarms")
                        .HasForeignKey("ScopeId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("Monitoring.Core.Domain.Zone", "Zone")
                        .WithMany("Alarms")
                        .HasForeignKey("ZoneId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Event");

                    b.Navigation("Scope");

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmReset", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Alarm", "Alarm")
                        .WithMany()
                        .HasForeignKey("AlarmId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "ResetBy")
                        .WithMany()
                        .HasForeignKey("ResetById")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Alarm");

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmScope", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("AlarmScopes")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmScopeStatusChanging", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.AlarmScope", "AlarmScope")
                        .WithMany("StatusHistory")
                        .HasForeignKey("AlarmScopeId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("AlarmScope");

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Event", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("Events")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.EventManagement.EventCode", "Code")
                        .WithMany()
                        .HasForeignKey("CodeId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", null)
                        .WithMany("Events")
                        .HasForeignKey("UserId");

                    b.Navigation("Asset");

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Fault", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Event", "Event")
                        .WithMany("Faults")
                        .HasForeignKey("EventId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.Zone", "Zone")
                        .WithMany("Faults")
                        .HasForeignKey("ZoneId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Event");

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

            modelBuilder.Entity("Monitoring.Core.Domain.FireDepartmentManagement.AlarmFireDepartmentDispatch", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.EventManagement.Alarm", "Alarm")
                        .WithMany()
                        .HasForeignKey("AlarmId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "Sender")
                        .WithMany()
                        .HasForeignKey("SenderId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Alarm");

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

            modelBuilder.Entity("Monitoring.Core.Domain.FireDepartmentManagement.FireDepartmentAccess", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.FireDepartmentManagement.FireDepartment", "Department")
                        .WithMany()
                        .HasForeignKey("DepartmentId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Department");

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

            modelBuilder.Entity("Monitoring.Core.Domain.LockedEventCode", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany()
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.EventManagement.EventCode", "EventCode")
                        .WithMany()
                        .HasForeignKey("EventCodeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Asset");

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

            modelBuilder.Entity("Monitoring.Core.Domain.Member", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.OrganizationManagement.Organization", "Organization")
                        .WithMany("Members")
                        .HasForeignKey("OrganizationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany("Members")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Organization");

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

            modelBuilder.Entity("Monitoring.Core.Domain.Photo", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("Photos")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.RefreshToken", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany("RefreshTokens")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.ReportManagement.Report", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany("Reports")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.ResponsiblePerson", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("ResponsiblePersons")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.ServiceOrganizationManagement.ServiceOrganization", b =>
                {
                    b.OwnsOne("Monitoring.Core.Domain.ServiceOrganizationManagement.ServiceOrganizationName", "Name", b1 =>
                        {
                            b1.Property<Guid>("ServiceOrganizationId")
                                .HasColumnType("uuid");

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

                            b1.HasKey("ServiceOrganizationId");

                            b1.HasIndex("Value")
                                .IsUnique();

                            b1.ToTable("ServiceOrganizations");

                            b1.WithOwner()
                                .HasForeignKey("ServiceOrganizationId");
                        });

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

            modelBuilder.Entity("Monitoring.Core.Domain.TokenManagement.Token", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.OrganizationManagement.Organization", "Organization")
                        .WithMany("Tokens")
                        .HasForeignKey("OrganizationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.User", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.Role", "Role")
                        .WithMany("Users")
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.UserLogManagement.UserLog", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.AssetManagement.Asset", "Asset")
                        .WithMany("Logs")
                        .HasForeignKey("AssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Monitoring.Core.Domain.User", "User")
                        .WithMany("Logs")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Asset");

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

            modelBuilder.Entity("Monitoring.Core.Domain.UserSettingsManagement.UserSettings", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.User", null)
                        .WithOne()
                        .HasForeignKey("Monitoring.Core.Domain.UserSettingsManagement.UserSettings", "UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsOne("Monitoring.Core.Domain.UserSettingsManagement.ManualPosition", "ManualPosition", b1 =>
                        {
                            b1.Property<Guid>("UserSettingsId")
                                .HasColumnType("uuid");

                            b1.Property<double>("Latitude")
                                .HasColumnType("double precision")
                                .HasColumnName("ManualLatitude");

                            b1.Property<double>("Longitude")
                                .HasColumnType("double precision")
                                .HasColumnName("ManualLongitude");

                            b1.HasKey("UserSettingsId");

                            b1.ToTable("UserSettings");

                            b1.WithOwner()
                                .HasForeignKey("UserSettingsId");
                        });

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

            modelBuilder.Entity("Monitoring.Core.Domain.Zone", b =>
                {
                    b.HasOne("Monitoring.Core.Domain.Area", "Area")
                        .WithMany("Zones")
                        .HasForeignKey("AreaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Monitoring.Core.Domain.AlarmResetComment", b =>
                {
                    b.Navigation("Translates");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.Area", b =>
                {
                    b.Navigation("Zones");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.AssetGroupManagement.AssetGroup", b =>
                {
                    b.Navigation("Accesses");

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

            modelBuilder.Entity("Monitoring.Core.Domain.AssetManagement.Asset", b =>
                {
                    b.Navigation("AlarmScopes");

                    b.Navigation("Areas");

                    b.Navigation("Events");

                    b.Navigation("Logs");

                    b.Navigation("Photos");

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

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckList", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplate", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.CheckListManagement.CheckListTemplateItem", b =>
                {
                    b.Navigation("Translations");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.AlarmScope", b =>
                {
                    b.Navigation("Alarms");

                    b.Navigation("CheckLists");

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

            modelBuilder.Entity("Monitoring.Core.Domain.EventManagement.Event", b =>
                {
                    b.Navigation("Alarms");

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

            modelBuilder.Entity("Monitoring.Core.Domain.Member", b =>
                {
                    b.Navigation("Accesses");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.OrganizationManagement.Organization", b =>
                {
                    b.Navigation("AlarmResetComments");

                    b.Navigation("AssetGroups");

                    b.Navigation("Assets");

                    b.Navigation("Members");

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

            modelBuilder.Entity("Monitoring.Core.Domain.Role", b =>
                {
                    b.Navigation("Users");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.ServiceOrganizationManagement.ServiceOrganization", b =>
                {
                    b.Navigation("Assets");
                });

            modelBuilder.Entity("Monitoring.Core.Domain.User", b =>
                {
                    b.Navigation("Events");

                    b.Navigation("Logs");

                    b.Navigation("Members");

                    b.Navigation("RefreshTokens");

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

            modelBuilder.Entity("Monitoring.Core.Domain.Zone", b =>
                {
                    b.Navigation("Alarms");

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