Merge branch 'release/EditingDatabase'

This commit is contained in:
2025-10-10 10:46:02 +02:00
35 changed files with 2497 additions and 7 deletions

View File

@@ -0,0 +1,27 @@
namespace PyroFetes.DTO.Price.Request;
public class CreatePriceDto
{
public decimal SellingPrice { get; set; }
public int SupplierId { get; set; }
public string? SupplierName { get; set; }
public string? SupplierEmail { get; set; }
public string? SupplierPhone { get; set; }
public string? SupplierAddress { get; set; }
public int SupplierZipCode { get; set; }
public string? SupplierCity { get; set; }
public int SupplierDeliveryDelay { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Price.Request;
public class PatchPriceSellingPriceDto
{
public int Id { get; set; }
public decimal SellingPrice { get; set; }
}

View File

@@ -0,0 +1,28 @@
namespace PyroFetes.DTO.Price.Request;
public class UpdatePriceDto
{
public int Id { get; set; }
public decimal SellingPrice { get; set; }
public int SupplierId { get; set; }
public string? SupplierName { get; set; }
public string? SupplierEmail { get; set; }
public string? SupplierPhone { get; set; }
public string? SupplierAddress { get; set; }
public int SupplierZipCode { get; set; }
public string? SupplierCity { get; set; }
public int SupplierDeliveryDelay { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,28 @@
namespace PyroFetes.DTO.Price.Response;
public class GetPriceDto
{
public int Id { get; set; }
public decimal SellingPrice { get; set; }
public int SupplierId { get; set; }
public string? SupplierName { get; set; }
public string? SupplierEmail { get; set; }
public string? SupplierPhone { get; set; }
public string? SupplierAddress { get; set; }
public int SupplierZipCode { get; set; }
public string? SupplierCity { get; set; }
public int SupplierDeliveryDelay { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,15 @@
namespace PyroFetes.DTO.Product.Request;
public class CreateProductDto
{
public int References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Product.Request;
public class PatchProductMinimalStockDto
{
public int Id { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace PyroFetes.DTO.Product.Request;
public class UpdateProductDto
{
public int Id { get; set; }
public int References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace PyroFetes.DTO.Product.Response;
public class GetProductDto
{
public int Id { get; set; }
public int References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,22 @@
namespace PyroFetes.DTO.PurchaseProduct.Request;
public class CreatePurchaseProductDto
{
public int Quantity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
public int PurchaseOrderId { get; set; }
public string? PurchaseOrderPurchaseConditions { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.PurchaseProduct.Request;
public class PatchPurchaseProductQuantityDto
{
public int Id { get; set; }
public int Quantity { get; set; }
}

View File

@@ -0,0 +1,23 @@
namespace PyroFetes.DTO.PurchaseProduct.Request;
public class UpdatePurchaseProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
public int PurchaseOrderId { get; set; }
public string? PurchaseOrderPurchaseConditions { get; set; }
}

View File

@@ -0,0 +1,24 @@
namespace PyroFetes.DTO.PurchaseProduct.Response;
public class GetPurchaseProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public decimal ProductSellingPrice { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
public int PurchaseOrderId { get; set; }
public string? PurchaseOrderPurchaseConditions { get; set; }
}

View File

@@ -0,0 +1,22 @@
namespace PyroFetes.DTO.QuotationProduct.Request;
public class CreateQuotationProductDto
{
public int Quantity { get; set; }
public int QuotationId { get; set; }
public string? QuotationMessage { get; set; }
public string? QuotationConditionsSale { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.QuotationProduct.Request;
public class PatchQuotationProductQuantityDto
{
public int Id { get; set; }
public int Quantity { get; set; }
}

View File

@@ -0,0 +1,23 @@
namespace PyroFetes.DTO.QuotationProduct.Request;
public class UpdateQuotationProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int QuotationId { get; set; }
public string? QuotationMessage { get; set; }
public string? QuotationConditionsSale { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,23 @@
namespace PyroFetes.DTO.QuotationProduct.Response;
public class GetQuotationProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int QuotationId { get; set; }
public string? QuotationMessage { get; set; }
public string? QuotationConditionsSale { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class CreateSettingDto
{
public string? ElectronicSignature { get; set; }
public string? Logo { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class PatchSettingElectronicSignatureDto
{
public int Id { get; set; }
public string? ElectronicSignature { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class PatchSettingLogoDto
{
public int Id { get; set; }
public string? Logo { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace PyroFetes.DTO.SettingDTO.Response;
public class GetSettingDto
{
public int Id { get; set; }
public string? ElectronicSignature { get; set; }
public string? Logo { get; set; }
}

View File

@@ -0,0 +1,12 @@
namespace PyroFetes.DTO.Supplier.Request;
public class CreateSupplierDto
{
public string? Name { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string? Address { get; set; }
public int ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Supplier.Request;
public class PatchSupplierDeliveryDelayDto
{
public int Id { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace PyroFetes.DTO.Supplier.Request;
public class UpdateSupplierDto
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string? Address { get; set; }
public int ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace PyroFetes.DTO.Supplier.Response;
public class GetSupplierDto
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string? Address { get; set; }
public int ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace PyroFetes.DTO.User.Request;
public class CreateUserDto
{
public string? Name { get; set; }
public string? Password { get; set; }
public string? Salt { get; set; }
public string? Fonction { get; set; }
public string? Email { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace PyroFetes.DTO.User.Request;
public class UpdateUserDto
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Password { get; set; }
public string? Fonction { get; set; }
public string? Email { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace PyroFetes.DTO.User.Response;
public class GetUserDto
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Password { get; set; }
public string? Salt { get; set; }
public string? Fonction { get; set; }
public string? Email { get; set; }
}

View File

@@ -0,0 +1,27 @@
namespace PyroFetes.DTO.WareHouseProduct.Request;
public class CreateWareHouseProductDto
{
public int Quantity { get; set; }
public int WareHouseId { get; set; }
public string? WareHouseName {get; set;}
public int WareHouseMaxWeight {get; set;}
public int WareHouseCurrent {get; set;}
public int WareHouseMinWeight {get; set;}
public string? WareHouseAddress { get; set; }
public int WareHouseZipCode { get; set; }
public string? WareHouseCity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.WareHouseProduct.Request;
public class PatchWareHouseProductQuantityDto
{
public int Id { get; set; }
public int Quantity { get; set; }
}

View File

@@ -0,0 +1,28 @@
namespace PyroFetes.DTO.WareHouseProduct.Request;
public class UpdateWareHouseProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int WareHouseId { get; set; }
public string? WareHouseName {get; set;}
public int WareHouseMaxWeight {get; set;}
public int WareHouseCurrent {get; set;}
public int WareHouseMinWeight {get; set;}
public string? WareHouseAddress { get; set; }
public int WareHouseZipCode { get; set; }
public string? WareHouseCity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,28 @@
namespace PyroFetes.DTO.WareHouseProduct.Response;
public class GetWareHouseProductDto
{
public int Id { get; set; }
public int Quantity { get; set; }
public int WareHouseId { get; set; }
public string? WareHouseName {get; set;}
public int WareHouseMaxWeight {get; set;}
public int WareHouseCurrent {get; set;}
public int WareHouseMinWeight {get; set;}
public string? WareHouseAddress { get; set; }
public int WareHouseZipCode { get; set; }
public string? WareHouseCity { get; set; }
public int ProductId { get; set; }
public int ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class FixingDatabase : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "References",
table: "Products");
migrationBuilder.DropColumn(
name: "SellingPrice",
table: "Products");
migrationBuilder.AddColumn<string>(
name: "Reference",
table: "Products",
type: "nvarchar(20)",
maxLength: 20,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Reference",
table: "Products");
migrationBuilder.AddColumn<int>(
name: "References",
table: "Products",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<decimal>(
name: "SellingPrice",
table: "Products",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
}
}
}

View File

@@ -541,11 +541,10 @@ namespace PyroFetes.Migrations
b.Property<int>("ProductCategoryId") b.Property<int>("ProductCategoryId")
.HasColumnType("int"); .HasColumnType("int");
b.Property<int>("References") b.Property<string>("Reference")
.HasColumnType("int"); .IsRequired()
.HasMaxLength(20)
b.Property<decimal>("SellingPrice") .HasColumnType("nvarchar(20)");
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Weight") b.Property<decimal>("Weight")
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");

View File

@@ -5,14 +5,13 @@ namespace PyroFetes.Models
public class Product public class Product
{ {
[Key] public int Id { get; set; } [Key] public int Id { get; set; }
[Required] public int References { get; set; } [Required, MaxLength(20)] public string? Reference { get; set; }
[Required, MaxLength(100)] public string? Name { get; set; } [Required, MaxLength(100)] public string? Name { get; set; }
[Required] public decimal Duration {get; set;} [Required] public decimal Duration {get; set;}
[Required] public decimal Caliber { get; set; } [Required] public decimal Caliber { get; set; }
[Required] public int ApprovalNumber { get; set; } [Required] public int ApprovalNumber { get; set; }
[Required] public decimal Weight { get; set; } [Required] public decimal Weight { get; set; }
[Required] public decimal Nec { get; set; } [Required] public decimal Nec { get; set; }
[Required] public decimal SellingPrice { get; set; }
[Required] public string? Image { get; set; } [Required] public string? Image { get; set; }
[Required, MaxLength(200)] public string? Link { get; set; } [Required, MaxLength(200)] public string? Link { get; set; }
[Required] public int MinimalQuantity { get; set; } [Required] public int MinimalQuantity { get; set; }