entity

package
v0.0.0-...-986cd6b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrAlreadyExists = errors.New("already exists")
	ErrAccessDenied  = errors.New(`access denied`)
	ErrBadRequest    = errors.New("bad request")
)

Functions

This section is empty.

Types

type AClient

type AClient struct {
	// contains filtered or unexported fields
}

type Authentication

type Authentication struct {
	ID              string `json:"id"`
	Login           string `json:"login"  validate:"required"`
	Password        string `json:"password,omitempty"`
	EncryptPassword string `json:"-"`
	*config.Config  `json:"-"`
}

func TestAuthentication

func TestAuthentication(t *testing.T) *Authentication

func (*Authentication) BeforeCreate

func (a *Authentication) BeforeCreate() error

func (*Authentication) ComparePassword

func (a *Authentication) ComparePassword(password string) bool

func (*Authentication) Sanitize

func (a *Authentication) Sanitize()

Sanitize очищает поля, для того чтоб они не возвращались в ответе

func (*Authentication) Validate

func (a *Authentication) Validate() error

type Balance

type Balance struct {
	Current  float32 `json:"current"`
	Withdraw float32 `json:"withdrawn"`
}

type GoferResponse

type GoferResponse struct {
	Slug string `json:"correlation_id" example:"1674872720465761244B_5"`        // Строковый идентификатор
	URL  string `json:"short_url" example:"https://example.com/correlation_id"` // URL для сокращения
}

type Gofermart

type Gofermart struct {
	Slug           string `json:"slug,omitempty" example:"1674872720465761244B_5"`             // Строковый идентификатор
	URL            string `json:"url,omitempty" example:"https://example.com/go/to/home.html"` // URL для сокращения
	UserID         string `json:"user_id,omitempty"`
	Order          string `json:"order,omitempty"`
	Del            bool   `json:"del"`
	*config.Config `json:"-"`
}

Gofermart -.

type Gofermarts

type Gofermarts []Gofermart

type LoyaltyStatus

type LoyaltyStatus struct {
	Order   string  `json:"order,omitempty"`
	Status  string  `json:"status,omitempty"`
	Accrual float32 `json:"accrual,omitempty"`
}

type Order

type Order struct {
	Number         int     `json:"number,omitempty"`
	Status         string  `json:"status,omitempty"`
	Accrual        float32 `json:"accrual,omitempty"`
	UploadedAt     string  `json:"uploaded_at"  db:"uploaded_at"`
	UserID         string  `json:"user_id,omitempty"  db:"user_id"`
	*config.Config `json:"-"`
}

type OrderList

type OrderList []OrderResponse

type OrderResponse

type OrderResponse struct {
	Number         string  `json:"number,omitempty"`
	Status         string  `json:"status,omitempty"`
	Accrual        float32 `json:"accrual,omitempty"`
	UploadedAt     string  `json:"uploaded_at" db:"uploaded_at"`
	UserID         string  `json:"user_id,omitempty" db:"user_id"`
	*config.Config `json:"-"`
}

type Response

type Response []GoferResponse

type User

type User struct {
	UserID string `json:"user_id" example:"1674872720465761244B_5"`
}

type Withdraw

type Withdraw struct {
	NumOrder    string  `json:"order" db:"number"`
	Sum         float32 `json:"sum"`
	ProcessedAt string  `json:"processed_at"`
	*Order      `json:"-"`
}

type WithdrawResponse

type WithdrawResponse struct {
	NumOrder    string  `json:"order" db:"number"`
	Sum         float32 `json:"sum"`
	ProcessedAt string  `json:"processed_at"`
	*Order      `json:"-"`
}

type WithdrawalsList

type WithdrawalsList []WithdrawResponse

Jump to

Keyboard shortcuts

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