cached gateway routing
This commit is contained in:
29
api/pkg/model/chainwalletroute.go
Normal file
29
api/pkg/model/chainwalletroute.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/tech/sendico/pkg/db/storable"
|
||||
"github.com/tech/sendico/pkg/mservice"
|
||||
)
|
||||
|
||||
// ChainWalletRoute stores authoritative wallet-to-gateway routing metadata.
|
||||
type ChainWalletRoute struct {
|
||||
storable.Base `bson:",inline" json:",inline"`
|
||||
|
||||
OrganizationRef string `bson:"organizationRef" json:"organizationRef"`
|
||||
WalletRef string `bson:"walletRef" json:"walletRef"`
|
||||
Network string `bson:"network" json:"network"`
|
||||
GatewayID string `bson:"gatewayId,omitempty" json:"gatewayId,omitempty"`
|
||||
}
|
||||
|
||||
func (*ChainWalletRoute) Collection() string {
|
||||
return mservice.WalletRoutes
|
||||
}
|
||||
|
||||
func (r *ChainWalletRoute) Normalize() {
|
||||
r.OrganizationRef = strings.TrimSpace(r.OrganizationRef)
|
||||
r.WalletRef = strings.TrimSpace(r.WalletRef)
|
||||
r.Network = strings.ToLower(strings.TrimSpace(r.Network))
|
||||
r.GatewayID = strings.TrimSpace(r.GatewayID)
|
||||
}
|
||||
Reference in New Issue
Block a user