compute insuranceEmployeeShare on checkout

This commit is contained in:
SamSys
2025-10-27 16:41:02 +03:30
parent 280db87408
commit 3d013cfa60
9 changed files with 11281 additions and 15 deletions

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class hasInsuranceShareTheSameAsList_checkoutTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "HasInsuranceShareTheSameAsList",
table: "Checkouts",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "HasInsuranceShareTheSameAsList",
table: "Checkouts");
}
}
}

View File

@@ -415,6 +415,9 @@ namespace CompanyManagment.EFCore.Migrations
b.Property<bool>("HasAmountConflict")
.HasColumnType("bit");
b.Property<bool>("HasInsuranceShareTheSameAsList")
.HasColumnType("bit");
b.Property<bool>("HasRollCall")
.HasColumnType("bit");

View File

@@ -524,6 +524,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
entity.SetCheckoutRollCall(command.CheckoutRollCall);
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
if(command.HasInsuranceShareTheSameAsList)
entity.SetInsuranceShare();
await _context.SaveChangesAsync();
}