Skip to content

Commit

Permalink
change file to document name (#700)
Browse files Browse the repository at this point in the history
# Description

This PR includes the following proposed change(s):

-Renew Integration
  • Loading branch information
peggy-quartech authored Jan 23, 2024
1 parent bd4e31d commit bbdd2c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Spd.Manager.Licence/PersonalLicenceAppContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public record WorkerLicenceAppAnonymousSubmitRequestJson : WorkerLicenceAppBase
{
public WorkerCategoryTypeCode[] CategoryCodes { get; set; } = Array.Empty<WorkerCategoryTypeCode>();
public DocumentBase[]? DocumentInfos { get; set; }
public Guid[]? FileKeyCodes { get; set; }
public Guid[]? PreviousFileIds { get; set; } //documentUrlId, used for renew
public Guid[]? DocumentKeyCodes { get; set; }
public Guid[]? PreviousDocumentIds { get; set; } //documentUrlId, used for renew
public Guid? OriginalApplicationId { get; set; } //for new, it should be null. for renew, replace, update, it should be original application id.
public Guid? OriginalLicenceId { get; set; } //for new, it should be null. for renew, replace, update, it should be original licence id.
}
Expand Down
12 changes: 6 additions & 6 deletions src/Spd.Manager.Licence/PersonalLicenceAppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ public async Task<WorkerLicenceAppUpsertResponse> Handle(AnonymousWorkerLicenceA
var appResponse = await _licenceAppRepository.CreateLicenceApplicationAsync(createApp, ct);

//new application, all file keys are in cache
if (cmd.LicenceAnonymousRequest.FileKeyCodes != null && cmd.LicenceAnonymousRequest.FileKeyCodes.Any())
if (cmd.LicenceAnonymousRequest.DocumentKeyCodes != null && cmd.LicenceAnonymousRequest.DocumentKeyCodes.Any())
{
foreach (Guid fileKeyCode in cmd.LicenceAnonymousRequest.FileKeyCodes)
foreach (Guid fileKeyCode in cmd.LicenceAnonymousRequest.DocumentKeyCodes)
{
IEnumerable<LicAppFileInfo> items = await _cache.Get<IEnumerable<LicAppFileInfo>>(fileKeyCode.ToString());
foreach (LicAppFileInfo licAppFile in items)
Expand Down Expand Up @@ -260,9 +260,9 @@ public async Task<WorkerLicenceAppUpsertResponse> Handle(AnonymousWorkerLicenceA
var response = await _licenceAppRepository.CreateLicenceApplicationAsync(createApp, ct);

//add all new files user uploaded
if (cmd.LicenceAnonymousRequest.FileKeyCodes != null && cmd.LicenceAnonymousRequest.FileKeyCodes.Any())
if (cmd.LicenceAnonymousRequest.DocumentKeyCodes != null && cmd.LicenceAnonymousRequest.DocumentKeyCodes.Any())
{
foreach (Guid fileKeyCode in cmd.LicenceAnonymousRequest.FileKeyCodes)
foreach (Guid fileKeyCode in cmd.LicenceAnonymousRequest.DocumentKeyCodes)
{
IEnumerable<LicAppFileInfo> items = await _cache.Get<IEnumerable<LicAppFileInfo>>(fileKeyCode.ToString());
foreach (LicAppFileInfo licAppFile in items)
Expand All @@ -283,9 +283,9 @@ await _documentRepository.ManageAsync(new CreateDocumentCmd
}

//copying all old files to new application in PreviousFileIds
if (cmd.LicenceAnonymousRequest.PreviousFileIds != null && cmd.LicenceAnonymousRequest.PreviousFileIds.Length != 0)
if (cmd.LicenceAnonymousRequest.PreviousDocumentIds != null && cmd.LicenceAnonymousRequest.PreviousDocumentIds.Length != 0)
{
foreach (var docUrlId in cmd.LicenceAnonymousRequest.PreviousFileIds)
foreach (var docUrlId in cmd.LicenceAnonymousRequest.PreviousDocumentIds)
{
await _documentRepository.ManageAsync(
new CopyDocumentCmd(docUrlId, response.LicenceAppId, response.ContactId),
Expand Down

0 comments on commit bbdd2c8

Please sign in to comment.