mapping missing purchase state with backup state
This commit is contained in:
parent
e63f202e36
commit
4dac65e557
@ -413,23 +413,31 @@ export async function exportBackup(
|
|||||||
let propStatus: BackupProposalStatus;
|
let propStatus: BackupProposalStatus;
|
||||||
switch (purch.purchaseStatus) {
|
switch (purch.purchaseStatus) {
|
||||||
case PurchaseStatus.Paid:
|
case PurchaseStatus.Paid:
|
||||||
|
case PurchaseStatus.QueryingAutoRefund:
|
||||||
|
case PurchaseStatus.QueryingRefund:
|
||||||
propStatus = BackupProposalStatus.Paid;
|
propStatus = BackupProposalStatus.Paid;
|
||||||
return;
|
break;
|
||||||
|
case PurchaseStatus.PayingReplay:
|
||||||
case PurchaseStatus.DownloadingProposal:
|
case PurchaseStatus.DownloadingProposal:
|
||||||
case PurchaseStatus.Proposed:
|
case PurchaseStatus.Proposed:
|
||||||
|
case PurchaseStatus.Paying:
|
||||||
propStatus = BackupProposalStatus.Proposed;
|
propStatus = BackupProposalStatus.Proposed;
|
||||||
break;
|
break;
|
||||||
case PurchaseStatus.ProposalDownloadFailed:
|
case PurchaseStatus.ProposalDownloadFailed:
|
||||||
|
case PurchaseStatus.PaymentAbortFinished:
|
||||||
propStatus = BackupProposalStatus.PermanentlyFailed;
|
propStatus = BackupProposalStatus.PermanentlyFailed;
|
||||||
break;
|
break;
|
||||||
|
case PurchaseStatus.AbortingWithRefund:
|
||||||
case PurchaseStatus.ProposalRefused:
|
case PurchaseStatus.ProposalRefused:
|
||||||
propStatus = BackupProposalStatus.Refused;
|
propStatus = BackupProposalStatus.Refused;
|
||||||
break;
|
break;
|
||||||
case PurchaseStatus.RepurchaseDetected:
|
case PurchaseStatus.RepurchaseDetected:
|
||||||
propStatus = BackupProposalStatus.Repurchase;
|
propStatus = BackupProposalStatus.Repurchase;
|
||||||
break;
|
break;
|
||||||
default:
|
default: {
|
||||||
throw Error();
|
const error: never = purch.purchaseStatus;
|
||||||
|
throw Error(`purchase status ${error} is not handled`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const payInfo = purch.payInfo;
|
const payInfo = purch.payInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user