Skip to content

Commit

Permalink
OpenAPI Implementation: CommunityDisctrict schema
Browse files Browse the repository at this point in the history
 - update the pattern for the CD schema
 - regenerate src/gen files
Closes #307
  • Loading branch information
horatiorosa committed Jun 6, 2024
1 parent 8ca1900 commit 0a545f1
Show file tree
Hide file tree
Showing 20 changed files with 332 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ components:
boroughId:
type: string
description: A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.
pattern: \b[1-9]\b
pattern: '^([0-9])$'
example: 1
required:
- id
Expand Down
2 changes: 1 addition & 1 deletion src/gen/types/CapitalProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ export type CapitalProject = {
* @example 2024-05-15
*/
maxDate: string;
category?: CapitalProjectCategory;
category: CapitalProjectCategory;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { Error } from "./Error";
import type { CapitalCommitment } from "./CapitalCommitment";

export type FindCapitalCommitmentsByManagingCodeCapitalProjectIdPathParams = {
/**
* @description Three character string of numbers representing managing agency
* @type string
* @example 801
*/
managingCode: string;
/**
* @description The id for the project, which combines with the managing code to make a unique id
* @type string
* @example HWPEDSF5
*/
capitalProjectId: string;
};

export type FindCapitalCommitmentsByManagingCodeCapitalProjectId400 = Error;

export type FindCapitalCommitmentsByManagingCodeCapitalProjectId404 = Error;

export type FindCapitalCommitmentsByManagingCodeCapitalProjectId500 = Error;

/**
* @description an object of capital commitments for the capital project
*/
export type FindCapitalCommitmentsByManagingCodeCapitalProjectIdQueryResponse =
{
/**
* @type array
*/
capitalCommitments: CapitalCommitment[];
};
28 changes: 28 additions & 0 deletions src/gen/types/FindCapitalProjectTiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Error } from "./Error";

export type FindCapitalProjectTilesPathParams = {
/**
* @description viewport zoom component
* @type integer
* @example 7
*/
z: number;
/**
* @description viewport x component
* @type integer
* @example 1000
*/
x: number;
/**
* @description viewport y component
* @type integer
* @example 1000
*/
y: number;
};

export type FindCapitalProjectTilesQueryResponse = any | null;

export type FindCapitalProjectTiles400 = Error;

export type FindCapitalProjectTiles500 = Error;
29 changes: 29 additions & 0 deletions src/gen/types/FindCapitalProjectsByBoroughIdCommunityDistrictId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Error } from "./Error";
import type { CapitalProjectPage } from "./CapitalProjectPage";

export type FindCapitalProjectsByBoroughIdCommunityDistrictIdPathParams = {
/**
* @description A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.
* @type string
* @example 1
*/
boroughId: string;
/**
* @description The two character numeric string containing the number used to refer to the community district.
* @type string
* @example 01
*/
communityDistrictId: string;
};

export type FindCapitalProjectsByBoroughIdCommunityDistrictId400 = Error;

export type FindCapitalProjectsByBoroughIdCommunityDistrictId404 = Error;

export type FindCapitalProjectsByBoroughIdCommunityDistrictId500 = Error;

/**
* @description An object containing pagination metadata and an array of capital projects for the community district
*/
export type FindCapitalProjectsByBoroughIdCommunityDistrictIdQueryResponse =
CapitalProjectPage;
23 changes: 23 additions & 0 deletions src/gen/types/FindCapitalProjectsByCityCouncilId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Error } from "./Error";
import type { CapitalProjectPage } from "./CapitalProjectPage";

export type FindCapitalProjectsByCityCouncilIdPathParams = {
/**
* @description One or two character code to represent city council districts.
* @type string
* @example 25
*/
cityCouncilDistrictId: string;
};

export type FindCapitalProjectsByCityCouncilId400 = Error;

export type FindCapitalProjectsByCityCouncilId404 = Error;

export type FindCapitalProjectsByCityCouncilId500 = Error;

/**
* @description An object containing pagination metadata and an array of capital projects for the city council district
*/
export type FindCapitalProjectsByCityCouncilIdQueryResponse =
CapitalProjectPage;
28 changes: 28 additions & 0 deletions src/gen/types/FindCityCouncilDistrictTiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Error } from "./Error";

export type FindCityCouncilDistrictTilesPathParams = {
/**
* @description viewport zoom component
* @type integer
* @example 7
*/
z: number;
/**
* @description viewport x component
* @type integer
* @example 1000
*/
x: number;
/**
* @description viewport y component
* @type integer
* @example 1000
*/
y: number;
};

export type FindCityCouncilDistrictTilesQueryResponse = any | null;

export type FindCityCouncilDistrictTiles400 = Error;

export type FindCityCouncilDistrictTiles500 = Error;
28 changes: 28 additions & 0 deletions src/gen/types/FindCommunityDistrictTiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Error } from "./Error";

export type FindCommunityDistrictTilesPathParams = {
/**
* @description viewport zoom component
* @type integer
* @example 7
*/
z: number;
/**
* @description viewport x component
* @type integer
* @example 1000
*/
x: number;
/**
* @description viewport y component
* @type integer
* @example 1000
*/
y: number;
};

export type FindCommunityDistrictTilesQueryResponse = any | null;

export type FindCommunityDistrictTiles400 = Error;

export type FindCommunityDistrictTiles500 = Error;
1 change: 1 addition & 0 deletions src/gen/types/Mvt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Mvt = string;
7 changes: 7 additions & 0 deletions src/gen/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ export * from "./CommunityDistrict";
export * from "./Error";
export * from "./FindAgencies";
export * from "./FindBoroughs";
export * from "./FindCapitalCommitmentsByManagingCodeCapitalProjectId";
export * from "./FindCapitalProjectTiles";
export * from "./FindCapitalProjectsByBoroughIdCommunityDistrictId";
export * from "./FindCapitalProjectsByCityCouncilId";
export * from "./FindCityCouncilDistrictTiles";
export * from "./FindCityCouncilDistricts";
export * from "./FindCommunityDistrictTiles";
export * from "./FindCommunityDistrictsByBoroughId";
export * from "./FindLandUses";
export * from "./FindTaxLotByBbl";
Expand All @@ -27,6 +33,7 @@ export * from "./FindZoningDistrictsByTaxLotBbl";
export * from "./InternalServerError";
export * from "./LandUse";
export * from "./MultiPolygon";
export * from "./Mvt";
export * from "./NotFound";
export * from "./Page";
export * from "./Position";
Expand Down
2 changes: 1 addition & 1 deletion src/gen/zod/capitalProjectSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const capitalProjectSchema = z.object({
.describe(`The managing agency name abbreviation or acronym`),
minDate: z.string().describe(`The starting date of the capital project`),
maxDate: z.string().describe(`The ending date of the capital project`),
category: z.lazy(() => capitalProjectCategorySchema).schema.optional(),
category: z.lazy(() => capitalProjectCategorySchema).schema,
});
2 changes: 1 addition & 1 deletion src/gen/zod/communityDistrictSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export const communityDistrictSchema = z.object({
.describe(
`A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.`,
)
.regex(new RegExp("\\b[1-9]\\b")),
.regex(new RegExp("^([0-9])$")),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";
import { capitalCommitmentSchema } from "./capitalCommitmentSchema";

export const findCapitalCommitmentsByManagingCodeCapitalProjectIdPathParamsSchema =
z.object({
managingCode: z
.string()
.describe(
`Three character string of numbers representing managing agency`,
)
.regex(new RegExp("^([0-9]{3})$")),
capitalProjectId: z
.string()
.describe(
`The id for the project, which combines with the managing code to make a unique id`,
),
});
export const findCapitalCommitmentsByManagingCodeCapitalProjectId400Schema =
z.lazy(() => errorSchema).schema;
export const findCapitalCommitmentsByManagingCodeCapitalProjectId404Schema =
z.lazy(() => errorSchema).schema;
export const findCapitalCommitmentsByManagingCodeCapitalProjectId500Schema =
z.lazy(() => errorSchema).schema;

/**
* @description an object of capital commitments for the capital project
*/
export const findCapitalCommitmentsByManagingCodeCapitalProjectIdQueryResponseSchema =
z.object({
capitalCommitments: z.array(z.lazy(() => capitalCommitmentSchema).schema),
});
16 changes: 16 additions & 0 deletions src/gen/zod/findCapitalProjectTilesSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";

export const findCapitalProjectTilesPathParamsSchema = z.object({
z: z.number().describe(`viewport zoom component`),
x: z.number().describe(`viewport x component`),
y: z.number().describe(`viewport y component`),
});
export const findCapitalProjectTilesQueryResponseSchema = z.any();
export const findCapitalProjectTiles400Schema = z.lazy(
() => errorSchema,
).schema;
export const findCapitalProjectTiles500Schema = z.lazy(
() => errorSchema,
).schema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";
import { capitalProjectPageSchema } from "./capitalProjectPageSchema";

export const findCapitalProjectsByBoroughIdCommunityDistrictIdPathParamsSchema =
z.object({
boroughId: z
.string()
.describe(
`A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.`,
)
.regex(new RegExp("^([0-9]{1})$")),
communityDistrictId: z
.string()
.describe(
`The two character numeric string containing the number used to refer to the community district.`,
)
.regex(new RegExp("^([0-9]{2})$")),
});
export const findCapitalProjectsByBoroughIdCommunityDistrictId400Schema =
z.lazy(() => errorSchema).schema;
export const findCapitalProjectsByBoroughIdCommunityDistrictId404Schema =
z.lazy(() => errorSchema).schema;
export const findCapitalProjectsByBoroughIdCommunityDistrictId500Schema =
z.lazy(() => errorSchema).schema;

/**
* @description An object containing pagination metadata and an array of capital projects for the community district
*/
export const findCapitalProjectsByBoroughIdCommunityDistrictIdQueryResponseSchema =
z.lazy(() => capitalProjectPageSchema).schema;
27 changes: 27 additions & 0 deletions src/gen/zod/findCapitalProjectsByCityCouncilIdSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";
import { capitalProjectPageSchema } from "./capitalProjectPageSchema";

export const findCapitalProjectsByCityCouncilIdPathParamsSchema = z.object({
cityCouncilDistrictId: z
.string()
.describe(`One or two character code to represent city council districts.`)
.regex(new RegExp("^([0-9]{1,2})$")),
});
export const findCapitalProjectsByCityCouncilId400Schema = z.lazy(
() => errorSchema,
).schema;
export const findCapitalProjectsByCityCouncilId404Schema = z.lazy(
() => errorSchema,
).schema;
export const findCapitalProjectsByCityCouncilId500Schema = z.lazy(
() => errorSchema,
).schema;

/**
* @description An object containing pagination metadata and an array of capital projects for the city council district
*/
export const findCapitalProjectsByCityCouncilIdQueryResponseSchema = z.lazy(
() => capitalProjectPageSchema,
).schema;
16 changes: 16 additions & 0 deletions src/gen/zod/findCityCouncilDistrictTilesSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";

export const findCityCouncilDistrictTilesPathParamsSchema = z.object({
z: z.number().describe(`viewport zoom component`),
x: z.number().describe(`viewport x component`),
y: z.number().describe(`viewport y component`),
});
export const findCityCouncilDistrictTilesQueryResponseSchema = z.any();
export const findCityCouncilDistrictTiles400Schema = z.lazy(
() => errorSchema,
).schema;
export const findCityCouncilDistrictTiles500Schema = z.lazy(
() => errorSchema,
).schema;
16 changes: 16 additions & 0 deletions src/gen/zod/findCommunityDistrictTilesSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from "zod";

import { errorSchema } from "./errorSchema";

export const findCommunityDistrictTilesPathParamsSchema = z.object({
z: z.number().describe(`viewport zoom component`),
x: z.number().describe(`viewport x component`),
y: z.number().describe(`viewport y component`),
});
export const findCommunityDistrictTilesQueryResponseSchema = z.any();
export const findCommunityDistrictTiles400Schema = z.lazy(
() => errorSchema,
).schema;
export const findCommunityDistrictTiles500Schema = z.lazy(
() => errorSchema,
).schema;
7 changes: 7 additions & 0 deletions src/gen/zod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ export * from "./communityDistrictSchema";
export * from "./errorSchema";
export * from "./findAgenciesSchema";
export * from "./findBoroughsSchema";
export * from "./findCapitalCommitmentsByManagingCodeCapitalProjectIdSchema";
export * from "./findCapitalProjectTilesSchema";
export * from "./findCapitalProjectsByBoroughIdCommunityDistrictIdSchema";
export * from "./findCapitalProjectsByCityCouncilIdSchema";
export * from "./findCityCouncilDistrictTilesSchema";
export * from "./findCityCouncilDistrictsSchema";
export * from "./findCommunityDistrictTilesSchema";
export * from "./findCommunityDistrictsByBoroughIdSchema";
export * from "./findLandUsesSchema";
export * from "./findTaxLotByBblSchema";
Expand All @@ -27,6 +33,7 @@ export * from "./findZoningDistrictsByTaxLotBblSchema";
export * from "./internalServerErrorSchema";
export * from "./landUseSchema";
export * from "./multiPolygonSchema";
export * from "./mvtSchema";
export * from "./notFoundSchema";
export * from "./pageSchema";
export * from "./positionSchema";
Expand Down
Loading

0 comments on commit 0a545f1

Please sign in to comment.