Documentation ¶
Index ¶
Constants ¶
const (
ERROR_PURCHASE_ID_NOT_FOUNDED = "purchase order with id (%d) not founded"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PurchaseOrders ¶
type PurchaseOrders struct {
// contains filtered or unexported fields
}
func NewPurchaseOrder ¶
func NewPurchaseOrder(r domain.Service) PurchaseOrders
func (*PurchaseOrders) Create ¶
func (b *PurchaseOrders) Create(c *gin.Context)
Create CreatePurchaseOrder godoc @Summary Create PurchaseOrder @Tags Buyers @Description store a new purchase order @Accept json @Produce json @Param token header string true "token" @Param buyer body buyerRequest true "Purchase Order to store" @Failure 401 {object} web.Response "We need token" @Failure 404 {object} web.Response @Failure 409 {object} web.Response "Conflict" @Failure 422 {object} web.Response "Missing some mandatory field" @Success 201 {object} web.Response @Router /api/v1/purchase-orders [POST]
func (*PurchaseOrders) GetPurchaseOrderById ¶
func (b *PurchaseOrders) GetPurchaseOrderById(c *gin.Context)
GetPurchaseOrderById GetPurchaseOrder godoc @Summary List buyer @Tags Buyers @Description get a specific purchase order by id @Accept json @Produce json @Param token header string true "token" @Failure 401 {object} web.Response "We need token" @Failure 404 {object} web.Response @Success 200 {object} web.Response @Router /api/v1/purchase-orders/{id} [GET]
type PurchaseOrdersCreate ¶
type PurchaseOrdersCreate struct { ID int `json:"id"` OrderNumber string `json:"order_number" binding:"required"` OrderDate string `json:"order_date" binding:"required"` TrackingCode string `json:"tracking_code" binding:"required"` BuyerId int `json:"buyer_id" binding:"required"` ProductRecordId int `json:"product_record_id" binding:"required"` OrderStatusId int `json:"order_status_id" binding:"required"` }