Skip to content

Add presign url get other costs#521

Merged
Kariamos merged 5 commits intoUN-2274-other-costsfrom
add-presign-url-get-other-costs
Feb 4, 2026
Merged

Add presign url get other costs#521
Kariamos merged 5 commits intoUN-2274-other-costsfrom
add-presign-url-get-other-costs

Conversation

@Kariamos
Copy link
Contributor

@Kariamos Kariamos commented Feb 3, 2026

This pull request enhances the API for campaign finance "other costs" by adding presigned S3 URLs to each attachment, improving secure access to files. It updates both the backend logic and the OpenAPI schema, and introduces comprehensive tests to ensure correct behavior.

API and Schema Enhancements:

  • Each attachment in the "other costs" API response now includes a presigned_url property, allowing secure, time-limited access to S3 files. [1] [2] [3] [4]

Backend Logic Improvements:

  • The getPresignedUrl function now accepts a configurable expiration time (default 20 minutes), and is used to generate presigned URLs for each attachment with a 3-hour expiration in the route handler. [1] [2] [3]

Testing Updates:

  • The test suite for the "other costs" endpoint was updated to:
    • Mock the getPresignedUrl function for predictable results.
    • Assert that each attachment includes a presigned_url in the response. [1] [2] [3] [4]
    • Verify that getPresignedUrl is called with the correct parameters for each attachment and the intended expiration time.

@Kariamos Kariamos added the core Team Core activity label Feb 3, 2026
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Tests difference:

New Tests

< GET /campaigns/campaignId/finance/otherCosts - Should call getPresignedUrl for each attachment

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 79.778% (+0.03%) from 79.746%
when pulling d874ec5 on add-presign-url-get-other-costs
into 26d19f4 on UN-2274-other-costs.

@Kariamos Kariamos merged commit 0b64666 into UN-2274-other-costs Feb 4, 2026
6 checks passed
@Kariamos Kariamos deleted the add-presign-url-get-other-costs branch February 4, 2026 10:14
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.

2 participants