Add Migration For Reward checkout

This commit is contained in:
2026-01-24 16:58:45 +03:30
parent 1257e15b62
commit 69f4819bf6
3 changed files with 11678 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddRewardtocheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<double>(
name: "RewardPay",
table: "Checkouts",
type: "float",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(double),
oldType: "float",
oldNullable: true);
migrationBuilder.CreateTable(
name: "CheckoutReward",
columns: table => new
{
Checkoutid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Amount = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
AmountDouble = table.Column<double>(type: "float", nullable: false),
GrantDateFa = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
GrantDateGr = table.Column<DateTime>(type: "datetime2", nullable: false),
Description = table.Column<string>(type: "ntext", nullable: true),
Title = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
EntityId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutReward", x => new { x.Checkoutid, x.Id });
table.ForeignKey(
name: "FK_CheckoutReward_Checkouts_Checkoutid",
column: x => x.Checkoutid,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutReward");
migrationBuilder.AlterColumn<double>(
name: "RewardPay",
table: "Checkouts",
type: "float",
nullable: true,
oldClrType: typeof(double),
oldType: "float");
}
}
}

View File

@@ -635,7 +635,7 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<double?>("RewardPay")
b.Property<double>("RewardPay")
.HasColumnType("float");
b.Property<string>("RotatingShiftValue")
@@ -7501,6 +7501,49 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("Checkoutid");
});
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutReward", "Rewards", b1 =>
{
b1.Property<long>("Checkoutid")
.HasColumnType("bigint");
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
b1.Property<string>("Amount")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b1.Property<double>("AmountDouble")
.HasColumnType("float");
b1.Property<string>("Description")
.HasColumnType("ntext");
b1.Property<long>("EntityId")
.HasColumnType("bigint");
b1.Property<string>("GrantDateFa")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b1.Property<DateTime>("GrantDateGr")
.HasColumnType("datetime2");
b1.Property<string>("Title")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)");
b1.HasKey("Checkoutid", "Id");
b1.ToTable("CheckoutReward");
b1.WithOwner()
.HasForeignKey("Checkoutid");
});
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
{
b1.Property<long>("Checkoutid")
@@ -7545,6 +7588,8 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("LoanInstallments");
b.Navigation("Rewards");
b.Navigation("SalaryAids");
b.Navigation("Workshop");