Skip to content

Commit

Permalink
spdbt-2969(Update licence preview printing endpoint in dynamics, the … (
Browse files Browse the repository at this point in the history
#1338)

# Description

This PR includes the following proposed change(s):

- spdbt-2969(Update licence preview printing endpoint in dynamics, the
category info needs to get from licence.)
  • Loading branch information
esdd1995 authored Aug 26, 2024
2 parents 21f6ab0 + 691d829 commit 428c8c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public Mappings()
.ForMember(d => d.LicenceNumber, opt => opt.MapFrom(s => s.LicenceNumber))
.ForMember(d => d.LicenceType, opt => opt.MapFrom(s => s.WorkerLicenceTypeCode))
.ForMember(d => d.IssuedDate, opt => opt.MapFrom(s => DateTime.Now.ToString("yyyy-MM-dd")))
.ForMember(d => d.ExpiryDate, opt => opt.MapFrom(s => s.ExpiryDate.ToString("yyyy-MM-dd")));
.ForMember(d => d.ExpiryDate, opt => opt.MapFrom(s => s.ExpiryDate.ToString("yyyy-MM-dd")))
.ForMember(d => d.LicenceCategories, opt => opt.MapFrom(s => s.CategoryCodes));

CreateMap<LicenceApplicationResp, LicencePreviewJson>()
.ForMember(d => d.ApplicantName, opt => opt.Ignore())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ protected override async Task<LicencePreviewJson> CreateDocument(PersonalLicence
var serviceTypeListResp = await serviceTypeRepository.QueryAsync(
new ServiceTypeQry(null, Enum.Parse<ServiceTypeEnum>(preview.LicenceType)), cancellationToken);
preview.LicenceType = serviceTypeListResp.Items.First().ServiceTypeName;
if (lic.WorkerLicenceTypeCode == WorkerLicenceTypeEnum.SecurityWorkerLicence)
preview.LicenceCategories = await GetCategoryNamesAsync(lic.CategoryCodes, cancellationToken);

LicenceApplicationResp app = await personLicAppRepository.GetLicenceApplicationAsync((Guid)lic.LicenceAppId, cancellationToken);
if (lic.WorkerLicenceTypeCode == WorkerLicenceTypeEnum.SecurityWorkerLicence)
preview.LicenceCategories = await GetCategoryNamesAsync(app.CategoryCodes, cancellationToken);
mapper.Map(app, preview);

if (lic.PhotoDocumentUrlId == null)
Expand Down

0 comments on commit 428c8c3

Please sign in to comment.