Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
This commit is contained in:
commit
33f979c5ad
73 changed files with 226 additions and 172 deletions
164
.github/workflows/release_leave.yaml
vendored
164
.github/workflows/release_leave.yaml
vendored
|
|
@ -1,89 +1,89 @@
|
||||||
name: release-dev
|
name: release-dev
|
||||||
run-name: release-dev ${{ github.actor }}
|
run-name: release-dev ${{ github.actor }}
|
||||||
on:
|
on:
|
||||||
# push:
|
# push:
|
||||||
# tags:
|
# tags:
|
||||||
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
# tags-ignore:
|
# tags-ignore:
|
||||||
# - '2.*'
|
# - '2.*'
|
||||||
# Allow run workflow manually from Action tab
|
# Allow run workflow manually from Action tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
env:
|
env:
|
||||||
REGISTRY: docker.frappet.com
|
REGISTRY: docker.frappet.com
|
||||||
IMAGE_NAME: ehr/bma-ehr-leave-service
|
IMAGE_NAME: ehr/bma-ehr-leave-service
|
||||||
DEPLOY_HOST: frappet.com
|
DEPLOY_HOST: frappet.com
|
||||||
DEPLOY_PORT: 10102
|
DEPLOY_PORT: 10102
|
||||||
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
||||||
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-leave
|
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-leave
|
||||||
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
|
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# act workflow_dispatch -W .github/workflows/release_leave.yaml --input IMAGE_VER=leave-1.0.0 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
# act workflow_dispatch -W .github/workflows/release_leave.yaml --input IMAGE_VER=leave-1.0.0 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||||
release-dev:
|
release-dev:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
# skip Set up QEMU because it fail on act and container
|
# skip Set up QEMU because it fail on act and container
|
||||||
- name: Gen Version
|
- name: Gen Version
|
||||||
id: gen_ver
|
id: gen_ver
|
||||||
run: |
|
run: |
|
||||||
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
||||||
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
||||||
else
|
else
|
||||||
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
||||||
fi
|
fi
|
||||||
if [[ $IMAGE_VER == '' ]]; then
|
if [[ $IMAGE_VER == '' ]]; then
|
||||||
IMAGE_VER='test-vBeta'
|
IMAGE_VER='test-vBeta'
|
||||||
fi
|
fi
|
||||||
echo '::set-output name=image_ver::'$IMAGE_VER
|
echo '::set-output name=image_ver::'$IMAGE_VER
|
||||||
- name: Test Version
|
- name: Test Version
|
||||||
run: |
|
run: |
|
||||||
echo $GITHUB_REF
|
echo $GITHUB_REF
|
||||||
echo ${{ steps.gen_ver.outputs.image_ver }}
|
echo ${{ steps.gen_ver.outputs.image_ver }}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login in to registry
|
- name: Login in to registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{env.REGISTRY}}
|
registry: ${{env.REGISTRY}}
|
||||||
username: ${{secrets.DOCKER_USER}}
|
username: ${{secrets.DOCKER_USER}}
|
||||||
password: ${{secrets.DOCKER_PASS}}
|
password: ${{secrets.DOCKER_PASS}}
|
||||||
- name: Build and load local docker image
|
- name: Build and load local docker image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
file: BMA.EHR.Leave.Service/Dockerfile
|
file: BMA.EHR.Leave/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
||||||
|
|
||||||
- name: Reload docker compose
|
- name: Reload docker compose
|
||||||
uses: appleboy/ssh-action@v0.1.8
|
uses: appleboy/ssh-action@v0.1.8
|
||||||
with:
|
with:
|
||||||
host: ${{env.DEPLOY_HOST}}
|
host: ${{env.DEPLOY_HOST}}
|
||||||
username: frappet
|
username: frappet
|
||||||
password: ${{ secrets.SSH_PASSWORD }}
|
password: ${{ secrets.SSH_PASSWORD }}
|
||||||
port: ${{env.DEPLOY_PORT}}
|
port: ${{env.DEPLOY_PORT}}
|
||||||
script: |
|
script: |
|
||||||
cd "${{env.COMPOSE_PATH}}"
|
cd "${{env.COMPOSE_PATH}}"
|
||||||
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
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ env.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Success✅✅✅
|
-Success✅✅✅
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
By: ${{secrets.DOCKER_USER}}
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ env.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Failure❌❌❌
|
-Failure❌❌❌
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
By: ${{secrets.DOCKER_USER}}
|
||||||
|
|
|
||||||
13
.idea/.idea.BMA.EHR.Solution/.idea/.gitignore
generated
vendored
13
.idea/.idea.BMA.EHR.Solution/.idea/.gitignore
generated
vendored
|
|
@ -1,13 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Rider ignored files
|
|
||||||
/contentModel.xml
|
|
||||||
/.idea.BMA.EHR.Solution.iml
|
|
||||||
/modules.xml
|
|
||||||
/projectSettingsUpdater.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
1
.idea/.idea.BMA.EHR.Solution/.idea/.name
generated
1
.idea/.idea.BMA.EHR.Solution/.idea/.name
generated
|
|
@ -1 +0,0 @@
|
||||||
BMA.EHR.Solution
|
|
||||||
|
Before Width: | Height: | Size: 16 B |
4
.idea/.idea.BMA.EHR.Solution/.idea/encodings.xml
generated
4
.idea/.idea.BMA.EHR.Solution/.idea/encodings.xml
generated
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="UserContentModel">
|
|
||||||
<attachedFolders />
|
|
||||||
<explicitIncludes />
|
|
||||||
<explicitExcludes />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/.idea.BMA.EHR.Solution/.idea/vcs.xml
generated
6
.idea/.idea.BMA.EHR.Solution/.idea/vcs.xml
generated
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
@ -113,10 +113,10 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
if (entity.Type != null)
|
if (entity.Type != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
_dbContext.Attatch(entity.Type);
|
_dbContext.Attatch(entity.Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return await base.UpdateAsync(entity);
|
return await base.UpdateAsync(entity);
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<List<LeaveRequest>> GetLeaveRequestByYearAsync(int year)
|
public async Task<List<LeaveRequest>> GetLeaveRequestByYearAsync(int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.LeaveStartDate.Year == year)
|
.Where(x => x.LeaveStartDate.Year == year)
|
||||||
.Where(x => x.LeaveStatus != "REJECT" && x.LeaveStatus != "DELETE")
|
.Where(x => x.LeaveStatus != "REJECT" && x.LeaveStatus != "DELETE")
|
||||||
|
|
@ -137,7 +137,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<List<LeaveRequest>> GetLeaveRequestByUserIdAsync(Guid keycloakUserId, int year, Guid type, string status)
|
public async Task<List<LeaveRequest>> GetLeaveRequestByUserIdAsync(Guid keycloakUserId, int year, Guid type, string status)
|
||||||
{
|
{
|
||||||
var rawData = _dbContext.Set<LeaveRequest>().AsQueryable()
|
var rawData = _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId);
|
.Where(x => x.KeycloakUserId == keycloakUserId);
|
||||||
|
|
||||||
|
|
@ -155,7 +155,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<List<LeaveRequest>> GetLeaveRequestForAdminAsync(int year, Guid type, string status, DateTime startDate, DateTime endDate)
|
public async Task<List<LeaveRequest>> GetLeaveRequestForAdminAsync(int year, Guid type, string status, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var rawData = _dbContext.Set<LeaveRequest>()
|
var rawData = _dbContext.Set<LeaveRequest>().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.LeaveStatus != "DRAFT")
|
.Where(x => x.LeaveStatus != "DRAFT")
|
||||||
.AsQueryable();
|
.AsQueryable();
|
||||||
|
|
@ -182,14 +182,15 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetRestDayTotalByYearForUserAsync(Guid keycloakUserId, int year)
|
public async Task<double> GetRestDayTotalByYearForUserAsync(Guid keycloakUserId, int year)
|
||||||
{
|
{
|
||||||
var leaveType = await _dbContext.Set<LeaveType>().AsQueryable().FirstOrDefaultAsync(l => l.Code.Trim().ToUpper() == "LV-005");
|
var leaveType = await _dbContext.Set<LeaveType>().AsQueryable().AsNoTracking()
|
||||||
|
.FirstOrDefaultAsync(l => l.Code.Trim().ToUpper() == "LV-005");
|
||||||
|
|
||||||
if (leaveType == null)
|
if (leaveType == null)
|
||||||
{
|
{
|
||||||
throw new Exception("ไม่พบข้อมูลประเภทการลาพักผ่อน โปรดติดต่อผู้ดูและระบบ");
|
throw new Exception("ไม่พบข้อมูลประเภทการลาพักผ่อน โปรดติดต่อผู้ดูและระบบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveType.Id)
|
.Where(x => x.Type.Id == leaveType.Id)
|
||||||
|
|
@ -201,7 +202,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
public async Task<double> GetSumLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -214,7 +215,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<DateTime?> GetLeaveLastByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId)
|
public async Task<DateTime?> GetLeaveLastByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -228,7 +229,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<LeaveRequest?> GetLastLeaveRequestByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId)
|
public async Task<LeaveRequest?> GetLastLeaveRequestByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -241,7 +242,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<List<LeaveRequest>> GetCancelLeaveRequestForAdminAsync(int year, Guid type, string status)
|
public async Task<List<LeaveRequest>> GetCancelLeaveRequestForAdminAsync(int year, Guid type, string status)
|
||||||
{
|
{
|
||||||
var rawData = _dbContext.Set<LeaveRequest>()
|
var rawData = _dbContext.Set<LeaveRequest>().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.LeaveStatus == "DELETE")
|
.Where(x => x.LeaveStatus == "DELETE")
|
||||||
.AsQueryable();
|
.AsQueryable();
|
||||||
|
|
@ -517,7 +518,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumSendLeaveAsync(int year)
|
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumSendLeaveAsync(int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.LeaveStartDate.Year == year)
|
.Where(x => x.LeaveStartDate.Year == year)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
@ -603,7 +604,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumSendLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
public async Task<double> GetSumSendLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -615,7 +616,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumApproveLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
public async Task<double> GetSumApproveLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -631,7 +632,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumApproveLeaveByRangeForUser(Guid keycloakUserId, DateTime startDate, DateTime endDate)
|
public async Task<double> GetSumApproveLeaveByRangeForUser(Guid keycloakUserId, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.LeaveStartDate.Date >= startDate.Date && x.LeaveStartDate.Date <= endDate.Date)
|
.Where(x => x.LeaveStartDate.Date >= startDate.Date && x.LeaveStartDate.Date <= endDate.Date)
|
||||||
|
|
@ -688,7 +689,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
public async Task<double> GetSumApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -704,7 +705,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<int> GetCountApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
public async Task<int> GetCountApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -717,7 +718,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<double> GetSumRejectLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
public async Task<double> GetSumRejectLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.Type.Id == leaveTypeId)
|
.Where(x => x.Type.Id == leaveTypeId)
|
||||||
|
|
@ -752,7 +753,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
var leaveStatus = new List<string>() { "NEW", "PENDING", "APPROVE" };
|
var leaveStatus = new List<string>() { "NEW", "PENDING", "APPROVE" };
|
||||||
if (range == "ALL")
|
if (range == "ALL")
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
//.Where(x => x.LeaveRange == "ALL")
|
//.Where(x => x.LeaveRange == "ALL")
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
|
|
@ -764,7 +765,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.LeaveRange == range)
|
.Where(x => x.LeaveRange == range)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
|
|
@ -791,7 +792,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<LeaveRequest?> GetLeavePeriodAsync(Guid keycloakUserId, DateTime date)
|
public async Task<LeaveRequest?> GetLeavePeriodAsync(Guid keycloakUserId, DateTime date)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
.Include(x => x.Type)
|
.Include(x => x.Type)
|
||||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||||
.Where(x => x.LeaveStatus == "APPROVE")
|
.Where(x => x.LeaveStatus == "APPROVE")
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
public async Task<LeaveType?> GetLeaveTypeByCodeAsync(string code)
|
public async Task<LeaveType?> GetLeaveTypeByCodeAsync(string code)
|
||||||
{
|
{
|
||||||
return await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Code == code);
|
return await _dbContext.Set<LeaveType>().AsNoTracking().FirstOrDefaultAsync(x => x.Code == code);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
|
||||||
public string? Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
|
|
||||||
|
public string? ProfileType { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PosLevel
|
public class PosLevel
|
||||||
|
|
@ -89,9 +91,11 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
|
||||||
public string PositionLevel { get; set; } = string.Empty;
|
public string PositionLevel { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string PositionType { get; set; } = string.Empty;
|
public string PositionType { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string Position { get; set; } = string.Empty;
|
public string Position { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ProfileInsignia
|
public class ProfileInsignia
|
||||||
|
|
|
||||||
|
|
@ -1041,10 +1041,13 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
|
|
||||||
//var profile = await _context.Profiles.Include(x => x.Salaries).FirstOrDefaultAsync(x => x.Id == req.ProfileId);
|
//var profile = await _context.Profiles.Include(x => x.Salaries).FirstOrDefaultAsync(x => x.Id == req.ProfileId);
|
||||||
var profile = _userProfileRepository.GetOfficerProfileById(req.ProfileId, AccessToken);
|
var profileTest = _userProfileRepository.GetOfficerProfileById(req.ProfileId, AccessToken);
|
||||||
|
|
||||||
if (profile == null)
|
if (profileTest == null)
|
||||||
return Error(GlobalMessages.DataNotFound);
|
return Error(GlobalMessages.DataNotFound);
|
||||||
|
|
||||||
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(profileTest.Keycloak ?? Guid.Empty, AccessToken ?? "");
|
||||||
|
|
||||||
var insignia = await _context.Insignias.FirstOrDefaultAsync(x => x.Id == req.insigniaId);
|
var insignia = await _context.Insignias.FirstOrDefaultAsync(x => x.Id == req.insigniaId);
|
||||||
|
|
||||||
if (insignia == null)
|
if (insignia == null)
|
||||||
|
|
@ -1103,6 +1106,15 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var lastInsignia = string.Empty;
|
||||||
|
if (profile.ProfileInsignia != null)
|
||||||
|
{
|
||||||
|
var id = profile.ProfileInsignia.Id ?? Guid.Empty;
|
||||||
|
var insigniaEnt = _insigniaPeriodRepository.GetInsigniaById(id);
|
||||||
|
if (insigniaEnt != null)
|
||||||
|
lastInsignia = insigniaEnt.Name;
|
||||||
|
}
|
||||||
|
|
||||||
await _context.AddAsync(new InsigniaRequestProfile
|
await _context.AddAsync(new InsigniaRequestProfile
|
||||||
{
|
{
|
||||||
Status = "PENDING",
|
Status = "PENDING",
|
||||||
|
|
@ -1112,14 +1124,30 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
Reason = req.Reason,
|
Reason = req.Reason,
|
||||||
RequestDate = DateTime.Now,
|
RequestDate = DateTime.Now,
|
||||||
MatchingConditions = System.Text.Json.JsonSerializer.Serialize(new List<dynamic>()), // serialize to string
|
MatchingConditions = System.Text.Json.JsonSerializer.Serialize(new List<dynamic>()), // serialize to string
|
||||||
Salary = profile.ProfileSalary == null || profile.ProfileSalary.Count == 0 ? 0 :
|
Salary = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.Amount, //profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
||||||
profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount, //profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
|
||||||
|
// Add Information for reused in API Call
|
||||||
|
ProfileType = "officer",
|
||||||
|
Prefix = profile.Prefix,
|
||||||
|
FirstName = profile.FirstName,
|
||||||
|
LastName = profile.LastName,
|
||||||
|
CitizenId = profile.CitizenId,
|
||||||
|
BirthDate = profile.BirthDate,
|
||||||
|
DateAppoint = profile.DateAppoint,
|
||||||
|
Position = profile.Position,
|
||||||
|
Gender = profile.Gender,
|
||||||
|
PosTypeName = profile.PosType!.PosTypeName,
|
||||||
|
PosLevelName = profile.PosLevel!.PosLevelName,
|
||||||
|
PosNo = profile.ProfileSalary == null ? "" : profile.ProfileSalary.PosNo,
|
||||||
|
Amount = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.Amount,
|
||||||
|
PositionSalaryAmount = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.PositionSalaryAmount,
|
||||||
|
LastInsigniaName = lastInsignia
|
||||||
});
|
});
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
<DockerfileContext>.</DockerfileContext>
|
<DockerfileContext>.</DockerfileContext>
|
||||||
<RootNamespace>BMA.EHR.Leave.Service</RootNamespace>
|
<RootNamespace>BMA.EHR.Leave.Service</RootNamespace>
|
||||||
|
<AssemblyName>BMA.EHR.Leave</AssemblyName>
|
||||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
@ -869,18 +869,24 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
//var count = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminCountAsync(startDate, endDate);
|
//var count = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminCountAsync(startDate, endDate);
|
||||||
|
|
||||||
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
var imgUrl = $"{_configuration["MinIO:Endpoint"]}{_configuration["MinIO:BucketName"]}";
|
||||||
var data = (await _processUserTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate))
|
|
||||||
.Select(d => new CheckInProcessHistoryForAdminDto
|
|
||||||
{
|
|
||||||
Id = d.Id,
|
|
||||||
FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId, AccessToken),
|
|
||||||
|
|
||||||
CheckInDate = d.CheckIn.Date,
|
var resultData = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate);
|
||||||
CheckInTime = d.CheckIn.ToString("HH:mm"),
|
var data = new List<CheckInProcessHistoryForAdminDto>();
|
||||||
CheckInLocation = d.CheckInPOI,
|
|
||||||
CheckInLat = d.CheckInLat,
|
foreach (var d in resultData)
|
||||||
CheckInLon = d.CheckInLon,
|
{
|
||||||
CheckInStatus = d.CheckInStatus != "" ? d.CheckInStatus :
|
var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(d.KeycloakUserId, AccessToken);
|
||||||
|
if (pf == null) continue;
|
||||||
|
data.Add(new CheckInProcessHistoryForAdminDto
|
||||||
|
{
|
||||||
|
Id = d.Id,
|
||||||
|
FullName = $"{pf.Prefix}{pf.FirstName} {pf.LastName}",
|
||||||
|
CheckInDate = d.CheckIn.Date,
|
||||||
|
CheckInTime = d.CheckIn.ToString("HH:mm"),
|
||||||
|
CheckInLocation = d.CheckInPOI,
|
||||||
|
CheckInLat = d.CheckInLat,
|
||||||
|
CheckInLon = d.CheckInLon,
|
||||||
|
CheckInStatus = d.CheckInStatus != "" ? d.CheckInStatus :
|
||||||
DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||||
|
|
||||||
|
|
@ -891,16 +897,16 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
|
|
||||||
|
|
||||||
"NORMAL",
|
"NORMAL",
|
||||||
CheckInIsLocation = d.IsLocationCheckIn,
|
CheckInIsLocation = d.IsLocationCheckIn,
|
||||||
CheckInLocationName = d.CheckInLocationName,
|
CheckInLocationName = d.CheckInLocationName,
|
||||||
//CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}",
|
//CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}",
|
||||||
|
|
||||||
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
||||||
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
|
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
|
||||||
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
|
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
|
||||||
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
||||||
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
||||||
CheckOutStatus = d.CheckOutStatus != "" ? d.CheckOutStatus :
|
CheckOutStatus = d.CheckOutStatus != "" ? d.CheckOutStatus :
|
||||||
d.CheckOut == null ? null : DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
d.CheckOut == null ? null : DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||||
"ABSENT" :
|
"ABSENT" :
|
||||||
|
|
@ -908,12 +914,58 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||||
"ABSENT" :
|
"ABSENT" :
|
||||||
"NORMAL",
|
"NORMAL",
|
||||||
CheckOutIsLocation = d.IsLocationCheckOut,
|
CheckOutIsLocation = d.IsLocationCheckOut,
|
||||||
CheckOutLocationName = d.CheckOutLocationName
|
CheckOutLocationName = d.CheckOutLocationName
|
||||||
//CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
//CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
|
||||||
.ToList();
|
|
||||||
|
// var data = (await _processUserTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate))
|
||||||
|
// .Select(d => new CheckInProcessHistoryForAdminDto
|
||||||
|
// {
|
||||||
|
// Id = d.Id,
|
||||||
|
// FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId, AccessToken),
|
||||||
|
|
||||||
|
// CheckInDate = d.CheckIn.Date,
|
||||||
|
// CheckInTime = d.CheckIn.ToString("HH:mm"),
|
||||||
|
// CheckInLocation = d.CheckInPOI,
|
||||||
|
// CheckInLat = d.CheckInLat,
|
||||||
|
// CheckInLon = d.CheckInLon,
|
||||||
|
// CheckInStatus = d.CheckInStatus != "" ? d.CheckInStatus :
|
||||||
|
// DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
|
// DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||||
|
|
||||||
|
// DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||||
|
// DateTime.Parse($"{d.CheckIn.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||||
|
// "ABSENT" :
|
||||||
|
// "LATE" :
|
||||||
|
|
||||||
|
|
||||||
|
// "NORMAL",
|
||||||
|
// CheckInIsLocation = d.IsLocationCheckIn,
|
||||||
|
// CheckInLocationName = d.CheckInLocationName,
|
||||||
|
// //CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}",
|
||||||
|
|
||||||
|
// CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
|
||||||
|
// CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
|
||||||
|
// CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
|
||||||
|
// CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
|
||||||
|
// CheckOutLon = d.CheckOut == null ? null : d.CheckOutLon,
|
||||||
|
// CheckOutStatus = d.CheckOutStatus != "" ? d.CheckOutStatus :
|
||||||
|
// d.CheckOut == null ? null : DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
|
// DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||||
|
// "ABSENT" :
|
||||||
|
// DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||||
|
// DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||||
|
// "ABSENT" :
|
||||||
|
// "NORMAL",
|
||||||
|
// CheckOutIsLocation = d.IsLocationCheckOut,
|
||||||
|
// CheckOutLocationName = d.CheckOutLocationName
|
||||||
|
// //CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
|
||||||
|
// })
|
||||||
|
|
||||||
|
// .ToList();
|
||||||
|
|
||||||
if (keyword != "")
|
if (keyword != "")
|
||||||
{
|
{
|
||||||
|
|
@ -11,17 +11,17 @@ WORKDIR /src
|
||||||
COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"]
|
COPY ["BMA.EHR.Domain/BMA.EHR.Domain.csproj", "BMA.EHR.Domain/"]
|
||||||
COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"]
|
COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"]
|
||||||
COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"]
|
COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"]
|
||||||
COPY ["BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj", "BMA.EHR.Leave.Service/"]
|
COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"]
|
||||||
|
|
||||||
RUN dotnet restore "BMA.EHR.Leave.Service/BMA.EHR.Leave.Service.csproj"
|
RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/BMA.EHR.Leave.Service"
|
WORKDIR "/src/BMA.EHR.Leave"
|
||||||
RUN dotnet build "BMA.EHR.Leave.Service.csproj" -c Release -o /app/build
|
RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
RUN dotnet publish "BMA.EHR.Leave.Service.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
RUN dotnet publish "BMA.EHR.Leave.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
ENTRYPOINT ["dotnet", "BMA.EHR.Leave.Service.dll"]
|
ENTRYPOINT ["dotnet", "BMA.EHR.Leave.dll"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue