Fix Type errors

This commit is contained in:
Cristiano
2025-11-20 16:45:44 +01:00
parent 3ad506f869
commit d537051bea
8 changed files with 2053 additions and 16 deletions

View File

@@ -17,8 +17,8 @@ public class CreatePriceDto
public string? ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public decimal ProductCaliber { get; set; }
public int ProductApprovalNumber { get; set; }
public int ProductCaliber { get; set; }
public string? ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }

View File

@@ -5,8 +5,8 @@ public class CreateProductDto
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }

View File

@@ -6,8 +6,8 @@ public class UpdateProductDto
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }

View File

@@ -6,8 +6,8 @@ public class GetProductDto
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public decimal Caliber { get; set; }
public int ApprovalNumber { get; set; }
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class FixTypeErrors : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Suppliers",
type: "nvarchar(5)",
maxLength: 5,
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "Caliber",
table: "Products",
type: "int",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<string>(
name: "ApprovalNumber",
table: "Products",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ZipCode",
table: "Suppliers",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(5)",
oldMaxLength: 5);
migrationBuilder.AlterColumn<decimal>(
name: "Caliber",
table: "Products",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "ApprovalNumber",
table: "Products",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
}
}
}

View File

@@ -503,11 +503,12 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ApprovalNumber")
.HasColumnType("int");
b.Property<string>("ApprovalNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Caliber")
.HasColumnType("decimal(18,2)");
b.Property<int>("Caliber")
.HasColumnType("int");
b.Property<int>("ClassificationId")
.HasColumnType("int");
@@ -1113,8 +1114,10 @@ namespace PyroFetes.Migrations
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.HasKey("Id");

View File

@@ -8,8 +8,8 @@ namespace PyroFetes.Models
[Required, MaxLength(20)] public string? Reference { get; set; }
[Required, MaxLength(100)] public string? Name { get; set; }
[Required] public decimal Duration {get; set;}
[Required] public decimal Caliber { get; set; }
[Required] public int ApprovalNumber { get; set; }
[Required] public int Caliber { get; set; }
[Required] public string? ApprovalNumber { get; set; }
[Required] public decimal Weight { get; set; }
[Required] public decimal Nec { get; set; }
[Required] public string? Image { get; set; }