Skip to content

Commit

Permalink
biz licence printing conditions (#1422)
Browse files Browse the repository at this point in the history
# Description

This PR includes the following proposed change(s):

- biz licence printing needs to add conditions to printing body.
  • Loading branch information
esdd1995 authored Sep 20, 2024
2 parents 42c88ae + 0ad40aa commit 08ef978
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AutoMapper;
using Spd.Resource.Repository;
using Spd.Resource.Repository.Biz;
using Spd.Resource.Repository.Incident;
using Spd.Resource.Repository.Licence;
using Spd.Resource.Repository.PersonLicApplication;
using Spd.Resource.Repository.ServiceTypes;
Expand All @@ -17,6 +18,7 @@ internal class BizLicencePrintingTransformStrategy(
IServiceTypeRepository serviceTypeRepository,
IWorkerLicenceCategoryRepository workerLicenceCategoryRepository,
IBizRepository bizRepository,
IIncidentRepository incidentRepository,
IMapper mapper)
: BcMailPlusTransformStrategyBase<BizLicencePrintingTransformRequest, BizLicencePrintingJson>(Jobs.BusinessLicense)
{
Expand All @@ -39,6 +41,12 @@ protected override async Task<BizLicencePrintingJson> CreateDocument(BizLicenceP
BizResult? biz = await bizRepository.GetBizAsync((Guid)lic.LicenceHolderId, cancellationToken);
mapper.Map(biz, bizLicJson);

//conditions
IncidentListResp resp = await incidentRepository.QueryAsync(
new IncidentQry() { ApplicationId = lic.LicenceAppId, IncludeInactive = true },
cancellationToken);
bizLicJson.Conditions = resp.Items.First().Conditions;

return bizLicJson;
}

Expand Down

0 comments on commit 08ef978

Please sign in to comment.