Skip to content

UN-2277 get other costs#515

Merged
iDome89 merged 13 commits intoUN-2274-other-costsfrom
UN-2277-get-other-costs
Feb 2, 2026
Merged

UN-2277 get other costs#515
iDome89 merged 13 commits intoUN-2274-other-costsfrom
UN-2277-get-other-costs

Conversation

@Kariamos
Copy link
Contributor

@Kariamos Kariamos commented Feb 2, 2026

This pull request introduces a new endpoint for retrieving "other costs" associated with a campaign, refines the supplier endpoints to include supplier IDs, and updates the OpenAPI specification and tests to reflect these changes. The most significant updates are the addition of the /campaigns/{campaign}/finance/otherCosts GET endpoint, improvements in supplier data handling, and enhanced OpenAPI documentation.

New "Other Costs" Endpoint:

  • Added the GET /campaigns/{campaign}/finance/otherCosts endpoint, including its implementation (_get/index.ts) and a comprehensive test suite. This endpoint returns detailed information about other costs for a campaign, including type, supplier, description, and attachments. [1] [2] [3]

Supplier Endpoint Improvements:

  • Updated supplier endpoints and tests to include the id property in supplier objects, ensuring supplier IDs are returned in API responses and are properly tested. [1] [2] [3] [4]

OpenAPI Specification Updates:

  • Modified the OpenAPI spec to require and document the id property for suppliers and other cost types, and updated example responses accordingly. [1] [2] [3]
  • Updated the POST supplier response schema to return a supplier_id in the response and adjusted related tests. [1] [2] [3] [4]

These changes collectively improve the API's consistency, add new functionality for financial data retrieval, and ensure that both documentation and tests accurately reflect the updated behavior.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Tests difference:

New Tests

< GET /campaigns/campaignId/finance/otherCosts - Should not include costs from other campaigns
< GET /campaigns/campaignId/finance/otherCosts - Should return 200 if logged in as admin
< GET /campaigns/campaignId/finance/otherCosts - Should return 403 if logged in as not admin user
< GET /campaigns/campaignId/finance/otherCosts - Should return 403 if logged out
< GET /campaigns/campaignId/finance/otherCosts - Should return 403 if no access to the campaign
< GET /campaigns/campaignId/finance/otherCosts - Should return cost with empty attachments array if cost has no attachments
< GET /campaigns/campaignId/finance/otherCosts - Should return empty items array if no costs exist for campaign
< GET /campaigns/campaignId/finance/otherCosts - Should return finance other costs - admin
< GET /campaigns/campaignId/finance/otherCosts - Should return other costs - olp permissions

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 79.53% (+0.01%) from 79.516%
when pulling 3cb2001 on UN-2277-get-other-costs
into 8336be7 on UN-2274-other-costs.

@iDome89 iDome89 merged commit 2077fa8 into UN-2274-other-costs Feb 2, 2026
4 checks passed
@iDome89 iDome89 deleted the UN-2277-get-other-costs branch February 2, 2026 09:40
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.

3 participants