Documentation ¶
Index ¶
- type DBTX
- type GetAllProductsRow
- type GetNotificationEventParams
- type GetProductsPricesParams
- type GetProductsPricesRow
- type ItemPreco
- type Queries
- func (q *Queries) ClearNotificationEvents(ctx context.Context, numberOfHours int) error
- func (q *Queries) GetAllProducts(ctx context.Context, codigoPrazo int) ([]GetAllProductsRow, error)
- func (q *Queries) GetMostRecentUpdate(ctx context.Context) (pgtype.Date, error)
- func (q *Queries) GetNotificationEvent(ctx context.Context, arg GetNotificationEventParams) (VnLastNotificationEvent, error)
- func (q *Queries) GetPriceWatcher(ctx context.Context) (VnPriceUpdateWatcher, error)
- func (q *Queries) GetProductsPrices(ctx context.Context, arg GetProductsPricesParams) ([]GetProductsPricesRow, error)
- func (q *Queries) RegisterNotificationEvent(ctx context.Context, arg RegisterNotificationEventParams) error
- func (q *Queries) RemoveOldPriceWatchers(ctx context.Context) error
- func (q *Queries) UpdatePriceWatcher(ctx context.Context, pricesHash string) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RegisterNotificationEventParams
- type VnLastNotificationEvent
- type VnPriceUpdateWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetAllProductsRow ¶
type GetProductsPricesParams ¶
type GetProductsPricesRow ¶
type ItemPreco ¶
type ItemPreco struct { CodigoItem float64 CodigoUnidade int CodigoPrazo int CodigoComissao pgtype.Int4 Preco float64 PermiteDesconto int DescontoMaximo float64 AlteracaoPreco pgtype.Date DescontoMaximoProg float64 DebitoEmpresaProg float64 CreditoVendedorProg float64 DebitoVendedorProg float64 NumeroAlteracao int FlagDelivery int }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ClearNotificationEvents ¶
ClearNotificationEvents deletes old notification exem.
func (*Queries) GetAllProducts ¶
GetAllProducts is used to calculate the hash of the products and prices. Always sorted in a predictable order. This is used to check if the prices have changed.
func (*Queries) GetMostRecentUpdate ¶
GetMostRecentUpdate retrieves the most recent update of the prices.
func (*Queries) GetNotificationEvent ¶
func (q *Queries) GetNotificationEvent(ctx context.Context, arg GetNotificationEventParams) (VnLastNotificationEvent, error)
func (*Queries) GetPriceWatcher ¶
func (q *Queries) GetPriceWatcher(ctx context.Context) (VnPriceUpdateWatcher, error)
GetPriceWatcher retrieves the last hash and update time of the prices.
func (*Queries) GetProductsPrices ¶
func (q *Queries) GetProductsPrices(ctx context.Context, arg GetProductsPricesParams) ([]GetProductsPricesRow, error)
Get the price of products from item_preco with a given codigo_prazo. Later we'll filter by the most recent alteracao_preco. If there are two with the same alteracao_preco, we'll send a warning to the admin through email.
func (*Queries) RegisterNotificationEvent ¶
func (q *Queries) RegisterNotificationEvent(ctx context.Context, arg RegisterNotificationEventParams) error
func (*Queries) RemoveOldPriceWatchers ¶
RemoveOldPriceWatchers deletes all but the most recent price watcher.
func (*Queries) UpdatePriceWatcher ¶
UpdatePriceWatcher updates the last hash and update time of the prices.
type VnLastNotificationEvent ¶
type VnLastNotificationEvent struct { EventType string CodigoItem float64 DateSent pgtype.Timestamptz }
type VnPriceUpdateWatcher ¶
type VnPriceUpdateWatcher struct { LastUpdate pgtype.Timestamptz PricesHash string }