Skip to content

feat(ui-reserves): add service layer methods and types#3217

Open
hdinia wants to merge 2 commits into
devfrom
feature/reserves-api-methods
Open

feat(ui-reserves): add service layer methods and types#3217
hdinia wants to merge 2 commits into
devfrom
feature/reserves-api-methods

Conversation

@hdinia
Copy link
Copy Markdown
Member

@hdinia hdinia commented May 21, 2026

No description provided.

@hdinia hdinia requested a review from skamril May 21, 2026 09:00
@hdinia hdinia self-assigned this May 21, 2026
@skamril skamril requested a review from Copilot May 22, 2026 08:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated “reserves” API service layer (schemas/types + CRUD functions) and wires it into TanStack React Query (keys, queries, mutations) so the UI can fetch/update reserve definitions and global parameters per study area.

Changes:

  • Introduce Zod schemas and inferred TS types for reserve definitions and global parameters.
  • Add API client methods for listing/getting/creating/updating/deleting reserves + get/update global parameters.
  • Add React Query keys/queries/mutations for reserves data access.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
webapp/src/services/api/studies/areas/reserves/types.ts Adds inferred types and request parameter interfaces for reserves endpoints.
webapp/src/services/api/studies/areas/reserves/schemas.ts Defines Zod schemas for reserves responses and request payload validation.
webapp/src/services/api/studies/areas/reserves/index.ts Implements HTTP methods for reserves CRUD and global parameters endpoints.
webapp/src/queries/reserves/queries.ts Adds React Query query options for reserves list/detail/global parameters.
webapp/src/queries/reserves/mutations.ts Adds React Query mutation options for create/update/delete and global-parameters update.
webapp/src/queries/reserves/keys.ts Introduces query/mutation key builders for reserves-related caching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/src/services/api/studies/areas/reserves/schemas.ts Outdated
return [...reserveKeys.list(studyId, areaId), "updateReserve"];
},
delete: (studyId: StudyMetadata["id"], areaId: AreaWithId["id"]) => {
return [...reserveKeys.list(studyId, areaId), "deleteReserves"];
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.

"deleteReserve" without "s", or rename deleteMany

Copy link
Copy Markdown
Member Author

@hdinia hdinia May 29, 2026

Choose a reason for hiding this comment

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

the key is correctly named, it can delete one or more reserves. (not only multiple) singular "deleteReserve" is wrong too for the same reason

Comment thread webapp/src/queries/reserves/keys.ts Outdated
Comment thread webapp/src/services/api/studies/areas/reserves/index.ts Outdated
Comment thread webapp/src/services/api/studies/areas/reserves/index.ts
Comment thread webapp/src/services/api/studies/areas/reserves/schemas.ts Outdated
Comment thread webapp/src/services/api/studies/areas/reserves/schemas.ts Outdated
Comment thread webapp/src/services/api/studies/areas/reserves/schemas.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants