Files
CartriX/CartriX.Api/Migrations/20260530090239_Init1.Designer.cs
T
Hukuta 0106a85570 Добавил библеотеку для создание росписи
Добавил страницу по замене картриджа

Создал новую сущность базы данных, ReqeustToReplace

Сделал маршрут для генерации документа, и его установки

Отредактировал контекст базы данных
2026-05-30 18:52:03 +09:00

589 lines
20 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// <auto-generated />
using System;
using CartriX.Api;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CartriX.Api.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260530090239_Init1")]
partial class Init1
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.7");
modelBuilder.Entity("ArticleCartridgeModel", b =>
{
b.Property<int>("SupportedArticlesId")
.HasColumnType("INTEGER");
b.Property<int>("SupportedCartridgeModelsId")
.HasColumnType("INTEGER");
b.HasKey("SupportedArticlesId", "SupportedCartridgeModelsId");
b.HasIndex("SupportedCartridgeModelsId");
b.ToTable("ArticleCartridgeModel");
});
modelBuilder.Entity("CartriX.Api.Entities.Article", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Articles");
});
modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("CountPrinted")
.HasColumnType("INTEGER");
b.Property<DateOnly?>("DateLastFilling")
.HasColumnType("TEXT");
b.Property<int?>("InstalledInPrinterId")
.HasColumnType("INTEGER");
b.Property<int>("ModelId")
.HasColumnType("INTEGER");
b.Property<int>("StatusId")
.HasColumnType("INTEGER");
b.Property<int>("Volume")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("InstalledInPrinterId")
.IsUnique();
b.HasIndex("ModelId");
b.HasIndex("StatusId");
b.ToTable("Cartridges");
});
modelBuilder.Entity("CartriX.Api.Entities.CartridgeModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ManufacturerId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ManufacturerId");
b.ToTable("CartridgeModels");
});
modelBuilder.Entity("CartriX.Api.Entities.CartridgeStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("CartridgeStatuses");
b.HasData(
new
{
Id = 1,
Name = "Установлен"
},
new
{
Id = 2,
Name = "На склаже"
},
new
{
Id = 3,
Name = "На заправке"
},
new
{
Id = 4,
Name = "В очереди на заправку"
},
new
{
Id = 5,
Name = "В ремонте"
});
});
modelBuilder.Entity("CartriX.Api.Entities.CauseFoReplace", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("CausesFoReplace");
b.HasData(
new
{
Id = 1,
Description = "Картридж истратил свой тоннер и требует заправки.",
Name = "Закончился"
},
new
{
Id = 2,
Description = "Картридж работает не корректно, оставляет полосы на распечатанной бумаге. \nТребуется диагностика.",
Name = "Полосит"
},
new
{
Id = 3,
Description = "Картридж работает не корректно, тоннер наноситься на бумагу бледно. \nТребуется диагностика.",
Name = "Бледнит>"
});
});
modelBuilder.Entity("CartriX.Api.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Locations");
});
modelBuilder.Entity("CartriX.Api.Entities.Manufacturer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("picturePath")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Manufacturers");
b.HasData(
new
{
Id = 1,
Name = "Неизвестен"
});
});
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("CountPrintedAllTime")
.HasColumnType("INTEGER");
b.Property<string>("IpAddressOrHostname")
.HasColumnType("TEXT");
b.Property<int>("LocationId")
.HasColumnType("INTEGER");
b.Property<int>("ModelId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OidForQueryCountPrintedAllTime")
.HasColumnType("TEXT");
b.Property<int>("PrintTypeId")
.HasColumnType("INTEGER");
b.Property<int>("PrinterConnetctionTypeId")
.HasColumnType("INTEGER");
b.Property<int>("PrinterStatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("LocationId");
b.HasIndex("ModelId");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("PrintTypeId");
b.HasIndex("PrinterConnetctionTypeId");
b.HasIndex("PrinterStatusId");
b.ToTable("Printers");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterConnetctionType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterConnetctionTypes");
b.HasData(
new
{
Id = 1,
Name = "Сетевой"
},
new
{
Id = 2,
Name = "USB"
});
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ManufacturerId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("SupportedArticleId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ManufacturerId");
b.HasIndex("SupportedArticleId")
.IsUnique();
b.ToTable("PrinterModels");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterPrintType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterPrintTypes");
b.HasData(
new
{
Id = 1,
Name = "Лазерный"
},
new
{
Id = 2,
Name = "Струйный"
});
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterStatus", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterStatuses");
b.HasData(
new
{
Id = 1,
Name = "Активный"
},
new
{
Id = 2,
Name = "Недоступен"
},
new
{
Id = 3,
Name = "В ремонте"
});
});
modelBuilder.Entity("CartriX.Api.Entities.RequestToReplaceCartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Applocant")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("CartridgeInfo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("CauseId")
.HasColumnType("INTEGER");
b.Property<int?>("CountCartridgePrinted")
.HasColumnType("INTEGER");
b.Property<DateOnly?>("DateAnswerRequest")
.HasColumnType("TEXT");
b.Property<DateOnly>("DateCreateRequest")
.HasColumnType("TEXT");
b.Property<string>("Executor")
.HasColumnType("TEXT");
b.Property<string>("LocationName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PrinterInfo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ReplacedCartridgeId")
.HasColumnType("INTEGER");
b.Property<string>("SignatureBase64Data")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CauseId");
b.ToTable("RequestsToReplaceCartridge");
});
modelBuilder.Entity("ArticleCartridgeModel", b =>
{
b.HasOne("CartriX.Api.Entities.Article", null)
.WithMany()
.HasForeignKey("SupportedArticlesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.CartridgeModel", null)
.WithMany()
.HasForeignKey("SupportedCartridgeModelsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b =>
{
b.HasOne("CartriX.Api.Entities.Printer", "InstalledInPrinter")
.WithOne("InstalledCartridge")
.HasForeignKey("CartriX.Api.Entities.Cartridge", "InstalledInPrinterId");
b.HasOne("CartriX.Api.Entities.CartridgeModel", "Model")
.WithMany()
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.CartridgeStatus", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InstalledInPrinter");
b.Navigation("Model");
b.Navigation("Status");
});
modelBuilder.Entity("CartriX.Api.Entities.CartridgeModel", b =>
{
b.HasOne("CartriX.Api.Entities.Manufacturer", "Manufacturer")
.WithMany()
.HasForeignKey("ManufacturerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manufacturer");
});
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
{
b.HasOne("CartriX.Api.Entities.Location", "Location")
.WithMany("Printers")
.HasForeignKey("LocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.PrinterModel", "Model")
.WithMany()
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.PrinterPrintType", "PrintType")
.WithMany()
.HasForeignKey("PrintTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.PrinterConnetctionType", "ConnetctionType")
.WithMany()
.HasForeignKey("PrinterConnetctionTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.PrinterStatus", "Status")
.WithMany()
.HasForeignKey("PrinterStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ConnetctionType");
b.Navigation("Location");
b.Navigation("Model");
b.Navigation("PrintType");
b.Navigation("Status");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b =>
{
b.HasOne("CartriX.Api.Entities.Manufacturer", "Manufacturer")
.WithMany()
.HasForeignKey("ManufacturerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.Article", "SupportedArticle")
.WithOne("SupportedPrinterModel")
.HasForeignKey("CartriX.Api.Entities.PrinterModel", "SupportedArticleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manufacturer");
b.Navigation("SupportedArticle");
});
modelBuilder.Entity("CartriX.Api.Entities.RequestToReplaceCartridge", b =>
{
b.HasOne("CartriX.Api.Entities.CauseFoReplace", "Cause")
.WithMany()
.HasForeignKey("CauseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Cause");
});
modelBuilder.Entity("CartriX.Api.Entities.Article", b =>
{
b.Navigation("SupportedPrinterModel");
});
modelBuilder.Entity("CartriX.Api.Entities.Location", b =>
{
b.Navigation("Printers");
});
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
{
b.Navigation("InstalledCartridge");
});
#pragma warning restore 612, 618
}
}
}