hrms-api-backend/BMA.EHR.Infrastructure/Persistence/LeaveDbContext.cs
Suphonchai Phoonsawat c91e6c8030 Add migration for LeaveProcessJobStatuses table
- Created a new migration to add the LeaveProcessJobStatuses table.
- The table includes fields for job status, timestamps, user information, and error messages.
- Supports tracking of leave process job statuses with relevant metadata.
2026-03-30 09:23:13 +07:00

65 lines
1.8 KiB
C#

using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Domain.Models.Leave.Commons;
using BMA.EHR.Domain.Models.Leave.Requests;
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Infrastructure.Persistence
{
public class LeaveDbContext : DbContext, ILeaveDbContext
{
#region " Check-In "
public DbSet<DutyTime> DutyTimes { get; set; }
public DbSet<UserTimeStamp> UserTimeStamps { get; set; }
public DbSet<ProcessUserTimeStamp> ProcessUserTimeStamps { get; set; }
public DbSet<UserDutyTime> UserDutyTimes { get; set; }
public DbSet<AdditionalCheckRequest> AdditionalCheckRequests { get; set; }
public DbSet<UserCalendar> UserCalendars { get; set; }
public DbSet<CheckInJobStatus> CheckInJobStatuses { get; set; }
#endregion
#region " Leave System "
public DbSet<LeaveType> LeaveTypes { get; set; }
public DbSet<LeaveRequest> LeaveRequests { get; set; }
public DbSet<LeaveDocument> LeaveDocuments { get; set; }
public DbSet<LeaveBeginning> LeaveBeginnings { get; set; }
public DbSet<LeaveRequestApprover> LeaveRequestApprovers { get; set; }
#endregion
public DbSet<LeaveProcessJobStatus> LeaveProcessJobStatuses { get; set; }
public LeaveDbContext(DbContextOptions<LeaveDbContext> options) : base(options)
{
}
public Task<int> SaveChangesAsync()
{
return base.SaveChangesAsync();
}
public void Attatch<T>(T entity) where T : class
{
Attach(entity);
}
public void Detach<T>(T entity) where T : class
{
base.Entry(entity).State = EntityState.Detached;
}
}
}