Skip to content

Commit

Permalink
Merge pull request #62 from IliyanIlievPH/master
Browse files Browse the repository at this point in the history
update campaign validation on voucher redeem
  • Loading branch information
starkmsu authored Jun 9, 2020
2 parents d4820bb + 9a506b5 commit 5d26e82
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ public async Task MarkVouchersFromExpiredCampaignsAsExpired()
}

private bool IsCampaignStateValid(VoucherCampaign campaign)
=> campaign.State != CampaignState.Published;
=> campaign.State == CampaignState.Published;

private bool IsCampaignDateValid(VoucherCampaign campaign)
=> DateTime.UtcNow < campaign.FromDate
|| (campaign.ToDate.HasValue && campaign.ToDate.Value < DateTime.UtcNow);
=> DateTime.UtcNow > campaign.FromDate
&& (!campaign.ExpirationDate.HasValue || campaign.ExpirationDate.Value > DateTime.UtcNow);

private async Task PublishVoucherSoldEvent(Guid? paymentRequestId, VoucherCampaign voucherCampaign, Voucher voucher)
{
Expand Down

0 comments on commit 5d26e82

Please sign in to comment.