Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ public async Task Execute(IJobExecutionContext context)

Guid estateId = context.MergedJobDataMap.GetGuidValueFromString("EstateId");
Guid merchantId = context.MergedJobDataMap.GetGuidValueFromString("MerchantId");
String contractsToSkip = context.MergedJobDataMap.GetString("contractsToSkip");

this.SecurityServiceClient = this.Bootstrapper.GetService<ISecurityServiceClient>();
this.EstateClient = this.Bootstrapper.GetService<IEstateClient>();
this.baseAddressFunc = this.Bootstrapper.GetService<Func<String, String>>();

await this.GenerateFileUploads(estateId, merchantId, context.CancellationToken);
await this.GenerateFileUploads(estateId, merchantId,contractsToSkip, context.CancellationToken);
}

/// <summary>
Expand All @@ -96,6 +97,7 @@ public async Task Execute(IJobExecutionContext context)
/// <param name="cancellationToken">The cancellation token.</param>
private async Task GenerateFileUploads(Guid estateId,
Guid merchantId,
String contractsToSkip,
CancellationToken cancellationToken)
{
DateTime fileDate = DateTime.Now;
Expand All @@ -112,6 +114,12 @@ private async Task GenerateFileUploads(Guid estateId,

List<ContractResponse> contracts = await this.EstateClient.GetMerchantContracts(accessToken, merchant.EstateId, merchant.MerchantId, cancellationToken);

if (String.IsNullOrEmpty(contractsToSkip) == false)
{
String[] skipContracts = contractsToSkip.Split('|');
contracts = contracts.Where(c => skipContracts.Contains(c.Description) == false).ToList();
}

EstateResponse estate = await this.EstateClient.GetEstate(accessToken, merchant.EstateId, cancellationToken);

SecurityUserResponse estateUser = estate.SecurityUsers.FirstOrDefault();
Expand Down