fix(scheduler): checking for predicates fullfillment on applying discount
This commit is contained in:
parent
b9661d74ee
commit
6374248132
2 changed files with 6 additions and 0 deletions
|
@ -189,6 +189,11 @@ describe('JobDoneInterpreter', () => {
|
|||
userIdentifier: 'test@standardnotes.com',
|
||||
userIdentifierType: 'email',
|
||||
} as jest.Mocked<Job>)
|
||||
predicateRepository.findByJobUuid = jest
|
||||
.fn()
|
||||
.mockReturnValue([
|
||||
{ name: PredicateName.SubscriptionPurchased, status: PredicateStatus.Denied } as jest.Mocked<Predicate>,
|
||||
])
|
||||
|
||||
await createInterpreter().interpret('1-2-3')
|
||||
|
||||
|
|
|
@ -124,6 +124,7 @@ export class JobDoneInterpreter implements JobDoneInterpreterInterface {
|
|||
PredicateStatus.Denied
|
||||
)
|
||||
case JobName.ENCOURAGE_SUBSCRIPTION_PURCHASING:
|
||||
case JobName.APPLY_SUBSCRIPTION_DISCOUNT:
|
||||
return (
|
||||
predicates.find((predicate) => predicate.name === PredicateName.SubscriptionPurchased)?.status ===
|
||||
PredicateStatus.Denied
|
||||
|
|
Loading…
Reference in a new issue