-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7511292
commit e038daf
Showing
13 changed files
with
241 additions
and
0 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,23 @@ | ||
get: | ||
summary: Find paginated capital projects. | ||
operationId: findCapitalProjects | ||
tags: | ||
- Capital Projects | ||
parameters: | ||
- $ref: ../components/parameters/limitParam.yaml | ||
- $ref: ../components/parameters/offsetParam.yaml | ||
responses: | ||
'200': | ||
description: >- | ||
An object containing pagination metadata and an array of capital | ||
projects | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../components/schemas/CapitalProjectPage.yaml | ||
'400': | ||
$ref: ../components/responses/BadRequest.yaml | ||
'404': | ||
$ref: ../components/responses/NotFound.yaml | ||
'500': | ||
$ref: ../components/responses/InternalServerError.yaml |
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
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,43 @@ | ||
import type { CapitalProjectPage } from "./CapitalProjectPage"; | ||
import type { Error } from "./Error"; | ||
|
||
export type FindCapitalProjectsQueryParams = { | ||
/** | ||
* @description The maximum number of results to be returned in each response. The default value is 20. It must be between 1 and 100, inclusive. | ||
* @type integer | undefined | ||
*/ | ||
limit?: number; | ||
/** | ||
* @description The position in the full list to begin returning results. Default offset is 0. If the offset is beyond the end of the list, no results will be returned. | ||
* @type integer | undefined | ||
*/ | ||
offset?: number; | ||
}; | ||
/** | ||
* @description An object containing pagination metadata and an array of capital projects | ||
*/ | ||
export type FindCapitalProjects200 = CapitalProjectPage; | ||
/** | ||
* @description Invalid client request | ||
*/ | ||
export type FindCapitalProjects400 = Error; | ||
/** | ||
* @description Requested resource does not exist or is not available | ||
*/ | ||
export type FindCapitalProjects404 = Error; | ||
/** | ||
* @description Server side error | ||
*/ | ||
export type FindCapitalProjects500 = Error; | ||
/** | ||
* @description An object containing pagination metadata and an array of capital projects | ||
*/ | ||
export type FindCapitalProjectsQueryResponse = CapitalProjectPage; | ||
export type FindCapitalProjectsQuery = { | ||
Response: FindCapitalProjectsQueryResponse; | ||
QueryParams: FindCapitalProjectsQueryParams; | ||
Errors: | ||
| FindCapitalProjects400 | ||
| FindCapitalProjects404 | ||
| FindCapitalProjects500; | ||
}; |
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,49 @@ | ||
import { z } from "zod"; | ||
import { capitalProjectPageSchema } from "./capitalProjectPageSchema"; | ||
import { errorSchema } from "./errorSchema"; | ||
|
||
export const findCapitalProjectsQueryParamsSchema = z | ||
.object({ | ||
limit: z.coerce | ||
.number() | ||
.int() | ||
.min(1) | ||
.max(100) | ||
.describe( | ||
"The maximum number of results to be returned in each response. The default value is 20. It must be between 1 and 100, inclusive.", | ||
) | ||
.optional(), | ||
offset: z.coerce | ||
.number() | ||
.int() | ||
.min(0) | ||
.describe( | ||
"The position in the full list to begin returning results. Default offset is 0. If the offset is beyond the end of the list, no results will be returned.", | ||
) | ||
.optional(), | ||
}) | ||
.optional(); | ||
/** | ||
* @description An object containing pagination metadata and an array of capital projects | ||
*/ | ||
export const findCapitalProjects200Schema = z.lazy( | ||
() => capitalProjectPageSchema, | ||
); | ||
/** | ||
* @description Invalid client request | ||
*/ | ||
export const findCapitalProjects400Schema = z.lazy(() => errorSchema); | ||
/** | ||
* @description Requested resource does not exist or is not available | ||
*/ | ||
export const findCapitalProjects404Schema = z.lazy(() => errorSchema); | ||
/** | ||
* @description Server side error | ||
*/ | ||
export const findCapitalProjects500Schema = z.lazy(() => errorSchema); | ||
/** | ||
* @description An object containing pagination metadata and an array of capital projects | ||
*/ | ||
export const findCapitalProjectsQueryResponseSchema = z.lazy( | ||
() => capitalProjectPageSchema, | ||
); |
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