diff --git a/src/Spd.Manager.Printing/Documents/TransformationStrategies/Mappings.cs b/src/Spd.Manager.Printing/Documents/TransformationStrategies/Mappings.cs index 63e983942..ca00a48c0 100644 --- a/src/Spd.Manager.Printing/Documents/TransformationStrategies/Mappings.cs +++ b/src/Spd.Manager.Printing/Documents/TransformationStrategies/Mappings.cs @@ -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() .ForMember(d => d.ApplicantName, opt => opt.Ignore()) diff --git a/src/Spd.Manager.Printing/Documents/TransformationStrategies/PersonalLicencePreviewTransformStrategy.cs b/src/Spd.Manager.Printing/Documents/TransformationStrategies/PersonalLicencePreviewTransformStrategy.cs index 1a72c5e70..90d1f9848 100644 --- a/src/Spd.Manager.Printing/Documents/TransformationStrategies/PersonalLicencePreviewTransformStrategy.cs +++ b/src/Spd.Manager.Printing/Documents/TransformationStrategies/PersonalLicencePreviewTransformStrategy.cs @@ -37,10 +37,10 @@ protected override async Task CreateDocument(PersonalLicence var serviceTypeListResp = await serviceTypeRepository.QueryAsync( new ServiceTypeQry(null, Enum.Parse(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)