Merge branch 'develop'

This commit is contained in:
Cristiano
2025-11-27 14:56:14 +01:00
10 changed files with 6038 additions and 10 deletions

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class UpdatedLengthOfPassword : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Password",
table: "Users",
type: "nvarchar(60)",
maxLength: 60,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Password",
table: "Users",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(60)",
oldMaxLength: 60);
}
}
}

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 FixZipCode : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Warehouses",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Suppliers",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(5)",
oldMaxLength: 5);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ZipCode",
table: "Warehouses",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Suppliers",
type: "nvarchar(5)",
maxLength: 5,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
}
}
}

View File

@@ -505,7 +505,8 @@ namespace PyroFetes.Migrations
b.Property<string>("ApprovalNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int>("Caliber")
.HasColumnType("int");
@@ -1116,8 +1117,7 @@ namespace PyroFetes.Migrations
b.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
@@ -1181,8 +1181,8 @@ namespace PyroFetes.Migrations
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b.Property<string>("Salt")
.IsRequired()
@@ -1226,8 +1226,9 @@ namespace PyroFetes.Migrations
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.Property<string>("ZipCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");

View File

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

View File

@@ -9,7 +9,7 @@ public class Supplier
[Required, MaxLength(100)] public string? Email { get; set; }
[Required, MaxLength(30)] public string? Phone { get; set; }
[Required, MaxLength(100)] public string? Address { get; set; }
[Required,MaxLength(5),MinLength(5)] public string? ZipCode { get; set; }
[Required,Length(5,5)] public string? ZipCode { get; set; }
[Required, MaxLength(100)] public string? City { get; set; }
[Required] public int DeliveryDelay { get; set; }

View File

@@ -10,7 +10,7 @@ public class Warehouse
[Required] public int Current {get; set;}
[Required] public int MinWeight {get; set;}
[Required, MaxLength(100)] public string? Address { get; set; }
[Required] public int ZipCode { get; set; }
[Required, Length(5,5)] public string? ZipCode { get; set; }
[Required, MaxLength(100)] public string? City { get; set; }
public List<WarehouseProduct>? WarehouseProducts { get; set; }