ส่งคัวกลับ
Some checks failed
release-dev / release-dev (push) Failing after 10s

This commit is contained in:
moss 2025-03-28 23:45:36 +07:00
parent 34b8562ffe
commit 18d93995aa
4 changed files with 108 additions and 97 deletions

View file

@ -68,40 +68,40 @@ jobs:
docker compose pull docker compose pull
docker compose up -d docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- name: Notify Discord Success # - name: Notify Discord Success
if: success() # if: success()
run: | # run: |
curl -H "Content-Type: application/json" \ # curl -H "Content-Type: application/json" \
-X POST \ # -X POST \
-d '{ # -d '{
"embeds": [{ # "embeds": [{
"title": "✅ Deployment Success!", # "title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993, # "color": 3066993,
"footer": { # "footer": {
"text": "Release Notification", # "text": "Release Notification",
"icon_url": "https://example.com/success-icon.png" # "icon_url": "https://example.com/success-icon.png"
}, # },
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}] # }]
}' \ # }' \
${{ secrets.DISCORD_WEBHOOK }} # ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Failure # - name: Notify Discord Failure
if: failure() # if: failure()
run: | # run: |
curl -H "Content-Type: application/json" \ # curl -H "Content-Type: application/json" \
-X POST \ # -X POST \
-d '{ # -d '{
"embeds": [{ # "embeds": [{
"title": "❌ Deployment Failed!", # "title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332, # "color": 15158332,
"footer": { # "footer": {
"text": "Release Notification", # "text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png" # "icon_url": "https://example.com/failure-icon.png"
}, # },
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}] # }]
}' \ # }' \
${{ secrets.DISCORD_WEBHOOK }} # ${{ secrets.DISCORD_WEBHOOK }}

View file

@ -672,6 +672,7 @@ namespace BMA.EHR.Placement.Service.Controllers
on p.Id.ToString() equals r.refId on p.Id.ToString() equals r.refId
select new select new
{ {
refId = p.Id,
profileId = p.profileId, profileId = p.profileId,
amount = r.amount, amount = r.amount,
amountSpecial = r.amountSpecial, amountSpecial = r.amountSpecial,

View file

@ -221,10 +221,18 @@ namespace BMA.EHR.Placement.Service.Controllers
[HttpPost()] [HttpPost()]
public async Task<ActionResult<ResponseObject>> Post([FromForm] PlacementAddProfileRequest req) public async Task<ActionResult<ResponseObject>> Post([FromForm] PlacementAddProfileRequest req)
{ {
var placementOfficer = await _context.PlacementOfficers
.Where(x => x.Id == (req.OfficerId ?? Guid.Parse("00000000-0000-0000-0000-000000000000")))
.FirstOrDefaultAsync();
if (placementOfficer == null)
return Error("ไม่พบรายการช่วยราชการ", 404);
var placementRepatriation = new PlacementRepatriation var placementRepatriation = new PlacementRepatriation
{ {
Organization = Request.Form.ContainsKey("Organization") ? Request.Form["Organization"] : "", Organization = placementOfficer.Organization,
Reason = Request.Form.ContainsKey("Reason") ? Request.Form["Reason"] : "", // Reason = placementOfficer.Reason,
Date = placementOfficer.DateStart,
DateRepatriation = placementOfficer.DateEnd,
Status = "WAITTING", Status = "WAITTING",
CreatedFullName = FullName ?? "System Administrator", CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "", CreatedUserId = UserId ?? "",
@ -507,6 +515,7 @@ namespace BMA.EHR.Placement.Service.Controllers
on p.Id.ToString() equals r.refId on p.Id.ToString() equals r.refId
select new select new
{ {
refId = p.Id,
profileId = p.profileId, profileId = p.profileId,
amount = r.amount, amount = r.amount,
amountSpecial = r.amountSpecial, amountSpecial = r.amountSpecial,

View file

@ -6,5 +6,6 @@ namespace BMA.EHR.Placement.Service.Requests
public class PlacementAddProfileRequest public class PlacementAddProfileRequest
{ {
public Guid Id { get; set; } public Guid Id { get; set; }
public Guid? OfficerId { get; set; }
} }
} }