Skip to content

Commit

Permalink
Merge pull request #602 from DFE-Digital/feature/add-trust-reference-…
Browse files Browse the repository at this point in the history
…number-to-transfer-project

auto generate TRN for form a mat A2B applications
  • Loading branch information
paullocknimble authored Nov 1, 2024
2 parents dc26b7d + 5cf9135 commit d1c7428
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,18 @@ public async Task<CommandResult> Handle(CreateFormAMatProjectsCommand request,
{
// create formAMat
formAMat = FormAMatProject.Create(conversionProject.Details.NameOfTrust, conversionProject.Details.ApplicationReferenceNumber, _dateTimeProvider.Now);
_formAMatProjectRepository.Insert(formAMat as FormAMatProject);
_formAMatProjectRepository.CreateFormAMatProjectWithTrustReferenceNumber(formAMat);
await _formAMatProjectRepository.UnitOfWork.SaveChangesAsync(cancellationToken);
}

conversionProject.SetFormAMatProjectId(formAMat.Id);
conversionProject.SetIncomingTrust(formAMat.TrustReferenceNumber, conversionProject.Details.NameOfTrust);

_conversionProjectRepository.Update(conversionProject as Domain.ProjectAggregate.Project);
}


await _conversionProjectRepository.UnitOfWork.SaveChangesAsync(cancellationToken);


// returning 'CommandSuccessResult', client will have to retrieve the updated transfer project to refresh data
return new CommandSuccessResult();
}
Expand Down

0 comments on commit d1c7428

Please sign in to comment.