Task/ozmap 6953 documentar change requests#65
Task/ozmap 6953 documentar change requests#65julio-silveira-ozmap wants to merge 6 commits intomainfrom
Conversation
… update package version to 1.1.8
There was a problem hiding this comment.
Pull request overview
Adds new SDK surface area for OZMAP-6953 by introducing Change Request and Polygon Report entities/models, plus BoxStructure support and related documentation.
Changes:
- Added new proxies and models for
ChangeRequest,BoxStructureChangeRequest,BoxCreateRequest, andPolygonReport. - Added
BoxStructuremodel (topology + design) and newgetStructure/updateStructuremethods onboxandbuildingproxies. - Added documentation pages for the new modules and introduced an alpha publishing GitHub Action.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/proxy/entities/index.ts | Re-exports new changeRequest proxies and PolygonReport proxy. |
| src/proxy/entities/changeRequest/index.ts | Barrel exports for change request-related proxies. |
| src/proxy/entities/changeRequest/ChangeRequest.ts | Read-only proxy for base change requests (change-requests). |
| src/proxy/entities/changeRequest/BoxStructureChangeRequest.ts | Writable proxy for box-structure change requests + review endpoint. |
| src/proxy/entities/changeRequest/BoxCreateRequest.ts | Writable proxy for box-create requests + approve/reject endpoints. |
| src/proxy/entities/PolygonReport.ts | Writable proxy for polygon reports + custom operations (move/tags/project/elements reports). |
| src/proxy/entities/Building.ts | Adds structure fetch/update helpers using base-box routes. |
| src/proxy/entities/Box.ts | Adds structure fetch/update helpers using base-box routes. |
| src/interface/model/index.ts | Exposes new model modules via top-level model exports. |
| src/interface/model/PolygonReport/index.ts | PolygonReport model barrel exports. |
| src/interface/model/PolygonReport/PolygonReportData.ts | Zod schema/types for detailed polygon report data payload. |
| src/interface/model/PolygonReport/PolygonReport.ts | Zod schema/types for PolygonReport + DTOs + auxiliary operations payloads. |
| src/interface/model/ChangeRequest/index.ts | ChangeRequest model barrel exports. |
| src/interface/model/ChangeRequest/ChangeTopologyActions.ts | Zod schema/types for discriminated union of topology-change actions. |
| src/interface/model/ChangeRequest/ChangeRequest.ts | Base change request schema/types (kinds/statuses/review structure). |
| src/interface/model/ChangeRequest/BoxStructureChangeRequest.ts | Zod schema/types for structure change requests + create DTO. |
| src/interface/model/ChangeRequest/BoxCreateRequest.ts | Zod schema/types for box-create requests + create/approve/reject DTOs. |
| src/interface/model/BoxStructure/index.ts | BoxStructure module barrel exports. |
| src/interface/model/BoxStructure/TopologyConnectors.ts | Connector-related topology schemas/types. |
| src/interface/model/BoxStructure/TopologyClients.ts | Client-related topology schemas/types. |
| src/interface/model/BoxStructure/TopologyCables.ts | Cable/drop topology schemas/types. |
| src/interface/model/BoxStructure/Topology.ts | Top-level topology schema/type composition. |
| src/interface/model/BoxStructure/Postit.ts | Post-it schema/types used in design positions. |
| src/interface/model/BoxStructure/Positions.ts | Shared position/orientation schemas/types for design. |
| src/interface/model/BoxStructure/BoxStructure.ts | BoxStructure schema/type (topology + design). |
| src/interface/model/BoxStructure/BoxDesign.ts | BoxDesign schema/type (positions/template metadata). |
| src/OZMapSDK.ts | Wires new proxies onto the SDK instance (changeRequest, boxStructureChangeRequest, boxCreateRequest, polygonReport). |
| package.json | Bumps package version to 1.1.8. |
| docs/POLYGONREPORT.md | Adds usage + model docs for PolygonReport operations. |
| docs/CHANGEREQUEST.md | Adds docs for base ChangeRequest and proxies (contains a formatting issue). |
| docs/BOXSTRUCTURECHANGEREQUEST.md | Adds docs for BoxStructureChangeRequest model and review flow. |
| docs/BOXDESIGN.md | Adds docs for BoxDesign/Topology/BoxStructure and structure operations. |
| docs/BOXCREATEREQUEST.md | Adds docs for BoxCreateRequest create/approve/reject flows. |
| .github/workflows/publish-alpha.yml | Adds workflow to publish to npm under the alpha dist-tag when pushing *-alpha* tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| public async getStructure(id: Box['id'], options?: Parameters<Api['get']>[0]['options']): Promise<BoxStructure> { | ||
| const [topology, design] = await Promise.all([ | ||
| this.apiInstance.get<BoxStructure['topology']>({ | ||
| route: `base-boxes/${id}/topology`, | ||
| options, | ||
| }), | ||
| this.apiInstance.get<BoxStructure['design']>({ | ||
| route: `base-boxes/${id}/design`, | ||
| options, | ||
| }), | ||
| ]); | ||
|
|
||
| return { topology, design }; | ||
| } | ||
|
|
||
| public async updateStructure( | ||
| id: Box['id'], | ||
| data: BoxStructure, | ||
| options?: Parameters<Api['patch']>[0]['options'], | ||
| ): Promise<void> { | ||
| return this.apiInstance.patch({ | ||
| route: `base-boxes/${id}/structure`, | ||
| inputData: { structure: data }, | ||
| options, | ||
| }); | ||
| } |
| public async getStructure(id: Building['id'], options?: Parameters<Api['get']>[0]['options']): Promise<BoxStructure> { | ||
| const [topology, design] = await Promise.all([ | ||
| this.apiInstance.get<BoxStructure['topology']>({ | ||
| route: `base-boxes/${id}/topology`, | ||
| options, | ||
| }), | ||
| this.apiInstance.get<BoxStructure['design']>({ | ||
| route: `base-boxes/${id}/design`, | ||
| options, | ||
| }), | ||
| ]); | ||
|
|
||
| return { topology, design }; | ||
| } | ||
|
|
||
| public async updateStructure( | ||
| id: Building['id'], | ||
| data: BoxStructure, | ||
| options?: Parameters<Api['patch']>[0]['options'], | ||
| ): Promise<void> { | ||
| return this.apiInstance.patch({ | ||
| route: `base-boxes/${id}/structure`, | ||
| inputData: { structure: data }, | ||
| options, | ||
| }); |
| }); | ||
| ``` |
There was a problem hiding this comment.
Pull request overview
This PR (OZMAP-6953) expands the SDK surface to support change requests (including box structure and box creation flows), adds polygon report support, and introduces box/building structure operations plus associated interface models and documentation.
Changes:
- Added new proxies for
changeRequest,boxStructureChangeRequest,boxCreateRequest, andpolygonReport, and wired them intoOZMapSDK. - Introduced new interface models/schemas for
ChangeRequest,BoxStructure, andPolygonReport(including many sub-schemas). - Added new documentation pages for the new modules and added an alpha publish GitHub Actions workflow.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/proxy/entities/index.ts | Exposes new change request exports and PolygonReportProxy from proxy barrel. |
| src/proxy/entities/changeRequest/index.ts | Adds change request proxy entrypoints. |
| src/proxy/entities/changeRequest/ChangeRequest.ts | Read-only proxy for base change requests (change-requests). |
| src/proxy/entities/changeRequest/BoxStructureChangeRequest.ts | Writable proxy for box-structure change requests + review operation. |
| src/proxy/entities/changeRequest/BoxCreateRequest.ts | Writable proxy for box create requests + approve/reject operations. |
| src/proxy/entities/PolygonReport.ts | Adds polygon report proxy + custom operations (move/tags/project/elements reports). |
| src/proxy/entities/Building.ts | Adds getStructure/updateStructure for buildings via base-boxes endpoints. |
| src/proxy/entities/Box.ts | Adds getStructure/updateStructure for boxes via base-boxes endpoints. |
| src/interface/model/index.ts | Re-exports new model modules (BoxStructure/ChangeRequest/PolygonReport). |
| src/interface/model/PolygonReport/index.ts | PolygonReport model barrel exports. |
| src/interface/model/PolygonReport/PolygonReportData.ts | Adds detailed PolygonReport data schemas/types. |
| src/interface/model/PolygonReport/PolygonReport.ts | Adds PolygonReport schemas/types + DTOs and operation payload schemas. |
| src/interface/model/ChangeRequest/index.ts | ChangeRequest model barrel exports. |
| src/interface/model/ChangeRequest/ChangeTopologyActions.ts | Adds schemas/types for describing topology change actions. |
| src/interface/model/ChangeRequest/ChangeRequest.ts | Adds base change request schemas/types and enums. |
| src/interface/model/ChangeRequest/BoxStructureChangeRequest.ts | Adds BoxStructureChangeRequest schemas/types. |
| src/interface/model/ChangeRequest/BoxCreateRequest.ts | Adds BoxCreateRequest schemas/types + approve/reject payload schemas. |
| src/interface/model/BoxStructure/index.ts | BoxStructure model barrel exports. |
| src/interface/model/BoxStructure/TopologyConnectors.ts | Adds connector/splitter/DIO topology schemas. |
| src/interface/model/BoxStructure/TopologyClients.ts | Adds client topology schema. |
| src/interface/model/BoxStructure/TopologyCables.ts | Adds cable/drop topology schemas (plus extra fiber data). |
| src/interface/model/BoxStructure/Topology.ts | Adds Topology schema tying together box structure topology pieces. |
| src/interface/model/BoxStructure/Postit.ts | Adds Post-it schemas for design positions. |
| src/interface/model/BoxStructure/Positions.ts | Adds positions/geometry schemas used in design. |
| src/interface/model/BoxStructure/BoxStructure.ts | Adds BoxStructure schema (topology + design). |
| src/interface/model/BoxStructure/BoxDesign.ts | Adds BoxDesign schema and design position structures. |
| src/OZMapSDK.ts | Wires new proxies onto the SDK instance. |
| package.json | Bumps package version to 1.1.8. |
| docs/POLYGONREPORT.md | Adds PolygonReport module documentation and usage examples. |
| docs/CHANGEREQUEST.md | Adds base ChangeRequest documentation and usage examples. |
| docs/BOXSTRUCTURECHANGEREQUEST.md | Adds BoxStructureChangeRequest documentation and examples. |
| docs/BOXDESIGN.md | Adds BoxDesign/BoxStructure/Topology documentation and structure operations examples. |
| docs/BOXCREATEREQUEST.md | Adds BoxCreateRequest documentation and examples. |
| .github/workflows/publish-alpha.yml | Adds tag-driven alpha publish workflow to npm. |
Comments suppressed due to low confidence (1)
docs/CHANGEREQUEST.md:74
- The example code block has extra trailing lines after the closing ``` (there is a stray
});and an extra code fence). This breaks Markdown rendering/copy-paste of the example; please remove the stray lines so the code block closes cleanly.
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| public async reviewById( | ||
| id: BaseModel['id'], | ||
| data: { status: 'approved' | 'rejected'; observation?: string }, | ||
| options?: Parameters<Api['patch']>[0]['options'], | ||
| ): Promise<void> { |
| public async createCompleteElementsReport( | ||
| data: ElementsReport, | ||
| options?: Parameters<Api['post']>[0]['options'], | ||
| ): Promise<unknown> { | ||
| const parsedData = ElementsReportSchema.parse(data); | ||
| return this.apiInstance.post({ | ||
| route: `${this._reportsRoute}/elements/complete`, | ||
| inputData: parsedData, | ||
| options, | ||
| }); | ||
| } | ||
|
|
||
| public async createCountElementsReport( | ||
| data: ElementsReport, | ||
| options?: Parameters<Api['post']>[0]['options'], | ||
| ): Promise<unknown> { | ||
| const parsedData = ElementsReportSchema.parse(data); | ||
| return this.apiInstance.post({ | ||
| route: `${this._reportsRoute}/elements/count`, | ||
| inputData: parsedData, | ||
| options, |
| }; | ||
| name?: string | null; | ||
| project: string; | ||
| isGeneralReport: boolean; |
| const TopologyCablesWithOptionalCableTypeSchema = TopologyCablesSchema.extend({ | ||
| cableType: stringOrObjectId.optional(), | ||
| }); | ||
|
|
||
| const CustomTopologySchema = TopologySchema.extend({ | ||
| cables: z.record(TopologyCablesWithOptionalCableTypeSchema).optional(), |
|
Gabriiel-Rabeloo
left a comment
There was a problem hiding this comment.
só um nit e é valido adicionar a referencia das novas documentações no readme principal para já aparecer na pagina inicial aqui e no npm igual os outros elementos
|
|
||
| const DesignPositionsSchema = z.object({ | ||
| cables: ElementPositionsSchema.optional(), | ||
| connectors: ElementPositionsSchema.optional(), | ||
| dios: ElementPositionsSchema.optional(), | ||
| drops: ElementPositionsSchema.optional(), | ||
| fusions: ElementPositionsSchema.optional(), | ||
| splitters: ElementPositionsSchema.optional(), | ||
| switches: ElementPositionsSchema.optional(), | ||
| fibers: ConnectablePositionsSchema.optional(), | ||
| cords: ConnectablePositionsSchema.optional(), | ||
| passings: ConnectablePositionsSchema.optional(), | ||
| postits: PostItPositionsSchema.optional(), | ||
| children: z.array(z.record(z.unknown())).optional(), | ||
| }); |
There was a problem hiding this comment.
nit:
| const DesignPositionsSchema = z.object({ | |
| cables: ElementPositionsSchema.optional(), | |
| connectors: ElementPositionsSchema.optional(), | |
| dios: ElementPositionsSchema.optional(), | |
| drops: ElementPositionsSchema.optional(), | |
| fusions: ElementPositionsSchema.optional(), | |
| splitters: ElementPositionsSchema.optional(), | |
| switches: ElementPositionsSchema.optional(), | |
| fibers: ConnectablePositionsSchema.optional(), | |
| cords: ConnectablePositionsSchema.optional(), | |
| passings: ConnectablePositionsSchema.optional(), | |
| postits: PostItPositionsSchema.optional(), | |
| children: z.array(z.record(z.unknown())).optional(), | |
| }); | |
| const DesignPositionsSchema = z.object({ | |
| cables: ElementPositionsSchema, | |
| connectors: ElementPositionsSchema, | |
| dios: ElementPositionsSchema, | |
| drops: ElementPositionsSchema, | |
| fusions: ElementPositionsSchema, | |
| splitters: ElementPositionsSchema, | |
| switches: ElementPositionsSchema, | |
| fibers: ConnectablePositionsSchema, | |
| cords: ConnectablePositionsSchema, | |
| passings: ConnectablePositionsSchema, | |
| postits: PostItPositionsSchema, | |
| children: z.array(z.record(z.unknown())), | |
| }).partial(); |



OZMAP-6953
Descrição das alterações: