lkdr

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Brand

type Brand struct {
	Description string  `json:"description"`
	Id          int64   `json:"id" gorm:"primaryKey;autoIncrement:false"`
	Image       *string `json:"image"`
	Name        string  `json:"name"`
}

type Builder

type Builder struct {
	Config Config      `validate:"required"`
	Clock  based.Clock `validate:"required"`

	CaptchaSolver captcha.TokenProvider
}

func (Builder) Build

func (b Builder) Build() (*pipeline, error)

type Client

type Client interface {
	Receipt(ctx context.Context, in *lkdr.ReceiptIn) (*lkdr.ReceiptOut, error)
	FiscalData(ctx context.Context, in *lkdr.FiscalDataIn) (*lkdr.FiscalDataOut, error)
}

type Config

type Config struct {
	DB        database.Config         `yaml:"db" doc:"Настройки подключения к БД."`
	BatchSize int                     `` /* 202-byte string literal not displayed */
	Timeout   time.Duration           `yaml:"timeout,omitempty" default:"5m" doc:"Таймаут для запросов."`
	Users     map[string][]Credential `yaml:"users" doc:"Пользователи и их авторизационные данные."`
}

type Credential

type Credential struct {
	Phone     string `yaml:"phone" pattern:"7\\d{10}" doc:"Номер телефона пользователя."`
	DeviceID  string `` /* 572-byte string literal not displayed */
	UserAgent string `` /* 371-byte string literal not displayed */
}

type DateTime

type DateTime struct {
	lkdr.DateTime
}

func (DateTime) GormDataType

func (dt DateTime) GormDataType() string

func (*DateTime) Scan

func (dt *DateTime) Scan(value any) error

func (DateTime) Value

func (dt DateTime) Value() (driver.Value, error)

type DateTimeTZ

type DateTimeTZ struct {
	lkdr.DateTimeTZ
}

func (DateTimeTZ) GormDataType

func (dt DateTimeTZ) GormDataType() string

func (*DateTimeTZ) Scan

func (dt *DateTimeTZ) Scan(value any) error

func (DateTimeTZ) Value

func (dt DateTimeTZ) Value() (driver.Value, error)

type Device

type Device struct {
	UserPhone string `gorm:"primaryKey"`
	User      User   `gorm:"constraint:OnDelete:CASCADE"`

	Id string
}

type FiscalData

type FiscalData struct {
	ReceiptKey string  `json:"-" gorm:"primaryKey"`
	Receipt    Receipt `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	BuyerAddress            string           `json:"buyerAddress"`
	CashTotalSum            float64          `json:"cashTotalSum"`
	CreditSum               float64          `json:"creditSum"`
	DateTime                DateTime         `json:"dateTime"`
	EcashTotalSum           float64          `json:"ecashTotalSum"`
	FiscalDocumentFormatVer string           `json:"fiscalDocumentFormatVer"`
	FiscalDocumentNumber    int64            `json:"fiscalDocumentNumber"`
	FiscalDriveNumber       string           `json:"fiscalDriveNumber"`
	FiscalSign              string           `json:"fiscalSign"`
	InternetSign            *int             `json:"internetSign"`
	Items                   []FiscalDataItem `json:"items" gorm:"constraint:OnDelete:CASCADE;foreignKey:ReceiptKey"`
	KktRegId                string           `json:"kktRegId"`
	MachineNumber           *string          `json:"machineNumber"`
	Nds10                   *float64         `json:"nds10"`
	Nds18                   *float64         `json:"nds18"`
	OperationType           int              `json:"operationType"`
	Operator                *string          `json:"operator"`
	PrepaidSum              float64          `json:"prepaidSum"`
	ProvisionSum            float64          `json:"provisionSum"`
	RequestNumber           int64            `json:"requestNumber"`
	RetailPlace             string           `json:"retailPlace"`
	RetailPlaceAddress      *string          `json:"retailPlaceAddress"`
	ShiftNumber             int64            `json:"shiftNumber"`
	TaxationType            int              `json:"taxationType"`
	TotalSum                float64          `json:"totalSum"`
	User                    *string          `json:"user"`
	UserInn                 string           `json:"userInn"`
}

type FiscalDataItem

type FiscalDataItem struct {
	ReceiptKey string `json:"-" gorm:"primaryKey"`
	DbIdx      int    `json:"dbIdx" gorm:"primaryKey"`

	Name        string  `json:"name"`
	Nds         int     `json:"nds"`
	PaymentType int     `json:"paymentType"`
	Price       float64 `json:"price"`
	ProductType int     `json:"productType"`
	ProviderInn *string `json:"providerInn"`
	Quantity    float64 `json:"quantity"`
	Sum         float64 `json:"sum"`
}

type Receipt

type Receipt struct {
	UserPhone string `json:"-" gorm:"index"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	BrandId *int64 `json:"brandId" gorm:"index"`
	Brand   *Brand `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	Buyer                string   `json:"buyer"`
	BuyerType            string   `json:"buyerType"`
	CreatedDate          DateTime `json:"createdDate" gorm:"index"`
	FiscalDocumentNumber string   `json:"fiscalDocumentNumber"`
	FiscalDriveNumber    string   `json:"fiscalDriveNumber"`
	Key                  string   `json:"key" gorm:"primaryKey"`
	KktOwner             string   `json:"kktOwner"`
	KktOwnerInn          string   `json:"kktOwnerInn"`
	ReceiveDate          DateTime `json:"receiveDate" gorm:"index"`
	TotalSum             string   `json:"totalSum"`
}

type Tokens

type Tokens struct {
	UserPhone string `json:"-" gorm:"primaryKey"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	RefreshToken          string      `json:"refreshToken"`
	RefreshTokenExpiresIn *DateTimeTZ `json:"refreshTokenExpiresIn,omitempty"`
	Token                 string      `json:"token"`
	TokenExpireIn         DateTimeTZ  `json:"tokenExpireIn"`
}

type User

type User struct {
	Phone string `gorm:"primaryKey"`
	Name  string `gorm:"index"`
}

Jump to

Keyboard shortcuts

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