Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProductNotFound = errors.New("product not found")
Functions ¶
This section is empty.
Types ¶
type ProductDTO ¶
type ProductDTO struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `bson:"name"` Description string `bson:"description"` Price float64 `bson:"price"` Stock int `bson:"stock"` Category string `bson:"category"` PromotionExpiresAt *time.Time `bson:"promotion_expires_at"` }
func NewProductDTO ¶
func NewPromotionProductDTO ¶
type ProductReciever ¶
type ProductReciever struct { Ctx context.Context Collection *mongo.Collection }
func NewProductRepository ¶
func NewProductRepository(ctx context.Context, DB *mongo.Database) *ProductReciever
func (*ProductReciever) Create ¶
func (c *ProductReciever) Create(dto *ProductDTO) (*ProductDTO, error)
func (*ProductReciever) FindOne ¶
func (c *ProductReciever) FindOne(id primitive.ObjectID) (*ProductDTO, error)
Click to show internal directories.
Click to hide internal directories.