Skip to content

feat: Added contract for the proposed generic endpoint#122

Open
NethmikaKekuu wants to merge 1 commit into
LDFLK:mainfrom
NethmikaKekuu:feat/bodies-generic
Open

feat: Added contract for the proposed generic endpoint#122
NethmikaKekuu wants to merge 1 commit into
LDFLK:mainfrom
NethmikaKekuu:feat/bodies-generic

Conversation

@NethmikaKekuu

Copy link
Copy Markdown
Member

Summary

  • Proposes a single generic endpoint, POST /v1/entities-by-relation/{parent_id}?relation=..., to replace having one endpoint per hierarchy level. It covers both existing departments-by-portfolio-style traversal and the newly needed department→body traversal, and any future level, without adding a new endpoint each time.
  • relation is a query param constrained by an OpenAPI enum to AS_DEPARTMENT / AS_BODY — a deliberate whitelist so the endpoint can't be used to traverse unrelated relation types (e.g. AS_APPOINTED, AS_PRESIDENT).
  • Response shape generalizes the existing departments-by-portfolio fields (totalDepartments/newDepartments/departmentList) into relation-agnostic total/new/entityList, so the same shape works for departments, bodies, or any future level.
  • This PR is contract-only — no implementation yet. Opening it for API design review before writing the router/service code.

Test plan

  • Contract reviewed and approved
  • organisation_api_contract.yaml validated to parse as valid OpenAPI YAML

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new endpoint /v1/entities-by-relation/{parent_id} to retrieve related entities in the organisation hierarchy. The feedback suggests changing the tag spelling from Organization to Organisation to match the rest of the project and avoid duplicate tags in generated documentation. Additionally, it is recommended to explicitly mark the top-level response fields (total, new, entityList) and item-level fields (isNew, hasData) as required in the schema to ensure consistent client model generation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread gi_service/contract/rest/organisation_api_contract.yaml
Comment thread gi_service/contract/rest/organisation_api_contract.yaml
Comment thread gi_service/contract/rest/organisation_api_contract.yaml

@ChanukaUOJ ChanukaUOJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial Comments

Comment on lines +767 to +775
- name: relation
in: query
required: true
description: Relation to traverse.
schema:
type: string
enum:
- AS_DEPARTMENT
- AS_BODY

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move this filters to the request body. and it should support for relation lists

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will move it to the request body after other comments are received

Comment thread gi_service/contract/rest/organisation_api_contract.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants