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

refactor(customer-order.function.ts): use less endpoints for orders, only range and get #105

Merged
merged 6 commits into from
Feb 29, 2024
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
24 changes: 6 additions & 18 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,14 @@ components:
$ref: paths/customer/order/_types/shipping_lines.yaml
CustomerOrderFulfillment:
$ref: paths/customer/order/_types/fulfillment.yaml
CustomerOrderGetLineItem:
$ref: paths/customer/order/get-line-item/get-line-item.yaml
CustomerOrderGetLineItemResponse:
$ref: paths/customer/order/get-line-item/response.yaml
CustomerOrderGet:
$ref: paths/customer/order/get/get.yaml
CustomerOrderGetResponse:
$ref: paths/customer/order/get/response.yaml
CustomerOrderList:
$ref: paths/customer/order/list/list.yaml
CustomerOrderListResponse:
$ref: paths/customer/order/list/response.yaml
CustomerOrderShipping:
$ref: paths/customer/order/shipping/list.yaml
CustomerOrderShippingResponse:
$ref: paths/customer/order/shipping/response.yaml
CustomerBookingRange:
$ref: paths/customer/order/range/list.yaml
CustomerBookingRangeResponse:
$ref: paths/customer/order/range/response.yaml

# Customer
CustomerProductList:
Expand Down Expand Up @@ -336,14 +328,10 @@ paths:
$ref: "./paths/customer/product/list-ids/index.yaml"
/customer/{customerId}/product/{productId}:
$ref: "paths/customer/product/product.yaml"
/customer/{customerId}/orders-range:
$ref: "paths/customer/order/list/index.yaml"
/customer/{customerId}/shipping-range:
$ref: "paths/customer/order/shipping/index.yaml"
/customer/{customerId}/lineItem/{lineItemId}:
$ref: "paths/customer/order/get-line-item/index.yaml"
/customer/{customerId}/orders/{orderId}:
$ref: "paths/customer/order/get/index.yaml"
/customer/{customerId}/orders-range:
$ref: "paths/customer/order/range/index.yaml"

# schedule
/customer/{customerId}/schedule:
Expand Down
2 changes: 2 additions & 0 deletions openapi/paths/customer/order/_types/order.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ properties:
type: string
title:
type: string
shipping:
$ref: ../../../shipping/_types/shipping.yaml
required:
- id
- admin_graphql_api_id
Expand Down
15 changes: 0 additions & 15 deletions openapi/paths/customer/order/get-line-item/get-line-item.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions openapi/paths/customer/order/get-line-item/index.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions openapi/paths/customer/order/get-line-item/response.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions openapi/paths/customer/order/get-shipping/index.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions openapi/paths/customer/order/get-shipping/list.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions openapi/paths/customer/order/get-shipping/response.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ get:
schema:
type: string
tags:
- CustomerOrder
operationId: customerOrderList
summary: GET Get all order for customer
description: This endpoint get all orders
- CustomerBooking
operationId: customerBookingRange
summary: GET Get all bookings for customer from orders
description: This endpoint get all bookings from orders
responses:
"200":
description: "Response"
Expand Down
42 changes: 0 additions & 42 deletions openapi/paths/customer/order/shipping/index.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions openapi/paths/customer/order/shipping/list.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions openapi/paths/customer/order/shipping/response.yaml

This file was deleted.

30 changes: 3 additions & 27 deletions src/functions/customer-order.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ import "module-alias/register";
import { app } from "@azure/functions";

import { CustomerOrderControllerGet } from "./customer/controllers/order/get";
import { CustomerOrderControllerGetLineItem } from "./customer/controllers/order/get-lineitem";
import { CustomerOrderControllerGetShipping } from "./customer/controllers/order/get-shipping";
import { CustomerOrderControllerList } from "./customer/controllers/order/list";
import { CustomerOrderControllerShipping } from "./customer/controllers/order/shipping";

app.http("customerOrderGetLineItem", {
methods: ["GET"],
authLevel: "anonymous",
route: "customer/{customerId?}/lineItem/{lineItemId?}",
handler: CustomerOrderControllerGetLineItem,
});
import { CustomerOrderControllerRange } from "./customer/controllers/order/range";

app.http("customerOrderGet", {
methods: ["GET"],
Expand All @@ -22,23 +12,9 @@ app.http("customerOrderGet", {
handler: CustomerOrderControllerGet,
});

app.http("customerOrderList", {
app.http("customerOrderRange", {
methods: ["GET"],
authLevel: "anonymous",
route: "customer/{customerId?}/orders-range",
handler: CustomerOrderControllerList,
});

app.http("customerOrderShipping", {
methods: ["GET"],
authLevel: "anonymous",
route: "customer/{customerId?}/shipping-range",
handler: CustomerOrderControllerShipping,
});

app.http("customerOrderGetShipping", {
methods: ["GET"],
authLevel: "anonymous",
route: "customer/{customerId?}/get-shipping/{id?}",
handler: CustomerOrderControllerGetShipping,
handler: CustomerOrderControllerRange,
});
24 changes: 0 additions & 24 deletions src/functions/customer/controllers/order/get-lineitem.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/functions/customer/controllers/order/get-shipping.ts

This file was deleted.

Loading
Loading