Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,57 @@
|
||||
package account_role
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type AccountRole string
|
||||
|
||||
const (
|
||||
AccountRoleOperating AccountRole = "operating"
|
||||
AccountRoleHold AccountRole = "hold"
|
||||
AccountRoleTransit AccountRole = "transit"
|
||||
AccountRoleSettlement AccountRole = "settlement"
|
||||
AccountRoleClearing AccountRole = "clearing"
|
||||
AccountRolePending AccountRole = "pending"
|
||||
AccountRoleReserve AccountRole = "reserve"
|
||||
AccountRoleLiquidity AccountRole = "liquidity"
|
||||
AccountRoleFee AccountRole = "fee"
|
||||
AccountRoleChargeback AccountRole = "chargeback"
|
||||
AccountRoleAdjustment AccountRole = "adjustment"
|
||||
)
|
||||
|
||||
const (
|
||||
MetadataKeyFromRole = "from_role"
|
||||
MetadataKeyToRole = "to_role"
|
||||
)
|
||||
|
||||
func Parse(value string) (AccountRole, bool) {
|
||||
switch strings.ToUpper(strings.TrimSpace(value)) {
|
||||
case "ACCOUNT_ROLE_OPERATING", "OPERATING":
|
||||
return AccountRoleOperating, true
|
||||
case "ACCOUNT_ROLE_HOLD", "HOLD":
|
||||
return AccountRoleHold, true
|
||||
case "ACCOUNT_ROLE_TRANSIT", "TRANSIT":
|
||||
return AccountRoleTransit, true
|
||||
case "ACCOUNT_ROLE_SETTLEMENT", "SETTLEMENT":
|
||||
return AccountRoleSettlement, true
|
||||
case "ACCOUNT_ROLE_CLEARING", "CLEARING":
|
||||
return AccountRoleClearing, true
|
||||
case "ACCOUNT_ROLE_PENDING", "PENDING":
|
||||
return AccountRolePending, true
|
||||
case "ACCOUNT_ROLE_RESERVE", "RESERVE":
|
||||
return AccountRoleReserve, true
|
||||
case "ACCOUNT_ROLE_LIQUIDITY", "LIQUIDITY":
|
||||
return AccountRoleLiquidity, true
|
||||
case "ACCOUNT_ROLE_FEE", "FEE":
|
||||
return AccountRoleFee, true
|
||||
case "ACCOUNT_ROLE_CHARGEBACK", "CHARGEBACK":
|
||||
return AccountRoleChargeback, true
|
||||
case "ACCOUNT_ROLE_ADJUSTMENT", "ADJUSTMENT":
|
||||
return AccountRoleAdjustment, true
|
||||
case "ACCOUNT_ROLE_UNSPECIFIED", "UNSPECIFIED", "":
|
||||
return "", true
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user