Remove platform tenancy from SXCHNGE customer BFF (#34)
This commit is contained in:
1 parent
7062672a87
commit
981e84a4b4
244 files changed
+651
-17130
No files matched your search
@@ -15,91 +15,5 @@ func Reason(err error) (string, bool) {
|
||||
return reason, true
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case errors.Is(err, ErrAMLSourceIdempotencyConflict):
|
||||
return ReasonAMLSourceIdempotencyConflict, true
|
||||
case errors.Is(err, ErrLedgerIdempotencyConflict):
|
||||
return ReasonLedgerIdempotencyConflict, true
|
||||
case errors.Is(err, ErrLedgerCommandIdentityMismatch):
|
||||
return ReasonLedgerCommandIdentityMismatch, true
|
||||
case errors.Is(err, ErrLedgerAccessViolation):
|
||||
return ReasonLedgerAccessViolation, true
|
||||
case errors.Is(err, ErrAccountNotEligible):
|
||||
return ReasonAccountNotEligible, true
|
||||
case errors.Is(err, ErrQuotationFeeConfigurationMissing):
|
||||
return QuotationFeeConfigurationMissingCode, true
|
||||
case errors.Is(err, ErrQuotationReplayMissing):
|
||||
return QuotationReplayMissingCode, true
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
|
||||
func FromReason(reason string, msg string) (error, bool) {
|
||||
switch strings.TrimSpace(reason) {
|
||||
case ReasonRouteNotFound:
|
||||
return RouteNotFound(msg), true
|
||||
case ReasonRouteAmbiguous:
|
||||
return RouteAmbiguous(msg), true
|
||||
case ReasonRouteDisabled:
|
||||
return RouteDisabled(msg), true
|
||||
case ReasonRouteInvalidSource:
|
||||
return RouteInvalidSource(msg), true
|
||||
case ReasonRouteDestinationNotFound:
|
||||
return RouteDestinationNotFound(msg), true
|
||||
case ReasonRouteDestinationInactive:
|
||||
return RouteDestinationInactive(msg), true
|
||||
case ReasonRouteDestinationCurrencyMismatch:
|
||||
return RouteDestinationCurrencyMismatch(msg), true
|
||||
case ReasonRouteDestinationOrgMismatch:
|
||||
return RouteDestinationOrgMismatch(msg), true
|
||||
case ReasonRouteDestinationAmbiguous:
|
||||
return RouteDestinationAmbiguous(msg), true
|
||||
case ReasonRouteDestinationOwnerMismatch:
|
||||
return RouteDestinationOwnerMismatch(msg), true
|
||||
case ReasonRouteActiveSourceConflict:
|
||||
return RouteActiveSourceConflict(msg), true
|
||||
case ReasonRouteDestinationTypeMismatch:
|
||||
return RouteDestinationTypeMismatch(msg), true
|
||||
case ReasonRouteDestinationRoleMismatch:
|
||||
return RouteDestinationRoleMismatch(msg), true
|
||||
case ReasonRouteIdempotencyConflict:
|
||||
return RouteIdempotencyConflict(msg), true
|
||||
case ReasonRouteVersionConflict:
|
||||
return RouteVersionConflict(msg), true
|
||||
case ReasonRouteInvalidState:
|
||||
return RouteInvalidState(msg), true
|
||||
case ReasonAMLSourceIdempotencyConflict:
|
||||
return AMLSourceIdempotencyConflict(msg), true
|
||||
case ReasonLedgerIdempotencyConflict:
|
||||
return LedgerIdempotencyConflict(msg), true
|
||||
case ReasonLedgerCommandIdentityMismatch:
|
||||
return LedgerCommandIdentityMismatch(msg), true
|
||||
case ReasonLedgerAccessViolation:
|
||||
return LedgerAccessViolation(msg), true
|
||||
case ReasonAccountNotEligible:
|
||||
return AccountNotEligible(msg), true
|
||||
case ReasonDocumentsReportOwned:
|
||||
return DocumentsReportOwned(msg), true
|
||||
case ReasonDocumentsQuotationExpired:
|
||||
return DocumentsQuotationExpired(msg), true
|
||||
case ReasonPaymentExecutionNotAccepted:
|
||||
return PaymentExecutionNotAccepted(msg), true
|
||||
case QuotationFeeConfigurationMissingCode:
|
||||
return QuotationFeeConfigurationMissing(), true
|
||||
case QuotationReplayMissingCode:
|
||||
return QuotationReplayMissing(), true
|
||||
case ReasonOrganizationProvisioningInProgress:
|
||||
return OrganizationProvisioningInProgress(msg), true
|
||||
case ReasonOrganizationAlreadyActive:
|
||||
return OrganizationAlreadyActive(msg), true
|
||||
case ReasonOrganizationProvisioningBlocked:
|
||||
return OrganizationProvisioningBlocked(msg), true
|
||||
case ReasonOrganizationOwnerMismatch:
|
||||
return OrganizationOwnerMismatch(msg), true
|
||||
case ReasonOrganizationNotOperatorProvisioned:
|
||||
return OrganizationNotOperatorProvisioned(msg), true
|
||||
default:
|
||||
return nil, false
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
Reference in new issue
Block a user