Order Info Order Product

Endpoints to manage product orders in an order.

'/orders/{id}/order-products'

GET

async find(
    @param.path.number('id') id: number,
  ): Promise<OrderProduct[]>

Auth: Yes RBAC: Admin, Customer (owner)

Retrieve all product orders in a given order.

POST

async create(
    @param.path.number('id') id: typeof OrderInfo.prototype.id,
    @requestBody({
      content: {
        'application/json': {
          schema: {
            type: 'object',
          }
        },
      },
    })
    product: Product & CheckoutLineItemInput,
  ): Promise<OrderProduct>

Auth: Yes RBAC: Admin, Customer (owner)

Add a new product order to an order.

'/orders/{id}/order-products/{orderProductId}'

PATCH

async patch(
    @param.path.number('id') id: typeof OrderInfo.prototype.id,
    @param.path.number('orderProductId') orderProductId: typeof OrderProduct.prototype.id,
    @requestBody({
      content: {
        'application/json': {
          schema: getModelSchemaRef(OrderProduct, { partial: true }),
        },
      },
    })
    orderProduct: Partial<OrderProduct>,
  ): Promise<Count>

Auth: Yes RBAC: Admin, Customer (owner)

Update a product order in an order.

DEL

async delete(
    @param.path.number('id') id: typeof OrderInfo.prototype.id,
    @param.path.number('orderProductId') orderProductId: typeof OrderProduct.prototype.id,
  ): Promise<void>

Auth: Yes RBAC: Admin, Customer (owner)

Delete a product order in an order.

Last updated