Enum mismatch on expired invoices being shown the correct error prompts on ticket setup
This commit is contained in:
parent
a01bd42122
commit
16a6499c72
2 changed files with 3 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ class ResultError(Enum):
|
||||||
TICKET_SETUP = "ticket_setup"
|
TICKET_SETUP = "ticket_setup"
|
||||||
TICKET_EXPIRED = "ticket_expired"
|
TICKET_EXPIRED = "ticket_expired"
|
||||||
ALREADY_EXISTS = "already_exists"
|
ALREADY_EXISTS = "already_exists"
|
||||||
|
ALREADY_USED = "already_used"
|
||||||
BILLING_CODE_EXISTS = "billing_code_exists"
|
BILLING_CODE_EXISTS = "billing_code_exists"
|
||||||
PROCESS_GOT_KILLED = "process_got_killed"
|
PROCESS_GOT_KILLED = "process_got_killed"
|
||||||
PROCESS_WONT_START = "process_wont_start"
|
PROCESS_WONT_START = "process_wont_start"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ TRANSLATION_DICT = {
|
||||||
ServerError.MISSING_DATA: ResultError.INVALID_INPUT,
|
ServerError.MISSING_DATA: ResultError.INVALID_INPUT,
|
||||||
ServerError.UNPAID: ResultError.SUBSCRIPTION,
|
ServerError.UNPAID: ResultError.SUBSCRIPTION,
|
||||||
ServerError.SERVER_SIDE: ResultError.SERVER_SIDE,
|
ServerError.SERVER_SIDE: ResultError.SERVER_SIDE,
|
||||||
ServerError.EXPIRED: ResultError.EXPIRED_INVOICE
|
ServerError.EXPIRED: ResultError.EXPIRED_INVOICE,
|
||||||
|
ServerError.ALREADY_USED: ResultError.ALREADY_EXISTS
|
||||||
}
|
}
|
||||||
|
|
||||||
def format_server_response(api_response: ApiResponse|dict, desired_type: str) -> Result:
|
def format_server_response(api_response: ApiResponse|dict, desired_type: str) -> Result:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue