diff --git a/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.test.tsx b/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.test.tsx new file mode 100644 index 0000000..01546cc --- /dev/null +++ b/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.test.tsx @@ -0,0 +1,72 @@ +import { + CapitalCommitment, + CapitalCommitmentType, + createCapitalCommitment, + createCapitalCommitmentType, +} from "~/gen"; +import { CapitalCommitmentsTable } from "./CapitalCommitmentsTable"; +import { render, screen } from "@testing-library/react"; + +describe("CapitalCommitmentsTable", () => { + let capitalCommitments: Array = []; + let capitalCommitmentTypes: Array = []; + beforeAll(() => { + capitalCommitments = Array.from(Array(1), () => + createCapitalCommitment({ + type: "CONS", + plannedDate: `${new Date("April 2024")}`, + totalValue: 1e6, + }), + ); + capitalCommitmentTypes = Array.from(Array(1), () => + createCapitalCommitmentType({ + code: "CONS", + description: "CONSTRUCTION", + }), + ); + }); + + it("should render the table header", () => { + render( + , + ); + + expect(screen.getByText(/Date/)).toBeVisible(); + expect(screen.getByText(/Description/)).toBeVisible(); + expect(screen.getByText(/Commitment/)).toBeVisible(); + }); + + it("should render the month and year of the commitment", () => { + render( + , + ); + expect(screen.getByText(/Apr 2024/)).toBeVisible(); + }); + + it("should render the description of the commitment type", () => { + render( + , + ); + expect(screen.getByText(/CONSTRUCTION/)).toBeVisible(); + }); + + it("should render the value of the commitment", () => { + render( + , + ); + + expect(screen.getByText(/\$1.00M/)).toBeVisible(); + }); +}); diff --git a/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.tsx b/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.tsx new file mode 100644 index 0000000..1c7e26c --- /dev/null +++ b/app/components/CapitalCommitmentsTable/CapitalCommitmentsTable.tsx @@ -0,0 +1,73 @@ +import numbro from "numbro"; +import { format } from "date-fns"; +import { + TableContainer, + Table, + Thead, + Tr, + Th, + Tbody, + Td, +} from "@nycplanning/streetscape"; +import { CapitalCommitment, CapitalCommitmentType } from "~/gen"; + +export interface CapitalCommitmentsTableProps { + capitalCommitments: Array; + capitalCommitmentTypes: Array; +} +export function CapitalCommitmentsTable({ + capitalCommitments, + capitalCommitmentTypes, +}: CapitalCommitmentsTableProps) { + return ( + + + + + + + + + + + {capitalCommitments.map((commitment) => ( + + + + + + ))} + +
+ Date + + Description + + Commitment +
+ {format(commitment.plannedDate, "MMM yyyy")} + + {capitalCommitmentTypes.find( + (type) => type.code === commitment.type, + )?.description ?? commitment.type} + + {numbro(commitment.totalValue) + .format({ + average: true, + output: "currency", + mantissa: 2, + }) + .toUpperCase()} +
+
+ ); +} diff --git a/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.test.tsx b/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.test.tsx new file mode 100644 index 0000000..3000c89 --- /dev/null +++ b/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.test.tsx @@ -0,0 +1,121 @@ +import { render, screen } from "@testing-library/react"; +import { CapitalCommitmentsTimeline } from "./CapitalCommitmentsTimeline"; +import { createCapitalCommitment } from "~/gen"; + +describe("CapitalCommitmentsTimeline", () => { + const currentYear = new Date().getFullYear(); + + it("should label past, current, and future commitments", () => { + const capitalCommitments = Array.from(Array(1), () => + createCapitalCommitment(), + ); + render( + , + ); + + expect(screen.getByText(/Past/)).toBeVisible(); + expect(screen.getByText(/Current/)).toBeVisible(); + expect(screen.getByText(/Future/)).toBeVisible(); + }); + + it("should sum commitments two in the past, one current, and none in the future", () => { + const capitalCommitments = Array.from(Array(3), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear - i}`).toString(), + totalValue: 1e6, + }), + ); + render( + , + ); + + expect(screen.getByText(/\$2.00M/)).toBeVisible(); + expect(screen.getByText(/\$1.00M/)).toBeVisible(); + expect(screen.getByText(/\$0.00/)).toBeVisible(); + }); + + it("should sum commitments none in the past, one current, and three in the future", () => { + const capitalCommitments = Array.from(Array(4), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear + i}`).toString(), + totalValue: 1e6, + }), + ); + render( + , + ); + + expect(screen.getByText(/\$0.00/)).toBeVisible(); + expect(screen.getByText(/\$1.00M/)).toBeVisible(); + expect(screen.getByText(/\$3.00M/)).toBeVisible(); + }); + + it("should show a range of past years", () => { + const capitalCommitments = Array.from(Array(4), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear - i}`).toString(), + }), + ); + render( + , + ); + + expect( + screen.getByText(`${currentYear - 3} - ${currentYear - 1}`), + ).toBeVisible(); + }); + + it("should show a single past year", () => { + const capitalCommitments = Array.from(Array(2), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear - i}`).toString(), + }), + ); + render( + , + ); + + expect(screen.getByText(`${currentYear - 1}`)).toBeVisible(); + }); + + it("should show the current year", () => { + const capitalCommitments = Array.from(Array(1), () => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear}`).toString(), + }), + ); + render( + , + ); + + expect(screen.getByText(currentYear)).toBeVisible(); + }); + + it("should show a range of future years", () => { + const capitalCommitments = Array.from(Array(4), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear + i}`).toString(), + }), + ); + render( + , + ); + + expect( + screen.getByText(`${currentYear + 1} - ${currentYear + 3}`), + ).toBeVisible(); + }); + + it("should show a single future year", () => { + const capitalCommitments = Array.from(Array(2), (_, i) => + createCapitalCommitment({ + plannedDate: new Date(`Jan ${currentYear + i}`).toString(), + }), + ); + render( + , + ); + + expect(screen.getByText(`${currentYear + 1}`)).toBeVisible(); + }); +}); diff --git a/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.tsx b/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.tsx new file mode 100644 index 0000000..0cc4d0a --- /dev/null +++ b/app/components/CapitalProjectDetailPanel/CapitalCommitmentsTimeline.tsx @@ -0,0 +1,194 @@ +import { Flex } from "@nycplanning/streetscape"; +import numbro from "numbro"; +import { CapitalCommitment } from "~/gen"; + +export interface CapitalCommitmentsTimelineProps { + capitalCommitments: Array; +} + +export const getDisplayYear = ( + minYear: number | null, + maxYear: number | null, +) => { + // If there were no commitments in a year, then the min and max year will both be null + if (minYear !== maxYear) return `${minYear} - ${maxYear}`; + // Only one of the variables need to be checked to know there were no commitments + if (maxYear === null) return ""; + // Through deduction, we know there was at least one commitment but they were all from the same year. + return `${maxYear}`; +}; + +export function CapitalCommitmentsTimeline({ + capitalCommitments, +}: CapitalCommitmentsTimelineProps) { + const currentYear = new Date().getFullYear(); + const commitmentsCount = capitalCommitments.length; + let maxPastYear = null; + let minPastYear = null; + let maxFutureYear = null; + let minFutureYear = null; + let pastCommitmentsTotal = 0; + let futureCommitmentsTotal = 0; + let currentCommitmentsTotal = 0; + for (let i = commitmentsCount; i--; ) { + const commitment = capitalCommitments[i]; + const commitmentYear = new Date(commitment.plannedDate).getFullYear(); + + if (commitmentYear < currentYear) { + pastCommitmentsTotal += commitment.totalValue; + maxPastYear = + maxPastYear === null + ? commitmentYear + : commitmentYear > maxPastYear + ? commitmentYear + : maxPastYear; + + minPastYear = + minPastYear === null + ? commitmentYear + : commitmentYear < minPastYear + ? commitmentYear + : minPastYear; + } else if (commitmentYear > currentYear) { + futureCommitmentsTotal += commitment.totalValue; + maxFutureYear = + maxFutureYear === null + ? commitmentYear + : commitmentYear > maxFutureYear + ? commitmentYear + : maxFutureYear; + + minFutureYear = + minFutureYear === null + ? commitmentYear + : commitmentYear < minFutureYear + ? commitmentYear + : minFutureYear; + } else if (commitmentYear === currentYear) { + currentCommitmentsTotal += commitment.totalValue; + } + } + + return ( + + + + + + + + + + + {numbro(pastCommitmentsTotal) + .format({ + average: true, + output: "currency", + mantissa: 2, + }) + .toUpperCase()} + + + Past + + + {getDisplayYear(minPastYear, maxPastYear)} + + + {numbro(currentCommitmentsTotal) + .format({ + average: true, + output: "currency", + mantissa: 2, + }) + .toUpperCase()} + + + Current + + + {currentYear} + + + {numbro(futureCommitmentsTotal) + .format({ + average: true, + output: "currency", + mantissa: 2, + }) + .toUpperCase()} + + + Future + + + {getDisplayYear(minFutureYear, maxFutureYear)} + + + + + ); +} diff --git a/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.test.tsx b/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.test.tsx index 2a88c2e..4a913e9 100644 --- a/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.test.tsx +++ b/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.test.tsx @@ -6,6 +6,7 @@ import { } from "~/gen"; import { render, screen } from "@testing-library/react"; import { userEvent } from "@testing-library/user-event"; +import { Flex } from "@nycplanning/streetscape"; describe("CapitalProjectDetailPanel", () => { let capitalProject: CapitalProjectBudgeted; @@ -29,6 +30,7 @@ describe("CapitalProjectDetailPanel", () => { capitalProject={capitalProject} agencies={agencies} onClose={onClose} + capitalCommitmentsTimeline={} />, ); expect(screen.getByText(capitalProject.description)).toBeVisible(); @@ -40,28 +42,19 @@ describe("CapitalProjectDetailPanel", () => { capitalProject={capitalProject} agencies={agencies} onClose={onClose} + capitalCommitmentsTimeline={} />, ); expect(screen.getByText(agencies[0].name)).toBeVisible(); }); - it("should render the name of the sponsoring agency", () => { - render( - , - ); - expect(screen.getByText(agencies[1].name)).toBeVisible(); - }); - it("should call onClose when the back chevron is clicked", async () => { render( } />, ); @@ -77,6 +70,7 @@ describe("CapitalProjectDetailPanel", () => { capitalProject={capitalProject} agencies={agencies} onClose={onClose} + capitalCommitmentsTimeline={} />, ); expect(screen.getByText("FY2019")).toBeVisible(); diff --git a/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.tsx b/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.tsx index 5bd5626..15c5155 100644 --- a/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.tsx +++ b/app/components/CapitalProjectDetailPanel/CapitalProjectDetailPanel.tsx @@ -1,4 +1,3 @@ -import { useState } from "react"; import { getYear, getMonth, compareAsc } from "date-fns"; import numbro from "numbro"; import { ChevronLeftIcon } from "@chakra-ui/icons"; @@ -11,12 +10,12 @@ import { Wrap, WrapItem, IconButton, - Hide, } from "@nycplanning/streetscape"; import { CapitalProjectBudgeted, Agency } from "../../gen"; export interface CapitalProjectDetailPanelProps { capitalProject: CapitalProjectBudgeted; + capitalCommitmentsTimeline: React.ReactNode; agencies: Agency[]; onClose: () => void; } @@ -35,46 +34,24 @@ const formatFiscalYearRange = (minDate: Date, maxDate: Date) => { export const CapitalProjectDetailPanel = ({ capitalProject, + capitalCommitmentsTimeline, agencies, onClose, }: CapitalProjectDetailPanelProps) => { - const [isExpanded, setIsExpanded] = useState(false); - return ( - - - { - setIsExpanded(!isExpanded); - }} - /> - - + + } - color={"black"} - backgroundColor={"white"} + color={"gray.600"} + backgroundColor={"inherit"} _hover={{ border: "none", backgroundColor: "blackAlpha.100", @@ -85,74 +62,27 @@ export const CapitalProjectDetailPanel = ({ {capitalProject.description} - - - - Capital Commitments - - - {formatFiscalYearRange( - new Date(capitalProject.minDate), - new Date(capitalProject.maxDate), - )} - - - Total Future Commitments - - - {numbro(capitalProject.commitmentsTotal) - .format({ - average: true, - mantissa: 2, - output: "currency", - spaceSeparated: true, - }) - .toUpperCase()} - - - - Project ID: {capitalProject.managingCode} - {capitalProject.id} - - - - Managing Agency + + + + Project ID:  - { - agencies.find( - (agency) => agency.initials === capitalProject.managingAgency, - )?.name - } + {capitalProject.managingCode} + {capitalProject.id} - - - Sponsoring Agency - - - {capitalProject.sponsoringAgencies - .map( - (initials) => - agencies.find((agency) => agency.initials === initials)?.name, - ) - .join(" ")} - - - - - Project Type + + + Project Type:  {capitalProject.budgetTypes.map((budgetType) => ( @@ -161,12 +91,9 @@ export const CapitalProjectDetailPanel = ({ as={"span"} display={"inline-block"} width="auto" - paddingX={2} - paddingY={1} - borderRadius={"0.5rem"} - borderColor="gray.400" - borderStyle={"solid"} - borderWidth={"1.5px"} + paddingX={0.5} + paddingY={0.25} + borderRadius={"0.25rem"} backgroundColor={"gray.100"} > {budgetType} @@ -175,6 +102,64 @@ export const CapitalProjectDetailPanel = ({ ))} + + + + + Managing Agency + + { + agencies.find( + (agency) => agency.initials === capitalProject.managingAgency, + )?.name + } + + + + + Commitments + + {formatFiscalYearRange( + new Date(capitalProject.minDate), + new Date(capitalProject.maxDate), + )} + + + + Total + + {numbro(capitalProject.commitmentsTotal) + .format({ + average: true, + mantissa: 2, + output: "currency", + spaceSeparated: true, + }) + .toUpperCase()} + + + + {capitalCommitmentsTimeline} + ); diff --git a/app/components/FilterMenu.tsx b/app/components/FilterMenu.tsx index 815b126..9ca5654 100644 --- a/app/components/FilterMenu.tsx +++ b/app/components/FilterMenu.tsx @@ -12,6 +12,7 @@ export const FilterMenu = ({ { + it("should have be clickable to expand", async () => { + const isExpanded = false; + const isExpandedToggle = vi.fn(); + render( + , + ); + fireEvent.click(screen.getByLabelText(/Expand/)); + expect(isExpandedToggle).toHaveBeenCalled(); + }); + + it("should have be clickable to collapse", async () => { + const isExpanded = true; + const isExpandedToggle = vi.fn(); + render( + , + ); + fireEvent.click(screen.getByLabelText(/Collapse/)); + expect(isExpandedToggle).toHaveBeenCalled(); + }); +}); diff --git a/app/components/MobilePanelSizeControl.tsx b/app/components/MobilePanelSizeControl.tsx new file mode 100644 index 0000000..5d4f618 --- /dev/null +++ b/app/components/MobilePanelSizeControl.tsx @@ -0,0 +1,31 @@ +import { Box, BoxProps, Hide } from "@nycplanning/streetscape"; + +export interface MobilePanelSizeControlProps extends BoxProps { + isExpanded: boolean; + isExpandedToggle: () => void; +} +export function MobilePanelSizeControl({ + isExpanded, + isExpandedToggle, + ...props +}: MobilePanelSizeControlProps) { + return ( + + + + ); +} diff --git a/app/components/Overlay.tsx b/app/components/Overlay.tsx index 1760542..e1ee506 100644 --- a/app/components/Overlay.tsx +++ b/app/components/Overlay.tsx @@ -9,7 +9,7 @@ export const Overlay = ({ children }: OverlayProps) => { return ( [0]> = {}, +): Promise["data"]> { + const res = await client({ + method: "get", + url: `/capital-commitment-types`, + ...options, + }); + return res.data; +} diff --git a/app/gen/axios/findCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts b/app/gen/axios/findCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts new file mode 100644 index 0000000..acc6676 --- /dev/null +++ b/app/gen/axios/findCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts @@ -0,0 +1,28 @@ +import client from "@kubb/swagger-client/client"; +import type { ResponseConfig } from "@kubb/swagger-client/client"; +import type { + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams, +} from "../types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; + +/** + * @summary Find a single capital project as a geojson feature + * @link /capital-projects/:managingCode/:capitalProjectId/geojson + */ +export async function findCapitalProjectGeoJsonByManagingCodeCapitalProjectId( + managingCode: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams["managingCode"], + capitalProjectId: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams["capitalProjectId"], + options: Partial[0]> = {}, +): Promise< + ResponseConfig["data"] +> { + const res = + await client( + { + method: "get", + url: `/capital-projects/${managingCode}/${capitalProjectId}/geojson`, + ...options, + }, + ); + return res.data; +} diff --git a/app/gen/axios/findCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts b/app/gen/axios/findCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts new file mode 100644 index 0000000..58e1048 --- /dev/null +++ b/app/gen/axios/findCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts @@ -0,0 +1,27 @@ +import client from "@kubb/swagger-client/client"; +import type { ResponseConfig } from "@kubb/swagger-client/client"; +import type { + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams, +} from "../types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; + +/** + * @summary Find GeoJson for a specific city council district + * @link /city-council-districts/:cityCouncilDistrictId/geojson + */ +export async function findCityCouncilDistrictGeoJsonByCityCouncilDistrictId( + cityCouncilDistrictId: FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams["cityCouncilDistrictId"], + options: Partial[0]> = {}, +): Promise< + ResponseConfig["data"] +> { + const res = + await client( + { + method: "get", + url: `/city-council-districts/${cityCouncilDistrictId}/geojson`, + ...options, + }, + ); + return res.data; +} diff --git a/app/gen/axios/findCityCouncilDistrictTiles.ts b/app/gen/axios/findCityCouncilDistrictTiles.ts index 9b2c132..d2fc8e9 100644 --- a/app/gen/axios/findCityCouncilDistrictTiles.ts +++ b/app/gen/axios/findCityCouncilDistrictTiles.ts @@ -6,7 +6,7 @@ import type { } from "../types/FindCityCouncilDistrictTiles"; /** - * @summary 🚧 Mapbox Vector Tiles for city council districts + * @summary Mapbox Vector Tiles for city council districts * @link /city-council-districts/:z/:x/:y.pbf */ export async function findCityCouncilDistrictTiles( diff --git a/app/gen/axios/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts b/app/gen/axios/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts new file mode 100644 index 0000000..1c06d45 --- /dev/null +++ b/app/gen/axios/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts @@ -0,0 +1,28 @@ +import client from "@kubb/swagger-client/client"; +import type { ResponseConfig } from "@kubb/swagger-client/client"; +import type { + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams, +} from "../types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; + +/** + * @summary Find GeoJson for a specific community district + * @link /boroughs/:boroughId/community-districts/:communityDistrictId/geojson + */ +export async function findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId( + boroughId: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams["boroughId"], + communityDistrictId: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams["communityDistrictId"], + options: Partial[0]> = {}, +): Promise< + ResponseConfig["data"] +> { + const res = + await client( + { + method: "get", + url: `/boroughs/${boroughId}/community-districts/${communityDistrictId}/geojson`, + ...options, + }, + ); + return res.data; +} diff --git a/app/gen/axios/index.ts b/app/gen/axios/index.ts index 2164506..d9e1b62 100644 --- a/app/gen/axios/index.ts +++ b/app/gen/axios/index.ts @@ -1,12 +1,16 @@ export * from "./findAgencies"; export * from "./findBoroughs"; +export * from "./findCapitalCommitmentTypes"; export * from "./findCapitalCommitmentsByManagingCodeCapitalProjectId"; export * from "./findCapitalProjectByManagingCodeCapitalProjectId"; +export * from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; export * from "./findCapitalProjectTiles"; export * from "./findCapitalProjectsByBoroughIdCommunityDistrictId"; export * from "./findCapitalProjectsByCityCouncilId"; +export * from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; export * from "./findCityCouncilDistrictTiles"; export * from "./findCityCouncilDistricts"; +export * from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; export * from "./findCommunityDistrictTiles"; export * from "./findCommunityDistrictsByBoroughId"; export * from "./findLandUses"; diff --git a/app/gen/axios/operations.ts b/app/gen/axios/operations.ts index 4ff9b57..12729c9 100644 --- a/app/gen/axios/operations.ts +++ b/app/gen/axios/operations.ts @@ -11,14 +11,26 @@ export const operations = { path: "/boroughs/:boroughId/community-districts", method: "get", }, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId: { + path: "/boroughs/:boroughId/community-districts/:communityDistrictId/geojson", + method: "get", + }, findCapitalProjectsByBoroughIdCommunityDistrictId: { path: "/boroughs/:boroughId/community-districts/:communityDistrictId/capital-projects", method: "get", }, + findCapitalCommitmentTypes: { + path: "/capital-commitment-types", + method: "get", + }, findCapitalCommitmentsByManagingCodeCapitalProjectId: { path: "/capital-projects/:managingCode/:capitalProjectId/capital-commitments", method: "get", }, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectId: { + path: "/capital-projects/:managingCode/:capitalProjectId/geojson", + method: "get", + }, findCapitalProjectByManagingCodeCapitalProjectId: { path: "/capital-projects/:managingCode/:capitalProjectId", method: "get", @@ -31,6 +43,10 @@ export const operations = { path: "/city-council-districts", method: "get", }, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictId: { + path: "/city-council-districts/:cityCouncilDistrictId/geojson", + method: "get", + }, findCapitalProjectsByCityCouncilId: { path: "/city-council-districts/:cityCouncilDistrictId/capital-projects", method: "get", diff --git a/app/gen/mocks/createCapitalCommitmentType.ts b/app/gen/mocks/createCapitalCommitmentType.ts new file mode 100644 index 0000000..97c48a0 --- /dev/null +++ b/app/gen/mocks/createCapitalCommitmentType.ts @@ -0,0 +1,12 @@ +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import type { CapitalCommitmentType } from "../types/CapitalCommitmentType"; + +export function createCapitalCommitmentType( + data: NonNullable> = {}, +): NonNullable { + return { + ...{ code: faker.string.alpha(), description: faker.string.alpha() }, + ...data, + }; +} diff --git a/app/gen/mocks/createCapitalProjectBudgetedGeoJson.ts b/app/gen/mocks/createCapitalProjectBudgetedGeoJson.ts new file mode 100644 index 0000000..6cb3e26 --- /dev/null +++ b/app/gen/mocks/createCapitalProjectBudgetedGeoJson.ts @@ -0,0 +1,23 @@ +import { createMultiPoint } from "./createMultiPoint"; +import { createMultiPolygon } from "./createMultiPolygon"; +import { createCapitalProjectBudgeted } from "./createCapitalProjectBudgeted"; +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import type { CapitalProjectBudgetedGeoJson } from "../types/CapitalProjectBudgetedGeoJson"; + +export function createCapitalProjectBudgetedGeoJson( + data: NonNullable> = {}, +): NonNullable { + return { + ...{ + id: faker.string.alpha(), + type: faker.helpers.arrayElement(["Feature"]), + geometry: faker.helpers.arrayElement([ + createMultiPoint(), + createMultiPolygon(), + ]), + properties: createCapitalProjectBudgeted(), + }, + ...data, + }; +} diff --git a/app/gen/mocks/createCityCouncilDistrictGeoJson.ts b/app/gen/mocks/createCityCouncilDistrictGeoJson.ts new file mode 100644 index 0000000..bdd2e71 --- /dev/null +++ b/app/gen/mocks/createCityCouncilDistrictGeoJson.ts @@ -0,0 +1,22 @@ +import { createCityCouncilDistrict } from "./createCityCouncilDistrict"; +import { createMultiPolygon } from "./createMultiPolygon"; +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import type { CityCouncilDistrictGeoJson } from "../types/CityCouncilDistrictGeoJson"; + +export function createCityCouncilDistrictGeoJson( + data: NonNullable> = {}, +): NonNullable { + return { + ...{ + id: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{1,2})$").gen(), + ]), + type: faker.helpers.arrayElement(["Feature"]), + properties: createCityCouncilDistrict(), + geometry: createMultiPolygon(), + }, + ...data, + }; +} diff --git a/app/gen/mocks/createCommunityDistrictGeoJson.ts b/app/gen/mocks/createCommunityDistrictGeoJson.ts new file mode 100644 index 0000000..290b86c --- /dev/null +++ b/app/gen/mocks/createCommunityDistrictGeoJson.ts @@ -0,0 +1,22 @@ +import { createCommunityDistrict } from "./createCommunityDistrict"; +import { createMultiPolygon } from "./createMultiPolygon"; +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import type { CommunityDistrictGeoJson } from "../types/CommunityDistrictGeoJson"; + +export function createCommunityDistrictGeoJson( + data: NonNullable> = {}, +): NonNullable { + return { + ...{ + id: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{3})$").gen(), + ]), + type: faker.helpers.arrayElement(["Feature"]), + properties: createCommunityDistrict(), + geometry: createMultiPolygon(), + }, + ...data, + }; +} diff --git a/app/gen/mocks/createFindCapitalCommitmentTypes.ts b/app/gen/mocks/createFindCapitalCommitmentTypes.ts new file mode 100644 index 0000000..49962b1 --- /dev/null +++ b/app/gen/mocks/createFindCapitalCommitmentTypes.ts @@ -0,0 +1,46 @@ +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import { createCapitalCommitmentType } from "./createCapitalCommitmentType"; +import { createError } from "./createError"; +import type { + FindCapitalCommitmentTypes200, + FindCapitalCommitmentTypes400, + FindCapitalCommitmentTypes500, + FindCapitalCommitmentTypesQueryResponse, +} from "../types/FindCapitalCommitmentTypes"; + +/** + * @description An object containing all capital commitment types. + */ +export function createFindCapitalCommitmentTypes200(): NonNullable { + return { + capitalCommitmentTypes: faker.helpers.arrayElements([ + createCapitalCommitmentType(), + ]) as any, + }; +} + +/** + * @description Invalid client request + */ +export function createFindCapitalCommitmentTypes400(): NonNullable { + return createError(); +} + +/** + * @description Server side error + */ +export function createFindCapitalCommitmentTypes500(): NonNullable { + return createError(); +} + +/** + * @description An object containing all capital commitment types. + */ +export function createFindCapitalCommitmentTypesQueryResponse(): NonNullable { + return { + capitalCommitmentTypes: faker.helpers.arrayElements([ + createCapitalCommitmentType(), + ]) as any, + }; +} diff --git a/app/gen/mocks/createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts b/app/gen/mocks/createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts new file mode 100644 index 0000000..72ae0e8 --- /dev/null +++ b/app/gen/mocks/createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts @@ -0,0 +1,57 @@ +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import { createCapitalProjectBudgetedGeoJson } from "./createCapitalProjectBudgetedGeoJson"; +import { createError } from "./createError"; +import type { + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500, + FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse, +} from "../types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; + +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams(): NonNullable { + return { + managingCode: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{3})$").gen(), + ]), + capitalProjectId: faker.string.alpha(), + }; +} + +/** + * @description A capital project geojson object + */ +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200(): NonNullable { + return createCapitalProjectBudgetedGeoJson(); +} + +/** + * @description Invalid client request + */ +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400(): NonNullable { + return createError(); +} + +/** + * @description Requested resource does not exist or is not available + */ +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404(): NonNullable { + return createError(); +} + +/** + * @description Server side error + */ +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500(): NonNullable { + return createError(); +} + +/** + * @description A capital project geojson object + */ +export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse(): NonNullable { + return createCapitalProjectBudgetedGeoJson(); +} diff --git a/app/gen/mocks/createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts b/app/gen/mocks/createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts new file mode 100644 index 0000000..023d8d2 --- /dev/null +++ b/app/gen/mocks/createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts @@ -0,0 +1,56 @@ +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import { createCityCouncilDistrictGeoJson } from "./createCityCouncilDistrictGeoJson"; +import { createError } from "./createError"; +import type { + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId200, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId400, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId404, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId500, + FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse, +} from "../types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; + +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams(): NonNullable { + return { + cityCouncilDistrictId: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{1,2})$").gen(), + ]), + }; +} + +/** + * @description a city council district geojson object + */ +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId200(): NonNullable { + return createCityCouncilDistrictGeoJson(); +} + +/** + * @description Invalid client request + */ +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId400(): NonNullable { + return createError(); +} + +/** + * @description Requested resource does not exist or is not available + */ +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId404(): NonNullable { + return createError(); +} + +/** + * @description Server side error + */ +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId500(): NonNullable { + return createError(); +} + +/** + * @description a city council district geojson object + */ +export function createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse(): NonNullable { + return createCityCouncilDistrictGeoJson(); +} diff --git a/app/gen/mocks/createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts b/app/gen/mocks/createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts new file mode 100644 index 0000000..ee21136 --- /dev/null +++ b/app/gen/mocks/createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts @@ -0,0 +1,60 @@ +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import { createCommunityDistrictGeoJson } from "./createCommunityDistrictGeoJson"; +import { createError } from "./createError"; +import type { + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId200, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500, + FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse, +} from "../types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; + +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams(): NonNullable { + return { + boroughId: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{1})$").gen(), + ]), + communityDistrictId: faker.helpers.arrayElement([ + faker.string.alpha(), + new RandExp("^([0-9]{2})$").gen(), + ]), + }; +} + +/** + * @description a community district geojson object + */ +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId200(): NonNullable { + return createCommunityDistrictGeoJson(); +} + +/** + * @description Invalid client request + */ +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400(): NonNullable { + return createError(); +} + +/** + * @description Requested resource does not exist or is not available + */ +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404(): NonNullable { + return createError(); +} + +/** + * @description Server side error + */ +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500(): NonNullable { + return createError(); +} + +/** + * @description a community district geojson object + */ +export function createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse(): NonNullable { + return createCommunityDistrictGeoJson(); +} diff --git a/app/gen/mocks/createMultiPoint.ts b/app/gen/mocks/createMultiPoint.ts new file mode 100644 index 0000000..7774d0c --- /dev/null +++ b/app/gen/mocks/createMultiPoint.ts @@ -0,0 +1,19 @@ +import { createPosition } from "./createPosition"; +import { faker } from "@faker-js/faker"; +import RandExp from "randexp"; +import type { MultiPoint } from "../types/MultiPoint"; + +/** + * @description A geojson implementation of a MultiPoint Simple Feature + */ +export function createMultiPoint( + data: NonNullable> = {}, +): NonNullable { + return { + ...{ + type: faker.helpers.arrayElement(["MultiPoint"]), + coordinates: faker.helpers.arrayElements([createPosition()]) as any, + }, + ...data, + }; +} diff --git a/app/gen/mocks/findCapitalCommitmentTypesHandler.ts b/app/gen/mocks/findCapitalCommitmentTypesHandler.ts new file mode 100644 index 0000000..9f9f801 --- /dev/null +++ b/app/gen/mocks/findCapitalCommitmentTypesHandler.ts @@ -0,0 +1,16 @@ +import { http } from "msw"; +import { createFindCapitalCommitmentTypesQueryResponse } from "./createFindCapitalCommitmentTypes"; + +export const findCapitalCommitmentTypesHandler = http.get( + "*/capital-commitment-types", + function handler(info) { + return new Response( + JSON.stringify(createFindCapitalCommitmentTypesQueryResponse()), + { + headers: { + "Content-Type": "application/json", + }, + }, + ); + }, +); diff --git a/app/gen/mocks/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler.ts b/app/gen/mocks/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler.ts new file mode 100644 index 0000000..540d592 --- /dev/null +++ b/app/gen/mocks/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler.ts @@ -0,0 +1,19 @@ +import { http } from "msw"; +import { createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse } from "./createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; + +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler = + http.get( + "*/capital-projects/:managingCode/:capitalProjectId/geojson", + function handler(info) { + return new Response( + JSON.stringify( + createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse(), + ), + { + headers: { + "Content-Type": "application/json", + }, + }, + ); + }, + ); diff --git a/app/gen/mocks/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler.ts b/app/gen/mocks/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler.ts new file mode 100644 index 0000000..b95d786 --- /dev/null +++ b/app/gen/mocks/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler.ts @@ -0,0 +1,19 @@ +import { http } from "msw"; +import { createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse } from "./createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; + +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler = + http.get( + "*/city-council-districts/:cityCouncilDistrictId/geojson", + function handler(info) { + return new Response( + JSON.stringify( + createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse(), + ), + { + headers: { + "Content-Type": "application/json", + }, + }, + ); + }, + ); diff --git a/app/gen/mocks/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler.ts b/app/gen/mocks/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler.ts new file mode 100644 index 0000000..6bc2f98 --- /dev/null +++ b/app/gen/mocks/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler.ts @@ -0,0 +1,19 @@ +import { http } from "msw"; +import { createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse } from "./createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; + +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler = + http.get( + "*/boroughs/:boroughId/community-districts/:communityDistrictId/geojson", + function handler(info) { + return new Response( + JSON.stringify( + createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse(), + ), + { + headers: { + "Content-Type": "application/json", + }, + }, + ); + }, + ); diff --git a/app/gen/mocks/handlers.ts b/app/gen/mocks/handlers.ts index c9a308d..526591b 100644 --- a/app/gen/mocks/handlers.ts +++ b/app/gen/mocks/handlers.ts @@ -1,11 +1,15 @@ import { findAgenciesHandler } from "./findAgenciesHandler"; import { findBoroughsHandler } from "./findBoroughsHandler"; import { findCommunityDistrictsByBoroughIdHandler } from "./findCommunityDistrictsByBoroughIdHandler"; +import { findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler } from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler"; import { findCapitalProjectsByBoroughIdCommunityDistrictIdHandler } from "./findCapitalProjectsByBoroughIdCommunityDistrictIdHandler"; +import { findCapitalCommitmentTypesHandler } from "./findCapitalCommitmentTypesHandler"; import { findCapitalCommitmentsByManagingCodeCapitalProjectIdHandler } from "./findCapitalCommitmentsByManagingCodeCapitalProjectIdHandler"; +import { findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler } from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler"; import { findCapitalProjectByManagingCodeCapitalProjectIdHandler } from "./findCapitalProjectByManagingCodeCapitalProjectIdHandler"; import { findCapitalProjectTilesHandler } from "./findCapitalProjectTilesHandler"; import { findCityCouncilDistrictsHandler } from "./findCityCouncilDistrictsHandler"; +import { findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler } from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler"; import { findCapitalProjectsByCityCouncilIdHandler } from "./findCapitalProjectsByCityCouncilIdHandler"; import { findCityCouncilDistrictTilesHandler } from "./findCityCouncilDistrictTilesHandler"; import { findCommunityDistrictTilesHandler } from "./findCommunityDistrictTilesHandler"; @@ -25,11 +29,15 @@ export const handlers = [ findAgenciesHandler, findBoroughsHandler, findCommunityDistrictsByBoroughIdHandler, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler, findCapitalProjectsByBoroughIdCommunityDistrictIdHandler, + findCapitalCommitmentTypesHandler, findCapitalCommitmentsByManagingCodeCapitalProjectIdHandler, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler, findCapitalProjectByManagingCodeCapitalProjectIdHandler, findCapitalProjectTilesHandler, findCityCouncilDistrictsHandler, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler, findCapitalProjectsByCityCouncilIdHandler, findCityCouncilDistrictTilesHandler, findCommunityDistrictTilesHandler, diff --git a/app/gen/mocks/index.ts b/app/gen/mocks/index.ts index 11bfc3b..c40fed1 100644 --- a/app/gen/mocks/index.ts +++ b/app/gen/mocks/index.ts @@ -2,22 +2,30 @@ export * from "./createAgency"; export * from "./createBadRequest"; export * from "./createBorough"; export * from "./createCapitalCommitment"; +export * from "./createCapitalCommitmentType"; export * from "./createCapitalProject"; export * from "./createCapitalProjectBudgeted"; +export * from "./createCapitalProjectBudgetedGeoJson"; export * from "./createCapitalProjectCategory"; export * from "./createCapitalProjectPage"; export * from "./createCityCouncilDistrict"; +export * from "./createCityCouncilDistrictGeoJson"; export * from "./createCommunityDistrict"; +export * from "./createCommunityDistrictGeoJson"; export * from "./createError"; export * from "./createFindAgencies"; export * from "./createFindBoroughs"; +export * from "./createFindCapitalCommitmentTypes"; export * from "./createFindCapitalCommitmentsByManagingCodeCapitalProjectId"; export * from "./createFindCapitalProjectByManagingCodeCapitalProjectId"; +export * from "./createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; export * from "./createFindCapitalProjectTiles"; export * from "./createFindCapitalProjectsByBoroughIdCommunityDistrictId"; export * from "./createFindCapitalProjectsByCityCouncilId"; +export * from "./createFindCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; export * from "./createFindCityCouncilDistrictTiles"; export * from "./createFindCityCouncilDistricts"; +export * from "./createFindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; export * from "./createFindCommunityDistrictTiles"; export * from "./createFindCommunityDistrictsByBoroughId"; export * from "./createFindLandUses"; @@ -33,6 +41,7 @@ export * from "./createFindZoningDistrictClassesByZoningDistrictId"; export * from "./createFindZoningDistrictsByTaxLotBbl"; export * from "./createInternalServerError"; export * from "./createLandUse"; +export * from "./createMultiPoint"; export * from "./createMultiPolygon"; export * from "./createMvt"; export * from "./createNotFound"; @@ -48,13 +57,17 @@ export * from "./createZoningDistrictClassCategory"; export * from "./createZoningDistrictClassCategoryColor"; export * from "./findAgenciesHandler"; export * from "./findBoroughsHandler"; +export * from "./findCapitalCommitmentTypesHandler"; export * from "./findCapitalCommitmentsByManagingCodeCapitalProjectIdHandler"; export * from "./findCapitalProjectByManagingCodeCapitalProjectIdHandler"; +export * from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdHandler"; export * from "./findCapitalProjectTilesHandler"; export * from "./findCapitalProjectsByBoroughIdCommunityDistrictIdHandler"; export * from "./findCapitalProjectsByCityCouncilIdHandler"; +export * from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdHandler"; export * from "./findCityCouncilDistrictTilesHandler"; export * from "./findCityCouncilDistrictsHandler"; +export * from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdHandler"; export * from "./findCommunityDistrictTilesHandler"; export * from "./findCommunityDistrictsByBoroughIdHandler"; export * from "./findLandUsesHandler"; diff --git a/app/gen/types/CapitalCommitmentType.ts b/app/gen/types/CapitalCommitmentType.ts new file mode 100644 index 0000000..816c36d --- /dev/null +++ b/app/gen/types/CapitalCommitmentType.ts @@ -0,0 +1,12 @@ +export type CapitalCommitmentType = { + /** + * @description The four character code to represent the capital commitment type + * @type string + */ + code: string; + /** + * @description The description of the capital commitment type. + * @type string + */ + description: string; +}; diff --git a/app/gen/types/CapitalProjectBudgetedGeoJson.ts b/app/gen/types/CapitalProjectBudgetedGeoJson.ts new file mode 100644 index 0000000..480649a --- /dev/null +++ b/app/gen/types/CapitalProjectBudgetedGeoJson.ts @@ -0,0 +1,22 @@ +import { MultiPoint } from "./MultiPoint"; +import { MultiPolygon } from "./MultiPolygon"; +import { CapitalProjectBudgeted } from "./CapitalProjectBudgeted"; + +export const capitalProjectBudgetedGeoJsonType = { + Feature: "Feature", +} as const; +export type CapitalProjectBudgetedGeoJsonType = + (typeof capitalProjectBudgetedGeoJsonType)[keyof typeof capitalProjectBudgetedGeoJsonType]; +export type CapitalProjectBudgetedGeoJson = { + /** + * @description The concatenation of the managing code and capital project id. + * @type string + */ + id: string; + /** + * @type string + */ + type: CapitalProjectBudgetedGeoJsonType; + geometry: MultiPoint | MultiPolygon; + properties: CapitalProjectBudgeted; +}; diff --git a/app/gen/types/CityCouncilDistrictGeoJson.ts b/app/gen/types/CityCouncilDistrictGeoJson.ts new file mode 100644 index 0000000..71ba9b1 --- /dev/null +++ b/app/gen/types/CityCouncilDistrictGeoJson.ts @@ -0,0 +1,21 @@ +import { CityCouncilDistrict } from "./CityCouncilDistrict"; +import { MultiPolygon } from "./MultiPolygon"; + +export const cityCouncilDistrictGeoJsonType = { + Feature: "Feature", +} as const; +export type CityCouncilDistrictGeoJsonType = + (typeof cityCouncilDistrictGeoJsonType)[keyof typeof cityCouncilDistrictGeoJsonType]; +export type CityCouncilDistrictGeoJson = { + /** + * @description One or two character code to represent city council districts. + * @type string + */ + id: string; + /** + * @type string + */ + type: CityCouncilDistrictGeoJsonType; + properties: CityCouncilDistrict; + geometry: MultiPolygon; +}; diff --git a/app/gen/types/CommunityDistrictGeoJson.ts b/app/gen/types/CommunityDistrictGeoJson.ts new file mode 100644 index 0000000..8ae4394 --- /dev/null +++ b/app/gen/types/CommunityDistrictGeoJson.ts @@ -0,0 +1,21 @@ +import { CommunityDistrict } from "./CommunityDistrict"; +import { MultiPolygon } from "./MultiPolygon"; + +export const communityDistrictGeoJsonType = { + Feature: "Feature", +} as const; +export type CommunityDistrictGeoJsonType = + (typeof communityDistrictGeoJsonType)[keyof typeof communityDistrictGeoJsonType]; +export type CommunityDistrictGeoJson = { + /** + * @description Three character code to represent a borough and community district. + * @type string + */ + id: string; + /** + * @type string + */ + type: CommunityDistrictGeoJsonType; + properties: CommunityDistrict; + geometry: MultiPolygon; +}; diff --git a/app/gen/types/FindCapitalCommitmentTypes.ts b/app/gen/types/FindCapitalCommitmentTypes.ts new file mode 100644 index 0000000..b67cad1 --- /dev/null +++ b/app/gen/types/FindCapitalCommitmentTypes.ts @@ -0,0 +1,33 @@ +import type { Error } from "./Error"; +import type { CapitalCommitmentType } from "./CapitalCommitmentType"; + +/** + * @description An object containing all capital commitment types. + */ +export type FindCapitalCommitmentTypes200 = { + /** + * @type array + */ + capitalCommitmentTypes: CapitalCommitmentType[]; +}; +/** + * @description Invalid client request + */ +export type FindCapitalCommitmentTypes400 = Error; +/** + * @description Server side error + */ +export type FindCapitalCommitmentTypes500 = Error; +/** + * @description An object containing all capital commitment types. + */ +export type FindCapitalCommitmentTypesQueryResponse = { + /** + * @type array + */ + capitalCommitmentTypes: CapitalCommitmentType[]; +}; +export type FindCapitalCommitmentTypesQuery = { + Response: FindCapitalCommitmentTypesQueryResponse; + Errors: FindCapitalCommitmentTypes400 | FindCapitalCommitmentTypes500; +}; diff --git a/app/gen/types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts b/app/gen/types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts new file mode 100644 index 0000000..af47981 --- /dev/null +++ b/app/gen/types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId.ts @@ -0,0 +1,46 @@ +import type { Error } from "./Error"; +import type { CapitalProjectBudgetedGeoJson } from "./CapitalProjectBudgetedGeoJson"; + +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams = + { + /** + * @description Three character string of numbers representing managing agency + * @type string + */ + managingCode: string; + /** + * @description The id for the project, which combines with the managing code to make a unique id + * @type string + */ + capitalProjectId: string; + }; +/** + * @description A capital project geojson object + */ +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200 = + CapitalProjectBudgetedGeoJson; +/** + * @description Invalid client request + */ +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400 = Error; +/** + * @description Requested resource does not exist or is not available + */ +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404 = Error; +/** + * @description Server side error + */ +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500 = Error; +/** + * @description A capital project geojson object + */ +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse = + CapitalProjectBudgetedGeoJson; +export type FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQuery = { + Response: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse; + PathParams: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams; + Errors: + | FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400 + | FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404 + | FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500; +}; diff --git a/app/gen/types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts b/app/gen/types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts new file mode 100644 index 0000000..d1773b8 --- /dev/null +++ b/app/gen/types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId.ts @@ -0,0 +1,40 @@ +import type { Error } from "./Error"; +import type { CityCouncilDistrictGeoJson } from "./CityCouncilDistrictGeoJson"; + +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams = { + /** + * @description One or two character code to represent city council districts. + * @type string + */ + cityCouncilDistrictId: string; +}; +/** + * @description a city council district geojson object + */ +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId200 = + CityCouncilDistrictGeoJson; +/** + * @description Invalid client request + */ +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId400 = Error; +/** + * @description Requested resource does not exist or is not available + */ +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId404 = Error; +/** + * @description Server side error + */ +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId500 = Error; +/** + * @description a city council district geojson object + */ +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse = + CityCouncilDistrictGeoJson; +export type FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQuery = { + Response: FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse; + PathParams: FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams; + Errors: + | FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId400 + | FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId404 + | FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId500; +}; diff --git a/app/gen/types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts b/app/gen/types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts new file mode 100644 index 0000000..ab7cd9e --- /dev/null +++ b/app/gen/types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId.ts @@ -0,0 +1,49 @@ +import type { Error } from "./Error"; +import type { CommunityDistrictGeoJson } from "./CommunityDistrictGeoJson"; + +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams = + { + /** + * @description A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5. + * @type string + */ + boroughId: string; + /** + * @description The two character numeric string containing the number used to refer to the community district. + * @type string + */ + communityDistrictId: string; + }; +/** + * @description a community district geojson object + */ +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId200 = + CommunityDistrictGeoJson; +/** + * @description Invalid client request + */ +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400 = + Error; +/** + * @description Requested resource does not exist or is not available + */ +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404 = + Error; +/** + * @description Server side error + */ +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500 = + Error; +/** + * @description a community district geojson object + */ +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse = + CommunityDistrictGeoJson; +export type FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQuery = { + Response: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse; + PathParams: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams; + Errors: + | FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400 + | FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404 + | FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500; +}; diff --git a/app/gen/types/MultiPoint.ts b/app/gen/types/MultiPoint.ts new file mode 100644 index 0000000..4015a0b --- /dev/null +++ b/app/gen/types/MultiPoint.ts @@ -0,0 +1,21 @@ +import { Position } from "./Position"; + +export const multiPointType = { + MultiPoint: "MultiPoint", +} as const; +export type MultiPointType = + (typeof multiPointType)[keyof typeof multiPointType]; +/** + * @description A geojson implementation of a MultiPoint Simple Feature + */ +export type MultiPoint = { + /** + * @type string + */ + type: MultiPointType; + /** + * @description Array of position coordinate arrays. + * @type array + */ + coordinates: Position[]; +}; diff --git a/app/gen/types/index.ts b/app/gen/types/index.ts index 534e0f1..c2de845 100644 --- a/app/gen/types/index.ts +++ b/app/gen/types/index.ts @@ -2,22 +2,30 @@ export * from "./Agency"; export * from "./BadRequest"; export * from "./Borough"; export * from "./CapitalCommitment"; +export * from "./CapitalCommitmentType"; export * from "./CapitalProject"; export * from "./CapitalProjectBudgeted"; +export * from "./CapitalProjectBudgetedGeoJson"; export * from "./CapitalProjectCategory"; export * from "./CapitalProjectPage"; export * from "./CityCouncilDistrict"; +export * from "./CityCouncilDistrictGeoJson"; export * from "./CommunityDistrict"; +export * from "./CommunityDistrictGeoJson"; export * from "./Error"; export * from "./FindAgencies"; export * from "./FindBoroughs"; +export * from "./FindCapitalCommitmentTypes"; export * from "./FindCapitalCommitmentsByManagingCodeCapitalProjectId"; export * from "./FindCapitalProjectByManagingCodeCapitalProjectId"; +export * from "./FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId"; export * from "./FindCapitalProjectTiles"; export * from "./FindCapitalProjectsByBoroughIdCommunityDistrictId"; export * from "./FindCapitalProjectsByCityCouncilId"; +export * from "./FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId"; export * from "./FindCityCouncilDistrictTiles"; export * from "./FindCityCouncilDistricts"; +export * from "./FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId"; export * from "./FindCommunityDistrictTiles"; export * from "./FindCommunityDistrictsByBoroughId"; export * from "./FindLandUses"; @@ -33,6 +41,7 @@ export * from "./FindZoningDistrictClassesByZoningDistrictId"; export * from "./FindZoningDistrictsByTaxLotBbl"; export * from "./InternalServerError"; export * from "./LandUse"; +export * from "./MultiPoint"; export * from "./MultiPolygon"; export * from "./Mvt"; export * from "./NotFound"; diff --git a/app/gen/zod/capitalCommitmentTypeSchema.ts b/app/gen/zod/capitalCommitmentTypeSchema.ts new file mode 100644 index 0000000..78bef19 --- /dev/null +++ b/app/gen/zod/capitalCommitmentTypeSchema.ts @@ -0,0 +1,14 @@ +import { z } from "zod"; + +export const capitalCommitmentTypeSchema = z.object({ + code: z + .string() + .min(4) + .max(4) + .describe( + "The four character code to represent the capital commitment type", + ), + description: z + .string() + .describe("The description of the capital commitment type."), +}); diff --git a/app/gen/zod/capitalProjectBudgetedGeoJsonSchema.ts b/app/gen/zod/capitalProjectBudgetedGeoJsonSchema.ts new file mode 100644 index 0000000..51add77 --- /dev/null +++ b/app/gen/zod/capitalProjectBudgetedGeoJsonSchema.ts @@ -0,0 +1,16 @@ +import { multiPointSchema } from "./multiPointSchema"; +import { multiPolygonSchema } from "./multiPolygonSchema"; +import { capitalProjectBudgetedSchema } from "./capitalProjectBudgetedSchema"; +import { z } from "zod"; + +export const capitalProjectBudgetedGeoJsonSchema = z.object({ + id: z + .string() + .describe("The concatenation of the managing code and capital project id."), + type: z.enum(["Feature"]), + geometry: z.union([ + z.lazy(() => multiPointSchema), + z.lazy(() => multiPolygonSchema), + ]), + properties: z.lazy(() => capitalProjectBudgetedSchema), +}); diff --git a/app/gen/zod/cityCouncilDistrictGeoJsonSchema.ts b/app/gen/zod/cityCouncilDistrictGeoJsonSchema.ts new file mode 100644 index 0000000..106a937 --- /dev/null +++ b/app/gen/zod/cityCouncilDistrictGeoJsonSchema.ts @@ -0,0 +1,13 @@ +import { cityCouncilDistrictSchema } from "./cityCouncilDistrictSchema"; +import { multiPolygonSchema } from "./multiPolygonSchema"; +import { z } from "zod"; + +export const cityCouncilDistrictGeoJsonSchema = z.object({ + id: z + .string() + .regex(new RegExp("^([0-9]{1,2})$")) + .describe("One or two character code to represent city council districts."), + type: z.enum(["Feature"]), + properties: z.lazy(() => cityCouncilDistrictSchema), + geometry: z.lazy(() => multiPolygonSchema), +}); diff --git a/app/gen/zod/communityDistrictGeoJsonSchema.ts b/app/gen/zod/communityDistrictGeoJsonSchema.ts new file mode 100644 index 0000000..6d6a18b --- /dev/null +++ b/app/gen/zod/communityDistrictGeoJsonSchema.ts @@ -0,0 +1,15 @@ +import { communityDistrictSchema } from "./communityDistrictSchema"; +import { multiPolygonSchema } from "./multiPolygonSchema"; +import { z } from "zod"; + +export const communityDistrictGeoJsonSchema = z.object({ + id: z + .string() + .regex(new RegExp("^([0-9]{3})$")) + .describe( + "Three character code to represent a borough and community district.", + ), + type: z.enum(["Feature"]), + properties: z.lazy(() => communityDistrictSchema), + geometry: z.lazy(() => multiPolygonSchema), +}); diff --git a/app/gen/zod/findCapitalCommitmentTypesSchema.ts b/app/gen/zod/findCapitalCommitmentTypesSchema.ts new file mode 100644 index 0000000..e1ba494 --- /dev/null +++ b/app/gen/zod/findCapitalCommitmentTypesSchema.ts @@ -0,0 +1,24 @@ +import { z } from "zod"; +import { capitalCommitmentTypeSchema } from "./capitalCommitmentTypeSchema"; +import { errorSchema } from "./errorSchema"; + +/** + * @description An object containing all capital commitment types. + */ +export const findCapitalCommitmentTypes200Schema = z.object({ + capitalCommitmentTypes: z.array(z.lazy(() => capitalCommitmentTypeSchema)), +}); +/** + * @description Invalid client request + */ +export const findCapitalCommitmentTypes400Schema = z.lazy(() => errorSchema); +/** + * @description Server side error + */ +export const findCapitalCommitmentTypes500Schema = z.lazy(() => errorSchema); +/** + * @description An object containing all capital commitment types. + */ +export const findCapitalCommitmentTypesQueryResponseSchema = z.object({ + capitalCommitmentTypes: z.array(z.lazy(() => capitalCommitmentTypeSchema)), +}); diff --git a/app/gen/zod/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdSchema.ts b/app/gen/zod/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdSchema.ts new file mode 100644 index 0000000..ab4b76a --- /dev/null +++ b/app/gen/zod/findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdSchema.ts @@ -0,0 +1,43 @@ +import { z } from "zod"; +import { capitalProjectBudgetedGeoJsonSchema } from "./capitalProjectBudgetedGeoJsonSchema"; +import { errorSchema } from "./errorSchema"; + +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParamsSchema = + z.object({ + managingCode: z + .string() + .regex(new RegExp("^([0-9]{3})$")) + .describe( + "Three character string of numbers representing managing agency", + ), + capitalProjectId: z + .string() + .describe( + "The id for the project, which combines with the managing code to make a unique id", + ), + }); +/** + * @description A capital project geojson object + */ +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectId200Schema = + z.lazy(() => capitalProjectBudgetedGeoJsonSchema); +/** + * @description Invalid client request + */ +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectId400Schema = + z.lazy(() => errorSchema); +/** + * @description Requested resource does not exist or is not available + */ +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectId404Schema = + z.lazy(() => errorSchema); +/** + * @description Server side error + */ +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectId500Schema = + z.lazy(() => errorSchema); +/** + * @description A capital project geojson object + */ +export const findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponseSchema = + z.lazy(() => capitalProjectBudgetedGeoJsonSchema); diff --git a/app/gen/zod/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdSchema.ts b/app/gen/zod/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdSchema.ts new file mode 100644 index 0000000..81d3a19 --- /dev/null +++ b/app/gen/zod/findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdSchema.ts @@ -0,0 +1,38 @@ +import { z } from "zod"; +import { cityCouncilDistrictGeoJsonSchema } from "./cityCouncilDistrictGeoJsonSchema"; +import { errorSchema } from "./errorSchema"; + +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParamsSchema = + z.object({ + cityCouncilDistrictId: z + .string() + .regex(new RegExp("^([0-9]{1,2})$")) + .describe( + "One or two character code to represent city council districts.", + ), + }); +/** + * @description a city council district geojson object + */ +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictId200Schema = + z.lazy(() => cityCouncilDistrictGeoJsonSchema); +/** + * @description Invalid client request + */ +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictId400Schema = + z.lazy(() => errorSchema); +/** + * @description Requested resource does not exist or is not available + */ +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictId404Schema = + z.lazy(() => errorSchema); +/** + * @description Server side error + */ +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictId500Schema = + z.lazy(() => errorSchema); +/** + * @description a city council district geojson object + */ +export const findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponseSchema = + z.lazy(() => cityCouncilDistrictGeoJsonSchema); diff --git a/app/gen/zod/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdSchema.ts b/app/gen/zod/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdSchema.ts new file mode 100644 index 0000000..5aabc3d --- /dev/null +++ b/app/gen/zod/findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdSchema.ts @@ -0,0 +1,44 @@ +import { z } from "zod"; +import { communityDistrictGeoJsonSchema } from "./communityDistrictGeoJsonSchema"; +import { errorSchema } from "./errorSchema"; + +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParamsSchema = + z.object({ + boroughId: z + .string() + .regex(new RegExp("^([0-9]{1})$")) + .describe( + "A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.", + ), + communityDistrictId: z + .string() + .regex(new RegExp("^([0-9]{2})$")) + .describe( + "The two character numeric string containing the number used to refer to the community district.", + ), + }); +/** + * @description a community district geojson object + */ +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId200Schema = + z.lazy(() => communityDistrictGeoJsonSchema); +/** + * @description Invalid client request + */ +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400Schema = + z.lazy(() => errorSchema); +/** + * @description Requested resource does not exist or is not available + */ +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404Schema = + z.lazy(() => errorSchema); +/** + * @description Server side error + */ +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500Schema = + z.lazy(() => errorSchema); +/** + * @description a community district geojson object + */ +export const findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponseSchema = + z.lazy(() => communityDistrictGeoJsonSchema); diff --git a/app/gen/zod/index.ts b/app/gen/zod/index.ts index 2dddaea..a0f4125 100644 --- a/app/gen/zod/index.ts +++ b/app/gen/zod/index.ts @@ -2,22 +2,30 @@ export * from "./agencySchema"; export * from "./badRequestSchema"; export * from "./boroughSchema"; export * from "./capitalCommitmentSchema"; +export * from "./capitalCommitmentTypeSchema"; +export * from "./capitalProjectBudgetedGeoJsonSchema"; export * from "./capitalProjectBudgetedSchema"; export * from "./capitalProjectCategorySchema"; export * from "./capitalProjectPageSchema"; export * from "./capitalProjectSchema"; +export * from "./cityCouncilDistrictGeoJsonSchema"; export * from "./cityCouncilDistrictSchema"; +export * from "./communityDistrictGeoJsonSchema"; export * from "./communityDistrictSchema"; export * from "./errorSchema"; export * from "./findAgenciesSchema"; export * from "./findBoroughsSchema"; +export * from "./findCapitalCommitmentTypesSchema"; export * from "./findCapitalCommitmentsByManagingCodeCapitalProjectIdSchema"; export * from "./findCapitalProjectByManagingCodeCapitalProjectIdSchema"; +export * from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdSchema"; export * from "./findCapitalProjectTilesSchema"; export * from "./findCapitalProjectsByBoroughIdCommunityDistrictIdSchema"; export * from "./findCapitalProjectsByCityCouncilIdSchema"; +export * from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdSchema"; export * from "./findCityCouncilDistrictTilesSchema"; export * from "./findCityCouncilDistrictsSchema"; +export * from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdSchema"; export * from "./findCommunityDistrictTilesSchema"; export * from "./findCommunityDistrictsByBoroughIdSchema"; export * from "./findLandUsesSchema"; @@ -33,6 +41,7 @@ export * from "./findZoningDistrictClassesSchema"; export * from "./findZoningDistrictsByTaxLotBblSchema"; export * from "./internalServerErrorSchema"; export * from "./landUseSchema"; +export * from "./multiPointSchema"; export * from "./multiPolygonSchema"; export * from "./mvtSchema"; export * from "./notFoundSchema"; diff --git a/app/gen/zod/multiPointSchema.ts b/app/gen/zod/multiPointSchema.ts new file mode 100644 index 0000000..2327871 --- /dev/null +++ b/app/gen/zod/multiPointSchema.ts @@ -0,0 +1,14 @@ +import { positionSchema } from "./positionSchema"; +import { z } from "zod"; + +/** + * @description A geojson implementation of a MultiPoint Simple Feature + */ +export const multiPointSchema = z + .object({ + type: z.enum(["MultiPoint"]), + coordinates: z + .array(z.lazy(() => positionSchema)) + .describe("Array of position coordinate arrays."), + }) + .describe("A geojson implementation of a MultiPoint Simple Feature"); diff --git a/app/gen/zod/operations.ts b/app/gen/zod/operations.ts index 5c18fb1..4e7c160 100644 --- a/app/gen/zod/operations.ts +++ b/app/gen/zod/operations.ts @@ -15,6 +15,13 @@ import { findCommunityDistrictsByBoroughId500Schema, findCommunityDistrictsByBoroughIdPathParamsSchema, } from "./findCommunityDistrictsByBoroughIdSchema"; +import { + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponseSchema, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400Schema, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404Schema, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500Schema, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParamsSchema, +} from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdSchema"; import { findCapitalProjectsByBoroughIdCommunityDistrictIdQueryResponseSchema, findCapitalProjectsByBoroughIdCommunityDistrictId400Schema, @@ -23,6 +30,11 @@ import { findCapitalProjectsByBoroughIdCommunityDistrictIdPathParamsSchema, findCapitalProjectsByBoroughIdCommunityDistrictIdQueryParamsSchema, } from "./findCapitalProjectsByBoroughIdCommunityDistrictIdSchema"; +import { + findCapitalCommitmentTypesQueryResponseSchema, + findCapitalCommitmentTypes400Schema, + findCapitalCommitmentTypes500Schema, +} from "./findCapitalCommitmentTypesSchema"; import { findCapitalCommitmentsByManagingCodeCapitalProjectIdQueryResponseSchema, findCapitalCommitmentsByManagingCodeCapitalProjectId400Schema, @@ -30,6 +42,13 @@ import { findCapitalCommitmentsByManagingCodeCapitalProjectId500Schema, findCapitalCommitmentsByManagingCodeCapitalProjectIdPathParamsSchema, } from "./findCapitalCommitmentsByManagingCodeCapitalProjectIdSchema"; +import { + findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponseSchema, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectId400Schema, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectId404Schema, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectId500Schema, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParamsSchema, +} from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdSchema"; import { findCapitalProjectByManagingCodeCapitalProjectIdQueryResponseSchema, findCapitalProjectByManagingCodeCapitalProjectId400Schema, @@ -48,6 +67,13 @@ import { findCityCouncilDistricts400Schema, findCityCouncilDistricts500Schema, } from "./findCityCouncilDistrictsSchema"; +import { + findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponseSchema, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictId400Schema, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictId404Schema, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictId500Schema, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParamsSchema, +} from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdSchema"; import { findCapitalProjectsByCityCouncilIdQueryResponseSchema, findCapitalProjectsByCityCouncilId400Schema, @@ -196,6 +222,27 @@ export const operations = { 500: findCommunityDistrictsByBoroughId500Schema, }, }, + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId: { + request: undefined, + parameters: { + path: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParamsSchema, + query: undefined, + header: undefined, + }, + responses: { + 200: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponseSchema, + 400: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400Schema, + 404: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404Schema, + 500: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500Schema, + default: + findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponseSchema, + }, + errors: { + 400: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId400Schema, + 404: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId404Schema, + 500: findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId500Schema, + }, + }, findCapitalProjectsByBoroughIdCommunityDistrictId: { request: undefined, parameters: { @@ -217,6 +264,24 @@ export const operations = { 500: findCapitalProjectsByBoroughIdCommunityDistrictId500Schema, }, }, + findCapitalCommitmentTypes: { + request: undefined, + parameters: { + path: undefined, + query: undefined, + header: undefined, + }, + responses: { + 200: findCapitalCommitmentTypesQueryResponseSchema, + 400: findCapitalCommitmentTypes400Schema, + 500: findCapitalCommitmentTypes500Schema, + default: findCapitalCommitmentTypesQueryResponseSchema, + }, + errors: { + 400: findCapitalCommitmentTypes400Schema, + 500: findCapitalCommitmentTypes500Schema, + }, + }, findCapitalCommitmentsByManagingCodeCapitalProjectId: { request: undefined, parameters: { @@ -238,6 +303,27 @@ export const operations = { 500: findCapitalCommitmentsByManagingCodeCapitalProjectId500Schema, }, }, + findCapitalProjectGeoJsonByManagingCodeCapitalProjectId: { + request: undefined, + parameters: { + path: findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParamsSchema, + query: undefined, + header: undefined, + }, + responses: { + 200: findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponseSchema, + 400: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId400Schema, + 404: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId404Schema, + 500: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId500Schema, + default: + findCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponseSchema, + }, + errors: { + 400: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId400Schema, + 404: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId404Schema, + 500: findCapitalProjectGeoJsonByManagingCodeCapitalProjectId500Schema, + }, + }, findCapitalProjectByManagingCodeCapitalProjectId: { request: undefined, parameters: { @@ -295,6 +381,27 @@ export const operations = { 500: findCityCouncilDistricts500Schema, }, }, + findCityCouncilDistrictGeoJsonByCityCouncilDistrictId: { + request: undefined, + parameters: { + path: findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParamsSchema, + query: undefined, + header: undefined, + }, + responses: { + 200: findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponseSchema, + 400: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId400Schema, + 404: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId404Schema, + 500: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId500Schema, + default: + findCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponseSchema, + }, + errors: { + 400: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId400Schema, + 404: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId404Schema, + 500: findCityCouncilDistrictGeoJsonByCityCouncilDistrictId500Schema, + }, + }, findCapitalProjectsByCityCouncilId: { request: undefined, parameters: { @@ -575,13 +682,24 @@ export const paths = { "/boroughs/{boroughId}/community-districts": { get: operations["findCommunityDistrictsByBoroughId"], }, + "/boroughs/{boroughId}/community-districts/{communityDistrictId}/geojson": { + get: operations[ + "findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId" + ], + }, "/boroughs/{boroughId}/community-districts/{communityDistrictId}/capital-projects": { get: operations["findCapitalProjectsByBoroughIdCommunityDistrictId"], }, + "/capital-commitment-types": { + get: operations["findCapitalCommitmentTypes"], + }, "/capital-projects/{managingCode}/{capitalProjectId}/capital-commitments": { get: operations["findCapitalCommitmentsByManagingCodeCapitalProjectId"], }, + "/capital-projects/{managingCode}/{capitalProjectId}/geojson": { + get: operations["findCapitalProjectGeoJsonByManagingCodeCapitalProjectId"], + }, "/capital-projects/{managingCode}/{capitalProjectId}": { get: operations["findCapitalProjectByManagingCodeCapitalProjectId"], }, @@ -591,6 +709,9 @@ export const paths = { "/city-council-districts": { get: operations["findCityCouncilDistricts"], }, + "/city-council-districts/{cityCouncilDistrictId}/geojson": { + get: operations["findCityCouncilDistrictGeoJsonByCityCouncilDistrictId"], + }, "/city-council-districts/{cityCouncilDistrictId}/capital-projects": { get: operations["findCapitalProjectsByCityCouncilId"], }, diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index 0b2a8a7..2d24ed6 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -19,6 +19,7 @@ export default function Index() { + + + + + + Commitment Details + + + ) : ( + + ) + } + color={"gray.600"} + backgroundColor={"inherit"} + _hover={{ + border: "none", + backgroundColor: "blackAlpha.100", + }} + onClick={toggleCommitmentsAreVisible} + /> + + {commitmentsAreVisible && ( + + )} + + + ); } diff --git a/package-lock.json b/package-lock.json index 8ebf466..db060da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", "@kubb/swagger-client": "^2.23.2", - "@nycplanning/streetscape": "^0.10.1", + "@nycplanning/streetscape": "^0.10.3", "@remix-run/node": "^2.7.2", "@remix-run/react": "^2.7.2", "@remix-run/serve": "^2.7.2", @@ -4770,9 +4770,9 @@ } }, "node_modules/@nycplanning/streetscape": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@nycplanning/streetscape/-/streetscape-0.10.1.tgz", - "integrity": "sha512-nAdchjueQ8Js4KP7G0lk/iE5QOS+M9FIYzgY+z/hV0Lda9AvgWIMPAw3GnnN3y/GVITV2wNujM5lgyi6u1grJQ==", + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@nycplanning/streetscape/-/streetscape-0.10.3.tgz", + "integrity": "sha512-R/EuWDpPEgr5i4Q43S9cB6bd7vy4uexCK+7uERodU8qj7I6bSugpxeKpXOPcsFlAOCKLrvIGtFj9S2mGdduV6A==", "hasInstallScript": true, "dependencies": { "@chakra-ui/cli": "^2.4.1", diff --git a/package.json b/package.json index 6a84c0e..7b8d4cf 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", "@kubb/swagger-client": "^2.23.2", - "@nycplanning/streetscape": "^0.10.1", + "@nycplanning/streetscape": "^0.10.3", "@remix-run/node": "^2.7.2", "@remix-run/react": "^2.7.2", "@remix-run/serve": "^2.7.2",