Merge branch 'develop' into working
# Conflicts: # BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs
This commit is contained in:
commit
37d9a5d7f5
61 changed files with 74888 additions and 80 deletions
|
|
@ -45,6 +45,9 @@ namespace BMA.EHR.Application
|
||||||
{
|
{
|
||||||
services.AddTransient<DutyTimeRepository>();
|
services.AddTransient<DutyTimeRepository>();
|
||||||
services.AddTransient<UserTimeStampRepository>();
|
services.AddTransient<UserTimeStampRepository>();
|
||||||
|
services.AddTransient<ProcessUserTimeStampRepository>();
|
||||||
|
services.AddTransient<UserDutyTimeRepository>();
|
||||||
|
services.AddTransient<AdditionalCheckRequestRepository>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
using BMA.EHR.Application.Common.Interfaces;
|
||||||
|
using BMA.EHR.Application.Messaging;
|
||||||
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
|
{
|
||||||
|
public class AdditionalCheckRequestRepository : GenericLeaveRepository<Guid, AdditionalCheckRequest>
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ILeaveDbContext _dbContext;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
private readonly OrganizationCommonRepository _organizationCommonRepository;
|
||||||
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
private readonly EmailSenderService _emailSenderService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destuctor "
|
||||||
|
|
||||||
|
public AdditionalCheckRequestRepository(ILeaveDbContext dbContext,
|
||||||
|
IHttpContextAccessor httpContextAccessor,
|
||||||
|
OrganizationCommonRepository organizationCommonRepository,
|
||||||
|
UserProfileRepository userProfileRepository,
|
||||||
|
IConfiguration configuration,
|
||||||
|
EmailSenderService emailSenderService) : base(dbContext, httpContextAccessor)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_organizationCommonRepository = organizationCommonRepository;
|
||||||
|
_userProfileRepository = userProfileRepository;
|
||||||
|
_configuration = configuration;
|
||||||
|
_emailSenderService = emailSenderService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
protected Guid UserOrganizationId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (UserId != null || UserId != "")
|
||||||
|
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
|
||||||
|
else
|
||||||
|
return Guid.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<List<AdditionalCheckRequest>> GetAdditionalCheckRequests(int year, int month)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<AdditionalCheckRequest>().AsQueryable()
|
||||||
|
.Where(x => (x.CheckDate.Year == year && x.CheckDate.Month == month))
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
using BMA.EHR.Application.Common.Interfaces;
|
||||||
|
using BMA.EHR.Application.Messaging;
|
||||||
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
|
{
|
||||||
|
public class ProcessUserTimeStampRepository : GenericLeaveRepository<Guid, ProcessUserTimeStamp>
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ILeaveDbContext _dbContext;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
private readonly OrganizationCommonRepository _organizationCommonRepository;
|
||||||
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
private readonly EmailSenderService _emailSenderService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destuctor "
|
||||||
|
|
||||||
|
public ProcessUserTimeStampRepository(ILeaveDbContext dbContext,
|
||||||
|
IHttpContextAccessor httpContextAccessor,
|
||||||
|
OrganizationCommonRepository organizationCommonRepository,
|
||||||
|
UserProfileRepository userProfileRepository,
|
||||||
|
IConfiguration configuration,
|
||||||
|
EmailSenderService emailSenderService) : base(dbContext, httpContextAccessor)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_organizationCommonRepository = organizationCommonRepository;
|
||||||
|
_userProfileRepository = userProfileRepository;
|
||||||
|
_configuration = configuration;
|
||||||
|
_emailSenderService = emailSenderService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
protected Guid UserOrganizationId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (UserId != null || UserId != "")
|
||||||
|
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
|
||||||
|
else
|
||||||
|
return Guid.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task Copy()
|
||||||
|
{
|
||||||
|
var userTimeStamps = await _dbContext.Set<UserTimeStamp>().ToListAsync();
|
||||||
|
|
||||||
|
foreach(var u in userTimeStamps)
|
||||||
|
{
|
||||||
|
var p = new ProcessUserTimeStamp
|
||||||
|
{
|
||||||
|
KeycloakUserId = u.KeycloakUserId,
|
||||||
|
CheckIn = u.CheckIn,
|
||||||
|
CheckInLat = u.CheckInLat,
|
||||||
|
CheckInLon = u.CheckInLon,
|
||||||
|
CheckInPOI = u.CheckInPOI,
|
||||||
|
CheckInImageUrl = u.CheckInImageUrl,
|
||||||
|
IsLocationCheckIn = u.IsLocationCheckIn,
|
||||||
|
CheckInLocationName = u.CheckInLocationName,
|
||||||
|
CheckInRemark = u.CheckInRemark,
|
||||||
|
|
||||||
|
CheckOut = u.CheckOut,
|
||||||
|
CheckOutLat = u.CheckOutLat,
|
||||||
|
CheckOutLon = u.CheckOutLon,
|
||||||
|
CheckOutPOI = u.CheckOutPOI,
|
||||||
|
CheckOutImageUrl = u.CheckOutImageUrl,
|
||||||
|
IsLocationCheckOut = u.IsLocationCheckOut,
|
||||||
|
CheckOutLocationName = u.CheckOutLocationName,
|
||||||
|
CheckOutRemark = u.CheckOutRemark,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
_dbContext.Set<ProcessUserTimeStamp>().Add(p);
|
||||||
|
}
|
||||||
|
await _dbContext.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<int> CountRecordAsync()
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>().CountAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ProcessUserTimeStamp?> GetTimestampByDateAsync(Guid keycloakId, DateTime date)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
|
.Where(u => u.CheckIn.Date == date.Date)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ProcessUserTimeStamp?> GetLastRecord(Guid keycloakId)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
|
.OrderByDescending(u => u.CheckIn)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryAsync(Guid keycloakId, int year, int page = 1, int pageSize = 10, string keyword = "")
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
|
.Where(u => u.CheckIn.Year == year)
|
||||||
|
.OrderBy(u => u.CheckIn)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<int> GetTimeStampHistoryForAdminCountAsync(DateTime startDate, DateTime endDate)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return data.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryForAdminAsync(DateTime startDate, DateTime endDate)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
|
||||||
|
.OrderBy(u => u.CheckIn)
|
||||||
|
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ProcessUserTimeStamp?> GetTimeStampById(Guid id)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.Id == id)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
using BMA.EHR.Application.Common.Interfaces;
|
||||||
|
using BMA.EHR.Application.Messaging;
|
||||||
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
|
{
|
||||||
|
public class UserDutyTimeRepository : GenericLeaveRepository<Guid, UserDutyTime>
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ILeaveDbContext _dbContext;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
private readonly OrganizationCommonRepository _organizationCommonRepository;
|
||||||
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
private readonly EmailSenderService _emailSenderService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destuctor "
|
||||||
|
|
||||||
|
public UserDutyTimeRepository(ILeaveDbContext dbContext,
|
||||||
|
IHttpContextAccessor httpContextAccessor,
|
||||||
|
OrganizationCommonRepository organizationCommonRepository,
|
||||||
|
UserProfileRepository userProfileRepository,
|
||||||
|
IConfiguration configuration,
|
||||||
|
EmailSenderService emailSenderService) : base(dbContext, httpContextAccessor)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_organizationCommonRepository = organizationCommonRepository;
|
||||||
|
_userProfileRepository = userProfileRepository;
|
||||||
|
_configuration = configuration;
|
||||||
|
_emailSenderService = emailSenderService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
protected Guid UserOrganizationId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (UserId != null || UserId != "")
|
||||||
|
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
|
||||||
|
else
|
||||||
|
return Guid.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public void UpdateUserDutyTime()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var data = _dbContext.Set<UserDutyTime>()
|
||||||
|
.Where(u => !u.IsProcess)
|
||||||
|
.Where(u => u.EffectiveDate.Value.Date <= DateTime.Now.Date)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var d in data)
|
||||||
|
{
|
||||||
|
var result = _userProfileRepository.UpdateDutyTimeAsync(d.ProfileId, d.DutyTimeId, d.EffectiveDate.Value.Date).Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<UserDutyTime>> GetListByProfileIdAsync(Guid profileId)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<UserDutyTime>().AsQueryable()
|
||||||
|
.Include(x => x.DutyTime)
|
||||||
|
.Where(x => x.ProfileId == profileId)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<UserDutyTime?> GetExist(Guid profileId,DateTime effectiveDate)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<UserDutyTime>()
|
||||||
|
.Where(x => x.ProfileId == profileId)
|
||||||
|
.Where(x => x.EffectiveDate == effectiveDate)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -57,7 +57,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
|
|
||||||
#region " Methods "
|
#region " Methods "
|
||||||
|
|
||||||
public async Task<UserTimeStamp?> GetTimestampByDateAsync(Guid keycloakId,DateTime date)
|
public async Task<int> CountRecordAsync()
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<UserTimeStamp>().CountAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<UserTimeStamp?> GetTimestampByDateAsync(Guid keycloakId, DateTime date)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<UserTimeStamp>()
|
var data = await _dbContext.Set<UserTimeStamp>()
|
||||||
.Where(u => u.KeycloakUserId == keycloakId)
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
|
|
@ -77,26 +84,24 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<UserTimeStamp>> GetTimeStampHistoryAsync(Guid keycloakId, int year, int page = 1, int pageSize = 10, string keyword = "")
|
public async Task<List<UserTimeStamp>> GetTimeStampHistoryAsync(Guid keycloakId, int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<UserTimeStamp>()
|
var data = await _dbContext.Set<UserTimeStamp>()
|
||||||
.Where(u => u.KeycloakUserId == keycloakId)
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
.Where(u => u.CheckIn.Year == year)
|
.Where(u => u.CheckIn.Year == year)
|
||||||
.OrderBy(u => u.CheckIn)
|
.OrderBy(u => u.CheckIn)
|
||||||
.Skip((page - 1) * pageSize)
|
|
||||||
.Take(pageSize)
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<UserTimeStamp>> GetTimeStampHistoryForAdminAsync(DateTime startDate,DateTime endDate, int page = 1, int pageSize = 10, string keyword = "")
|
public async Task<List<UserTimeStamp>> GetTimeStampHistoryForAdminAsync(DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<UserTimeStamp>()
|
var data = await _dbContext.Set<UserTimeStamp>()
|
||||||
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
|
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
|
||||||
.OrderBy(u => u.CheckIn)
|
.OrderBy(u => u.CheckIn)
|
||||||
.Skip((page - 1) * pageSize)
|
|
||||||
.Take(pageSize)
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,73 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
#region " Methods "
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<Profile?> GetProfileByKeycloakIdAsync(Guid keycloakId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<Profile>().AsQueryable()
|
||||||
|
.Include(p => p.Prefix)
|
||||||
|
.FirstOrDefaultAsync(p => p.KeycloakId == keycloakId);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateDutyTimeAsync(Guid profileId, Guid roundId, DateTime effectiveDate)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var profile = await _dbContext.Set<Profile>().FirstOrDefaultAsync(x => x.Id == profileId);
|
||||||
|
if (profile == null)
|
||||||
|
{
|
||||||
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
profile.DutyTimeId = roundId;
|
||||||
|
profile.DutyTimeEffectiveDate = effectiveDate;
|
||||||
|
|
||||||
|
await UpdateAsync(profile);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<Profile>> SearchProfile(string? citizenId, string? firstName, string? lastName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var data = _dbContext.Set<Profile>().AsQueryable();
|
||||||
|
|
||||||
|
|
||||||
|
if (citizenId != null)
|
||||||
|
data = data.Where(x => x.CitizenId!.Contains(citizenId));
|
||||||
|
|
||||||
|
if (firstName != null)
|
||||||
|
data = data.Where(x => x.FirstName!.Contains(firstName));
|
||||||
|
|
||||||
|
if (lastName != null)
|
||||||
|
data = data.Where(x => x.LastName!.Contains(lastName));
|
||||||
|
|
||||||
|
data = data.Include(x => x.Prefix);
|
||||||
|
|
||||||
|
return await data.ToListAsync();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetUserFullName(Guid keycloakId)
|
public string GetUserFullName(Guid keycloakId)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (_data == null)
|
if (_data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
var disciplineComplaintDocs = new List<dynamic>();
|
var disciplineComplaintDocs = new List<dynamic>();
|
||||||
foreach (var doc in _data.DisciplineComplaintDocs)
|
foreach (var doc in _data.DisciplineComplaintDocs)
|
||||||
|
|
@ -242,9 +242,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineComplaints.Include(x => x.DisciplineComplaint_Profiles).Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineComplaints.Include(x => x.DisciplineComplaint_Profiles).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
data.RespondentType = req.respondentType.Trim().ToUpper();
|
data.RespondentType = req.respondentType.Trim().ToUpper();
|
||||||
data.Organization = req.organizationId;
|
data.Organization = req.organizationId;
|
||||||
|
|
@ -310,7 +310,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
_context.DisciplineComplaints.Remove(data);
|
_context.DisciplineComplaints.Remove(data);
|
||||||
// var _docId = data.Document.Id;
|
// var _docId = data.Document.Id;
|
||||||
// await _context.SaveChangesAsync();
|
// await _context.SaveChangesAsync();
|
||||||
|
|
@ -334,9 +334,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "STOP";
|
data.Status = "STOP";
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
@ -362,9 +362,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "SEND_INVESTIGATE";
|
data.Status = "SEND_INVESTIGATE";
|
||||||
|
|
||||||
var disciplineInvestigate = new Domain.Models.Discipline.DisciplineInvestigate
|
var disciplineInvestigate = new Domain.Models.Discipline.DisciplineInvestigate
|
||||||
|
|
@ -450,9 +450,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "STOP")
|
if (data.Status.Trim().ToUpper() != "STOP")
|
||||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "NEW";
|
data.Status = "NEW";
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
@ -474,9 +474,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -524,9 +524,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
var dataDoc = data.DisciplineComplaint_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
var dataDoc = data.DisciplineComplaint_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||||
if (dataDoc != null)
|
if (dataDoc != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
return Success(data);
|
return Success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,11 +133,11 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
var dupicateData = await _context.DisciplineComplaint_Channels.Where(x => x.Id != id && x.Name == req.name).FirstOrDefaultAsync();
|
var dupicateData = await _context.DisciplineComplaint_Channels.Where(x => x.Id != id && x.Name == req.name).FirstOrDefaultAsync();
|
||||||
if (dupicateData != null)
|
if (dupicateData != null)
|
||||||
return Error(new Exception("ชื่อประเภทนี้มีอยู่ในระบบแล้ว"), (int)StatusCodes.Status400BadRequest);
|
return Error(new Exception("ชื่อประเภทนี้มีอยู่ในระบบแล้ว"), StatusCodes.Status400BadRequest);
|
||||||
|
|
||||||
data.Name = req.name;
|
data.Name = req.name;
|
||||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
|
@ -160,7 +160,7 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
_context.DisciplineComplaint_Channels.Remove(data);
|
_context.DisciplineComplaint_Channels.Remove(data);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
return Success(data);
|
return Success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +153,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
data.Prefix = req.prefix;
|
data.Prefix = req.prefix;
|
||||||
data.FirstName = req.firstName;
|
data.FirstName = req.firstName;
|
||||||
|
|
@ -181,7 +181,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
_context.DisciplineDirectors.Remove(data);
|
_context.DisciplineDirectors.Remove(data);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (_data == null)
|
if (_data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
var disciplineInvestigateDocComplaints = new List<dynamic>();
|
var disciplineInvestigateDocComplaints = new List<dynamic>();
|
||||||
foreach (var doc in _data.DisciplineInvestigateDocComplaints)
|
foreach (var doc in _data.DisciplineInvestigateDocComplaints)
|
||||||
|
|
@ -179,9 +179,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_ProfileComplaints).Where(x => x.Id == id).FirstOrDefaultAsync();
|
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_ProfileComplaints).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
data.Title = req.title;
|
data.Title = req.title;
|
||||||
data.Description = req.description;
|
data.Description = req.description;
|
||||||
|
|
@ -282,7 +282,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (_data == null)
|
if (_data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
var disciplineInvestigateDocs = new List<dynamic>();
|
var disciplineInvestigateDocs = new List<dynamic>();
|
||||||
foreach (var doc in _data.DisciplineInvestigateDocs)
|
foreach (var doc in _data.DisciplineInvestigateDocs)
|
||||||
|
|
@ -347,9 +347,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
||||||
data.InvestigationDetailOther = req.investigationDetailOther;
|
data.InvestigationDetailOther = req.investigationDetailOther;
|
||||||
|
|
@ -432,11 +432,11 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||||
if (data.InvestigationStatusResult == null || data.InvestigationStatusResult.Trim().ToUpper() != "NO_CAUSE")
|
if (data.InvestigationStatusResult == null || data.InvestigationStatusResult.Trim().ToUpper() != "NO_CAUSE")
|
||||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "STOP";
|
data.Status = "STOP";
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
@ -467,7 +467,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถส่งต่อไปสอบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถส่งต่อไปสอบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "SEND_DISCIPLINARY";
|
data.Status = "SEND_DISCIPLINARY";
|
||||||
|
|
@ -609,9 +609,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "STOP")
|
if (data.Status.Trim().ToUpper() != "STOP")
|
||||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), StatusCodes.Status500InternalServerError);
|
||||||
data.Status = "NEW";
|
data.Status = "NEW";
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
@ -633,9 +633,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -683,9 +683,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
var dataDoc = data.DisciplineInvestigate_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
var dataDoc = data.DisciplineInvestigate_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||||
if (dataDoc != null)
|
if (dataDoc != null)
|
||||||
{
|
{
|
||||||
|
|
@ -716,9 +716,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -769,9 +769,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
var dataDoc = data.DisciplineInvestigate_DocComplaints.Where(x => x.Document.Id == docId).FirstOrDefault();
|
var dataDoc = data.DisciplineInvestigate_DocComplaints.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||||
if (dataDoc != null)
|
if (dataDoc != null)
|
||||||
{
|
{
|
||||||
|
|
@ -806,9 +806,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
|
||||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -856,9 +856,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
var dataDoc = data.DisciplineInvestigateRelevant_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
var dataDoc = data.DisciplineInvestigateRelevant_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||||
if (dataDoc != null)
|
if (dataDoc != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using BMA.EHR.Domain.Models.Base;
|
||||||
using BMA.EHR.Domain.Models.Documents;
|
using BMA.EHR.Domain.Models.Documents;
|
||||||
using BMA.EHR.Domain.Models.MetaData;
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
using BMA.EHR.Domain.Models.Organizations;
|
using BMA.EHR.Domain.Models.Organizations;
|
||||||
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||||
|
|
||||||
namespace BMA.EHR.Domain.Models.HR
|
namespace BMA.EHR.Domain.Models.HR
|
||||||
{
|
{
|
||||||
|
|
@ -326,5 +327,13 @@ namespace BMA.EHR.Domain.Models.HR
|
||||||
public virtual List<ProfileChildren> Childrens { get; set; } = new List<ProfileChildren>();
|
public virtual List<ProfileChildren> Childrens { get; set; } = new List<ProfileChildren>();
|
||||||
public virtual List<ProfileChangeName> ChangeNames { get; set; } = new List<ProfileChangeName>();
|
public virtual List<ProfileChangeName> ChangeNames { get; set; } = new List<ProfileChangeName>();
|
||||||
public virtual List<ProfileEmployment> Employments { get; set; } = new List<ProfileEmployment>();
|
public virtual List<ProfileEmployment> Employments { get; set; } = new List<ProfileEmployment>();
|
||||||
|
|
||||||
|
// รอบการลงเวลา
|
||||||
|
[Comment("รอบการลงเวลาเข้างาน")]
|
||||||
|
public Guid? DutyTimeId { get; set; }
|
||||||
|
|
||||||
|
[Comment("วันที่รอบการลงเวลามีผล")]
|
||||||
|
public DateTime? DutyTimeEffectiveDate { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using BMA.EHR.Domain.Models.Base;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
||||||
|
{
|
||||||
|
public class AdditionalCheckRequest: EntityBase
|
||||||
|
{
|
||||||
|
[Required,Comment("*วันที่ลงเวลา")]
|
||||||
|
public DateTime CheckDate { get; set; } = DateTime.Now.Date;
|
||||||
|
|
||||||
|
[Required, Comment("*ขอลงเวลาช่วงเช้า")]
|
||||||
|
public bool CheckInEdit { get; set; } = false;
|
||||||
|
|
||||||
|
[Required, Comment("*ขอลงเวลาช่วงบ่าย")]
|
||||||
|
public bool CheckOutEdit { get; set; } = false;
|
||||||
|
|
||||||
|
[Required, Comment("*หมายเหตุขอลงเวลาพิเศษ")]
|
||||||
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Comment("สถานะการอนุมัติ")]
|
||||||
|
public string Status { get; set; } = "PENDING"; // APPROVE,REJECT
|
||||||
|
|
||||||
|
[Comment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ")]
|
||||||
|
public string? Comment { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("รหัส User ของ Keycloak ที่ร้องขอ")]
|
||||||
|
public Guid KeycloakUserId { get; set; } = Guid.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
using BMA.EHR.Domain.Models.Base;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
||||||
|
{
|
||||||
|
public class ProcessUserTimeStamp : EntityBase
|
||||||
|
{
|
||||||
|
[Required, Comment("รหัส User ของ Keycloak")]
|
||||||
|
public Guid KeycloakUserId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("วัน เวลา เข้างาน")]
|
||||||
|
public DateTime CheckIn { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
[Comment("วัน เวลา ออกงาน")]
|
||||||
|
public DateTime? CheckOut { get; set; }
|
||||||
|
|
||||||
|
[Required, Comment("นำไปประมวลผลแล้วหรือยัง")]
|
||||||
|
public bool IsProcess { get; set; } = false;
|
||||||
|
|
||||||
|
[Required, Comment("พิกัดละติจูด Check-In")]
|
||||||
|
public double CheckInLat { get; set; } = 0;
|
||||||
|
|
||||||
|
[Required, Comment("พิกัดลองจิจูด Check-In")]
|
||||||
|
public double CheckInLon { get; set; } = 0;
|
||||||
|
|
||||||
|
[Required, Comment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In")]
|
||||||
|
public string CheckInPOI { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In")]
|
||||||
|
public bool IsLocationCheckIn { get; set; } = true;
|
||||||
|
|
||||||
|
[Comment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In")]
|
||||||
|
public string? CheckInLocationName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("รูปถ่ายสถานที่ Check-In")]
|
||||||
|
public string CheckInImageUrl { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Comment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In")]
|
||||||
|
public string? CheckInRemark { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("สถานะ Check-In")]
|
||||||
|
public string? CheckInStatus { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("พิกัดละติจูด Check-Out")]
|
||||||
|
public double CheckOutLat { get; set; } = 0;
|
||||||
|
|
||||||
|
[Required, Comment("พิกัดลองจิจูด Check-Out")]
|
||||||
|
public double CheckOutLon { get; set; } = 0;
|
||||||
|
|
||||||
|
[Required, Comment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out")]
|
||||||
|
public string CheckOutPOI { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out")]
|
||||||
|
public bool IsLocationCheckOut { get; set; } = true;
|
||||||
|
|
||||||
|
[Comment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out")]
|
||||||
|
public string? CheckOutLocationName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("รูปถ่ายสถานที่ Check-Out")]
|
||||||
|
public string CheckOutImageUrl { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Comment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out")]
|
||||||
|
public string? CheckOutRemark { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Comment("สถานะ Check-Out")]
|
||||||
|
public string? CheckOutStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
26
BMA.EHR.Domain/Models/Leave/TimeAttendants/UserDutyTime.cs
Normal file
26
BMA.EHR.Domain/Models/Leave/TimeAttendants/UserDutyTime.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
using BMA.EHR.Domain.Models.Base;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
||||||
|
{
|
||||||
|
public class UserDutyTime : EntityBase
|
||||||
|
{
|
||||||
|
[Required, Comment("รหัส Profile ในระบบทะเบียนประวัติ")]
|
||||||
|
public Guid ProfileId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
[Required, Comment("รหัสรอบการลงเวลา")]
|
||||||
|
public Guid DutyTimeId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
public DutyTime DutyTime { get; set; }
|
||||||
|
|
||||||
|
[Comment("วันที่มีผล")]
|
||||||
|
public DateTime? EffectiveDate { get; set; }
|
||||||
|
|
||||||
|
[Comment("ทำการประมวลผลแล้วหรือยัง")]
|
||||||
|
public bool IsProcess { get; set; } = false;
|
||||||
|
|
||||||
|
[Comment("หมายเหตุ")]
|
||||||
|
public string? Remark { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -59,7 +59,5 @@ namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
||||||
|
|
||||||
[Comment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out")]
|
[Comment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out")]
|
||||||
public string? CheckOutRemark { get; set; } = string.Empty;
|
public string? CheckOutRemark { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17021
BMA.EHR.Infrastructure/Migrations/20231123073249_add duty time to profile.Designer.cs
generated
Normal file
17021
BMA.EHR.Infrastructure/Migrations/20231123073249_add duty time to profile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,87 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adddutytimetoprofile : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DutyTime",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||||
|
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||||
|
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Description = table.Column<string>(type: "longtext", nullable: false, comment: "คำอธิบาย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
StartTimeMorning = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาเข้างานช่วงเช้า")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
EndTimeMorning = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาออกงานช่วงเช้า")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
StartTimeAfternoon = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาเข้างานช่วงบ่าย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
EndTimeAfternoon = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาออกงานช่วงบ่าย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsDefault = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)"),
|
||||||
|
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการเปิดใช้งาน (เปิด/ปิด)")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DutyTime", x => x.Id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Profiles_DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
column: "DutyTimeId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Profiles_DutyTime_DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
column: "DutyTimeId",
|
||||||
|
principalTable: "DutyTime",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Profiles_DutyTime_DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DutyTime");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Profiles_DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16925
BMA.EHR.Infrastructure/Migrations/20231123073530_remove duty time to profile.Designer.cs
generated
Normal file
16925
BMA.EHR.Infrastructure/Migrations/20231123073530_remove duty time to profile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,87 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class removedutytimetoprofile : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Profiles_DutyTime_DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DutyTime");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Profiles_DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DutyTime",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||||
|
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||||
|
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Description = table.Column<string>(type: "longtext", nullable: false, comment: "คำอธิบาย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
EndTimeAfternoon = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาออกงานช่วงบ่าย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
EndTimeMorning = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาออกงานช่วงเช้า")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการเปิดใช้งาน (เปิด/ปิด)"),
|
||||||
|
IsDefault = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)"),
|
||||||
|
StartTimeAfternoon = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาเข้างานช่วงบ่าย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
StartTimeMorning = table.Column<string>(type: "longtext", nullable: false, comment: "เวลาเข้างานช่วงเช้า")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DutyTime", x => x.Id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Profiles_DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
column: "DutyTimeId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Profiles_DutyTime_DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
column: "DutyTimeId",
|
||||||
|
principalTable: "DutyTime",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16929
BMA.EHR.Infrastructure/Migrations/20231123073812_add duty time id to profile.Designer.cs
generated
Normal file
16929
BMA.EHR.Infrastructure/Migrations/20231123073812_add duty time id to profile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adddutytimeidtoprofile : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "รอบการลงเวลาเข้างาน",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DutyTimeId",
|
||||||
|
table: "Profiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16933
BMA.EHR.Infrastructure/Migrations/20231123081146_add duty time effectivedata to profile.Designer.cs
generated
Normal file
16933
BMA.EHR.Infrastructure/Migrations/20231123081146_add duty time effectivedata to profile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,30 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adddutytimeeffectivedatatoprofile : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "DutyTimeEffectiveDate",
|
||||||
|
table: "Profiles",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "วันที่รอบการลงเวลามีผล");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DutyTimeEffectiveDate",
|
||||||
|
table: "Profiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1049,6 +1049,14 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
b.Property<DateTime?>("DateStart")
|
b.Property<DateTime?>("DateStart")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DutyTimeEffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่รอบการลงเวลามีผล");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รอบการลงเวลาเข้างาน");
|
||||||
|
|
||||||
b.Property<string>("EmployeeClass")
|
b.Property<string>("EmployeeClass")
|
||||||
.HasMaxLength(20)
|
.HasMaxLength(20)
|
||||||
.HasColumnType("varchar(20)")
|
.HasColumnType("varchar(20)")
|
||||||
|
|
|
||||||
377
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123024901_add process time stamp.Designer.cs
generated
Normal file
377
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123024901_add process time stamp.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,377 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123024901_add process time stamp")]
|
||||||
|
partial class addprocesstimestamp
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addprocesstimestamp : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ProcessUserTimeStamps",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||||
|
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||||
|
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
KeycloakUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัส User ของ Keycloak", collation: "ascii_general_ci"),
|
||||||
|
CheckIn = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วัน เวลา เข้างาน"),
|
||||||
|
CheckOut = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วัน เวลา ออกงาน"),
|
||||||
|
IsProcess = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "นำไปประมวลผลแล้วหรือยัง"),
|
||||||
|
CheckInLat = table.Column<double>(type: "double", nullable: false, comment: "พิกัดละติจูด Check-In"),
|
||||||
|
CheckInLon = table.Column<double>(type: "double", nullable: false, comment: "พิกัดลองจิจูด Check-In"),
|
||||||
|
CheckInPOI = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsLocationCheckIn = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In"),
|
||||||
|
CheckInLocationName = table.Column<string>(type: "longtext", nullable: true, comment: "กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckInImageUrl = table.Column<string>(type: "longtext", nullable: false, comment: "รูปถ่ายสถานที่ Check-In")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckInRemark = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckInStatus = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะ Check-In")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckOutLat = table.Column<double>(type: "double", nullable: false, comment: "พิกัดละติจูด Check-Out"),
|
||||||
|
CheckOutLon = table.Column<double>(type: "double", nullable: false, comment: "พิกัดลองจิจูด Check-Out"),
|
||||||
|
CheckOutPOI = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsLocationCheckOut = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out"),
|
||||||
|
CheckOutLocationName = table.Column<string>(type: "longtext", nullable: true, comment: "กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckOutImageUrl = table.Column<string>(type: "longtext", nullable: false, comment: "รูปถ่ายสถานที่ Check-Out")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckOutRemark = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckOutStatus = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะ Check-Out")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ProcessUserTimeStamps", x => x.Id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ProcessUserTimeStamps");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
437
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123032746_add user duty time.Designer.cs
generated
Normal file
437
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123032746_add user duty time.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,437 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123032746_add user duty time")]
|
||||||
|
partial class adduserdutytime
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adduserdutytime : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserDutyTimes",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||||
|
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||||
|
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
KeycloakUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัส User ของ Keycloak", collation: "ascii_general_ci"),
|
||||||
|
DutyTimeId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสรอบการลงเวลา", collation: "ascii_general_ci")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserDutyTimes", x => x.Id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserDutyTimes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
440
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123033051_add user duty time - effective date.Designer.cs
generated
Normal file
440
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123033051_add user duty time - effective date.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,440 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123033051_add user duty time - effective date")]
|
||||||
|
partial class adduserdutytimeeffectivedate
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adduserdutytimeeffectivedate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "EffectiveDate",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "EffectiveDate",
|
||||||
|
table: "UserDutyTimes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,441 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123033334_add comment user duty time - effective date")]
|
||||||
|
partial class addcommentuserdutytimeeffectivedate
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addcommentuserdutytimeeffectivedate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "EffectiveDate",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "วันที่มีผล",
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime(6)",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<DateTime>(
|
||||||
|
name: "EffectiveDate",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(DateTime),
|
||||||
|
oldType: "datetime(6)",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "วันที่มีผล");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,441 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123082309_change field from kk_id to profile id")]
|
||||||
|
partial class changefieldfromkk_idtoprofileid
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class changefieldfromkk_idtoprofileid : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "KeycloakUserId",
|
||||||
|
table: "UserDutyTimes");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
comment: "รหัส Profile ในระบบทะเบียนประวัติ",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "UserDutyTimes");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "KeycloakUserId",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
comment: "รหัส User ของ Keycloak",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
445
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123082554_add process dutytime status.Designer.cs
generated
Normal file
445
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123082554_add process dutytime status.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,445 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123082554_add process dutytime status")]
|
||||||
|
partial class addprocessdutytimestatus
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addprocessdutytimestatus : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsProcess",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "tinyint(1)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false,
|
||||||
|
comment: "ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsProcess",
|
||||||
|
table: "UserDutyTimes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
449
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123083034_add user 'dutytime remark.Designer.cs
generated
Normal file
449
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231123083034_add user 'dutytime remark.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,449 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231123083034_add user 'dutytime remark")]
|
||||||
|
partial class adduserdutytimeremark
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<string>("Remark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class adduserdutytimeremark : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Remark",
|
||||||
|
table: "UserDutyTimes",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
comment: "หมายเหตุ")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Remark",
|
||||||
|
table: "UserDutyTimes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
539
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231124035028_add AdditionalCheckInRequest Table.Designer.cs
generated
Normal file
539
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231124035028_add AdditionalCheckInRequest Table.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,539 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231124035028_add AdditionalCheckInRequest Table")]
|
||||||
|
partial class addAdditionalCheckInRequestTable
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("*วันที่ลงเวลา");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckInEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckOutEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("Comment")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("*หมายเหตุขอลงเวลาพิเศษ");
|
||||||
|
|
||||||
|
b.Property<bool>("IsApproved")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการอนุมัติ");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AdditionalCheckRequests");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<string>("Remark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DutyTimeId");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DutyTimeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DutyTime");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addAdditionalCheckInRequestTable : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AdditionalCheckRequests",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||||
|
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||||
|
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CheckDate = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "*วันที่ลงเวลา"),
|
||||||
|
CheckInEdit = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "*ขอลงเวลาช่วงเช้า"),
|
||||||
|
CheckOutEdit = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "*ขอลงเวลาช่วงบ่าย"),
|
||||||
|
Description = table.Column<string>(type: "longtext", nullable: false, comment: "*หมายเหตุขอลงเวลาพิเศษ")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการอนุมัติ"),
|
||||||
|
Comment = table.Column<string>(type: "longtext", nullable: true, comment: "หมายเหตุในการการอนุมัติ/ไม่อนุมัติ")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AdditionalCheckRequests", x => x.Id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AdditionalCheckRequests");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,543 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231124040110_add keycloakid to AdditionalCheckInRequest Table")]
|
||||||
|
partial class addkeycloakidtoAdditionalCheckInRequestTable
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("*วันที่ลงเวลา");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckInEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckOutEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("Comment")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("*หมายเหตุขอลงเวลาพิเศษ");
|
||||||
|
|
||||||
|
b.Property<bool>("IsApproved")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการอนุมัติ");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak ที่ร้องขอ");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AdditionalCheckRequests");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<string>("Remark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DutyTimeId");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DutyTimeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DutyTime");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addkeycloakidtoAdditionalCheckInRequestTable : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "KeycloakUserId",
|
||||||
|
table: "AdditionalCheckRequests",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
comment: "รหัส User ของ Keycloak ที่ร้องขอ",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "KeycloakUserId",
|
||||||
|
table: "AdditionalCheckRequests");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,544 @@
|
||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(LeaveDbContext))]
|
||||||
|
[Migration("20231124043728_change status field in AdditionalCheckInRequest Table")]
|
||||||
|
partial class changestatusfieldinAdditionalCheckInRequestTable
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("*วันที่ลงเวลา");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckInEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckOutEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("Comment")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("*หมายเหตุขอลงเวลาพิเศษ");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak ที่ร้องขอ");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะการอนุมัติ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AdditionalCheckRequests");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("คำอธิบาย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("EndTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาออกงานช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDefault")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeAfternoon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("StartTimeMorning")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("DutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<string>("Remark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DutyTimeId");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("UserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DutyTimeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DutyTime");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class changestatusfieldinAdditionalCheckInRequestTable : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsApproved",
|
||||||
|
table: "AdditionalCheckRequests");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Status",
|
||||||
|
table: "AdditionalCheckRequests",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: false,
|
||||||
|
comment: "สถานะการอนุมัติ")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Status",
|
||||||
|
table: "AdditionalCheckRequests");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsApproved",
|
||||||
|
table: "AdditionalCheckRequests",
|
||||||
|
type: "tinyint(1)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false,
|
||||||
|
comment: "สถานะการอนุมัติ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,88 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
.HasAnnotation("ProductVersion", "7.0.9")
|
.HasAnnotation("ProductVersion", "7.0.9")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("*วันที่ลงเวลา");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckInEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงเช้า");
|
||||||
|
|
||||||
|
b.Property<bool>("CheckOutEdit")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("*ขอลงเวลาช่วงบ่าย");
|
||||||
|
|
||||||
|
b.Property<string>("Comment")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("*หมายเหตุขอลงเวลาพิเศษ");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak ที่ร้องขอ");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะการอนุมัติ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AdditionalCheckRequests");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -104,6 +186,217 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
b.ToTable("DutyTimes");
|
b.ToTable("DutyTimes");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CheckIn")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา เข้างาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||||
|
|
||||||
|
b.Property<double>("CheckInLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||||
|
|
||||||
|
b.Property<string>("CheckInStatus")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-In");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("CheckOut")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วัน เวลา ออกงาน");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutImageUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLat")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดละติจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutLocationName")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||||
|
|
||||||
|
b.Property<double>("CheckOutLon")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutPOI")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutRemark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||||
|
|
||||||
|
b.Property<string>("CheckOutStatus")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะ Check-Out");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckIn")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLocationCheckOut")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<Guid>("KeycloakUserId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส User ของ Keycloak");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("ProcessUserTimeStamps");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasColumnOrder(0)
|
||||||
|
.HasComment("PrimaryKey")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(100)
|
||||||
|
.HasComment("สร้างข้อมูลเมื่อ");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(104)
|
||||||
|
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(101)
|
||||||
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<Guid>("DutyTimeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสรอบการลงเวลา");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EffectiveDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่มีผล");
|
||||||
|
|
||||||
|
b.Property<bool>("IsProcess")
|
||||||
|
.HasColumnType("tinyint(1)")
|
||||||
|
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateFullName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("varchar(200)")
|
||||||
|
.HasColumnOrder(105)
|
||||||
|
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<string>("LastUpdateUserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("varchar(40)")
|
||||||
|
.HasColumnOrder(103)
|
||||||
|
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastUpdatedAt")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(102)
|
||||||
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProfileId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<string>("Remark")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุ");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DutyTimeId");
|
||||||
|
|
||||||
|
b.ToTable("UserDutyTimes");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -231,6 +524,17 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
|
||||||
b.ToTable("UserTimeStamps");
|
b.ToTable("UserTimeStamps");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DutyTimeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DutyTime");
|
||||||
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,12 @@ namespace BMA.EHR.Infrastructure.Persistence
|
||||||
|
|
||||||
public DbSet<UserTimeStamp> UserTimeStamps { 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; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,11 @@
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
||||||
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
//"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
|
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
|
"ExamConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
|
"LeaveConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
|
"DisciplineConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Hangfire" Version="1.8.6" />
|
||||||
|
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.6" />
|
||||||
|
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
||||||
<PackageReference Include="iTextSharp" Version="5.5.13.3" />
|
<PackageReference Include="iTextSharp" Version="5.5.13.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,23 @@
|
||||||
using BMA.EHR.Application.Repositories;
|
using Amazon.S3.Model;
|
||||||
|
using Amazon.S3.Model.Internal.MarshallTransformations;
|
||||||
|
using BMA.EHR.Application.Repositories;
|
||||||
using BMA.EHR.Application.Repositories.Leaves.TimeAttendants;
|
using BMA.EHR.Application.Repositories.Leaves.TimeAttendants;
|
||||||
using BMA.EHR.Domain.Common;
|
using BMA.EHR.Domain.Common;
|
||||||
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||||
using BMA.EHR.Domain.Shared;
|
using BMA.EHR.Domain.Shared;
|
||||||
using BMA.EHR.Infrastructure.Persistence;
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using BMA.EHR.Leave.Service.DTOs.AdditionalCheck;
|
||||||
|
using BMA.EHR.Leave.Service.DTOs.ChangeRound;
|
||||||
using BMA.EHR.Leave.Service.DTOs.CheckIn;
|
using BMA.EHR.Leave.Service.DTOs.CheckIn;
|
||||||
using BMA.EHR.Leave.Service.DTOs.DutyTime;
|
using BMA.EHR.Leave.Service.DTOs.DutyTime;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.DirectoryServices.ActiveDirectory;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
using System.Security.Permissions;
|
||||||
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||||
|
|
||||||
namespace BMA.EHR.Leave.Service.Controllers
|
namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -32,6 +39,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
private readonly UserProfileRepository _userProfileRepository;
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
private readonly UserTimeStampRepository _userTimeStampRepository;
|
private readonly UserTimeStampRepository _userTimeStampRepository;
|
||||||
private readonly MinIOService _minIOService;
|
private readonly MinIOService _minIOService;
|
||||||
|
private readonly ProcessUserTimeStampRepository _processUserTimeStampRepository;
|
||||||
|
private readonly UserDutyTimeRepository _userDutyTimeRepository;
|
||||||
|
private readonly AdditionalCheckRequestRepository _additionalCheckRequestRepository;
|
||||||
|
|
||||||
private readonly string _bucketName = "check-in";
|
private readonly string _bucketName = "check-in";
|
||||||
|
|
||||||
|
|
@ -46,7 +56,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
IConfiguration configuration,
|
IConfiguration configuration,
|
||||||
UserProfileRepository userProfileRepository,
|
UserProfileRepository userProfileRepository,
|
||||||
UserTimeStampRepository userTimeStampRepository,
|
UserTimeStampRepository userTimeStampRepository,
|
||||||
MinIOService minIOService)
|
MinIOService minIOService,
|
||||||
|
ProcessUserTimeStampRepository processUserTimeStampRepository,
|
||||||
|
UserDutyTimeRepository userDutyTimeRepository,
|
||||||
|
AdditionalCheckRequestRepository additionalCheckRequestRepository)
|
||||||
{
|
{
|
||||||
_dutyTimeRepository = dutyTimeRepository;
|
_dutyTimeRepository = dutyTimeRepository;
|
||||||
_context = context;
|
_context = context;
|
||||||
|
|
@ -56,6 +69,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
_userProfileRepository = userProfileRepository;
|
_userProfileRepository = userProfileRepository;
|
||||||
_userTimeStampRepository = userTimeStampRepository;
|
_userTimeStampRepository = userTimeStampRepository;
|
||||||
_minIOService = minIOService;
|
_minIOService = minIOService;
|
||||||
|
_processUserTimeStampRepository = processUserTimeStampRepository;
|
||||||
|
_userDutyTimeRepository = userDutyTimeRepository;
|
||||||
|
_additionalCheckRequestRepository = additionalCheckRequestRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -375,14 +391,19 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
await _minIOService.UploadFileAsync(fileName, ms);
|
await _minIOService.UploadFileAsync(fileName, ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var currentCheckInProcess = await _processUserTimeStampRepository.GetTimestampByDateAsync(Guid.Parse(UserId), currentDate);
|
||||||
|
|
||||||
// create check in object
|
// create check in object
|
||||||
if (data.CheckInId == null)
|
if (data.CheckInId == null)
|
||||||
{
|
{
|
||||||
// validate duplicate check in
|
// validate duplicate check in
|
||||||
var currentCheckIn = await _userTimeStampRepository.GetTimestampByDateAsync(Guid.Parse(UserId), currentDate);
|
var currentCheckIn = await _userTimeStampRepository.GetTimestampByDateAsync(Guid.Parse(UserId), currentDate);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (currentCheckIn != null)
|
if (currentCheckIn != null)
|
||||||
{
|
{
|
||||||
return Error(new Exception("ไม่สามารถลงเวลาได้ เนืองจากมีการลงเวลาในวันนี้แล้ว!"), (int)StatusCodes.Status400BadRequest);
|
return Error(new Exception("ไม่สามารถลงเวลาได้ เนืองจากมีการลงเวลาในวันนี้แล้ว!"), StatusCodes.Status400BadRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -399,11 +420,29 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
CheckIn = currentDate
|
CheckIn = currentDate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// process - รอทำใน queue
|
||||||
|
var checkin_process = new ProcessUserTimeStamp
|
||||||
|
{
|
||||||
|
KeycloakUserId = UserId != null ? Guid.Parse(UserId) : Guid.Empty,
|
||||||
|
CheckInLat = data.Lat,
|
||||||
|
CheckInLon = data.Lon,
|
||||||
|
IsLocationCheckIn = data.IsLocation,
|
||||||
|
CheckInLocationName = data.LocationName,
|
||||||
|
CheckInPOI = data.POI,
|
||||||
|
CheckInRemark = data.Remark,
|
||||||
|
CheckInImageUrl = fileName,
|
||||||
|
CheckIn = currentDate
|
||||||
|
};
|
||||||
|
|
||||||
await _userTimeStampRepository.AddAsync(checkin);
|
await _userTimeStampRepository.AddAsync(checkin);
|
||||||
|
await _processUserTimeStampRepository.AddAsync(checkin_process);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var checkout = await _userTimeStampRepository.GetByIdAsync(data.CheckInId.Value);
|
var checkout = await _userTimeStampRepository.GetByIdAsync(data.CheckInId.Value);
|
||||||
|
var checkout_process = await _processUserTimeStampRepository.GetByIdAsync(currentCheckInProcess.Id);
|
||||||
|
|
||||||
|
|
||||||
if (checkout != null)
|
if (checkout != null)
|
||||||
{
|
{
|
||||||
checkout.CheckOutLat = data.Lat;
|
checkout.CheckOutLat = data.Lat;
|
||||||
|
|
@ -419,8 +458,27 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (checkout_process != null)
|
||||||
|
{
|
||||||
|
checkout_process.CheckOutLat = data.Lat;
|
||||||
|
checkout_process.CheckOutLon = data.Lon;
|
||||||
|
checkout_process.IsLocationCheckOut = data.IsLocation;
|
||||||
|
checkout_process.CheckOutLocationName = data.LocationName;
|
||||||
|
checkout_process.CheckOutPOI = data.POI;
|
||||||
|
checkout_process.CheckOutRemark = data.Remark;
|
||||||
|
checkout_process.CheckOutImageUrl = fileName;
|
||||||
|
checkout_process.CheckOut = currentDate;
|
||||||
|
|
||||||
|
await _processUserTimeStampRepository.UpdateAsync(checkout_process);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(new { date = currentDate });
|
return Success(new { date = currentDate });
|
||||||
|
|
@ -442,18 +500,27 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
// TODO : รอดุึงรอบที่ผูกกับ user
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId);
|
||||||
var duty = await _dutyTimeRepository.GetDefaultAsync();
|
if (profile == null)
|
||||||
|
|
||||||
if (duty == null)
|
|
||||||
{
|
{
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||||
|
if (defaultRound == null)
|
||||||
|
{
|
||||||
|
return Error("ไม่พบรอบการลงเวลาทำงาน Default", StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||||
|
|
||||||
|
// TODO : รอดุึงรอบที่ผูกกับ user
|
||||||
|
var duty = userRound ?? defaultRound;
|
||||||
|
|
||||||
var checkin_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}");
|
var checkin_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}");
|
||||||
var checkout_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
|
var checkout_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
|
||||||
|
|
||||||
var data = (await _userTimeStampRepository.GetTimeStampHistoryAsync(userId, year, page, pageSize, keyword))
|
var data = (await _userTimeStampRepository.GetTimeStampHistoryAsync(userId, year))
|
||||||
.Select(d => new CheckInHistoryDto
|
.Select(d => new CheckInHistoryDto
|
||||||
{
|
{
|
||||||
CheckInId = d.Id,
|
CheckInId = d.Id,
|
||||||
|
|
@ -476,7 +543,17 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
return Success(data);
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
data = data.Where(x => (x.CheckInLocation.Contains(keyword) || x.CheckOutLocation.Contains(keyword))).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
var pageData = data
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return Success(new { data = pageData, total = data.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -495,12 +572,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
if (startDate.Date > endDate.Date)
|
if (startDate.Date > endDate.Date)
|
||||||
{
|
{
|
||||||
return Error(new Exception("วันเริ่มต้นต้องมีค่าน้อยกว่าหรือเท่ากับวันสิ้นสุด"), (int)StatusCodes.Status400BadRequest);
|
return Error(new Exception("วันเริ่มต้นต้องมีค่าน้อยกว่าหรือเท่ากับวันสิ้นสุด"), StatusCodes.Status400BadRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//var count = await _userTimeStampRepository.CountRecordAsync();
|
||||||
|
|
||||||
|
|
||||||
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
||||||
var data = (await _userTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate, page, pageSize, keyword))
|
var data = (await _userTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate))
|
||||||
.Select(d => new CheckInHistoryForAdminDto
|
.Select(d => new CheckInHistoryForAdminDto
|
||||||
{
|
{
|
||||||
Id = d.Id,
|
Id = d.Id,
|
||||||
|
|
@ -522,12 +601,18 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// if (data == null || data.Count == 0)
|
if (keyword != "")
|
||||||
// {
|
{
|
||||||
// return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
data = data.Where(x => x.FullName.Contains(keyword)).ToList();
|
||||||
// }
|
}
|
||||||
|
|
||||||
return Success(new { data = data, total = data.Count });
|
var pageData = data
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
return Success(new { data = pageData, total = data.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -545,6 +630,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
public async Task<ActionResult<ResponseObject>> GetTimeRecordAsync([Required] Guid id)
|
public async Task<ActionResult<ResponseObject>> GetTimeRecordAsync([Required] Guid id)
|
||||||
{
|
{
|
||||||
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
||||||
|
|
||||||
|
|
||||||
var d = (await _userTimeStampRepository.GetTimeStampById(id));
|
var d = (await _userTimeStampRepository.GetTimeStampById(id));
|
||||||
if (d == null)
|
if (d == null)
|
||||||
{
|
{
|
||||||
|
|
@ -552,30 +639,513 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(d.KeycloakUserId);
|
||||||
|
if (profile == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||||
|
if (defaultRound == null)
|
||||||
|
{
|
||||||
|
return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||||
|
|
||||||
|
var duty = userRound ?? defaultRound;
|
||||||
|
|
||||||
var result = new CheckInDetailForAdminDto
|
var result = new CheckInDetailForAdminDto
|
||||||
{
|
{
|
||||||
Id = d.Id,
|
Id = d.Id,
|
||||||
FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId),
|
FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId),
|
||||||
|
|
||||||
CheckInDate = d.CheckIn.Date,
|
CheckInDate = d.CheckIn.Date,
|
||||||
CheckInTime = d.CheckIn.ToString("HH:mm:ss"),
|
CheckInTime = d.CheckIn.ToString("HH:mm"),
|
||||||
CheckInLocation = d.CheckInPOI,
|
CheckInPOI = d.CheckInPOI,
|
||||||
CheckInLat = d.CheckInLat,
|
CheckInLat = d.CheckInLat,
|
||||||
CheckInLon = d.CheckInLon,
|
CheckInLon = d.CheckInLon,
|
||||||
CheckInImg = $"{imgUrl}/{d.CheckInImageUrl}",
|
CheckInImg = $"{imgUrl}/{d.CheckInImageUrl}",
|
||||||
|
CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
CheckInDescription = d.CheckInRemark ?? "",
|
||||||
|
|
||||||
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
||||||
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"),
|
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
|
||||||
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
|
CheckOutPOI = d.CheckOut == null ? "" : d.CheckOutPOI,
|
||||||
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
||||||
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
||||||
CheckOutImg = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
CheckOutImg = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
||||||
|
|
||||||
|
CheckOutStatus = d.CheckOut == null ? null :
|
||||||
|
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
CheckOutDescription = d.CheckOutRemark ?? "",
|
||||||
};
|
};
|
||||||
|
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_009 - รายการลงเวลาปฏิบัติงานที่ประมวลผลแล้ว (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("time-record")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetTimeRecordAsync([Required] DateTime startDate, [Required] DateTime endDate, int page = 1, int pageSize = 10, string status = "NORMAL", string keyword = "")
|
||||||
|
{
|
||||||
|
if (startDate.Date > endDate.Date)
|
||||||
|
{
|
||||||
|
return Error(new Exception("วันเริ่มต้นต้องมีค่าน้อยกว่าหรือเท่ากับวันสิ้นสุด"), StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId);
|
||||||
|
if (profile == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||||
|
if (defaultRound == null)
|
||||||
|
{
|
||||||
|
return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||||
|
|
||||||
|
var duty = userRound ?? defaultRound;
|
||||||
|
|
||||||
|
var checkin_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}");
|
||||||
|
var checkout_base = DateTime.Parse($"{DateTime.Now.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
|
||||||
|
|
||||||
|
//var count = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminCountAsync(startDate, endDate);
|
||||||
|
|
||||||
|
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
||||||
|
var data = (await _processUserTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate))
|
||||||
|
.Select(d => new CheckInProcessHistoryForAdminDto
|
||||||
|
{
|
||||||
|
Id = d.Id,
|
||||||
|
FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId),
|
||||||
|
|
||||||
|
CheckInDate = d.CheckIn.Date,
|
||||||
|
CheckInTime = d.CheckIn.ToString("HH:mm"),
|
||||||
|
CheckInLocation = d.CheckInPOI,
|
||||||
|
CheckInLat = d.CheckInLat,
|
||||||
|
CheckInLon = d.CheckInLon,
|
||||||
|
CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
//CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}",
|
||||||
|
|
||||||
|
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
||||||
|
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
|
||||||
|
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
|
||||||
|
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
||||||
|
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
||||||
|
CheckOutStatus = d.CheckOut == null ? null : DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
//CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
||||||
|
})
|
||||||
|
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
data = data.Where(x => x.FullName.Contains(keyword)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status.Trim().ToUpper() != "ALL")
|
||||||
|
{
|
||||||
|
data = data.Where(x => x.CheckInStatus == status || x.CheckOutStatus == status).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
var pageData = data
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return Success(new { data = pageData, total = data.Count });
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " เปลี่ยนรอบการทำงาน "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_006 - เช็คเวลาต้องลงเวลาเข้าหรือออกงาน (USER)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("search")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> SearchProfileAsync([FromBody] SearchProfileDto req)
|
||||||
|
{
|
||||||
|
var profile = await _userProfileRepository.SearchProfile(req.CitizenId, req.FirstName, req.LastName);
|
||||||
|
|
||||||
|
var pagedProfile = profile.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList();
|
||||||
|
|
||||||
|
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var resultSet = new List<SearchProfileResultDto>();
|
||||||
|
|
||||||
|
foreach (var p in pagedProfile)
|
||||||
|
{
|
||||||
|
var roundId = p.DutyTimeId ?? Guid.Empty;
|
||||||
|
var round = await _dutyTimeRepository.GetByIdAsync(roundId);
|
||||||
|
|
||||||
|
var res = new SearchProfileResultDto
|
||||||
|
{
|
||||||
|
ProfileId = p.Id,
|
||||||
|
CitizenId = p.CitizenId,
|
||||||
|
FullName = $"{p.Prefix.Name}{p.FirstName} {p.LastName}",
|
||||||
|
StartTimeMorning = round != null ? round.StartTimeMorning : defaultRound.StartTimeMorning,
|
||||||
|
LeaveTimeAfterNoon = round != null ? round.EndTimeAfternoon : defaultRound.EndTimeAfternoon,
|
||||||
|
EffectiveDate = p.DutyTimeEffectiveDate
|
||||||
|
};
|
||||||
|
resultSet.Add(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = resultSet, total = profile.Count });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_014 - เปลี่ยนรอบการลงเวลา (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("round")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> CreateChangeRoundAsync([FromBody] CreateChangeRoundDto req)
|
||||||
|
{
|
||||||
|
if (req.EffectiveDate.Date < DateTime.Now.Date)
|
||||||
|
{
|
||||||
|
return Error(new Exception("วันที่มีผลต้องมากกว่าหรือเท่ากับวันที่ปัจจุบัน"), StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = await _userDutyTimeRepository.GetExist(req.ProfileId, req.EffectiveDate);
|
||||||
|
|
||||||
|
if (old != null)
|
||||||
|
{
|
||||||
|
return Error(new Exception("ไม่สามารถทำรายการได้ เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = new UserDutyTime
|
||||||
|
{
|
||||||
|
ProfileId = req.ProfileId,
|
||||||
|
DutyTimeId = req.RoundId,
|
||||||
|
EffectiveDate = req.EffectiveDate,
|
||||||
|
Remark = req.Remark,
|
||||||
|
};
|
||||||
|
|
||||||
|
await _userDutyTimeRepository.AddAsync(data);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_015 - ประวัติการเปลี่ยนรอบการลงเวลา (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("round/{id:guid}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetChangeRoundHistoryByProfileIdAsync(Guid id, int page = 1, int pageSize = 10, string keyword = "")
|
||||||
|
{
|
||||||
|
var data = await _userDutyTimeRepository.GetListByProfileIdAsync(id);
|
||||||
|
|
||||||
|
var resultSet = new List<ChangeRoundHistoryDto>();
|
||||||
|
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
resultSet = data
|
||||||
|
.GroupBy(item => item.ProfileId)
|
||||||
|
.SelectMany(group => group
|
||||||
|
.OrderBy(item => item.EffectiveDate) // เรียงลำดับตาม property ที่คุณต้องการ
|
||||||
|
.Select((item, index) => new ChangeRoundHistoryDto
|
||||||
|
{
|
||||||
|
Round = index + 1,
|
||||||
|
StartTimeMorning = item.DutyTime.StartTimeMorning,
|
||||||
|
LeaveTimeAfternoon = item.DutyTime.EndTimeAfternoon,
|
||||||
|
EffectiveDate = item.EffectiveDate.Value,
|
||||||
|
Remark = item.Remark
|
||||||
|
}))
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = resultSet, total = data.Count });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " ขอลงเวลาเป็นกรณีพิเศษ "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_017 - เพิ่มลงเวลากรณีพิเศษ (USER)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("user/edit")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> CreateAdditionalCheckRequestAsync([FromBody] CreateAdditionalCheckRequestDto req)
|
||||||
|
{
|
||||||
|
if (req.CheckDate.Date > DateTime.Now.Date)
|
||||||
|
{
|
||||||
|
return Error("ไม่สามารถขอลงเวลากรณีพิเศษในวันที่มากกว่าวันที่ปัจจุบันได้", StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var request = new AdditionalCheckRequest
|
||||||
|
{
|
||||||
|
KeycloakUserId = UserId != null ? Guid.Parse(UserId) : Guid.Empty,
|
||||||
|
CheckDate = req.CheckDate,
|
||||||
|
CheckInEdit = req.CheckInEdit,
|
||||||
|
CheckOutEdit = req.CheckOutEdit,
|
||||||
|
Description = req.Description,
|
||||||
|
};
|
||||||
|
await _additionalCheckRequestRepository.AddAsync(request);
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_018 - รายการลงเวลากรณีพิเศษ (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("admin/edit")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetAdditionalCheckRequestAsync([Required] int year, [Required] int month, [Required] int page = 1, [Required] int pageSize = 10, string keyword = "")
|
||||||
|
{
|
||||||
|
var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequests(year, month);
|
||||||
|
|
||||||
|
var getDefaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||||
|
if (getDefaultRound == null)
|
||||||
|
{
|
||||||
|
return Error("ไม่พบรอบลงเวลา Default", StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = new List<GetAdditionalCheckRequestDto>();
|
||||||
|
|
||||||
|
foreach (var data in rawData)
|
||||||
|
{
|
||||||
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId);
|
||||||
|
if (profile == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||||
|
var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
|
||||||
|
|
||||||
|
var duty = userRound ?? getDefaultRound;
|
||||||
|
|
||||||
|
// create result object to return
|
||||||
|
var resObj = new GetAdditionalCheckRequestDto
|
||||||
|
{
|
||||||
|
Id = data.Id,
|
||||||
|
FullName = $"{profile.Prefix.Name}{profile.FirstName} {profile.LastName}",
|
||||||
|
CreatedAt = data.CreatedAt,
|
||||||
|
CheckDate = data.CheckDate,
|
||||||
|
CheckInEdit = data.CheckInEdit,
|
||||||
|
CheckOutEdit = data.CheckOutEdit,
|
||||||
|
|
||||||
|
CheckInTime = checkInData == null ? "00:00" : checkInData.CheckIn.ToString("HH:mm"),
|
||||||
|
CheckOutTime = checkInData == null ? "00:00" : checkInData.CheckOut == null ? "00:00" : checkInData.CheckOut.Value.ToString("HH:mm"),
|
||||||
|
|
||||||
|
CheckInStatus = checkInData == null ? null :
|
||||||
|
DateTime.Parse(checkInData.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
|
DateTime.Parse($"{checkInData.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
|
||||||
|
CheckOutStatus = checkInData == null ? null :
|
||||||
|
checkInData.CheckOut == null ? null :
|
||||||
|
DateTime.Parse(checkInData.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
|
DateTime.Parse($"{checkInData.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||||
|
"LATE" :
|
||||||
|
"NORMAL",
|
||||||
|
|
||||||
|
StartTimeMorning = duty.StartTimeMorning,
|
||||||
|
EndTimeMorning = duty.EndTimeMorning,
|
||||||
|
StartTimeAfternoon = duty.StartTimeAfternoon,
|
||||||
|
EndTimeAfternoon = duty.EndTimeAfternoon,
|
||||||
|
|
||||||
|
Reason = data.Comment ?? "",
|
||||||
|
Status = data.Status,
|
||||||
|
Description = data.Description,
|
||||||
|
|
||||||
|
StatusSort = data.Status.Trim().ToLower() == "pending" ? 1 :
|
||||||
|
data.Status.Trim().ToLower() == "approve" ? 2 : 3,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
result.Add(resObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
result = result.Where(x => x.FullName.Contains(keyword)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
var pageResult = result.Skip((page - 1) * pageSize).Take(pageSize)
|
||||||
|
.OrderBy(x => x.StatusSort)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return Success(new { data = pageResult, total = result.Count });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_019 - อนุมัติลงเวลากรณีพิเศษ (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("admin/edit/approve/{id:guid}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> ApproveRequestAsync(Guid id, [FromBody] ApproveRequestDto req)
|
||||||
|
{
|
||||||
|
if (req.Reason == null || req.Reason == string.Empty)
|
||||||
|
{
|
||||||
|
return Error("กรุณากรอกเหตุผล", StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var requestData = await _additionalCheckRequestRepository.GetByIdAsync(id);
|
||||||
|
if (requestData == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
requestData.Status = "APPROVE";
|
||||||
|
requestData.Comment = req.Reason;
|
||||||
|
await _additionalCheckRequestRepository.UpdateAsync(requestData);
|
||||||
|
|
||||||
|
// change user timestamp
|
||||||
|
var processTimeStamp = await _processUserTimeStampRepository.GetTimestampByDateAsync(requestData.KeycloakUserId, requestData.CheckDate.Date);
|
||||||
|
|
||||||
|
if (processTimeStamp == null)
|
||||||
|
{
|
||||||
|
processTimeStamp = new ProcessUserTimeStamp
|
||||||
|
{
|
||||||
|
KeycloakUserId = requestData.KeycloakUserId,
|
||||||
|
CheckIn = DateTime.Parse($"{requestData.CheckDate.Date.ToString("yyyy-MM-dd")} {req.CheckInTime}"),
|
||||||
|
CheckOut = DateTime.Parse($"{requestData.CheckDate.Date.ToString("yyyy-MM-dd")} {req.CheckOutTime}"),
|
||||||
|
CheckInRemark = req.Reason,
|
||||||
|
CheckOutRemark = req.Reason,
|
||||||
|
|
||||||
|
CheckInLat = 0,
|
||||||
|
CheckInLon = 0,
|
||||||
|
CheckOutLat = 0,
|
||||||
|
CheckOutLon = 0,
|
||||||
|
CheckInPOI = "ลงเวลากรณีพิเศษ",
|
||||||
|
CheckOutPOI = "ลงเวลากรณีพิเศษ",
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
await _processUserTimeStampRepository.AddAsync(processTimeStamp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (requestData.CheckInEdit)
|
||||||
|
{
|
||||||
|
processTimeStamp.CheckIn = DateTime.Parse($"{requestData.CheckDate.Date.ToString("yyyy-MM-dd")} {req.CheckInTime}");
|
||||||
|
processTimeStamp.CheckInRemark = req.Reason;
|
||||||
|
processTimeStamp.CheckInLat = 0;
|
||||||
|
processTimeStamp.CheckInLon = 0;
|
||||||
|
processTimeStamp.CheckInPOI = "ลงเวลากรณีพิเศษ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestData.CheckOutEdit)
|
||||||
|
{
|
||||||
|
processTimeStamp.CheckOut = DateTime.Parse($"{requestData.CheckDate.Date.ToString("yyyy-MM-dd")} {req.CheckOutTime}");
|
||||||
|
processTimeStamp.CheckOutRemark = req.Reason;
|
||||||
|
processTimeStamp.CheckOutLat = 0;
|
||||||
|
processTimeStamp.CheckOutLon = 0;
|
||||||
|
processTimeStamp.CheckOutPOI = "ลงเวลากรณีพิเศษ";
|
||||||
|
}
|
||||||
|
|
||||||
|
await _processUserTimeStampRepository.UpdateAsync(processTimeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LV1_020 - ไม่อนุมัติลงเวลากรณีพิเศษ (ADMIN)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// </returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("admin/edit/reject/{id:guid}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> RejectRequestAsync(Guid id, [FromBody] RejectRequestDto req)
|
||||||
|
{
|
||||||
|
if (req.Reason == null || req.Reason == string.Empty)
|
||||||
|
{
|
||||||
|
return Error("กรุณากรอกเหตุผล", StatusCodes.Status400BadRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var requestData = await _additionalCheckRequestRepository.GetByIdAsync(id);
|
||||||
|
if (requestData == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
requestData.Status = "REJECT";
|
||||||
|
requestData.Comment = req.Reason;
|
||||||
|
await _additionalCheckRequestRepository.UpdateAsync(requestData);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.AdditionalCheck
|
||||||
|
{
|
||||||
|
public class ApproveRequestDto
|
||||||
|
{
|
||||||
|
public string CheckInTime { get; set; }
|
||||||
|
|
||||||
|
public string CheckOutTime { get; set; }
|
||||||
|
|
||||||
|
public string CheckInStatus { get; set; }
|
||||||
|
|
||||||
|
public string CheckOutStatus { get; set; }
|
||||||
|
|
||||||
|
public string Reason { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.AdditionalCheck
|
||||||
|
{
|
||||||
|
public class CreateAdditionalCheckRequestDto
|
||||||
|
{
|
||||||
|
public DateTime CheckDate { get; set; }
|
||||||
|
|
||||||
|
public bool CheckInEdit { get; set; }
|
||||||
|
|
||||||
|
public bool CheckOutEdit { get; set;}
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.AdditionalCheck
|
||||||
|
{
|
||||||
|
public class GetAdditionalCheckRequestDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
|
||||||
|
public DateTime CheckDate { get; set; }
|
||||||
|
|
||||||
|
public bool CheckInEdit { get; set; }
|
||||||
|
|
||||||
|
public bool CheckOutEdit { get; set; }
|
||||||
|
|
||||||
|
public string CheckInTime { get; set; }
|
||||||
|
|
||||||
|
public string CheckOutTime { get; set; }
|
||||||
|
|
||||||
|
public string? CheckInStatus { get; set; }
|
||||||
|
|
||||||
|
public string? CheckOutStatus { get; set; }
|
||||||
|
|
||||||
|
public string StartTimeMorning { get; set; }
|
||||||
|
|
||||||
|
public string EndTimeMorning { get; set; }
|
||||||
|
|
||||||
|
public string StartTimeAfternoon { get; set; }
|
||||||
|
|
||||||
|
public string EndTimeAfternoon { get; set; }
|
||||||
|
|
||||||
|
public string Reason { get; set; }
|
||||||
|
|
||||||
|
public string Status { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
public int StatusSort { get; set; } = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.AdditionalCheck
|
||||||
|
{
|
||||||
|
public class RejectRequestDto
|
||||||
|
{
|
||||||
|
public string Reason { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.ChangeRound
|
||||||
|
{
|
||||||
|
public class ChangeRoundHistoryDto
|
||||||
|
{
|
||||||
|
|
||||||
|
public int Round { get; set; }
|
||||||
|
|
||||||
|
public string StartTimeMorning { get; set; }
|
||||||
|
|
||||||
|
public string LeaveTimeAfternoon { get; set; }
|
||||||
|
|
||||||
|
public DateTime EffectiveDate { get; set; }
|
||||||
|
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.ChangeRound
|
||||||
|
{
|
||||||
|
public class CreateChangeRoundDto
|
||||||
|
{
|
||||||
|
public Guid ProfileId { get; set; }
|
||||||
|
|
||||||
|
public Guid RoundId { get; set; }
|
||||||
|
|
||||||
|
public DateTime EffectiveDate { get; set; }
|
||||||
|
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
BMA.EHR.Leave.Service/DTOs/ChangeRound/SearchProfileDto.cs
Normal file
17
BMA.EHR.Leave.Service/DTOs/ChangeRound/SearchProfileDto.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.ChangeRound
|
||||||
|
{
|
||||||
|
public class SearchProfileDto
|
||||||
|
{
|
||||||
|
public string? CitizenId { get; set; }
|
||||||
|
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
|
||||||
|
public string? LastName { get; set; }
|
||||||
|
|
||||||
|
public int Page { get; set; } = 1;
|
||||||
|
|
||||||
|
public int PageSize { get; set; } = 10;
|
||||||
|
|
||||||
|
public string? Keyword { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.ChangeRound
|
||||||
|
{
|
||||||
|
public class SearchProfileResultDto
|
||||||
|
{
|
||||||
|
public Guid ProfileId { get; set; }
|
||||||
|
|
||||||
|
public string CitizenId { get; set; }
|
||||||
|
|
||||||
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
public string StartTimeMorning { get; set; }
|
||||||
|
|
||||||
|
public string LeaveTimeAfterNoon { get;set; }
|
||||||
|
|
||||||
|
public DateTime? EffectiveDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,9 +8,11 @@
|
||||||
|
|
||||||
public DateTime? CheckInDate { get; set; } = DateTime.MinValue;
|
public DateTime? CheckInDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? CheckInStatus { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string? CheckInTime { get; set; } = "00:00";
|
public string? CheckInTime { get; set; } = "00:00";
|
||||||
|
|
||||||
public string? CheckInLocation { get; set; } = string.Empty;
|
public string? CheckInPOI { get; set; } = string.Empty;
|
||||||
|
|
||||||
public double? CheckInLat { get; set; } = 0;
|
public double? CheckInLat { get; set; } = 0;
|
||||||
|
|
||||||
|
|
@ -18,16 +20,22 @@
|
||||||
|
|
||||||
public string? CheckInImg { get; set; } = string.Empty;
|
public string? CheckInImg { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string CheckInDescription { get; set; } = string.Empty;
|
||||||
|
|
||||||
public DateTime? CheckOutDate { get; set; } = DateTime.MinValue;
|
public DateTime? CheckOutDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? CheckOutStatus { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string? CheckOutTime { get; set; } = "00:00";
|
public string? CheckOutTime { get; set; } = "00:00";
|
||||||
|
|
||||||
public string? CheckOutLocation { get; set; } = string.Empty;
|
public string? CheckOutPOI { get; set; } = string.Empty;
|
||||||
|
|
||||||
public double? CheckOutLat { get; set; } = 0;
|
public double? CheckOutLat { get; set; } = 0;
|
||||||
|
|
||||||
public double? CheckOutLon { get; set; } = 0;
|
public double? CheckOutLon { get; set; } = 0;
|
||||||
|
|
||||||
public string? CheckOutImg { get; set; } = string.Empty;
|
public string? CheckOutImg { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string? CheckOutDescription { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
namespace BMA.EHR.Leave.Service.DTOs.CheckIn
|
||||||
|
{
|
||||||
|
public class CheckInProcessHistoryForAdminDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
public string FullName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public DateTime? CheckInDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? CheckInTime { get; set; } = "00:00";
|
||||||
|
|
||||||
|
public string? CheckInLocation { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double? CheckInLat { get; set; } = 0;
|
||||||
|
|
||||||
|
public double? CheckInLon { get; set; } = 0;
|
||||||
|
|
||||||
|
public string? CheckInStatus { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public DateTime? CheckOutDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? CheckOutTime { get; set; } = "00:00";
|
||||||
|
|
||||||
|
public string? CheckOutLocation { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double? CheckOutLat { get; set; } = 0;
|
||||||
|
|
||||||
|
public double? CheckOutLon { get; set; } = 0;
|
||||||
|
|
||||||
|
public string? CheckOutStatus { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
BMA.EHR.Leave.Service/Filters/CustomAuthorizeFilter.cs
Normal file
15
BMA.EHR.Leave.Service/Filters/CustomAuthorizeFilter.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
using Hangfire.Dashboard;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Leave.Service.Filters
|
||||||
|
{
|
||||||
|
public class CustomAuthorizeFilter : IDashboardAuthorizationFilter
|
||||||
|
{
|
||||||
|
public bool Authorize([NotNull] DashboardContext context)
|
||||||
|
{
|
||||||
|
//var httpcontext = context.GetHttpContext();
|
||||||
|
//return httpcontext.User.Identity.IsAuthenticated;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using BMA.EHR.Application;
|
using BMA.EHR.Application;
|
||||||
using BMA.EHR.Leave.Service;
|
using BMA.EHR.Leave.Service;
|
||||||
using BMA.EHR.Domain.Middlewares;
|
using BMA.EHR.Domain.Middlewares;
|
||||||
using BMA.EHR.Infrastructure;
|
using BMA.EHR.Infrastructure;
|
||||||
|
|
@ -15,6 +15,12 @@ using Serilog.Exceptions;
|
||||||
using Serilog.Sinks.Elasticsearch;
|
using Serilog.Sinks.Elasticsearch;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Hangfire;
|
||||||
|
using Hangfire.MySql;
|
||||||
|
using System.Transactions;
|
||||||
|
using BMA.EHR.Leave.Service.Filters;
|
||||||
|
using Hangfire.Common;
|
||||||
|
using BMA.EHR.Application.Repositories.Leaves.TimeAttendants;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
{
|
{
|
||||||
|
|
@ -93,6 +99,29 @@ var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
|
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
|
||||||
|
|
||||||
builder.Services.AddHealthChecks();
|
builder.Services.AddHealthChecks();
|
||||||
|
|
||||||
|
// Add Hangfire services.
|
||||||
|
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||||
|
|
||||||
|
builder.Services.AddHangfire(configuration => configuration
|
||||||
|
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
|
||||||
|
.UseSimpleAssemblyNameTypeSerializer()
|
||||||
|
.UseRecommendedSerializerSettings()
|
||||||
|
.UseStorage(
|
||||||
|
new MySqlStorage(
|
||||||
|
defaultConnection,
|
||||||
|
new MySqlStorageOptions
|
||||||
|
{
|
||||||
|
TransactionIsolationLevel = IsolationLevel.ReadCommitted,
|
||||||
|
QueuePollInterval = TimeSpan.FromSeconds(15),
|
||||||
|
JobExpirationCheckInterval = TimeSpan.FromHours(1),
|
||||||
|
CountersAggregateInterval = TimeSpan.FromMinutes(5),
|
||||||
|
PrepareSchemaIfNecessary = true,
|
||||||
|
DashboardJobListLimit = 50000,
|
||||||
|
TransactionTimeout = TimeSpan.FromMinutes(1),
|
||||||
|
TablesPrefix = "Hangfire"
|
||||||
|
})));
|
||||||
|
builder.Services.AddHangfireServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
@ -124,6 +153,18 @@ var app = builder.Build();
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
app.UseMiddleware<ErrorHandlerMiddleware>();
|
app.UseMiddleware<ErrorHandlerMiddleware>();
|
||||||
|
|
||||||
|
|
||||||
|
app.UseHangfireDashboard("/hangfire", new DashboardOptions()
|
||||||
|
{
|
||||||
|
Authorization = new[] { new CustomAuthorizeFilter() }
|
||||||
|
});
|
||||||
|
|
||||||
|
var manager = new RecurringJobManager();
|
||||||
|
if (manager != null)
|
||||||
|
{
|
||||||
|
manager.AddOrUpdate("ปรับปรุงรอบการลงเวลาทำงาน", Job.FromExpression<UserDutyTimeRepository>(x => x.UpdateUserDutyTime()), Cron.Daily(6, 0), TimeZoneInfo.Local);
|
||||||
|
}
|
||||||
|
|
||||||
// apply migrations
|
// apply migrations
|
||||||
await using var scope = app.Services.CreateAsyncScope();
|
await using var scope = app.Services.CreateAsyncScope();
|
||||||
await using var db = scope.ServiceProvider.GetRequiredService<LeaveDbContext>();
|
await using var db = scope.ServiceProvider.GetRequiredService<LeaveDbContext>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue