Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create a req body for the endpoint #761

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Leona-cloud
Copy link
Contributor

@Leona-cloud Leona-cloud commented Aug 10, 2024

Description: Endpoint for that allows users with admin access to edit product

Acceptance Criteria

The route of the endpoint should be:

PATCH /api/v1/organisations/orgId/products/productId

Update products (Admin Route)

  • The request body (Payload) should be:
{
  "name": "fANTASTIC PRODUCT Name",
  "quantity": 10,
  "price": 99.99,
  "category": "Electronics"
}
  • The response body should be:
{

    "status_code": 200,
    "message": "Product updated successfully",
    "data": {
      "id": "b208c320-b3d3-485f-9e63-2dc43dec4991",
      "created_at": "2024-08-10T02:53:26.174Z",
      "updated_at": "2024-08-10T02:53:51.429Z",
      "name": "fANTASTIC PRODUCT Name",
      "description": "10",
      "category": "Electronics",
      "image": "10",
      "price": 99.99,
      "cost_price": 79.99.
      "quantity": 10,
      "size": "Small",
      "stock_status": "in stock",
      "deletedAt": null
    }
}
  • The error response should be:
{
  "status_code": Error Code,
  "message": "Error Message",
  "data": {}
}

Copy link
Contributor

@CFCIfe CFCIfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants