- Introduced a new migration that creates the CheckInJobStatuses table. - The table includes fields for tracking job statuses, timestamps, user information, and error messages. - Supports various statuses such as PENDING, PROCESSING, COMPLETED, and FAILED.
63 lines
1.7 KiB
C#
63 lines
1.7 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 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;
|
|
}
|
|
}
|
|
}
|