Documentation ¶
Index ¶
- type Address
- type AddressDefaultType
- type CreateOrderItemsParams
- type DBTX
- type ListActiveWithPaymentAndAddressByUserIDRow
- type ListUnpaidWithPaymentAndAddressByUserIDRow
- type ListWithPaymentAndAddressByUserIDRow
- type NullAddressDefaultType
- type NullOrderStatus
- type NullPaymentMethod
- type NullPaymentStatus
- type Order
- type OrderItem
- type OrderStatus
- type PaymentMethod
- type PaymentStatus
- type Querier
- type Queries
- func (q *Queries) Create(ctx context.Context, userID int64, cartID int64, paymentMethod PaymentMethod, ...) (*Order, error)
- func (q *Queries) CreateOrderItems(ctx context.Context, arg []CreateOrderItemsParams) (int64, error)
- func (q *Queries) Get(ctx context.Context, id int64) (*Order, error)
- func (q *Queries) GetItemByOrderIds(ctx context.Context, orderids []int64) ([]*OrderItem, error)
- func (q *Queries) GetOrders(ctx context.Context, cartID int64) ([]*Order, error)
- func (q *Queries) ListActiveByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error)
- func (q *Queries) ListActiveWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListActiveWithPaymentAndAddressByUserIDRow, error)
- func (q *Queries) ListByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error)
- func (q *Queries) ListUnpaidPaymentByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error)
- func (q *Queries) ListUnpaidWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListUnpaidWithPaymentAndAddressByUserIDRow, error)
- func (q *Queries) ListWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListWithPaymentAndAddressByUserIDRow, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Repository
- type StripeCardPayment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID int64 UserID int64 DefaultFor NullAddressDefaultType Name string AddressLine1 string AddressLine2 *string City string StateProvince *string PostalCode *string Country *string Phone *string CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz }
type AddressDefaultType ¶
type AddressDefaultType string
const ( AddressDefaultTypeShipping AddressDefaultType = "Shipping" AddressDefaultTypeBilling AddressDefaultType = "Billing" )
func (*AddressDefaultType) Scan ¶
func (e *AddressDefaultType) Scan(src interface{}) error
type CreateOrderItemsParams ¶
type DBTX ¶
type DBTX interface { Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) Query(context.Context, string, ...interface{}) (pgx.Rows, error) QueryRow(context.Context, string, ...interface{}) pgx.Row CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) }
type ListActiveWithPaymentAndAddressByUserIDRow ¶
type ListActiveWithPaymentAndAddressByUserIDRow struct { Order Order Address Address StripeCardPayment StripeCardPayment }
type ListUnpaidWithPaymentAndAddressByUserIDRow ¶
type ListUnpaidWithPaymentAndAddressByUserIDRow struct { Order Order Address Address StripeCardPayment StripeCardPayment }
type ListWithPaymentAndAddressByUserIDRow ¶
type ListWithPaymentAndAddressByUserIDRow struct { Order Order Address Address StripeCardPayment StripeCardPayment }
type NullAddressDefaultType ¶
type NullAddressDefaultType struct { AddressDefaultType AddressDefaultType Valid bool // Valid is true if AddressDefaultType is not NULL }
func (*NullAddressDefaultType) Scan ¶
func (ns *NullAddressDefaultType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullOrderStatus ¶
type NullOrderStatus struct { OrderStatus OrderStatus Valid bool // Valid is true if OrderStatus is not NULL }
func (*NullOrderStatus) Scan ¶
func (ns *NullOrderStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPaymentMethod ¶
type NullPaymentMethod struct { PaymentMethod PaymentMethod Valid bool // Valid is true if PaymentMethod is not NULL }
func (*NullPaymentMethod) Scan ¶
func (ns *NullPaymentMethod) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPaymentStatus ¶
type NullPaymentStatus struct { PaymentStatus PaymentStatus Valid bool // Valid is true if PaymentStatus is not NULL }
func (*NullPaymentStatus) Scan ¶
func (ns *NullPaymentStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type Order ¶
type Order struct { ID int64 UserID int64 CartID int64 PaymentMethod PaymentMethod PaymentStatus PaymentStatus Status OrderStatus ShippingAddressID int64 IsPickup bool Amount decimal.Decimal Currency string CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz }
type OrderStatus ¶
type OrderStatus string
const ( OrderStatusPending OrderStatus = "Pending" OrderStatusProcessing OrderStatus = "Processing" OrderStatusShipped OrderStatus = "Shipped" OrderStatusDelivered OrderStatus = "Delivered" OrderStatusCancelled OrderStatus = "Cancelled" OrderStatusFulfilled OrderStatus = "Fulfilled" )
func (*OrderStatus) Scan ¶
func (e *OrderStatus) Scan(src interface{}) error
type PaymentMethod ¶
type PaymentMethod string
const ( PaymentMethodStripeCard PaymentMethod = "StripeCard" PaymentMethodPaypal PaymentMethod = "Paypal" PaymentMethodAnorInstallment PaymentMethod = "AnorInstallment" PaymentMethodPayOnDelivery PaymentMethod = "PayOnDelivery" )
func (*PaymentMethod) Scan ¶
func (e *PaymentMethod) Scan(src interface{}) error
type PaymentStatus ¶
type PaymentStatus string
const ( PaymentStatusPending PaymentStatus = "Pending" PaymentStatusPaid PaymentStatus = "Paid" )
func (*PaymentStatus) Scan ¶
func (e *PaymentStatus) Scan(src interface{}) error
type Querier ¶
type Querier interface { Create(ctx context.Context, userID int64, cartID int64, paymentMethod PaymentMethod, paymentStatus PaymentStatus, status OrderStatus, shippingAddressID int64, isPickup bool, amount decimal.Decimal, currency string) (*Order, error) CreateOrderItems(ctx context.Context, arg []CreateOrderItemsParams) (int64, error) Get(ctx context.Context, id int64) (*Order, error) GetItemByOrderIds(ctx context.Context, orderids []int64) ([]*OrderItem, error) GetOrders(ctx context.Context, cartID int64) ([]*Order, error) ListActiveByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error) ListActiveWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListActiveWithPaymentAndAddressByUserIDRow, error) ListByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error) ListUnpaidPaymentByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*Order, error) ListUnpaidWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListUnpaidWithPaymentAndAddressByUserIDRow, error) ListWithPaymentAndAddressByUserID(ctx context.Context, userID int64, limit int32, offset int32) ([]*ListWithPaymentAndAddressByUserIDRow, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) Create ¶
func (q *Queries) Create(ctx context.Context, userID int64, cartID int64, paymentMethod PaymentMethod, paymentStatus PaymentStatus, status OrderStatus, shippingAddressID int64, isPickup bool, amount decimal.Decimal, currency string) (*Order, error)
func (*Queries) CreateOrderItems ¶
func (*Queries) GetItemByOrderIds ¶
func (*Queries) ListActiveByUserID ¶
func (*Queries) ListActiveWithPaymentAndAddressByUserID ¶
func (*Queries) ListByUserID ¶
func (*Queries) ListUnpaidPaymentByUserID ¶
func (*Queries) ListUnpaidWithPaymentAndAddressByUserID ¶
func (*Queries) ListWithPaymentAndAddressByUserID ¶
type Repository ¶
type Repository interface { Querier }
func NewRepository ¶
func NewRepository(db *pgxpool.Pool) Repository
type StripeCardPayment ¶
type StripeCardPayment struct { ID int64 OrderID int64 UserID *int64 BillingAddressID int64 PaymentIntentID string PaymentMethodID *string Amount decimal.Decimal Currency string Status string ClientSecret *string LastError *string CardLast4 string CardBrand string CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz }
Click to show internal directories.
Click to hide internal directories.