Remove Legacy Status from the code (#5982)

This commit is contained in:
Nicolas Dorier
2024-05-15 07:49:53 +09:00
committed by GitHub
parent d96b066658
commit c134602cbd
40 changed files with 218 additions and 309 deletions

View File

@@ -349,7 +349,24 @@ namespace BTCPayServer.Data
if (blob["defaultPaymentMethod"] is not (null or { Type : JTokenType.Null }))
blob["defaultPaymentMethod"] = MigrationExtensions.MigratePaymentMethodId(blob["defaultPaymentMethod"].Value<string>());
blob.Remove("derivationStrategies");
Status = Status switch
{
"new" => "New",
"paid" => "Processing",
"complete" or "confirmed" => "Settled",
"expired" => "Expired",
null or "invalid" => "Invalid",
_ => throw new NotSupportedException($"Unknown Status for invoice ({Status})")
};
ExceptionStatus = ExceptionStatus switch
{
"marked" => "Marked",
"paidLate" => "PaidLate",
"paidPartial" => "PaidPartial",
"paidOver" => "PaidOver",
null or "" => "",
_ => throw new NotSupportedException($"Unknown ExceptionStatus for invoice ({ExceptionStatus})")
};
blob["version"] = 3;
Blob2 = blob.ToString(Formatting.None);
}