This commit is contained in:
parent
864c348531
commit
c89ecf8cda
11 changed files with 3729 additions and 18 deletions
|
|
@ -33,12 +33,14 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
private readonly NotificationRepository _repositoryNoti;
|
||||
private readonly PermissionRepository _permission;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly UserProfileRepository _userProfileRepository;
|
||||
|
||||
public DisciplineComplaintController(DisciplineDbContext context,
|
||||
MinIODisciplineService documentService,
|
||||
NotificationRepository repositoryNoti,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IConfiguration configuration,
|
||||
UserProfileRepository userProfileRepository,
|
||||
PermissionRepository permission)
|
||||
{
|
||||
// _repository = repository;
|
||||
|
|
@ -48,6 +50,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
_repositoryNoti = repositoryNoti;
|
||||
_permission = permission;
|
||||
_configuration = configuration;
|
||||
_userProfileRepository = userProfileRepository;
|
||||
}
|
||||
|
||||
#region " Properties "
|
||||
|
|
@ -299,6 +302,11 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||
|
||||
var profile = await _userProfileRepository.GetUserOC(userId, token.Replace("Bearer ", ""));
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound);
|
||||
var disciplineComplaint = new Domain.Models.Discipline.DisciplineComplaint
|
||||
{
|
||||
RespondentType = req.respondentType.Trim().ToUpper(),
|
||||
|
|
@ -310,6 +318,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
Title = req.title,
|
||||
Description = req.description,
|
||||
DateReceived = req.dateReceived,
|
||||
RootDnaId = profile.RootDnaId,
|
||||
LevelConsideration = req.levelConsideration == null ? null : req.levelConsideration.Trim().ToUpper(),
|
||||
DateConsideration = req.dateConsideration,
|
||||
OffenseDetails = req.offenseDetails == null ? null : req.offenseDetails.Trim().ToUpper(),
|
||||
|
|
@ -582,6 +591,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
{
|
||||
RespondentType = data.RespondentType.Trim().ToUpper(),
|
||||
Organization = data.Organization,
|
||||
RootDnaId = data.RootDnaId,
|
||||
ConsideredAgency = data.ConsideredAgency,
|
||||
OrganizationId = data.OrganizationId,
|
||||
ConsideredAgencyId = data.ConsideredAgencyId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue