Skip to content

UN-2283: get finance type#513

Merged
iDome89 merged 4 commits into
UN-2274-other-costsfrom
UN-2283-get-finance-type
Jan 29, 2026
Merged

UN-2283: get finance type#513
iDome89 merged 4 commits into
UN-2274-other-costsfrom
UN-2283-get-finance-type

Conversation

@Kariamos
Copy link
Copy Markdown
Contributor

This pull request introduces a new API endpoint for retrieving finance types associated with a campaign, updates the OpenAPI schema and TypeScript types to support this endpoint, and adds comprehensive tests to ensure correct behavior and permissions. It also updates a database dependency and adds several default values to the OpenAPI schema.

New API Endpoint and Implementation:

  • Added a new GET endpoint at /campaigns/{campaign}/finance/type to fetch finance types for a campaign, including OpenAPI documentation and TypeScript schema definitions. [1] [2] [3]
  • Implemented the endpoint logic in src/routes/campaigns/campaignId/finance/type/_get/index.ts, including permission checks and response formatting.

Testing:

  • Added a full test suite for the new endpoint in index.spec.ts, covering authentication, authorization, and response structure.

Schema and Type Updates:

  • Updated the OpenAPI schema and TypeScript types to include the new endpoint, its parameters, and response structure. [1] [2]

Other Improvements:

  • Added several @default values to schema fields in src/schema.ts to improve documentation and type safety. [1] [2] [3] [4] [5] [6] [7]
  • Updated the @appquality/tryber-database dependency version in package.json for improved compatibility or bug fixes.

@Kariamos Kariamos added the core Team Core activity label Jan 29, 2026
@github-actions
Copy link
Copy Markdown

Tests difference:

New Tests

< GET /campaigns/campaignId/finance/type - Should return 200 if logged in as admin
< GET /campaigns/campaignId/finance/type - Should return 403 if logged in as not admin user
< GET /campaigns/campaignId/finance/type - Should return 403 if logged out
< GET /campaigns/campaignId/finance/type - Should return 403 if no access to the campaign
< GET /campaigns/campaignId/finance/type - Should return finance types - admin
< GET /campaigns/campaignId/finance/type - Should return types - olp permissions

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 79.509% (+0.02%) from 79.494%
when pulling 3b762a7 on UN-2283-get-finance-type
into bc0de18 on develop.

@iDome89 iDome89 changed the base branch from develop to UN-2274-other-costs January 29, 2026 15:35
@iDome89 iDome89 merged commit 8f955c7 into UN-2274-other-costs Jan 29, 2026
4 checks passed
@iDome89 iDome89 deleted the UN-2283-get-finance-type branch January 29, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Team Core activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants