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

profile option to change price and compare price instead of dropdown #113

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ components:
$ref: paths/customer/product/destroy/response.yaml
CustomerProductGetResponse:
$ref: paths/customer/product/get/response.yaml
CustomerProductCreateVariantResponse:
$ref: paths/customer/product/create-variant/response.yaml
CustomerProductCreateVariantBody:
$ref: paths/customer/product/create-variant/body.yaml
CustomerProductCreateVariant:
$ref: paths/customer/product/create-variant/variant.yaml

# Schedule
CustomerScheduleDestroy:
Expand Down Expand Up @@ -351,6 +357,8 @@ paths:
$ref: "./paths/customer/product/list-ids/index.yaml"
/customer/{customerId}/product/{productId}:
$ref: "paths/customer/product/product.yaml"
/customer/{customerId}/product/{productId}/create-variant:
$ref: "paths/customer/product/create-variant/index.yaml"

# Orders
/customer/{customerId}/bookings/{orderId}/group/{groupId}:
Expand Down
10 changes: 10 additions & 0 deletions openapi/paths/customer/product/create-variant/body.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
properties:
price:
type: string
compareAtPrice:
type: string

required:
- price
- compareAtPrice
41 changes: 41 additions & 0 deletions openapi/paths/customer/product/create-variant/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
post:
parameters:
- name: customerId
in: path
required: true
schema:
type: string
- name: productId
in: path
required: true
schema:
type: string
tags:
- CustomerProduct
operationId: customerProductCreateVariant
summary: POST create product variant
description: This endpoint create product variant
requestBody:
required: true
content:
application/json:
schema:
$ref: "./body.yaml"

responses:
"200":
description: Response with product variant payload
content:
application/json:
schema:
$ref: "./response.yaml"
"400":
$ref: "../../../../responses/bad.yaml"
"401":
$ref: "../../../../responses/unauthorized.yaml"
"403":
$ref: "../../../../responses/forbidden.yaml"
"404":
$ref: "../../../../responses/not-found.yaml"

security: []
10 changes: 10 additions & 0 deletions openapi/paths/customer/product/create-variant/response.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
properties:
success:
type: boolean
example: true
payload:
$ref: ./variant.yaml
required:
- success
- payload
10 changes: 10 additions & 0 deletions openapi/paths/customer/product/create-variant/variant.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
properties:
id:
type: number
title:
type: string
selectedOptions:
type: array
items:
$ref: ../../schedule/_types/product-selected-options.yaml
143 changes: 76 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
"generate-docs": "npx @redocly/cli build-docs docs/openapi.yaml -o docs/index.html --title 'Booking Api Documentation'",
"generate-ts": "npm run bundle && npx orval --config ./orval.config.js",
"postprocess": "node postprocess.js",
"graphql:codegen": "npx graphql-codegen && npm run postprocess"
"graphql:codegen": "npx graphql-codegen -- --watch && npm run postprocess"
},
"dependencies": {
"@azure/functions": "^4.0.0",
"@azure/storage-queue": "^12.16.0",
"@shopify/shopify-api": "^8.0.2",
"@shopify/admin-api-client": "^0.2.8",
"@shopify/shopify-api": "^9.5.0",
"@types/jsonwebtoken": "^9.0.3",
"applicationinsights": "^2.9.1",
"applicationinsights": "^2.9.5",
"axios": "^1.5.1",
"bcryptjs": "^2.4.3",
"date-fns": "^2.30.0",
Expand Down
Loading
Loading