-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from jamalsoueidan/split-schedule
feat(customer): add customer availability, booking, location, product…
- Loading branch information
Showing
42 changed files
with
651 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
name: Deploy to Azure Function App (Production) | ||
name: Deploy Node.js project to Azure Function App | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# CONFIGURATION | ||
# For help, go to https://github.com/Azure/Actions | ||
# | ||
# 1. Set up the following secrets in your repository: | ||
# AZURE_FUNCTIONAPP_PUBLISH_PROFILE | ||
# | ||
# 2. Change these variables for your configuration: | ||
|
||
env: | ||
AZURE_FUNCTIONAPP_NAME: "booking-shopify-api" # set this to your function app name on Azure | ||
AZURE_FUNCTIONAPP_PACKAGE_PATH: "." # set this to the path to your function app project, defaults to the repository root | ||
NODE_VERSION: "18.x" # set this to the node version to use (e.g. '8.x', '10.x', '12.x') | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
environment: dev | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: "Checkout GitHub Action" | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
- name: Setup Node ${{ env.NODE_VERSION }} Environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Build | ||
run: npm run build | ||
- name: "Resolve Project Dependencies Using Npm" | ||
shell: bash | ||
run: | | ||
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' | ||
npm install | ||
npm run build --if-present | ||
popd | ||
- name: Deploy to Azure Function App | ||
uses: azure/functions-action@v1 | ||
- name: "Run Azure Functions Action" | ||
uses: Azure/functions-action@v1 | ||
id: fa | ||
with: | ||
app-name: booking-shopify-api | ||
package: . | ||
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | ||
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} | ||
publish-profile: ${{ secrets.AZURE_FUNCTION_APP_PUBLISH_PROFILE_PRODUCTION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "module-alias/register"; | ||
|
||
import { app } from "@azure/functions"; | ||
|
||
import { CustomerAvailabilityControllerGet } from "./customer/controllers/availability"; | ||
|
||
app.http("customerAvailabilityGet", { | ||
methods: ["POST"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/availability/{locationId?}/get", | ||
handler: CustomerAvailabilityControllerGet, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import "module-alias/register"; | ||
|
||
import { app } from "@azure/functions"; | ||
|
||
import { | ||
CustomerBookingControllerGet, | ||
CustomerBookingControllerList, | ||
} from "./customer/controllers/booking"; | ||
|
||
app.http("customerBookingGet", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/booking/{orderId?}", | ||
handler: CustomerBookingControllerGet, | ||
}); | ||
|
||
app.http("customerBookingList", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/bookings", | ||
handler: CustomerBookingControllerList, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
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", | ||
route: "customer/{customerId}/locations", | ||
handler: CustomerLocationControllerGetAll, | ||
}); | ||
|
||
app.http("customerLocationGet", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/location/{locationId}", | ||
handler: CustomerLocationControllerGetOne, | ||
}); | ||
|
||
app.http("customerLocationUpdate", { | ||
methods: ["PUT"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/location/{locationId?}", | ||
handler: CustomerLocationControllerUpdate, | ||
}); | ||
|
||
app.http("customerLocationCreate", { | ||
methods: ["POST"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/locations", | ||
handler: CustomerLocationControllerCreate, | ||
}); | ||
|
||
app.http("customerLocationAdd", { | ||
methods: ["POST"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/location/{locationId}", | ||
handler: CustomerLocationControllerAdd, | ||
}); | ||
|
||
app.http("customerLocationRemove", { | ||
methods: ["DELETE"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/location/{locationId}", | ||
handler: CustomerLocationControllerRemove, | ||
}); | ||
|
||
app.http("customerLocationSetDefault", { | ||
methods: ["PUT"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId}/location/{locationId}/setDefault", | ||
handler: CustomerLocationControllerSetDefault, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import "module-alias/register"; | ||
import { CustomerProductsControllerList } from "./customer/controllers/products/list"; | ||
|
||
import { app } from "@azure/functions"; | ||
|
||
import { | ||
CustomerProductControllerDestroy, | ||
CustomerProductControllerGet, | ||
CustomerProductControllerUpsert, | ||
} from "./customer/controllers/product"; | ||
import { CustomerProductsControllerListIds } from "./customer/controllers/products"; | ||
|
||
app.http("customerProductsListIds", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/products/ids", | ||
handler: CustomerProductsControllerListIds, | ||
}); | ||
|
||
app.http("customerProductsList", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/products", | ||
handler: CustomerProductsControllerList, | ||
}); | ||
|
||
app.http("customerProductUpsert", { | ||
methods: ["PUT"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/product/{productId?}", | ||
handler: CustomerProductControllerUpsert, | ||
}); | ||
|
||
app.http("customerProductGet", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/product/{productId?}", | ||
handler: CustomerProductControllerGet, | ||
}); | ||
|
||
app.http("customerProductDestroy", { | ||
methods: ["DELETE"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/product/{productId?}", | ||
handler: CustomerProductControllerDestroy, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import "module-alias/register"; | ||
|
||
import { app } from "@azure/functions"; | ||
|
||
import { | ||
CustomerScheduleControllerCreate, | ||
CustomerScheduleControllerDestroy, | ||
CustomerScheduleControllerGet, | ||
CustomerScheduleControllerList, | ||
CustomerScheduleControllerUpdate, | ||
} from "./customer/controllers/schedule"; | ||
import { CustomerScheduleSlotControllerUpdate } from "./customer/controllers/slot"; | ||
|
||
app.http("customerScheduleDestroy", { | ||
methods: ["DELETE"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedule/{scheduleId?}", | ||
handler: CustomerScheduleControllerDestroy, | ||
}); | ||
|
||
app.http("customerScheduleCreate", { | ||
methods: ["POST"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedule", | ||
handler: CustomerScheduleControllerCreate, | ||
}); | ||
|
||
app.http("customerScheduleUpdate", { | ||
methods: ["PUT"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedule/{scheduleId?}", | ||
handler: CustomerScheduleControllerUpdate, | ||
}); | ||
|
||
app.http("customerScheduleGet", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedule/{scheduleId?}", | ||
handler: CustomerScheduleControllerGet, | ||
}); | ||
|
||
app.http("customerScheduleList", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedules", | ||
handler: CustomerScheduleControllerList, | ||
}); | ||
|
||
app.http("customerScheduleSlotUpdate", { | ||
methods: ["PUT"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/schedule/{scheduleId?}/slots", | ||
handler: CustomerScheduleSlotControllerUpdate, | ||
}); |
Oops, something went wrong.