Merge branch 'working' into develop
Some checks failed
release-dev / release-dev (push) Failing after 14s

This commit is contained in:
Suphonchai Phoonsawat 2024-10-16 10:48:12 +07:00
commit e5f8b5b9f0
7 changed files with 1098 additions and 22 deletions

View file

@ -501,7 +501,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
//var _organization = await _context.Organizations.AsQueryable()
// .FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
//TODO : Hardcode OCId
//TODO : Hardcode OCId ต้องแก้ให้ดึงมาจากคน Login
if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
var organization = _userProfileRepository.GetOc(req.BorrowOrganizationId.Value, 0, AccessToken);

View file

@ -8,6 +8,7 @@ using BMA.EHR.Domain.Models.Insignias;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Domain.Shared;
using BMA.EHR.Infrastructure.MessageQueue;
using BMA.EHR.Infrastructure.Migrations.LeaveDb;
using BMA.EHR.Infrastructure.Persistence;
using BMA.EHR.Insignia.Service.Requests;
using Microsoft.AspNetCore.Authorization;
@ -755,7 +756,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
var org = _userProfileRepository.GetOc(ocId, 0, AccessToken);
requestNew.RequestStatus = "st6";
requestNew.RequestNote = "";
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-64d9-497a-87a3-0244eade622c"),
@ -1164,7 +1165,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call
ProfileType = "officer",
ProfileType = profile.ProfileType ?? "officer",
Prefix = profile.Prefix,
FirstName = profile.FirstName,
LastName = profile.LastName,
@ -1316,6 +1317,24 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call
ProfileType = profileOld.ProfileType ?? "officer",
Prefix = profileOld.Prefix,
FirstName = profileOld.FirstName,
LastName = profileOld.LastName,
CitizenId = profileOld.CitizenId,
BirthDate = profileOld.BirthDate,
DateAppoint = profileOld.DateAppoint,
Position = profileOld.Position,
Gender = profileOld.Gender,
PosTypeName = profileOld.PosTypeName,
PosLevelName = profileOld.PosLevelName,
PosNo = profileOld.PosNo,
Amount = profileOld.Amount,
PositionSalaryAmount = profileOld.PositionSalaryAmount,
});
}
}
@ -1447,7 +1466,13 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
x.Prefix,
x.FirstName,
x.LastName,
x.Position,
x.CitizenId,
x.ProfileType,
//Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
OcId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3"), // TODO: ต้องมาแก้ไข
RequestInsignia = x.RequestInsignia.Name,
RequestInsigniaId = x.RequestInsignia.Id,
@ -1480,12 +1505,15 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Prefix = x.Profile == null ? "" : x.Profile.Prefix,
Position = x.Profile == null ? "" : x.Profile.Position,
ProfileType = x.Profile == null ? "" : x.Profile.ProfileType,
//Prefix = x.Profile == null ? "" : x.Profile.Prefix,
//Position = x.Profile == null ? "" : x.Profile.Position,
//ProfileType = x.Profile == null ? "" : x.Profile.ProfileType,
Prefix = x.Prefix ?? "",
Position = x.Position ?? "",
ProfileType = x.ProfileType ?? "",
x.OcId,
CitizenId = x.Profile == null ? "" : x.Profile.CitizenId,
FullName = x.Profile == null ? "" : $"{x.Profile.Prefix}{x.Profile.FirstName} {x.Profile.LastName}",
CitizenId = x.CitizenId ?? "",
FullName = $"{x.Prefix ?? ""}{x.FirstName ?? ""} {x.LastName ?? ""}".Trim(),
RequestInsignia = x.RequestInsignia,
RequestInsigniaId = x.RequestInsigniaId,
RequestInsigniaShortName = x.RequestInsigniaShortName,
@ -1594,7 +1622,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
return Success(_insigniaNoteProfiles);
}
/// <summary>
/// list รายชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยสภรณ์/การจ่ายใบกำกับ ไม่ validate สิทธิ์
/// </summary>
@ -1628,7 +1656,13 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
//Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
x.CitizenId,
x.Prefix,
x.FirstName,
x.LastName,
x.ProfileType,
x.Position,
OcId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3"), // TODO: ต้องมาแก้ไข
RequestInsignia = x.RequestInsignia.Name,
RequestInsigniaId = x.RequestInsignia.Id,
@ -1661,12 +1695,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Prefix = x.Profile == null ? "" : x.Profile.Prefix,
Position = x.Profile == null ? "" : x.Profile.Position,
ProfileType = x.Profile == null ? "" : x.Profile.ProfileType,
Prefix = x.Prefix ?? "",
Position = x.Position ?? "",
ProfileType = x.ProfileType ?? "",
x.OcId,
CitizenId = x.Profile == null ? "" : x.Profile.CitizenId,
FullName = x.Profile == null ? "" : $"{x.Profile.Prefix}{x.Profile.FirstName} {x.Profile.LastName}",
CitizenId = x.CitizenId ?? "",
FullName = $"{x.Prefix ?? ""}{x.FirstName ?? ""} {x.LastName ?? ""}".Trim(),
RequestInsignia = x.RequestInsignia,
RequestInsigniaId = x.RequestInsigniaId,
RequestInsigniaShortName = x.RequestInsigniaShortName,
@ -1754,12 +1788,20 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
Prefix = x.Prefix,
FirstName = x.FirstName,
LastName = x.LastName,
CitizenId = x.CitizenId,
Positon = x.Position ?? "",
ProfileType = x.ProfileType,
//Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
//Prefix = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Prefix,
//Position = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Position,
//ProfileType = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).ProfileType,
OcId = Guid.Empty,
CitizenId = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).CitizenId,
//CitizenId = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).CitizenId,
//FullName = $"{_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).LastName}",
RequestInsignia = x.RequestInsignia.Name,
RequestInsigniaId = x.RequestInsignia.Id,
@ -1783,11 +1825,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
var _insigniaNoteProfile = new
{
insigniaNoteProfile.Id,
Prefix = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.Prefix : "",
Position = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.Position : "",
Prefix = insigniaNoteProfile.Prefix ?? "",
Position = insigniaNoteProfile.Positon,
insigniaNoteProfile.CitizenId,
ProfileType = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.ProfileType : "",
FullName = insigniaNoteProfile.Profile is not null ? $"{insigniaNoteProfile.Profile.Prefix}{insigniaNoteProfile.Profile.FirstName} {insigniaNoteProfile.Profile.LastName}" : "",
ProfileType = insigniaNoteProfile.ProfileType ?? "",
FullName = $"{insigniaNoteProfile.Prefix ?? ""}{insigniaNoteProfile.FirstName ?? ""} {insigniaNoteProfile.LastName ?? ""}",
insigniaNoteProfile.RequestInsignia,
insigniaNoteProfile.RequestInsigniaId,
insigniaNoteProfile.RequestInsigniaShortName,

View file

@ -38,6 +38,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "k6_scripts", "k6_scripts",
checkin_load_test.js = checkin_load_test.js
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkageResponseTest", "LinkageResponseTest\LinkageResponseTest.csproj", "{2C8742F0-06C9-40CF-BD96-2BB451ED6777}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -96,6 +98,10 @@ Global
{B36F7E5A-2745-42B5-8493-D648EF8CC43C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B36F7E5A-2745-42B5-8493-D648EF8CC43C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B36F7E5A-2745-42B5-8493-D648EF8CC43C}.Release|Any CPU.Build.0 = Release|Any CPU
{2C8742F0-06C9-40CF-BD96-2BB451ED6777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C8742F0-06C9-40CF-BD96-2BB451ED6777}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C8742F0-06C9-40CF-BD96-2BB451ED6777}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C8742F0-06C9-40CF-BD96-2BB451ED6777}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -115,6 +121,7 @@ Global
{03AB740F-AF31-423E-8546-198B914AF76F} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F}
{B06C5612-2346-44B1-9D50-F8373885BD88} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F}
{B36F7E5A-2745-42B5-8493-D648EF8CC43C} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F}
{2C8742F0-06C9-40CF-BD96-2BB451ED6777} = {FA618F0C-1AF5-49AB-AE13-C020B403B64F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3111A492-1818-4438-B718-75199D8E779A}

View file

@ -0,0 +1,28 @@
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
USER app
WORKDIR /app
# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["LinkageResponseTest/LinkageResponseTest.csproj", "LinkageResponseTest/"]
RUN dotnet restore "./LinkageResponseTest/LinkageResponseTest.csproj"
COPY . .
WORKDIR "/src/LinkageResponseTest"
RUN dotnet build "./LinkageResponseTest.csproj" -c $BUILD_CONFIGURATION -o /app/build
# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./LinkageResponseTest.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "LinkageResponseTest.dll"]

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,974 @@
// See https://aka.ms/new-console-template for more information
using System.Text;
var byteArray = new byte[] { 53,
48,
48,
48,
48,
48,
48,
48,
48,
123,
34,
116,
105,
116,
108,
101,
67,
111,
100,
101,
34,
58,
51,
44,
34,
116,
105,
116,
108,
101,
68,
101,
115,
99,
34,
58,
34,
224,
184,
153,
224,
184,
178,
224,
184,
162,
34,
44,
34,
116,
105,
116,
108,
101,
78,
97,
109,
101,
34,
58,
34,
224,
184,
153,
224,
184,
178,
224,
184,
162,
34,
44,
34,
116,
105,
116,
108,
101,
83,
101,
120,
34,
58,
49,
44,
34,
102,
105,
114,
115,
116,
78,
97,
109,
101,
34,
58,
34,
224,
184,
170,
224,
184,
184,
224,
184,
158,
224,
184,
165,
224,
184,
138,
224,
184,
177,
224,
184,
162,
34,
44,
34,
109,
105,
100,
100,
108,
101,
78,
97,
109,
101,
34,
58,
34,
34,
44,
34,
108,
97,
115,
116,
78,
97,
109,
101,
34,
58,
34,
224,
184,
158,
224,
184,
185,
224,
184,
165,
224,
184,
170,
224,
184,
167,
224,
184,
177,
224,
184,
170,
224,
184,
148,
224,
184,
180,
224,
185,
140,
34,
44,
34,
103,
101,
110,
100,
101,
114,
67,
111,
100,
101,
34,
58,
49,
44,
34,
103,
101,
110,
100,
101,
114,
68,
101,
115,
99,
34,
58,
34,
224,
184,
138,
224,
184,
178,
224,
184,
162,
34,
44,
34,
100,
97,
116,
101,
79,
102,
66,
105,
114,
116,
104,
34,
58,
50,
53,
50,
49,
49,
50,
50,
56,
44,
34,
110,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
67,
111,
100,
101,
34,
58,
57,
57,
44,
34,
110,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
68,
101,
115,
99,
34,
58,
34,
224,
185,
132,
224,
184,
151,
224,
184,
162,
34,
44,
34,
111,
119,
110,
101,
114,
83,
116,
97,
116,
117,
115,
68,
101,
115,
99,
34,
58,
34,
224,
185,
128,
224,
184,
136,
224,
185,
137,
224,
184,
178,
224,
184,
154,
224,
185,
137,
224,
184,
178,
224,
184,
153,
34,
44,
34,
115,
116,
97,
116,
117,
115,
79,
102,
80,
101,
114,
115,
111,
110,
67,
111,
100,
101,
34,
58,
48,
44,
34,
115,
116,
97,
116,
117,
115,
79,
102,
80,
101,
114,
115,
111,
110,
68,
101,
115,
99,
34,
58,
34,
224,
184,
154,
224,
184,
184,
224,
184,
132,
224,
184,
132,
224,
184,
165,
224,
184,
153,
224,
184,
181,
224,
185,
137,
224,
184,
161,
224,
184,
181,
224,
184,
160,
224,
184,
185,
224,
184,
161,
224,
184,
180,
224,
184,
165,
224,
184,
179,
224,
185,
128,
224,
184,
153,
224,
184,
178,
224,
184,
173,
224,
184,
162,
224,
184,
185,
224,
185,
136,
224,
185,
131,
224,
184,
153,
224,
184,
154,
224,
185,
137,
224,
184,
178,
224,
184,
153,
224,
184,
153,
224,
184,
181,
224,
185,
137,
34,
44,
34,
100,
97,
116,
101,
79,
102,
77,
111,
118,
101,
73,
110,
34,
58,
50,
53,
53,
56,
48,
55,
50,
56,
44,
34,
97,
103,
101,
34,
58,
52,
53,
44,
34,
102,
97,
116,
104,
101,
114,
80,
101,
114,
115,
111,
110,
97,
108,
73,
68,
34,
58,
51,
49,
48,
50,
49,
48,
48,
54,
50,
49,
52,
55,
57,
44,
34,
102,
97,
116,
104,
101,
114,
78,
97,
109,
101,
34,
58,
34,
224,
184,
154,
224,
184,
184,
224,
184,
141,
224,
185,
128,
224,
184,
138,
224,
184,
180,
224,
184,
148,
34,
44,
34,
102,
97,
116,
104,
101,
114,
78,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
67,
111,
100,
101,
34,
58,
57,
57,
44,
34,
102,
97,
116,
104,
101,
114,
78,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
68,
101,
115,
99,
34,
58,
34,
224,
185,
132,
224,
184,
151,
224,
184,
162,
34,
44,
34,
109,
111,
116,
104,
101,
114,
80,
101,
114,
115,
111,
110,
97,
108,
73,
68,
34,
58,
51,
49,
48,
50,
49,
48,
48,
54,
50,
49,
52,
56,
55,
44,
34,
109,
111,
116,
104,
101,
114,
78,
97,
109,
101,
34,
58,
34,
224,
184,
158,
224,
184,
162,
224,
184,
173,
224,
184,
161,
34,
44,
34,
109,
111,
116,
104,
101,
114,
78,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
67,
111,
100,
101,
34,
58,
57,
57,
44,
34,
109,
111,
116,
104,
101,
114,
78,
97,
116,
105,
111,
110,
97,
108,
105,
116,
121,
68,
101,
115,
99,
34,
58,
34,
224,
185,
132,
224,
184,
151,
224,
184,
162,
34,
44,
34,
102,
117,
108,
108,
110,
97,
109,
101,
65,
110,
100,
82,
97,
110,
107,
34,
58,
34,
224,
184,
153,
224,
184,
178,
224,
184,
162,
224,
184,
170,
224,
184,
184,
224,
184,
158,
224,
184,
165,
224,
184,
138,
224,
184,
177,
224,
184,
162,
32,
224,
184,
158,
224,
184,
185,
224,
184,
165,
224,
184,
170,
224,
184,
167,
224,
184,
177,
224,
184,
170,
224,
184,
148,
224,
184,
180,
224,
185,
140,
34,
44,
34,
101,
110,
103,
108,
105,
115,
104,
84,
105,
116,
108,
101,
68,
101,
115,
99,
34,
58,
34,
77,
82,
46,
34,
44,
34,
101,
110,
103,
108,
105,
115,
104,
70,
105,
114,
115,
116,
78,
97,
109,
101,
34,
58,
34,
83,
85,
80,
72,
79,
78,
67,
72,
65,
73,
34,
44,
34,
101,
110,
103,
108,
105,
115,
104,
77,
105,
100,
100,
108,
101,
78,
97,
109,
101,
34,
58,
34,
34,
44,
34,
101,
110,
103,
108,
105,
115,
104,
76,
97,
115,
116,
78,
97,
109,
101,
34,
58,
34,
80,
72,
79,
79,
78,
83,
65,
87,
65,
84,
34,
125
};
var output = Encoding.UTF8.GetString(byteArray);
Console.WriteLine(output);

View file

@ -0,0 +1,10 @@
{
"profiles": {
"LinkageResponseTest": {
"commandName": "Project"
},
"Container (Dockerfile)": {
"commandName": "Docker"
}
}
}