-
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.
Add customer blocked feature to OpenAPI spec and update backend funct…
…ions • Introduce new OpenAPI components for managing customer block lists, including create, destroy, list, and range operations. • Add corresponding paths and methods to the OpenAPI spec for the new blocked feature. • Create new schema files for blocked types and operations. • Implement backend functions for creating, deleting, listing, and querying customer block ranges. • Update blocked schema and types in the backend to include the title field. • Write and adjust tests for the new blocked functionality.
- Loading branch information
1 parent
fd8998c
commit 2dc4b86
Showing
27 changed files
with
353 additions
and
14 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
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,18 @@ | ||
type: object | ||
properties: | ||
_id: | ||
type: string | ||
customerId: | ||
type: number | ||
start: | ||
type: string | ||
end: | ||
type: string | ||
title: | ||
type: string | ||
required: | ||
- id | ||
- customerId | ||
- start | ||
- end | ||
- title |
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,20 @@ | ||
parameters: | ||
- name: customerId | ||
in: path | ||
description: The ID of the customerId | ||
required: true | ||
schema: | ||
type: string | ||
- name: scheduleId | ||
in: path | ||
description: The ID of the scheduleId | ||
required: true | ||
schema: | ||
type: string | ||
|
||
get: | ||
$ref: "./get/index.yaml#/get" | ||
put: | ||
$ref: "./update/index.yaml#/put" | ||
delete: | ||
$ref: "./destroy/index.yaml#/delete" |
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 @@ | ||
type: object | ||
properties: | ||
title: | ||
type: string | ||
start: | ||
type: string | ||
end: | ||
type: string | ||
required: | ||
- title | ||
- start | ||
- end |
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,37 @@ | ||
parameters: | ||
- name: customerId | ||
in: path | ||
description: The ID of the customerId | ||
required: true | ||
schema: | ||
type: string | ||
post: | ||
tags: | ||
- CustomerBlocked | ||
operationId: customerBlockedCreate | ||
summary: POST Create blocked | ||
description: This endpoint create new blocked | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "./body.yaml" | ||
|
||
responses: | ||
"200": | ||
description: Response with blocked 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: [] |
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,10 @@ | ||
type: object | ||
properties: | ||
success: | ||
type: boolean | ||
example: true | ||
payload: | ||
$ref: ../_types/blocked.yaml | ||
required: | ||
- success | ||
- payload |
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,10 @@ | ||
type: object | ||
properties: | ||
deletedCount: | ||
type: number | ||
acknowledged: | ||
type: boolean | ||
|
||
required: | ||
- deletedCount | ||
- acknowledged |
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,34 @@ | ||
delete: | ||
parameters: | ||
- name: customerId | ||
in: path | ||
description: The ID of the customerId | ||
required: true | ||
schema: | ||
type: string | ||
- name: blockedId | ||
in: path | ||
description: The ID of the blockedId to be destroyed | ||
required: true | ||
schema: | ||
type: string | ||
tags: | ||
- CustomerBlocked | ||
operationId: customerBlockedDestroy | ||
summary: DEL destroy blocked | ||
description: This endpoint destroy blocked for customer | ||
responses: | ||
"200": | ||
description: "Response" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "./response.yaml" | ||
"400": | ||
$ref: "../../../../responses/bad.yaml" | ||
"401": | ||
$ref: "../../../../responses/unauthorized.yaml" | ||
"403": | ||
$ref: "../../../../responses/forbidden.yaml" | ||
|
||
security: [] |
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,10 @@ | ||
type: object | ||
properties: | ||
success: | ||
type: boolean | ||
example: true | ||
payload: | ||
$ref: ./destroy.yaml | ||
required: | ||
- success | ||
- payload |
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,40 @@ | ||
get: | ||
parameters: | ||
- name: customerId | ||
in: path | ||
description: The ID of the customerId | ||
required: true | ||
schema: | ||
type: string | ||
- name: nextCursor | ||
in: query | ||
description: paginate | ||
required: false | ||
schema: | ||
type: string | ||
- name: limit | ||
in: query | ||
description: limit counts of documents | ||
required: true | ||
schema: | ||
type: string | ||
tags: | ||
- CustomerBlocked | ||
operationId: customerBlockedList | ||
summary: GET Get all blocked documents for customer | ||
description: This endpoint get all blocked documents for customer | ||
responses: | ||
"200": | ||
description: "Response" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "./response.yaml" | ||
"400": | ||
$ref: "../../../../responses/bad.yaml" | ||
"401": | ||
$ref: "../../../../responses/unauthorized.yaml" | ||
"403": | ||
$ref: "../../../../responses/forbidden.yaml" | ||
|
||
security: [] |
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,13 @@ | ||
type: object | ||
properties: | ||
nextCursor: | ||
type: string | ||
totalCount: | ||
type: boolean | ||
results: | ||
type: array | ||
items: | ||
$ref: ../_types/blocked.yaml | ||
required: | ||
- totalCount | ||
- results |
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 @@ | ||
type: object | ||
properties: | ||
success: | ||
type: boolean | ||
example: true | ||
payload: | ||
type: array | ||
items: | ||
$ref: ../_types/blocked.yaml | ||
required: | ||
- success | ||
- payload |
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,42 @@ | ||
get: | ||
parameters: | ||
- name: customerId | ||
in: path | ||
description: customerId for the customer | ||
required: true | ||
schema: | ||
type: string | ||
- name: start | ||
in: query | ||
description: start of date | ||
required: true | ||
schema: | ||
type: string | ||
- name: end | ||
in: query | ||
description: end of date | ||
required: true | ||
schema: | ||
type: string | ||
tags: | ||
- CustomerBlocked | ||
operationId: customerBlockedRange | ||
summary: GET Get all blocked documents for customer | ||
description: This endpoint get all blocked documents | ||
responses: | ||
"200": | ||
description: "Response" | ||
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: [] |
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 @@ | ||
type: object | ||
properties: | ||
success: | ||
type: boolean | ||
example: true | ||
payload: | ||
type: array | ||
items: | ||
$ref: ../_types/blocked.yaml | ||
required: | ||
- success | ||
- payload |
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
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,35 @@ | ||
import "module-alias/register"; | ||
|
||
import { app } from "@azure/functions"; | ||
|
||
import { CustomerBlockedControllerCreate } from "./customer/controllers/blocked/create"; | ||
import { CustomerBlockedControlleDestroy } from "./customer/controllers/blocked/destroy"; | ||
import { CustomerBlockedControllerList } from "./customer/controllers/blocked/list"; | ||
|
||
app.http("customerBlockedDestroy", { | ||
methods: ["DELETE"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/blocked/{blockedId?}", | ||
handler: CustomerBlockedControlleDestroy, | ||
}); | ||
|
||
app.http("customerBlockedCreate", { | ||
methods: ["POST"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/blocked", | ||
handler: CustomerBlockedControllerCreate, | ||
}); | ||
|
||
app.http("customerBlockedList", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/blocked/list", | ||
handler: CustomerBlockedControllerList, | ||
}); | ||
|
||
app.http("customerBlockedRange", { | ||
methods: ["GET"], | ||
authLevel: "anonymous", | ||
route: "customer/{customerId?}/blocked/range", | ||
handler: CustomerBlockedControllerList, | ||
}); |
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
Oops, something went wrong.