Add BackupSubscriptionCheckJob.

This commit is contained in:
Alex Hart
2024-10-04 10:39:26 -03:00
committed by Greyson Parrelli
parent 24209756e3
commit 5bc8435d25
10 changed files with 326 additions and 26 deletions

View File

@@ -178,10 +178,14 @@ object InAppPaymentsRepository {
return when (inAppPayment.type) {
InAppPaymentType.UNKNOWN -> error("Unsupported type UNKNOWN.")
InAppPaymentType.ONE_TIME_GIFT, InAppPaymentType.ONE_TIME_DONATION -> "$JOB_PREFIX${inAppPayment.id.serialize()}"
InAppPaymentType.RECURRING_DONATION, InAppPaymentType.RECURRING_BACKUP -> "$JOB_PREFIX${inAppPayment.type.code}"
InAppPaymentType.RECURRING_DONATION, InAppPaymentType.RECURRING_BACKUP -> getRecurringJobQueueKey(inAppPayment.type)
}
}
fun getRecurringJobQueueKey(inAppPaymentType: InAppPaymentType): String {
return "$JOB_PREFIX${inAppPaymentType.code}"
}
/**
* Returns a duration to utilize for jobs tied to different payment methods. For long running bank transfers, we need to
* allow extra time for completion.