Documentation ¶
Index ¶
Constants ¶
View Source
const ( PAYMENT_SATUS_OPEN PaymentStatus = "Aberto" PAYMENT_STATUS_APPROVED = "Aprovado" PAYMENT_STATUS_REFUSED = "Recusado" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoriesRepository ¶
type CategoriesRepository interface { InsertCategory(ctx context.Context, in *models.Category) (*models.Category, error) GetCategoryByID(ctx context.Context, id uuid.UUID) (*models.Category, error) DeleteCategory(ctx context.Context, id uuid.UUID) error ListCategories(ctx context.Context, limit int, offset int) (*models.CategoryList, error) }
func NewCategoriesPersistence ¶
func NewCategoriesPersistence(db *gorm.DB, log kitlog.Logger) CategoriesRepository
type OrderProduct ¶
type OrderStatus ¶
type OrderStatus int
const ( ORDER_STATUS_UNSET OrderStatus = iota ORDER_STATUS_OPEN ORDER_STATUS_WAITING_PAYMENT ORDER_STATUS_RECEIVED ORDER_STATUS_PREPARING ORDER_STATUS_DONE ORDER_STATUS_FINISHED ORDER_STATUS_CANCELED )
type OrdersRepository ¶
type OrdersRepository interface { GetOrder(ctx context.Context, orderID uuid.UUID) (*models.Order, error) GetOrderByPaymentID(ctx context.Context, paymentID uuid.UUID) (*models.Order, error) CreateOrder(ctx context.Context, order *models.Order) (*models.Order, error) UpdateOrder(ctx context.Context, order *models.Order) (*models.Order, error) DeleteOrder(ctx context.Context, orderID uuid.UUID) error ListOrdersByUser(ctx context.Context, limit, offset int, userID uuid.UUID) (*models.OrderList, error) ListOrders(ctx context.Context, limit, offset int) (*models.OrderList, error) }
func NewOrdersPersistence ¶
func NewOrdersPersistence(db *gorm.DB, log kitlog.Logger) OrdersRepository
type PaymentRepository ¶
type PaymentRepository interface { CreatePayment(ctx context.Context, payment *models.Payment) (*models.Payment, error) GetPayment(ctx context.Context, paymentID uuid.UUID) (*models.Payment, error) UpdatePayment(ctx context.Context, payment *models.Payment) (*models.Payment, error) }
func NewPaymentsPersistence ¶
func NewPaymentsPersistence(db *gorm.DB, log kitlog.Logger) PaymentRepository
type PaymentStatus ¶
type PaymentStatus string
type ProductList ¶
type ProductList struct {
// contains filtered or unexported fields
}
type ProductsRepository ¶
type ProductsRepository interface { GetProduct(ctx context.Context, id uuid.UUID) (*models.Product, error) InsertProduct(ctx context.Context, product *models.Product) (*models.Product, error) UpdateProduct(ctx context.Context, product *models.Product) (*models.Product, error) DeleteProduct(ctx context.Context, uuid uuid.UUID) error ListProductsByCategory(ctx context.Context, categoryID uuid.UUID, limit, offset int) (*models.ProductList, error) GetProductsPriceSumByID(ctx context.Context, ids []uuid.UUID) (*models.ProductsSum, error) }
func NewProductsPersistence ¶
func NewProductsPersistence(db *gorm.DB, log kitlog.Logger) ProductsRepository
Click to show internal directories.
Click to hide internal directories.