From fcf76349f66ca22fb14694a64c5c9058be4805b4 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 24 Mar 2025 16:33:46 +0700 Subject: [PATCH 1/8] =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A5=E0=B8=94=E0=B9=8C=20posExecutiveName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PlacementAppointmentController.cs | 1 + BMA.EHR.Placement.Service/Controllers/PlacementController.cs | 1 + .../Controllers/PlacementReceiveController.cs | 1 + .../Requests/PersonSelectPositionAppointmentRequest.cs | 1 + .../Requests/PersonSelectPositionReceiveRequest.cs | 1 + .../Requests/PersonSelectPositionRequest.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 55406e64..c251b5f5 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -574,6 +574,7 @@ namespace BMA.EHR.Placement.Service.Controllers uppdated.positionId = req.positionId; uppdated.posMasterNo = req.posMasterNo; uppdated.position = req.positionName; + uppdated.PositionExecutive = req.posExecutiveName; uppdated.positionField = req.positionField; uppdated.posTypeId = req.posTypeId; uppdated.posTypeName = req.posTypeName; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index f47673e8..56aa10ed 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -968,6 +968,7 @@ namespace BMA.EHR.Placement.Service.Controllers person.positionId = req.positionId; person.posMasterNo = req.posMasterNo; person.positionName = req.positionName; + person.PositionExecutive = req.posExecutiveName; person.positionField = req.positionField; person.posTypeId = req.posTypeId; person.posTypeName = req.posTypeName; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 99bf35eb..127e4fd3 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -673,6 +673,7 @@ namespace BMA.EHR.Placement.Service.Controllers uppdated.positionId = req.positionId; uppdated.posMasterNo = req.posMasterNo; uppdated.position = req.positionName; + uppdated.PositionExecutive = req.posExecutiveName; uppdated.positionField = req.positionField; uppdated.posTypeId = req.posTypeId; uppdated.posTypeName = req.posTypeName; diff --git a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionAppointmentRequest.cs b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionAppointmentRequest.cs index 21bdc0f5..c3b084bc 100644 --- a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionAppointmentRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionAppointmentRequest.cs @@ -29,5 +29,6 @@ namespace BMA.EHR.Placement.Service.Requests public string? posLevelId { get; set; } public string? posLevelName { get; set; } public string? typeCommand { get; set; } + public string? posExecutiveName { get; set; } } } \ No newline at end of file diff --git a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionReceiveRequest.cs b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionReceiveRequest.cs index a41a2b62..340647cf 100644 --- a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionReceiveRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionReceiveRequest.cs @@ -29,5 +29,6 @@ namespace BMA.EHR.Placement.Service.Requests public string? posLevelId { get; set; } public string? posLevelName { get; set; } public string? typeCommand { get; set; } + public string? posExecutiveName { get; set; } } } \ No newline at end of file diff --git a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionRequest.cs b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionRequest.cs index c4457424..511cd196 100644 --- a/BMA.EHR.Placement.Service/Requests/PersonSelectPositionRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/PersonSelectPositionRequest.cs @@ -38,5 +38,6 @@ namespace BMA.EHR.Placement.Service.Requests public string? posLevelId { get; set; } public string? posLevelName { get; set; } public string? typeCommand { get; set; } + public string? posExecutiveName { get; set; } } } \ No newline at end of file From a7bf381d0af39bb7433bd059a96096935aa62198 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 24 Mar 2025 18:01:59 +0700 Subject: [PATCH 2/8] fix bug retirement --- .../Reports/RetireReportRepository.cs | 36 ++++++++++++++++++- .../Controllers/RetirementOutController.cs | 3 +- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs index 1e9eb62c..ff5fa3e3 100644 --- a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -400,9 +400,43 @@ namespace BMA.EHR.Application.Repositories.Reports p.RemarkHorizontal, }) .FirstOrDefaultAsync(); + if (data == null) + data = await _dbContext.Set().AsQueryable() + .Where(x => x.Id == id) + .Select(p => new + { + p.Id, + p.prefix, + p.firstName, + p.lastName, + p.profileId, + p.Location, + p.SendDate, + p.ActiveDate, + p.Reason, + p.Status, + salary = p.AmountOld, + p.ApproveReason, + p.RejectReason, + p.IsActive, + p.CreatedAt, + p.PositionTypeOld, + p.PositionLevelOld, + p.PositionNumberOld, + p.OrganizationPositionOld, + p.OligarchReject, + p.OligarchApproveReason, + p.OligarchRejectReason, + p.OligarchRejectDate, + p.CommanderReject, + p.CommanderApproveReason, + p.CommanderRejectReason, + p.CommanderRejectDate, + p.RemarkHorizontal, + }) + .FirstOrDefaultAsync(); if (data == null) return null; - var _data = new { data.Id, diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 356ee3eb..ceeba566 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -149,7 +149,8 @@ namespace BMA.EHR.Retirement.Service.Controllers p.IsActive, }) .ToListAsync(); - if (status != null && status.Trim().ToUpper() != "WAITTING") + //if (status != null && status.Trim().ToUpper() != "WAITTING") + if (status != null) retirementOuts = retirementOuts.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList(); return Success(retirementOuts); } From 54e634d0062a02a561123334b202561845dc84a9 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 25 Mar 2025 18:05:25 +0700 Subject: [PATCH 3/8] =?UTF-8?q?fix=20bug=20=E0=B8=AA=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B8=B1=E0=B8=87=E0=B8=AA=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B9=80=E0=B8=A7=E0=B8=B5=E0=B8=A2=E0=B8=99=20(issue=20#1280,?= =?UTF-8?q?=20#1282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RetirementDeceasedController.cs | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs index dca86be2..7f170ec0 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs @@ -553,6 +553,10 @@ namespace BMA.EHR.Retirement.Service.Controllers if (retirementDeceased == null) return Error(GlobalMessages.RetirementDeceasedNotFound, 404); + bool checkDup = req.Persons.Any(x => retirementDeceased.RetirementDeceasedNotis.Any(y => y.profileId == x.ProfileId)); + if (checkDup) + return Error("ไม่สามารถเพิ่มรายชื่อส่งหนังสือเวียนซ้ำได้", 404); + foreach (var item in req.Persons) { // var profile = await _context.Profiles.AsQueryable() @@ -574,8 +578,8 @@ namespace BMA.EHR.Retirement.Service.Controllers LastUpdateUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, }; - if (retirementDeceased.profileType.Trim().ToUpper() == "OFFICER") - { + //if (retirementDeceased.profileType.Trim().ToUpper() == "OFFICER") + //{ var apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{item.ProfileId}"; using (var client = new HttpClient()) { @@ -602,36 +606,36 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.root == null ? "" : org.result.root); retirementDeceased.RetirementDeceasedNotis.Add(retirementDeceasedNoti); } - } - else - { - var apiUrl = $"{_configuration["API"]}/org/profile-employee/profileid/position/{item.ProfileId}"; - using (var client = new HttpClient()) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); - var _res = await client.SendAsync(_req); - var _result = await _res.Content.ReadAsStringAsync(); + //} + //else + //{ + // var apiUrl = $"{_configuration["API"]}/org/profile-employee/profileid/position/{item.ProfileId}"; + // using (var client = new HttpClient()) + // { + // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + // var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); + // var _res = await client.SendAsync(_req); + // var _result = await _res.Content.ReadAsStringAsync(); - var org = JsonConvert.DeserializeObject(_result); + // var org = JsonConvert.DeserializeObject(_result); - if (org == null || org.result == null) - continue; + // if (org == null || org.result == null) + // continue; - retirementDeceasedNoti.Prefix = org.result.prefix == null ? "" : org.result.prefix; - retirementDeceasedNoti.FirstName = org.result.firstName == null ? "" : org.result.firstName; - retirementDeceasedNoti.LastName = org.result.lastName == null ? "" : org.result.lastName; - retirementDeceasedNoti.CitizenId = org.result.citizenId == null ? "" : org.result.citizenId; - retirementDeceasedNoti.PositionName = org.result.position == null ? "" : org.result.position; - retirementDeceasedNoti.OrganizationName = (org.result.child4 == null ? "" : org.result.child4 + "\n") + - (org.result.child3 == null ? "" : org.result.child3 + "\n") + - (org.result.child2 == null ? "" : org.result.child2 + "\n") + - (org.result.child1 == null ? "" : org.result.child1 + "\n") + - (org.result.root == null ? "" : org.result.root); - retirementDeceased.RetirementDeceasedNotis.Add(retirementDeceasedNoti); - } - } + // retirementDeceasedNoti.Prefix = org.result.prefix == null ? "" : org.result.prefix; + // retirementDeceasedNoti.FirstName = org.result.firstName == null ? "" : org.result.firstName; + // retirementDeceasedNoti.LastName = org.result.lastName == null ? "" : org.result.lastName; + // retirementDeceasedNoti.CitizenId = org.result.citizenId == null ? "" : org.result.citizenId; + // retirementDeceasedNoti.PositionName = org.result.position == null ? "" : org.result.position; + // retirementDeceasedNoti.OrganizationName = (org.result.child4 == null ? "" : org.result.child4 + "\n") + + // (org.result.child3 == null ? "" : org.result.child3 + "\n") + + // (org.result.child2 == null ? "" : org.result.child2 + "\n") + + // (org.result.child1 == null ? "" : org.result.child1 + "\n") + + // (org.result.root == null ? "" : org.result.root); + // retirementDeceased.RetirementDeceasedNotis.Add(retirementDeceasedNoti); + // } + //} await _context.SaveChangesAsync(); } From 92451af236b21b40e912362f7e96de926d3716a3 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 26 Mar 2025 11:43:26 +0700 Subject: [PATCH 4/8] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B9=80=E0=B8=95=E0=B8=B4=E0=B8=A1=20function=20?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=82=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=99=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Middlewares/RequestLoggingMiddleware.cs | 159 ++++++++++++++++-- BMA.EHR.Leave/Program.cs | 2 +- BMA.EHR.Leave/appsettings.json | 4 +- 3 files changed, 149 insertions(+), 16 deletions(-) diff --git a/BMA.EHR.Domain/Middlewares/RequestLoggingMiddleware.cs b/BMA.EHR.Domain/Middlewares/RequestLoggingMiddleware.cs index ef1297ac..55dcf051 100644 --- a/BMA.EHR.Domain/Middlewares/RequestLoggingMiddleware.cs +++ b/BMA.EHR.Domain/Middlewares/RequestLoggingMiddleware.cs @@ -1,49 +1,122 @@ -using Microsoft.AspNetCore.Http; +using BMA.EHR.Domain.Models.HR; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging.Abstractions; using Nest; +using Newtonsoft.Json; using Serilog; using System.Diagnostics; using System.IO; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text.Encodings.Web; using System.Text.Json; +using JsonSerializer = System.Text.Json.JsonSerializer; namespace BMA.EHR.Domain.Middlewares { public class RequestLoggingMiddleware { private readonly RequestDelegate _next; + private readonly IConfiguration _configuration; - public RequestLoggingMiddleware(RequestDelegate next) + private string Uri = ""; + private string IndexFormat = ""; + private string SystemName = ""; + private string APIKey = ""; + + public RequestLoggingMiddleware(RequestDelegate next, IConfiguration configuration) { _next = next; + _configuration = configuration; + + Uri = _configuration["ElasticConfiguration:Uri"] ?? "http://192.168.1.40:9200"; + IndexFormat = _configuration["ElasticConfiguration:IndexFormat"] ?? "bma-ehr-log-index"; + SystemName = _configuration["ElasticConfiguration:SystemName"] ?? "Unknown"; + } + + protected async Task GetExternalAPIAsync(string apiPath, string accessToken, string apiKey) + { + try + { + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", apiKey); + var _res = await client.GetAsync(apiPath); + if (_res.IsSuccessStatusCode) + { + var _result = await _res.Content.ReadAsStringAsync(); + + return _result; + } + return string.Empty; + } + } + catch + { + throw; + } + } + + public async Task GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken) + { + try + { + var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak/{keycloakId}"; + var apiKey = _configuration["API_KEY"]; + + var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey); + if (apiResult != null) + { + var raw = JsonConvert.DeserializeObject(apiResult); + if (raw != null) + return raw.Result; + } + + return null; + } + catch + { + throw; + } } public async Task Invoke(HttpContext context) { - var settings = new ConnectionSettings(new Uri("http://192.168.1.40:9200")) - .DefaultIndex("bma-ehr-log-test-net"); + var settings = new ConnectionSettings(new Uri(Uri)) + .DefaultIndex(IndexFormat); var client = new ElasticClient(settings); var startTime = DateTime.UtcNow; var stopwatch = Stopwatch.StartNew(); + string? responseBodyJson = null; + string? requestBodyJson = null; string requestBody = await ReadRequestBodyAsync(context); + if (requestBody != "") + requestBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize(requestBody), new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true }); + var originalBodyStream = context.Response.Body; - using (var memoryStream = new MemoryStream()) { // เปลี่ยน stream ของ Response เพื่อให้สามารถอ่านได้ context.Response.Body = memoryStream; + + + var keycloakId = context.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? Guid.Empty.ToString("D"); + var token = context.Request.Headers["Authorization"]; + + var pf = await GetProfileByKeycloakIdAsync(Guid.Parse(keycloakId), token); + await _next(context); // ดำเนินการต่อไปยัง Middleware อื่น ๆ - - - stopwatch.Stop(); var processTime = stopwatch.ElapsedMilliseconds; var endTime = DateTime.UtcNow; @@ -55,16 +128,26 @@ namespace BMA.EHR.Domain.Middlewares _ => "info" }; + string? message = null; + // อ่านข้อมูลจาก Response หลังจากที่ได้ถูกส่งออกไป memoryStream.Seek(0, SeekOrigin.Begin); var responseBody = new StreamReader(memoryStream).ReadToEnd(); + if (responseBody != "") + responseBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize(responseBody), new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = true }); + + var json = JsonSerializer.Deserialize(responseBody); + if (json.TryGetProperty("message", out var messageElement)) + { + message = messageElement.GetString(); + } var logData = new { logType = logType, ip = context.Connection.RemoteIpAddress?.ToString(), - rootId = context.Items["RootId"] ?? null, - systemName = "test", + rootId = pf == null ? null : pf.RootId, + systemName = SystemName, startTimeStamp = startTime.ToString("o"), endTimeStamp = endTime.ToString("o"), processTime = processTime, @@ -72,9 +155,14 @@ namespace BMA.EHR.Domain.Middlewares method = context.Request.Method, endpoint = context.Request.Path + context.Request.QueryString, responseCode = context.Response.StatusCode == 304 ? "200" : context.Response.StatusCode.ToString(), - responseDescription = context.Items["ResponseMessage"] ?? null, - input = requestBody, - output = responseBody + responseDescription = message, + input = requestBodyJson, + output = responseBodyJson, + + userId = keycloakId, + userName = $"{pf?.Prefix ?? ""}{pf?.FirstName ?? ""} {pf?.LastName ?? ""}", + user = pf?.CitizenId ?? "" + }; // เขียนข้อมูลกลับไปยัง original Response body @@ -85,7 +173,7 @@ namespace BMA.EHR.Domain.Middlewares } - + //Log.Information("API Request Log: {@LogData}", logData); } @@ -98,4 +186,47 @@ namespace BMA.EHR.Domain.Middlewares return body; } } + + public class GetProfileByKeycloakIdLocal + { + public Guid Id { get; set; } + + public string? Prefix { get; set; } + public string? FirstName { get; set; } + public string? LastName { get; set; } + public string? CitizenId { get; set; } + + public string? Root { get; set; } + public string? Child1 { get; set; } + public string? Child2 { get; set; } + public string? Child3 { get; set; } + public string? Child4 { get; set; } + public Guid? RootId { get; set; } + public Guid? Child1Id { get; set; } + public Guid? Child2Id { get; set; } + public Guid? Child3Id { get; set; } + public Guid? Child4Id { get; set; } + public Guid? RootDnaId { get; set; } + public Guid? Child1DnaId { get; set; } + public Guid? Child2DnaId { get; set; } + public Guid? Child3DnaId { get; set; } + public Guid? Child4DnaId { get; set; } + public double? Amount { get; set; } + public double? PositionSalaryAmount { get; set; } + public string? Commander { get; set; } + + public Guid? CommanderId { get; set; } + + public Guid? CommanderKeycloak { get; set; } + + } + + public class GetProfileByKeycloakIdResultLocal + { + public string Message { get; set; } = string.Empty; + + public int Status { get; set; } = -1; + + public GetProfileByKeycloakIdLocal? Result { get; set; } + } } diff --git a/BMA.EHR.Leave/Program.cs b/BMA.EHR.Leave/Program.cs index ebe39458..bda6f614 100644 --- a/BMA.EHR.Leave/Program.cs +++ b/BMA.EHR.Leave/Program.cs @@ -162,7 +162,7 @@ app.UseStaticFiles(); app.MapControllers(); app.UseMiddleware(); // Disable ก่อน เพื่อแก้ไขให้เรีบร้อยก่อนการใช้งาน -// app.UseMiddleware(); +app.UseMiddleware(); app.UseHangfireDashboard("/hangfire", new DashboardOptions() diff --git a/BMA.EHR.Leave/appsettings.json b/BMA.EHR.Leave/appsettings.json index e5591a00..b5ad52fe 100644 --- a/BMA.EHR.Leave/appsettings.json +++ b/BMA.EHR.Leave/appsettings.json @@ -9,7 +9,9 @@ } }, "ElasticConfiguration": { - "Uri": "http://localhost:9200" + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "leave" }, "AllowedHosts": "*", "ConnectionStrings": { From 65fbf4582a54be2743321cf8c8467b1efa39f2ad Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 26 Mar 2025 12:11:41 +0700 Subject: [PATCH 5/8] =?UTF-8?q?add=20migration=20=E0=B8=AA=E0=B8=B3?= =?UTF-8?q?=E0=B8=AB=E0=B8=A3=E0=B8=B1=E0=B8=9A=20LeaveBeginning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Leave/Requests/LeaveBeginning.cs | 24 + ...0326045016_Add Leave Beginning.Designer.cs | 1365 +++++++++++++++++ .../20250326045016_Add Leave Beginning.cs | 59 + .../LeaveDb/LeaveDbContextModelSnapshot.cs | 81 + .../Persistence/LeaveDbContext.cs | 1 + 5 files changed, 1530 insertions(+) create mode 100644 BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs create mode 100644 BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.Designer.cs create mode 100644 BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.cs diff --git a/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs b/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs new file mode 100644 index 00000000..dea7fdc6 --- /dev/null +++ b/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs @@ -0,0 +1,24 @@ +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Leave.Commons; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Domain.Models.Leave.Requests +{ + public class LeaveBeginning : EntityBase + { + [Required, Comment("รหัส Profile ในระบบทะเบียนประวัติ")] + public Guid ProfileId { get; set; } = Guid.Empty; + + [Required, Comment("รหัสประเภทการลา")] + public Guid LeaveTypeId { get; set; } = Guid.Empty; + + public LeaveType LeaveType { get; set; } + + [Required, Comment("ปีงบประมาณ")] + public int LeaveYear { get; set; } = 0; + + [Required, Comment("จำนวนวันลา")] + public double LeaveDays { get; set; } = 0.0; + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.Designer.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.Designer.cs new file mode 100644 index 00000000..fcef0f9a --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.Designer.cs @@ -0,0 +1,1365 @@ +// +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("20250326045016_Add Leave Beginning")] + partial class AddLeaveBeginning + { + /// + 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.Documents.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ObjectRefId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Code") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รหัสประเภทการลา"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Limit") + .HasColumnType("int") + .HasComment("จำนวนวันลาสูงสุดประจำปี"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการลา"); + + b.HasKey("Id"); + + b.ToTable("LeaveTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LeaveDays") + .HasColumnType("double") + .HasComment("จำนวนวันลา"); + + b.Property("LeaveTypeId") + .HasColumnType("char(36)") + .HasComment("รหัสประเภทการลา"); + + b.Property("LeaveYear") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); + + b.HasKey("Id"); + + b.HasIndex("LeaveTypeId"); + + b.ToTable("LeaveBeginnings"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LeaveRequestId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("LeaveRequestId"); + + b.ToTable("LeaveDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AbsentDayAt") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AbsentDayGetIn") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AbsentDayLocation") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AbsentDayRegistorDate") + .HasColumnType("datetime(6)"); + + b.Property("AbsentDaySummon") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Amount") + .HasColumnType("double"); + + b.Property("ApproveStep") + .HasColumnType("longtext") + .HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ "); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("CancelLeaveWrote") + .HasColumnType("longtext") + .HasComment("เขียนที่ (ขอยกเลิก)"); + + b.Property("Child1") + .HasColumnType("longtext"); + + b.Property("Child1Id") + .HasColumnType("char(36)"); + + b.Property("Child2") + .HasColumnType("longtext"); + + b.Property("Child2Id") + .HasColumnType("char(36)"); + + b.Property("Child3") + .HasColumnType("longtext"); + + b.Property("Child3Id") + .HasColumnType("char(36)"); + + b.Property("Child4") + .HasColumnType("longtext"); + + b.Property("Child4Id") + .HasColumnType("char(36)"); + + b.Property("CitizenId") + .HasColumnType("longtext"); + + b.Property("CoupleDayCountryHistory") + .HasColumnType("longtext"); + + b.Property("CoupleDayEndDateHistory") + .HasColumnType("datetime(6)"); + + b.Property("CoupleDayLevel") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CoupleDayLevelCountry") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CoupleDayName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CoupleDayPosition") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CoupleDayStartDateHistory") + .HasColumnType("datetime(6)"); + + b.Property("CoupleDaySumTotalHistory") + .HasColumnType("longtext"); + + b.Property("CoupleDayTotalHistory") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateAppoint") + .HasColumnType("datetime(6)"); + + b.Property("Dear") + .HasColumnType("longtext") + .HasComment("เรียนใคร"); + + b.Property("FirstName") + .HasColumnType("longtext"); + + b.Property("Gender") + .HasColumnType("longtext"); + + b.Property("HajjDayStatus") + .HasColumnType("tinyint(1)"); + + b.Property("KeycloakUserId") + .HasColumnType("char(36)"); + + b.Property("LastName") + .HasColumnType("longtext"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LeaveAddress") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานที่ติดต่อขณะลา"); + + b.Property("LeaveBirthDate") + .HasColumnType("datetime(6)"); + + b.Property("LeaveCancelComment") + .HasColumnType("longtext") + .HasComment("เหตุผลในการขอยกเลิก"); + + b.Property("LeaveCancelDocumentId") + .HasColumnType("char(36)"); + + b.Property("LeaveCancelStatus") + .HasColumnType("longtext") + .HasComment("สถานะของคำขอยกเลิก"); + + b.Property("LeaveComment") + .HasColumnType("longtext") + .HasComment("ความเห็นของผู้บังคับบัญชา"); + + b.Property("LeaveDetail") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รายละเอียดการลา"); + + b.Property("LeaveDirectorComment") + .HasColumnType("longtext") + .HasComment("ความเห็นของผู้อำนวยการสำนัก"); + + b.Property("LeaveDraftDocumentId") + .HasColumnType("char(36)"); + + b.Property("LeaveEndDate") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปีสิ้นสุดลา"); + + b.Property("LeaveGovernmentDate") + .HasColumnType("datetime(6)"); + + b.Property("LeaveLast") + .HasColumnType("datetime(6)"); + + b.Property("LeaveNumber") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเลขที่ติดต่อขณะลา"); + + b.Property("LeaveRange") + .HasColumnType("longtext") + .HasComment("ช่วงของการลา เช่น ลาทั้งวัน ครึ่งวันเช้า ครึ่งวันบ่าย"); + + b.Property("LeaveSalary") + .HasColumnType("int"); + + b.Property("LeaveSalaryText") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("LeaveStartDate") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปีเริ่มต้นลา"); + + b.Property("LeaveStatus") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะของคำร้อง"); + + b.Property("LeaveTotal") + .HasColumnType("double"); + + b.Property("LeaveTypeCode") + .HasColumnType("longtext") + .HasComment("code ของประเภทการลา"); + + b.Property("LeaveWrote") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เขียนที่"); + + b.Property("OrdainDayBuddhistLentAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OrdainDayBuddhistLentName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OrdainDayLocationAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OrdainDayLocationName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OrdainDayLocationNumber") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("OrdainDayOrdination") + .HasColumnType("datetime(6)"); + + b.Property("OrdainDayStatus") + .HasColumnType("tinyint(1)"); + + b.Property("OrganizationName") + .HasColumnType("longtext") + .HasComment("สังกัดผู้ยื่นขอ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ระดับผู้ยื่นขอ"); + + b.Property("PositionName") + .HasColumnType("longtext") + .HasComment("ตำแหน่งผู้ยื่นขอ"); + + b.Property("Prefix") + .HasColumnType("longtext"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProfileType") + .HasColumnType("longtext"); + + b.Property("RestDayCurrentTotal") + .HasColumnType("double"); + + b.Property("RestDayOldTotal") + .HasColumnType("double"); + + b.Property("Root") + .HasColumnType("longtext"); + + b.Property("RootId") + .HasColumnType("char(36)"); + + b.Property("StudyDayCountry") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDayDegreeLevel") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDayScholarship") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDaySubject") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDayTrainingName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDayTrainingSubject") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("StudyDayUniversityName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TypeId") + .HasColumnType("char(36)"); + + b.Property("WifeDayDateBorn") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("WifeDayName") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("LeaveCancelDocumentId"); + + b.HasIndex("LeaveDraftDocumentId"); + + b.HasIndex("TypeId"); + + b.ToTable("LeaveRequests"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CheckDate") + .HasColumnType("datetime(6)") + .HasComment("*วันที่ลงเวลา"); + + b.Property("CheckInEdit") + .HasColumnType("tinyint(1)") + .HasComment("*ขอลงเวลาช่วงเช้า"); + + b.Property("CheckOutEdit") + .HasColumnType("tinyint(1)") + .HasComment("*ขอลงเวลาช่วงบ่าย"); + + b.Property("Comment") + .HasColumnType("longtext") + .HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext") + .HasComment("*หมายเหตุขอลงเวลาพิเศษ"); + + b.Property("FirstName") + .HasColumnType("longtext"); + + b.Property("KeycloakUserId") + .HasColumnType("char(36)") + .HasComment("รหัส User ของ Keycloak ที่ร้องขอ"); + + b.Property("LastName") + .HasColumnType("longtext"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Prefix") + .HasColumnType("longtext"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะการอนุมัติ"); + + b.HasKey("Id"); + + b.ToTable("AdditionalCheckRequests"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำอธิบาย"); + + b.Property("EndTimeAfternoon") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เวลาออกงานช่วงบ่าย"); + + b.Property("EndTimeMorning") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เวลาออกงานช่วงเช้า"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("StartTimeAfternoon") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เวลาเข้างานช่วงบ่าย"); + + b.Property("StartTimeMorning") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เวลาเข้างานช่วงเช้า"); + + b.HasKey("Id"); + + b.ToTable("DutyTimes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CheckIn") + .HasColumnType("datetime(6)") + .HasComment("วัน เวลา เข้างาน"); + + b.Property("CheckInImageUrl") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รูปถ่ายสถานที่ Check-In"); + + b.Property("CheckInLat") + .HasColumnType("double") + .HasComment("พิกัดละติจูด Check-In"); + + b.Property("CheckInLocationName") + .HasColumnType("longtext") + .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In"); + + b.Property("CheckInLon") + .HasColumnType("double") + .HasComment("พิกัดลองจิจูด Check-In"); + + b.Property("CheckInPOI") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In"); + + b.Property("CheckInRemark") + .HasColumnType("longtext") + .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In"); + + b.Property("CheckInStatus") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะ Check-In"); + + b.Property("CheckOut") + .HasColumnType("datetime(6)") + .HasComment("วัน เวลา ออกงาน"); + + b.Property("CheckOutImageUrl") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รูปถ่ายสถานที่ Check-Out"); + + b.Property("CheckOutLat") + .HasColumnType("double") + .HasComment("พิกัดละติจูด Check-Out"); + + b.Property("CheckOutLocationName") + .HasColumnType("longtext") + .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out"); + + b.Property("CheckOutLon") + .HasColumnType("double") + .HasComment("พิกัดลองจิจูด Check-Out"); + + b.Property("CheckOutPOI") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out"); + + b.Property("CheckOutRemark") + .HasColumnType("longtext") + .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out"); + + b.Property("CheckOutStatus") + .HasColumnType("longtext") + .HasComment("สถานะ Check-Out"); + + b.Property("Child1") + .HasColumnType("longtext"); + + b.Property("Child1Id") + .HasColumnType("char(36)"); + + b.Property("Child2") + .HasColumnType("longtext"); + + b.Property("Child2Id") + .HasColumnType("char(36)"); + + b.Property("Child3") + .HasColumnType("longtext"); + + b.Property("Child3Id") + .HasColumnType("char(36)"); + + b.Property("Child4") + .HasColumnType("longtext"); + + b.Property("Child4Id") + .HasColumnType("char(36)"); + + b.Property("CitizenId") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EditReason") + .HasColumnType("longtext") + .HasComment("เหตุผลการอนุมัติ/ไม่อนุมัติขอลงเวลาพิเศษ"); + + b.Property("EditStatus") + .HasColumnType("longtext") + .HasComment("สถานะการของลงเวลาพิเศษ"); + + b.Property("FirstName") + .HasColumnType("longtext"); + + b.Property("Gender") + .HasColumnType("longtext"); + + b.Property("IsLocationCheckIn") + .HasColumnType("tinyint(1)") + .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In"); + + b.Property("IsLocationCheckOut") + .HasColumnType("tinyint(1)") + .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out"); + + b.Property("IsProcess") + .HasColumnType("tinyint(1)") + .HasComment("นำไปประมวลผลแล้วหรือยัง"); + + b.Property("KeycloakUserId") + .HasColumnType("char(36)") + .HasComment("รหัส User ของ Keycloak"); + + b.Property("LastName") + .HasColumnType("longtext"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Prefix") + .HasColumnType("longtext"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProfileType") + .HasColumnType("longtext"); + + b.Property("Root") + .HasColumnType("longtext"); + + b.Property("RootId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("ProcessUserTimeStamps"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserCalendar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Calendar") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ปฏิทินการทำงานของ ขรก ปกติ หรือ 6 วันต่อสัปดาห์"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); + + b.HasKey("Id"); + + b.ToTable("UserCalendars"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DutyTimeId") + .HasColumnType("char(36)") + .HasComment("รหัสรอบการลงเวลา"); + + b.Property("EffectiveDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่มีผล"); + + b.Property("IsProcess") + .HasColumnType("tinyint(1)") + .HasComment("ทำการประมวลผลแล้วหรือยัง"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CheckIn") + .HasColumnType("datetime(6)") + .HasComment("วัน เวลา เข้างาน"); + + b.Property("CheckInImageUrl") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รูปถ่ายสถานที่ Check-In"); + + b.Property("CheckInLat") + .HasColumnType("double") + .HasComment("พิกัดละติจูด Check-In"); + + b.Property("CheckInLocationName") + .HasColumnType("longtext") + .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In"); + + b.Property("CheckInLon") + .HasColumnType("double") + .HasComment("พิกัดลองจิจูด Check-In"); + + b.Property("CheckInPOI") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In"); + + b.Property("CheckInRemark") + .HasColumnType("longtext") + .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In"); + + b.Property("CheckOut") + .HasColumnType("datetime(6)") + .HasComment("วัน เวลา ออกงาน"); + + b.Property("CheckOutImageUrl") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รูปถ่ายสถานที่ Check-Out"); + + b.Property("CheckOutLat") + .HasColumnType("double") + .HasComment("พิกัดละติจูด Check-Out"); + + b.Property("CheckOutLocationName") + .HasColumnType("longtext") + .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out"); + + b.Property("CheckOutLon") + .HasColumnType("double") + .HasComment("พิกัดลองจิจูด Check-Out"); + + b.Property("CheckOutPOI") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out"); + + b.Property("CheckOutRemark") + .HasColumnType("longtext") + .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out"); + + b.Property("Child1") + .HasColumnType("longtext"); + + b.Property("Child1Id") + .HasColumnType("char(36)"); + + b.Property("Child2") + .HasColumnType("longtext"); + + b.Property("Child2Id") + .HasColumnType("char(36)"); + + b.Property("Child3") + .HasColumnType("longtext"); + + b.Property("Child3Id") + .HasColumnType("char(36)"); + + b.Property("Child4") + .HasColumnType("longtext"); + + b.Property("Child4Id") + .HasColumnType("char(36)"); + + b.Property("CitizenId") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("FirstName") + .HasColumnType("longtext"); + + b.Property("Gender") + .HasColumnType("longtext"); + + b.Property("IsLocationCheckIn") + .HasColumnType("tinyint(1)") + .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In"); + + b.Property("IsLocationCheckOut") + .HasColumnType("tinyint(1)") + .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out"); + + b.Property("IsProcess") + .HasColumnType("tinyint(1)") + .HasComment("นำไปประมวลผลแล้วหรือยัง"); + + b.Property("KeycloakUserId") + .HasColumnType("char(36)") + .HasComment("รหัส User ของ Keycloak"); + + b.Property("LastName") + .HasColumnType("longtext"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Prefix") + .HasColumnType("longtext"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProfileType") + .HasColumnType("longtext"); + + b.Property("Root") + .HasColumnType("longtext"); + + b.Property("RootId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("UserTimeStamps"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => + { + b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LeaveType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", "LeaveRequest") + .WithMany("LeaveDocument") + .HasForeignKey("LeaveRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("LeaveRequest"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveCancelDocument") + .WithMany() + .HasForeignKey("LeaveCancelDocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveDraftDocument") + .WithMany() + .HasForeignKey("LeaveDraftDocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "Type") + .WithMany() + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LeaveCancelDocument"); + + b.Navigation("LeaveDraftDocument"); + + b.Navigation("Type"); + }); + + 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"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => + { + b.Navigation("LeaveDocument"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.cs new file mode 100644 index 00000000..313912c6 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20250326045016_Add Leave Beginning.cs @@ -0,0 +1,59 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.LeaveDb +{ + /// + public partial class AddLeaveBeginning : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "LeaveBeginnings", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + ProfileId = table.Column(type: "char(36)", nullable: false, comment: "รหัส Profile ในระบบทะเบียนประวัติ", collation: "ascii_general_ci"), + LeaveTypeId = table.Column(type: "char(36)", nullable: false, comment: "รหัสประเภทการลา", collation: "ascii_general_ci"), + LeaveYear = table.Column(type: "int", nullable: false, comment: "ปีงบประมาณ"), + LeaveDays = table.Column(type: "double", nullable: false, comment: "จำนวนวันลา") + }, + constraints: table => + { + table.PrimaryKey("PK_LeaveBeginnings", x => x.Id); + table.ForeignKey( + name: "FK_LeaveBeginnings_LeaveTypes_LeaveTypeId", + column: x => x.LeaveTypeId, + principalTable: "LeaveTypes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_LeaveBeginnings_LeaveTypeId", + table: "LeaveBeginnings", + column: "LeaveTypeId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "LeaveBeginnings"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs index 13e6f633..3ed10221 100644 --- a/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs @@ -119,6 +119,76 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb b.ToTable("LeaveTypes"); }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LeaveDays") + .HasColumnType("double") + .HasComment("จำนวนวันลา"); + + b.Property("LeaveTypeId") + .HasColumnType("char(36)") + .HasComment("รหัสประเภทการลา"); + + b.Property("LeaveYear") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.Property("ProfileId") + .HasColumnType("char(36)") + .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); + + b.HasKey("Id"); + + b.HasIndex("LeaveTypeId"); + + b.ToTable("LeaveBeginnings"); + }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => { b.Property("Id") @@ -1218,6 +1288,17 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb b.ToTable("UserTimeStamps"); }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => + { + b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "LeaveType") + .WithMany() + .HasForeignKey("LeaveTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LeaveType"); + }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => { b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") diff --git a/BMA.EHR.Infrastructure/Persistence/LeaveDbContext.cs b/BMA.EHR.Infrastructure/Persistence/LeaveDbContext.cs index cbc150a7..1b2dcbdf 100644 --- a/BMA.EHR.Infrastructure/Persistence/LeaveDbContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/LeaveDbContext.cs @@ -32,6 +32,7 @@ namespace BMA.EHR.Infrastructure.Persistence public DbSet LeaveDocuments { get; set; } + public DbSet LeaveBeginnings { get; set; } #endregion From 559d682dfd8fd234ba86cc2a2e38afb97df42c01 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 26 Mar 2025 12:24:34 +0700 Subject: [PATCH 6/8] add log to insignia --- BMA.EHR.Insignia/BMA.EHR.Insignia.csproj | 1 + BMA.EHR.Insignia/Program.cs | 4 ++-- BMA.EHR.Insignia/appsettings.json | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj b/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj index e4ba6d2b..3c761786 100644 --- a/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj +++ b/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj @@ -28,6 +28,7 @@ + diff --git a/BMA.EHR.Insignia/Program.cs b/BMA.EHR.Insignia/Program.cs index cec95718..b83b3d21 100644 --- a/BMA.EHR.Insignia/Program.cs +++ b/BMA.EHR.Insignia/Program.cs @@ -71,8 +71,8 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthorization(); // use serilog - ConfigureLogs(); - builder.Host.UseSerilog(); + //ConfigureLogs(); + //builder.Host.UseSerilog(); // Add config CORS builder.Services.AddCors(options => options.AddDefaultPolicy(builder => diff --git a/BMA.EHR.Insignia/appsettings.json b/BMA.EHR.Insignia/appsettings.json index 6c16b2ac..212bf833 100644 --- a/BMA.EHR.Insignia/appsettings.json +++ b/BMA.EHR.Insignia/appsettings.json @@ -9,9 +9,10 @@ } }, "ElasticConfiguration": { - "Uri": "http://192.168.1.40:9200" + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "insignia" }, - "LogIndex": "bma-ehr-log-index", "AllowedHosts": "*", "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", From f1460dd384bfe0aad897db8ea6595171328a43b8 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 26 Mar 2025 12:33:22 +0700 Subject: [PATCH 7/8] add log to discipline --- BMA.EHR.Discipline.Service/Program.cs | 6 +- BMA.EHR.Discipline.Service/appsettings.json | 100 ++++++++++---------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Program.cs b/BMA.EHR.Discipline.Service/Program.cs index d33c885a..4ead4ce6 100644 --- a/BMA.EHR.Discipline.Service/Program.cs +++ b/BMA.EHR.Discipline.Service/Program.cs @@ -69,8 +69,8 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthorization(); // use serilog - ConfigureLogs(); - builder.Host.UseSerilog(); + //ConfigureLogs(); + //builder.Host.UseSerilog(); // Add config CORS builder.Services.AddCors(options => options.AddDefaultPolicy(builder => @@ -154,6 +154,8 @@ var app = builder.Build(); app.UseStaticFiles(); app.MapControllers(); app.UseMiddleware(); + app.UseMiddleware(); + app.UseHangfireDashboard("/hangfire", new DashboardOptions() { Authorization = new[] { new CustomAuthorizeFilter() } diff --git a/BMA.EHR.Discipline.Service/appsettings.json b/BMA.EHR.Discipline.Service/appsettings.json index 62c756cb..4122d7ae 100644 --- a/BMA.EHR.Discipline.Service/appsettings.json +++ b/BMA.EHR.Discipline.Service/appsettings.json @@ -1,51 +1,53 @@ { - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Information", - "System": "Warning" - } - } - }, - "ElasticConfiguration": { - "Uri": "http://localhost:9200" - }, - "AllowedHosts": "*", - "ConnectionStrings": { - //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - }, - "Jwt": { - "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/hrms" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" - } - }, - "MinIO": { - "Endpoint": "https://edm-s3.frappet.synology.me/", - "AccessKey": "XxtdnJajPjp3hHuKdOMn", - "SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg", - "BucketName": "bma-ehr-fpt" - }, - "Mail": { - "Server": "smtp.gmail.com", - "User": "suphonchai.ph@gmail.com", - "Password": "nnjazjcnwhepkxdm", - "MailFrom": "suphonchai.ph@gmail.com", - "Port": "587" - }, - "KeycloakCron": { - "Hour": "08", - "Minute": "00" - }, - "Protocol": "HTTPS", - "API": "https://bma-ehr.frappet.synology.me/api/v1", - "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Information", + "System": "Warning" + } + } + }, + "ElasticConfiguration": { + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "discipline" + }, + "AllowedHosts": "*", + "ConnectionStrings": { + //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + }, + "Jwt": { + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/hrms" + }, + "EPPlus": { + "ExcelPackage": { + "LicenseContext": "NonCommercial" + } + }, + "MinIO": { + "Endpoint": "https://edm-s3.frappet.synology.me/", + "AccessKey": "XxtdnJajPjp3hHuKdOMn", + "SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg", + "BucketName": "bma-ehr-fpt" + }, + "Mail": { + "Server": "smtp.gmail.com", + "User": "suphonchai.ph@gmail.com", + "Password": "nnjazjcnwhepkxdm", + "MailFrom": "suphonchai.ph@gmail.com", + "Port": "587" + }, + "KeycloakCron": { + "Hour": "08", + "Minute": "00" + }, + "Protocol": "HTTPS", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file From e4dccb5c1f034f5270cd67a718498f309d866356 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 26 Mar 2025 12:59:42 +0700 Subject: [PATCH 8/8] add log to placement and retirement --- BMA.EHR.Placement.Service/Program.cs | 6 +- BMA.EHR.Placement.Service/appsettings.json | 96 +++++++++++---------- BMA.EHR.Retirement.Service/Program.cs | 5 +- BMA.EHR.Retirement.Service/appsettings.json | 78 +++++++++-------- 4 files changed, 96 insertions(+), 89 deletions(-) diff --git a/BMA.EHR.Placement.Service/Program.cs b/BMA.EHR.Placement.Service/Program.cs index 6a13aea1..6ba63a4e 100644 --- a/BMA.EHR.Placement.Service/Program.cs +++ b/BMA.EHR.Placement.Service/Program.cs @@ -68,8 +68,8 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthorization(); // use serilog - ConfigureLogs(); - builder.Host.UseSerilog(); + //ConfigureLogs(); + //builder.Host.UseSerilog(); // Add config CORS builder.Services.AddCors(options => options.AddDefaultPolicy(builder => @@ -153,6 +153,8 @@ var app = builder.Build(); app.UseStaticFiles(); app.MapControllers(); app.UseMiddleware(); + app.UseMiddleware(); + app.UseHangfireDashboard("/hangfire", new DashboardOptions() { Authorization = new[] { new CustomAuthorizeFilter() } diff --git a/BMA.EHR.Placement.Service/appsettings.json b/BMA.EHR.Placement.Service/appsettings.json index 72b6e16e..f40436b3 100644 --- a/BMA.EHR.Placement.Service/appsettings.json +++ b/BMA.EHR.Placement.Service/appsettings.json @@ -1,49 +1,51 @@ { - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Information", - "System": "Warning" - } - } - }, - "ElasticConfiguration": { - "Uri": "http://localhost:9200" - }, - "AllowedHosts": "*", - "ConnectionStrings": { - //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - }, - "Jwt": { - "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/hrms" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" - } - }, - "MinIO": { - "Endpoint": "https://edm-s3.frappet.synology.me/", - "AccessKey": "XxtdnJajPjp3hHuKdOMn", - "SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg", - "BucketName": "bma-ehr-fpt" - }, - "KeycloakCron": { - "Hour": "08", - "Minute": "00" - }, - "Mail": { - "Server": "smtp.gmail.com", - "User": "suphonchai.ph@gmail.com", - "Password": "nnjazjcnwhepkxdm", - "MailFrom": "suphonchai.ph@gmail.com", - "Port": "587" - }, - "Protocol": "HTTPS", - "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", - "API": "https://bma-ehr.frappet.synology.me/api/v1", - "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Information", + "System": "Warning" + } + } + }, + "ElasticConfiguration": { + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "placement" + }, + "AllowedHosts": "*", + "ConnectionStrings": { + //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + }, + "Jwt": { + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/hrms" + }, + "EPPlus": { + "ExcelPackage": { + "LicenseContext": "NonCommercial" + } + }, + "MinIO": { + "Endpoint": "https://edm-s3.frappet.synology.me/", + "AccessKey": "XxtdnJajPjp3hHuKdOMn", + "SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg", + "BucketName": "bma-ehr-fpt" + }, + "KeycloakCron": { + "Hour": "08", + "Minute": "00" + }, + "Mail": { + "Server": "smtp.gmail.com", + "User": "suphonchai.ph@gmail.com", + "Password": "nnjazjcnwhepkxdm", + "MailFrom": "suphonchai.ph@gmail.com", + "Port": "587" + }, + "Protocol": "HTTPS", + "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file diff --git a/BMA.EHR.Retirement.Service/Program.cs b/BMA.EHR.Retirement.Service/Program.cs index fc121e82..f8cf5bf8 100644 --- a/BMA.EHR.Retirement.Service/Program.cs +++ b/BMA.EHR.Retirement.Service/Program.cs @@ -69,8 +69,8 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthorization(); // use serilog - ConfigureLogs(); - builder.Host.UseSerilog(); + //ConfigureLogs(); + //builder.Host.UseSerilog(); // Add config CORS builder.Services.AddCors(options => options.AddDefaultPolicy(builder => @@ -161,6 +161,7 @@ var app = builder.Build(); app.UseStaticFiles(); app.MapControllers(); app.UseMiddleware(); + app.UseMiddleware(); app.UseHangfireDashboard("/hangfire", new DashboardOptions() { diff --git a/BMA.EHR.Retirement.Service/appsettings.json b/BMA.EHR.Retirement.Service/appsettings.json index e0bb99d4..18183333 100644 --- a/BMA.EHR.Retirement.Service/appsettings.json +++ b/BMA.EHR.Retirement.Service/appsettings.json @@ -1,40 +1,42 @@ { - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Information", - "System": "Warning" - } - } - }, - "ElasticConfiguration": { - "Uri": "http://localhost:9200" - }, - "AllowedHosts": "*", - "ConnectionStrings": { - //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - // "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" - }, - "Jwt": { - "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://id.frappet.synology.me/realms/hrms" - }, - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" - } - }, - "MinIO": { - "Endpoint": "https://s3.frappet.com/", - "AccessKey": "frappet", - "SecretKey": "P@ssw0rd", - "BucketName": "bma-recruit" - }, - "Protocol": "HTTPS", - "API": "https://bma-ehr.frappet.synology.me/api/v1", - "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", - "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Information", + "System": "Warning" + } + } + }, + "ElasticConfiguration": { + "Uri": "http://192.168.1.40:9200", + "IndexFormat": "bma-ehr-log-index", + "SystemName": "retirement" + }, + "AllowedHosts": "*", + "ConnectionStrings": { + //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", + // "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + }, + "Jwt": { + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/hrms" + }, + "EPPlus": { + "ExcelPackage": { + "LicenseContext": "NonCommercial" + } + }, + "MinIO": { + "Endpoint": "https://s3.frappet.com/", + "AccessKey": "frappet", + "SecretKey": "P@ssw0rd", + "BucketName": "bma-recruit" + }, + "Protocol": "HTTPS", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", + "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file