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

Removed location creation and update logic along with associated test from user #117

Merged
merged 6 commits into from
Mar 15, 2024
10 changes: 0 additions & 10 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ components:
$ref: paths/customer/location/_types/location.yaml
CustomerLocationIsDefault:
$ref: paths/customer/location/_types/location-is-default.yaml
CustomerLocationGetAllOriginsRepsonse:
$ref: paths/customer/location/get-all-origins/response.yaml
CustomerLocationCreateBody:
$ref: paths/customer/location/create/body.yaml
CustomerLocationCreateResponse:
Expand All @@ -202,8 +200,6 @@ components:
$ref: paths/customer/location/update/body.yaml
CustomerLocationUpdateResponse:
$ref: paths/customer/location/update/response.yaml
CustomerLocationAddResponse:
$ref: paths/customer/location/add/response.yaml
CustomerLocationRemoveResponse:
$ref: paths/customer/location/remove/response.yaml
CustomerLocationSetDefaultResponse:
Expand Down Expand Up @@ -268,8 +264,6 @@ components:
$ref: paths/location/get-coordinates/response.yaml
LocationGetTravelTimeResponse:
$ref: paths/location/get-travel-time/response.yaml
LocationValidateAddressResponse:
$ref: paths/location/validate-address/response.yaml

# Shipping
Shipping:
Expand Down Expand Up @@ -388,8 +382,6 @@ paths:
$ref: "./paths/meta/specialties/index.yaml"

# locations
/customer/{customerId}/locations/get-all-origins:
$ref: "./paths/customer/location/get-all-origins/index.yaml"
/customer/{customerId}/location/{locationId}/setDefault:
$ref: "./paths/customer/location/set-default/index.yaml"
/customer/{customerId}/location/{locationId}:
Expand All @@ -398,8 +390,6 @@ paths:
$ref: "./paths/customer/location/create-list.yaml"
/location/get-coordinates:
$ref: "./paths/location/get-coordinates/index.yaml"
/location/validate-address:
$ref: "./paths/location/validate-address/index.yaml"
/location/get-travel-time:
$ref: "./paths/location/get-travel-time/index.yaml"

Expand Down
33 changes: 0 additions & 33 deletions openapi/paths/customer/location/add/index.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions openapi/paths/customer/location/add/response.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions openapi/paths/customer/location/get-all-origins/index.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions openapi/paths/customer/location/get-all-origins/response.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions openapi/paths/customer/location/get-delete-update-add.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ get:
$ref: "./get/index.yaml#/get"
delete:
$ref: "./remove/index.yaml#/delete"
post:
$ref: "./add/index.yaml#/post"
put:
$ref: "./update/index.yaml#/put"
33 changes: 0 additions & 33 deletions openapi/paths/location/validate-address/index.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions openapi/paths/location/validate-address/response.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions src/functions/customer-location.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@ import "module-alias/register";
import { app } from "@azure/functions";

import {
CustomerLocationControllerAdd,
CustomerLocationControllerCreate,
CustomerLocationControllerGetAll,
CustomerLocationControllerGetAllOrigins,
CustomerLocationControllerGetOne,
CustomerLocationControllerRemove,
CustomerLocationControllerSetDefault,
CustomerLocationControllerUpdate,
} from "./customer/controllers/location";

app.http("customerLocationGetAllOrigins", {
methods: ["GET"],
authLevel: "anonymous",
route: "customer/{customerId}/locations/get-all-origins",
handler: CustomerLocationControllerGetAllOrigins,
});

app.http("customerLocationList", {
methods: ["GET"],
authLevel: "anonymous",
Expand Down Expand Up @@ -48,13 +39,6 @@ app.http("customerLocationCreate", {
handler: CustomerLocationControllerCreate,
});

app.http("customerLocationAdd", {
methods: ["POST"],
authLevel: "anonymous",
route: "customer/{customerId}/location/{locationId}",
handler: CustomerLocationControllerAdd,
});

app.http("customerLocationRemove", {
methods: ["DELETE"],
authLevel: "anonymous",
Expand Down
25 changes: 0 additions & 25 deletions src/functions/customer/controllers/location/add.ts

This file was deleted.

80 changes: 0 additions & 80 deletions src/functions/customer/controllers/location/create.spec.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/functions/customer/controllers/location/create.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { z } from "zod";
import { LocationZodSchema } from "~/functions/location/location.types";
import { LocationServiceCreate } from "~/functions/location/services/create";

import { _ } from "~/library/handler";
import { CustomerLocationServiceCreate } from "../../services/location/create";

export type CustomerLocationControllerCreateRequest = {
query: z.infer<typeof CustomerLocationControllerCreateQuerySchema>;
Expand All @@ -19,7 +19,7 @@ export const CustomerLocationControllerCreateQuerySchema = z.object({
});

export type CustomerLocationControllerCreateResponse = Awaited<
ReturnType<typeof LocationServiceCreate>
ReturnType<typeof CustomerLocationServiceCreate>
>;

export const CustomerLocationControllerCreate = _(
Expand All @@ -29,7 +29,7 @@ export const CustomerLocationControllerCreate = _(

const validateBody = CustomerLocationControllerCreateBodySchema.parse(body);

return LocationServiceCreate({
return CustomerLocationServiceCreate({
...validateData,
...validateBody,
});
Expand Down
23 changes: 0 additions & 23 deletions src/functions/customer/controllers/location/get-all-origins.ts

This file was deleted.

Loading
Loading