model

package
v0.0.0-...-0406d23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientCollection     = "clients"
	InvitationCollection = "invitations"
	PermissionCollection = "permissions"
	RoleCollection       = "roles"
	KeyCollection        = "keys"
	UserCollection       = "users"
)

Variables

Functions

This section is empty.

Types

type Address

type Address struct {
	Street  string `json:"street"`
	City    string `json:"city"`
	State   string `json:"state"`
	Zip     string `json:"zip"`
	Country string `json:"country"`
}

type Card

type Card struct {
	Model       `bson:",inline"`
	UID         primitive.ObjectID  `json:"uid" bson:"uid"`
	Wallet      *primitive.ObjectID `json:"wallet" bson:"wallet"`
	Name        string              `json:"name" bson:"name"`
	Number      string              `json:"number" bson:"number"`
	ExpMonth    int                 `json:"exp_month" bson:"exp_month"`
	ExpYear     int                 `json:"exp_year" bson:"exp_year"`
	Cvv         string              `json:"cvv" bson:"cvv"`
	Last4       string              `json:"last4" bson:"last4"`
	Brand       string              `json:"brand" bson:"brand"`
	Country     string              `json:"country" bson:"country"`
	Funding     string              `json:"funding" bson:"funding"`
	Fingerprint string              `json:"fingerprint" bson:"fingerprint"`
	Billing     primitive.M         `json:"billing" bson:"billing"`
	Status      string              `json:"status" bson:"status"`
}

func (*Card) Collection

func (i *Card) Collection() string

func (*Card) Index

func (i *Card) Index() []mongo.IndexModel

func (*Card) MarshalBSON

func (i *Card) MarshalBSON() ([]byte, error)

type Cards

type Cards struct {
	Count int     `json:"count"`
	Data  []*Card `json:"data,omitempty"`
}

type Model

type Model struct {
	ID        primitive.ObjectID  `json:"id,omitempty" bson:"_id,omitempty"`
	Workspace primitive.ObjectID  `json:"workspace,omitempty" bson:"workspace,omitempty"`
	Metadata  primitive.M         `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Created   primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"`
	Updated   primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"`
	Deleted   primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"`
	Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"`
}

type NewCardInput

type NewCardInput struct {
	Name     string                 `json:"name"`
	Number   string                 `json:"number"`
	ExpMonth int                    `json:"exp_month"`
	ExpYear  int                    `json:"exp_year"`
	Cvv      string                 `json:"cvv"`
	Billing  map[string]interface{} `json:"billing"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type NewTransaction

type NewTransaction struct {
	Type        string                 `json:"type"`
	Status      string                 `json:"status"`
	Amount      float64                `json:"amount"`
	Currency    string                 `json:"currency"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Date        string                 `json:"date"`
	Description string                 `json:"description"`
	Card        string                 `json:"card"`
	UID         string                 `json:"uid"`
	Wallet      string                 `json:"wallet"`
}

type NewWallet

type NewWallet struct {
	Balance  float64                `json:"balance"`
	Currency string                 `json:"currency"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type Transaction

type Transaction struct {
	Model       `bson:",inline"`
	UID         primitive.ObjectID  `json:"uid" bson:"uid"`
	Wallet      *primitive.ObjectID `json:"wallet" bson:"wallet"`
	Card        *primitive.ObjectID `json:"card" bson:"card"`
	Type        string              `json:"type" bson:"type"`
	Status      string              `json:"status" bson:"status"`
	Amount      float64             `json:"amount" bson:"amount"`
	Currency    string              `json:"currency" bson:"currency"`
	Date        primitive.DateTime  `json:"date" bson:"date"`
	Description *string             `json:"description,omitempty" bson:"description,omitempty"`
}

func (*Transaction) Collection

func (i *Transaction) Collection() string

func (*Transaction) Index

func (i *Transaction) Index() []mongo.IndexModel

func (*Transaction) MarshalBSON

func (i *Transaction) MarshalBSON() ([]byte, error)

type TransactionMethod

type TransactionMethod string
const (
	TransactionMethodCreditCard TransactionMethod = "CREDIT_CARD"
	TransactionMethodDebitCard  TransactionMethod = "DEBIT_CARD"
	TransactionMethodPaypal     TransactionMethod = "PAYPAL"
	TransactionMethodStripe     TransactionMethod = "STRIPE"
)

func (TransactionMethod) IsValid

func (e TransactionMethod) IsValid() bool

func (TransactionMethod) MarshalGQL

func (e TransactionMethod) MarshalGQL(w io.Writer)

func (TransactionMethod) String

func (e TransactionMethod) String() string

func (*TransactionMethod) UnmarshalGQL

func (e *TransactionMethod) UnmarshalGQL(v interface{}) error

type TransactionStatus

type TransactionStatus string
const (
	TransactionStatusPending   TransactionStatus = "PENDING"
	TransactionStatusCompleted TransactionStatus = "COMPLETED"
	TransactionStatusFailed    TransactionStatus = "FAILED"
	TransactionStatusRefunded  TransactionStatus = "REFUNDED"
)

func (TransactionStatus) IsValid

func (e TransactionStatus) IsValid() bool

func (TransactionStatus) MarshalGQL

func (e TransactionStatus) MarshalGQL(w io.Writer)

func (TransactionStatus) String

func (e TransactionStatus) String() string

func (*TransactionStatus) UnmarshalGQL

func (e *TransactionStatus) UnmarshalGQL(v interface{}) error

type Transactions

type Transactions struct {
	Data  []*Transaction `json:"data,omitempty"`
	Count int            `json:"count"`
}

type UpdateCardInput

type UpdateCardInput struct {
	Name     *string                `json:"name,omitempty"`
	ExpMonth *int                   `json:"exp_month,omitempty"`
	ExpYear  *int                   `json:"exp_year,omitempty"`
	Cvv      *string                `json:"cvv,omitempty"`
	Billing  map[string]interface{} `json:"billing,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateTransaction

type UpdateTransaction struct {
	Description *string                `json:"description,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateWallet

type UpdateWallet struct {
	Balance  *float64               `json:"balance,omitempty"`
	Currency *string                `json:"currency,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type User

type User struct {
	ID      string    `json:"id"`
	Wallets []*Wallet `json:"wallets,omitempty"`
}

func (User) IsEntity

func (User) IsEntity()

type Wallet

type Wallet struct {
	Model    `bson:",inline"`
	UID      primitive.ObjectID `json:"uid" bson:"uid"`
	Balance  float64            `json:"balance" bson:"balance"`
	Currency string             `json:"currency" bson:"currency"`
	Status   string             `json:"status" bson:"status"`
}

func (*Wallet) Collection

func (i *Wallet) Collection() string

func (*Wallet) Index

func (i *Wallet) Index() []mongo.IndexModel

func (*Wallet) MarshalBSON

func (i *Wallet) MarshalBSON() ([]byte, error)

type Wallets

type Wallets struct {
	Data  []*Wallet `json:"data,omitempty"`
	Count int       `json:"count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL