แก้บั้ก และเพิ่ม api inbox noti

This commit is contained in:
Suphonchai Phoonsawat 2023-08-09 20:28:56 +07:00
parent 060765d373
commit aacbcfee32
6 changed files with 220 additions and 5 deletions

View file

@ -1007,15 +1007,21 @@ namespace BMA.EHR.Application.Repositories.Commands
}
}
public async Task UpdatePlacementSalaryAsync(Guid placementProfileId, UpdatePlacementSalaryRequest req)
public async Task UpdatePlacementSalaryAsync(Guid personalId, UpdatePlacementSalaryRequest req)
{
try
{
var current = await _dbContext.Set<CommandReceiver>()
.FirstOrDefaultAsync(x => x.Id == personalId);
if (current == null)
throw new Exception(GlobalMessages.DataNotFound);
var placementProfile = await _dbContext.Set<PlacementProfile>()
.FirstOrDefaultAsync(p => p.Id == placementProfileId);
.FirstOrDefaultAsync(p => p.Id == current.RefPlacementProfileId);
if (placementProfile == null)
throw new Exception($"Invalid placement profile: {placementProfileId}");
throw new Exception($"Invalid placement profile: {current.RefPlacementProfileId}");
placementProfile.Amount = req.SalaryAmount;
placementProfile.PositionSalaryAmount = req.PositionSalaryAmount;