Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop

This commit is contained in:
mamoss 2025-03-12 22:45:14 +07:00
commit 8e45d1de01
2 changed files with 49 additions and 40 deletions

View file

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

View file

@ -3473,6 +3473,9 @@ export class CommandController extends Controller {
const dataDis = new ProfileDiscipline();
const metaDis = {
date: item.commandDateAffect,
refCommandDate: item.commandDateSign,
refCommandNo: item.commandNo,
createdUserId: req.user.sub,
createdFullName: req.user.name,
lastUpdateUserId: req.user.sub,
@ -3481,7 +3484,7 @@ export class CommandController extends Controller {
lastUpdatedAt: new Date(),
};
Object.assign(dataDis, { ...body, ...metaDis });
Object.assign(dataDis, { ...item, ...metaDis });
const historyDis = new ProfileDisciplineHistory();
Object.assign(historyDis, { ...dataDis, id: undefined });
@ -3670,8 +3673,11 @@ export class CommandController extends Controller {
};
Object.assign(dataDis, {
...body,
...item,
...metaDis,
date: item.commandDateAffect,
refCommandDate: item.commandDateSign,
refCommandNo: item.commandNo,
profileEmployeeId: item.profileId,
profileId: undefined,
});
@ -3899,8 +3905,11 @@ export class CommandController extends Controller {
};
Object.assign(dataDis, {
...body,
...item,
...metaDis,
date: item.commandDateAffect,
refCommandDate: item.commandDateSign,
refCommandNo: item.commandNo,
profileEmployeeId: item.profileId,
profileId: undefined,
});
@ -5059,7 +5068,7 @@ export class CommandController extends Controller {
commandName: body.refIds[0].commandName,
remark: body.refIds[0].remark,
};
const dataAct = new ProfileActposition();
Object.assign(dataAct, metaAct);
const historyAct = new ProfileActpositionHistory();