model

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Base
	MerchantId uuid.UUID       `gorm:"index:api_key_index,unique;type:uuid"`
	Mode       enum.Mode       `gorm:"index:api_key_index,unique"`
	KeyType    enum.ApiKeyType `gorm:"index:api_key_index,unique,where:deleted_at IS NULL""`
	ApiKey     string
	SecretKey  string
	Salt       []byte
}

type Base

type Base struct {
	ID        uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type EmailVerification

type EmailVerification struct {
	Base
	MerchantId       uuid.UUID `gorm:"type:uuid"`
	VerificationCode uint64
}

type Merchant

type Merchant struct {
	Base
	FirstName         string
	LastName          string
	Email             string `gorm:"unique"`
	Password          string
	Salt              []byte
	IsActive          bool
	EmailVerification EmailVerification
	Wallets           []Wallet
	ApiKeys           []ApiKey
	Payments          []Payment
}

type Payment

type Payment struct {
	Base
	BlockchainPaymentId uuid.UUID `gorm:"type:uuid"`
	MerchantId          uuid.UUID `gorm:"type:uuid"`
	Wallet              Wallet
	WalletId            uuid.UUID `gorm:"type:uuid"`
	Mode                enum.Mode
	PriceAmount         float64 `gorm:"type:numeric"`
	PriceCurrency       enum.FiatCurrency
	PayCurrency         enum.CryptoCurrency
	PayAddress          string
	CallbackUrl         string
	PaymentStates       []PaymentState
}

type PaymentState

type PaymentState struct {
	Base
	PaymentId    uuid.UUID `gorm:"type:uuid"`
	PayAmount    float64   `gorm:"type:numeric"`
	ActuallyPaid float64   `gorm:"type:numeric"`
	PaymentState enum.State
}

type Wallet

type Wallet struct {
	Base
	MerchantId uuid.UUID           `gorm:"index:wallet_index,unique;type:uuid"`
	Currency   enum.CryptoCurrency `gorm:"index:wallet_index,unique"`
	Mode       enum.Mode           `gorm:"index:wallet_index,unique,where:deleted_at IS NULL"`
	Address    string
}

Jump to

Keyboard shortcuts

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