Skip to content

UN-2278 post campaign supplier#512

Merged
Kariamos merged 12 commits into
UN-2274-other-costsfrom
UN-2278-post-campaign-supplier
Jan 29, 2026
Merged

UN-2278 post campaign supplier#512
Kariamos merged 12 commits into
UN-2274-other-costsfrom
UN-2278-post-campaign-supplier

Conversation

@Kariamos
Copy link
Copy Markdown
Contributor

This pull request introduces a new API endpoint for creating campaign finance suppliers, along with its implementation, OpenAPI documentation, schema updates, and comprehensive tests. The main focus is to allow authorized users to add new suppliers to a campaign, ensuring name uniqueness and proper permissions.

Key changes:

1. New API Endpoint for Creating Campaign Finance Suppliers

  • Added the /campaigns/{campaign}/finance/supplier POST endpoint to the OpenAPI spec, enabling creation of new suppliers for a campaign with validation for required fields and security responses.
  • Implemented the endpoint logic in SupplierRoute, including permission checks, duplicate name prevention, and error handling.
  • Integrated the new endpoint into the TypeScript schema definitions, ensuring type safety and OpenAPI alignment. [1] [2]

2. Testing

  • Added a comprehensive test suite for the new endpoint, covering permission scenarios, successful creation, duplicate prevention, and input validation.

3. Schema Enhancements

  • Updated related schema fields with default values and improved documentation for better clarity and consistency in the API spec. [1] [2] [3] [4] [5] [6] [7]

These changes collectively introduce a robust and well-documented way to manage campaign finance suppliers via the API.

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

Tests difference:

New Tests

< Enough permissions - admin - Should add new finance supplier
< Enough permissions - admin - Should not add existing supplier
< Enough permissions - admin - Should not add supplier with empty name
< Enough permissions - admin - Should return 200 if logged in as admin
< Enough permissions - olp - Should add supplier 
< Enough permissions - olp - Should not add existing supplier
< Not enough permissions - Should return 403 if logged in as not admin user
< Not enough permissions - Should return 403 if logged out
< Not enough permissions - Should return 403 if no access to the campaign

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 79.513% (+0.02%) from 79.494%
when pulling 7e105f7 on UN-2278-post-campaign-supplier
into bc0de18 on develop.

@Kariamos Kariamos changed the title Un 2278 post campaign supplier UN-2278 post campaign supplier Jan 29, 2026
@iDome89 iDome89 changed the base branch from develop to UN-2274-other-costs January 29, 2026 15:36
@Kariamos Kariamos merged commit 8336be7 into UN-2274-other-costs Jan 29, 2026
8 checks passed
@Kariamos Kariamos deleted the UN-2278-post-campaign-supplier branch January 29, 2026 16:53
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