Skip to content

Commit

Permalink
Merge pull request #72 from jamalsoueidan/fix-deployment
Browse files Browse the repository at this point in the history
Fix deployment
  • Loading branch information
jamalsoueidan authored Oct 21, 2023
2 parents 53e70c8 + b5faa03 commit 3f42d5d
Show file tree
Hide file tree
Showing 50 changed files with 4,383 additions and 12,672 deletions.
16,851 changes: 4,276 additions & 12,575 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"~": "dist/src"
},
"scripts": {
"prebuild": "npm run clean",
"build": "tsc",
"watch": "tsc -w",
"prestart": "npm run build",
"clean": "rimraf dist",
"prestart": "npm run clean && npm run build",
"start": "func start",
"test": "jest --verbose",
"bundle": "npx swagger-cli bundle openapi/openapi.yaml -t yaml -o docs/openapi.yaml",
Expand All @@ -17,7 +19,7 @@
"generate-ts": "npm run bundle && npx orval --config ./orval.config.js"
},
"dependencies": {
"@azure/functions": "^4.0.1",
"@azure/functions": "^4.0.0",
"@types/jsonwebtoken": "^9.0.3",
"axios": "^1.5.1",
"bcryptjs": "^2.4.3",
Expand All @@ -27,21 +29,22 @@
"graphql-request": "^6.1.0",
"jsonwebtoken": "^9.0.2",
"module-alias": "^2.2.3",
"mongoose": "^7.6.1",
"mongoose": "^7.3.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@faker-js/faker": "^8.1.0",
"@types/bcryptjs": "^2.4.4",
"@types/jest": "^29.5.5",
"@types/node": "^20.x",
"@types/node": "^18.x",
"date-fns-tz": "^2.0.0",
"fs": "^0.0.1-security",
"jest": "^29.7.0",
"mongodb-memory-server": "^9.0.0",
"orval": "^6.18.1",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
"typescript": "^4.0.0",
"rimraf": "^5.0.0"
},
"main": "dist/src/functions/*.js"
}
6 changes: 3 additions & 3 deletions src/functions/availability/availability.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Lookup } from "../lookup";
import { User } from "../user";
import { Lookup } from "../lookup/lookup.type";
import { User } from "../user/user.types";

export type Availability = {
date: Date;
Expand All @@ -12,7 +12,7 @@ export type Availability = {
productId: number;
variantId: number;
from: Date;
to: Date;
["to"]: any;
breakTime: number;
duration: number;
}[];
Expand Down
1 change: 1 addition & 0 deletions src/functions/booking.function.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { app } from "@azure/functions";
import "module-alias/register";
import { BookingControllerUpsert } from "./booking/controllers/upsert";

app.http("bookingUpsert", {
Expand Down
15 changes: 11 additions & 4 deletions src/functions/customer.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ import "module-alias/register";
import { CustomerProductsControllerList } from "./customer/controllers/products/list";

import { app } from "@azure/functions";

import { CustomerAvailabilityControllerGet } from "./customer/controllers/availability";
import {
CustomerBookingControllerGet,
CustomerBookingControllerList,
} from "./customer/controllers/booking";
import {
CustomerControllerGet,
CustomerControllerIsBusiness,
CustomerControllerStatus,
CustomerControllerUpdate,
CustomerControllerUpsert,
} from "./customer/controllers/customer";
import {
CustomerLocationControllerAdd,
CustomerLocationControllerCreate,
CustomerLocationControllerGetAll,
CustomerLocationControllerGetAllOrigins,
CustomerLocationControllerGetOne,
CustomerLocationControllerRemove,
CustomerLocationControllerSetDefault,
CustomerLocationControllerUpdate,
} from "./customer/controllers/location";
import {
CustomerProductControllerDestroy,
CustomerProductControllerGet,
CustomerProductControllerUpsert,
CustomerProductsControllerListIds,
} from "./customer";
import { CustomerAvailabilityControllerGet } from "./customer/controllers/availability";
import { CustomerLocationControllerGetAllOrigins } from "./customer/controllers/location/get-all-origins";
} from "./customer/controllers/product";
import { CustomerProductsControllerListIds } from "./customer/controllers/products";
import {
CustomerScheduleControllerCreate,
CustomerScheduleControllerDestroy,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/availability/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { UserZodSchema } from "~/functions/user";

import { LocationZodSchema } from "~/functions/location";
import { NumberOrStringType, StringOrObjectIdType } from "~/library/zod";
import { CustomerAvailabilityServiceGet } from "../../services";
import { CustomerAvailabilityServiceGet } from "../../services/availability";
import { CustomerProductsServiceListIds } from "../../services/product";

export type CustomerAvailabilityControllerGetRequest = {
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/customer/get.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { UserZodSchema } from "~/functions/user";
import { _ } from "~/library/handler";
import { CustomerServiceGet } from "../../services";
import { CustomerServiceGet } from "../../services/customer";

export type CustomerControllerGetRequest = {
query: z.infer<typeof CustomerServiceGetSchema>;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/customer/is-business.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { UserZodSchema } from "~/functions/user";
import { _ } from "~/library/handler";
import { CustomerServiceIsBusiness } from "../../services";
import { CustomerServiceIsBusiness } from "../../services/customer";

export type CustomerControllerIsBusinessRequest = {
query: z.infer<typeof CustomerControllerIsBusinessSchema>;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/customer/status.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { UserZodSchema } from "~/functions/user";
import { _ } from "~/library/handler";
import { CustomerServiceStatus } from "../../services";
import { CustomerServiceStatus } from "../../services/customer";

export type CustomerControllerStatusRequest = {
query: z.infer<typeof CustomerServiceStatusSchema>;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/customer/update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { UserZodSchema } from "~/functions/user";
import { _ } from "~/library/handler";
import { CustomerServiceUpsert } from "../../services";
import { CustomerServiceUpsert } from "../../services/customer";

export type CustomerControllerUpdateRequest = {
query: CustomerControllerUpdateQuery;
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/customer/upsert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
} from "~/library/jest/azure";

import { Professions } from "~/functions/user";
import { CustomerServiceUpsert } from "../../services";

import { CustomerServiceUpsert } from "../../services/customer";
import {
CustomerControllerUpsert,
CustomerControllerUpsertBody,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/customer/upsert.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { UserZodSchema } from "~/functions/user";
import { _ } from "~/library/handler";
import { CustomerServiceUpsert } from "../../services";
import { CustomerServiceUpsert } from "../../services/customer";

export type CustomerControllerUpsertRequest = {
query: CustomerControllerUpsertQuery;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { LocationZodSchema } from "~/functions/location";
import { _ } from "~/library/handler";
import { CustomerLocationServiceGetAllOrigins } from "../../services";
import { CustomerLocationServiceGetAllOrigins } from "../../services/location";

export type CustomerLocationControllerGetAllOriginsRequest = {
query: z.infer<typeof CustomerLocationServiceQuerySchema>;
Expand Down
1 change: 1 addition & 0 deletions src/functions/customer/controllers/location/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from "./add";
export * from "./create";
export * from "./get";
export * from "./get-all-origins";
export * from "./list";
export * from "./remove";
export * from "./set-default";
Expand Down
6 changes: 4 additions & 2 deletions src/functions/customer/controllers/product/destroy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import { ScheduleProduct, TimeUnit } from "~/functions/schedule";
import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { omitObjectIdProps } from "~/library/jest/helpers";
import { CustomerProductServiceUpsert } from "../../services";

import { CustomerProductServiceUpsert } from "../../services/product";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerProductControllerDestroy,
CustomerProductControllerDestroyRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/product/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ScheduleZodSchema,
} from "~/functions/schedule/schedule.types";
import { _ } from "~/library/handler";
import { CustomerProductServiceDestroy } from "../../services";
import { CustomerProductServiceDestroy } from "../../services/product";

export type CustomerProductControllerDestroyRequest = {
query: z.infer<typeof CustomerProductControllerDestroyQuerySchema>;
Expand Down
5 changes: 3 additions & 2 deletions src/functions/customer/controllers/product/get.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import { ScheduleProduct, TimeUnit } from "~/functions/schedule";

import { CustomerProductServiceUpsert } from "~/functions/customer/services";
import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { CustomerProductServiceUpsert } from "../../services/product";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerProductControllerGet,
CustomerProductControllerGetRequest,
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/product/get.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { z } from "zod";
import { CustomerProductServiceGet } from "~/functions/customer/services";

import {
ScheduleProductZodSchema,
ScheduleZodSchema,
} from "~/functions/schedule/schedule.types";
import { _ } from "~/library/handler";
import { CustomerProductServiceGet } from "../../services/product";

export type CustomerProductControllerGetRequest = {
query: z.infer<typeof CustomerProductControllerGetQuerySchema>;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/product/upsert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { HttpRequest, InvocationContext } from "@azure/functions";

import { CustomerScheduleServiceCreate } from "~/functions/customer/services";
import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";

import { ScheduleProduct, TimeUnit } from "~/functions/schedule";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerProductControllerUpsert,
CustomerProductControllerUpsertRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/customer/controllers/product/upsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from "~/functions/schedule/schedule.types";

import { _ } from "~/library/handler";
import { CustomerProductServiceUpsert } from "../../services";
import { CustomerProductServiceUpsert } from "../../services/product";

export type CustomerProductControllerUpsertRequest = {
query: z.infer<typeof CustomerProductControllerUpsertQuerySchema>;
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/products/list-ids.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import { CustomerProductServiceUpsert } from "~/functions/customer/services/product";
import { ScheduleProduct, TimeUnit } from "~/functions/schedule";
import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerProductsControllerListIds,
CustomerProductsControllerListIdsRequest,
Expand Down
6 changes: 4 additions & 2 deletions src/functions/customer/controllers/products/list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import { ScheduleProduct, TimeUnit } from "~/functions/schedule";

import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { CustomerProductServiceUpsert } from "../../services";

import { CustomerProductServiceUpsert } from "../../services/product";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerProductsControllerList,
CustomerProductsControllerListRequest,
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { z } from "zod";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import { ScheduleZodSchema } from "~/functions/schedule";
import { _ } from "~/library/handler";
import { CustomerScheduleServiceCreate } from "../../services/schedule";

export type CustomerScheduleControllerCreateRequest = {
query: z.infer<typeof CustomerScheduleControllerCreateQuerySchema>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";
import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerScheduleControllerDestroy,
CustomerScheduleControllerDestroyRequest,
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/destroy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { z } from "zod";
import { CustomerScheduleServiceDestroy } from "~/functions/customer/services";

import { ScheduleZodSchema } from "~/functions/schedule/schedule.types";
import { _ } from "~/library/handler";
import { CustomerScheduleServiceDestroy } from "../../services/schedule";

export type CustomerScheduleControllerDestroyRequest = {
query: z.infer<typeof CustomerScheduleControllerDestroySchema>;
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/get.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";
import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerScheduleControllerGet,
CustomerScheduleControllerGetRequest,
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/get.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { z } from "zod";
import { CustomerScheduleServiceGet } from "~/functions/customer/services";

import { ScheduleZodSchema } from "~/functions/schedule";
import { _ } from "~/library/handler";
import { CustomerScheduleServiceGet } from "../../services/schedule";

export type CustomerScheduleControllerGetRequest = {
query: z.infer<typeof CustomerScheduleControllerGetSchema>;
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";

import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerScheduleControllerList,
CustomerScheduleControllerListRequest,
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/list.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { z } from "zod";
import { CustomerScheduleServiceList } from "~/functions/customer/services";

import { ScheduleZodSchema } from "~/functions/schedule/schedule.types";
import { _ } from "~/library/handler";
import { CustomerScheduleServiceList } from "../../services/schedule";

export type CustomerScheduleControllerListRequest = {
query: z.infer<typeof CustomerScheduleControllerListQuerySchema>;
Expand Down
3 changes: 2 additions & 1 deletion src/functions/customer/controllers/schedule/update.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { HttpRequest, InvocationContext } from "@azure/functions";
import { CustomerScheduleServiceCreate } from "~/functions/customer/services";

import {
HttpSuccessResponse,
createContext,
createHttpRequest,
} from "~/library/jest/azure";

import { CustomerScheduleServiceCreate } from "../../services/schedule";
import {
CustomerScheduleControllerUpdate,
CustomerScheduleControllerUpdateRequest,
Expand Down
Loading

0 comments on commit 3f42d5d

Please sign in to comment.