Add LeaveCount column to LeaveBeginnings table
- Introduced a new column 'LeaveCount' of type int to the LeaveBeginnings table. - Set default value to 0 and added a comment for clarity in Thai: "จำนวนครั้งที่ลาสะสม".
This commit is contained in:
parent
358fd47b99
commit
639d41649c
6 changed files with 1752 additions and 0 deletions
|
|
@ -30,6 +30,9 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
|||
[Required, Comment("จำนวนวันลาที่ใช้ไป")]
|
||||
public double LeaveDaysUsed { get; set; } = 0.0;
|
||||
|
||||
[Comment("จำนวนครั้งที่ลาสะสม")]
|
||||
public int LeaveCount { get; set; } = 0;
|
||||
|
||||
public Guid? RootDnaId { get; set; }
|
||||
|
||||
public Guid? Child1DnaId { get; set; }
|
||||
|
|
|
|||
1709
BMA.EHR.Infrastructure/Migrations/LeaveDb/20260205034753_Add LeaveCount to LeaveBeginning.Designer.cs
generated
Normal file
1709
BMA.EHR.Infrastructure/Migrations/LeaveDb/20260205034753_Add LeaveCount to LeaveBeginning.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddLeaveCounttoLeaveBeginning : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "LeaveCount",
|
||||
table: "LeaveBeginnings",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
comment: "จำนวนครั้งที่ลาสะสม");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LeaveCount",
|
||||
table: "LeaveBeginnings");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -184,6 +184,10 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<int>("LeaveCount")
|
||||
.HasColumnType("int")
|
||||
.HasComment("จำนวนครั้งที่ลาสะสม");
|
||||
|
||||
b.Property<double>("LeaveDays")
|
||||
.HasColumnType("double")
|
||||
.HasComment("จำนวนวันลายกมา");
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
item.LeaveYear,
|
||||
item.LeaveDays,
|
||||
item.LeaveDaysUsed,
|
||||
item.LeaveCount,
|
||||
item.CreatedAt,
|
||||
item.CreatedFullName,
|
||||
item.LastUpdatedAt,
|
||||
|
|
@ -394,6 +395,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveBeginning.LeaveYear = req.LeaveYear;
|
||||
leaveBeginning.LeaveDays = req.LeaveDays;
|
||||
leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed;
|
||||
leaveBeginning.LeaveCount = req.LeaveCount;
|
||||
|
||||
leaveBeginning.ProfileId = req.ProfileId;
|
||||
leaveBeginning.Prefix = profile.Prefix;
|
||||
|
|
@ -462,6 +464,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveBeginning.LeaveYear = req.LeaveYear;
|
||||
leaveBeginning.LeaveDays = req.LeaveDays;
|
||||
leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed;
|
||||
leaveBeginning.LeaveCount = req.LeaveCount;
|
||||
|
||||
leaveBeginning.ProfileId = req.ProfileId;
|
||||
leaveBeginning.Prefix = profile.Prefix;
|
||||
|
|
|
|||
|
|
@ -19,5 +19,8 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveBeginnings
|
|||
|
||||
[Required, Comment("จำนวนวันลาที่ใช้ไป")]
|
||||
public double LeaveDaysUsed { get; set; } = 0.0;
|
||||
|
||||
[Required, Comment("จำนวนครั้งที่ลาสะสม")]
|
||||
public int LeaveCount { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue