Skip to content

Conversation

@Kariamos
Copy link
Contributor

@Kariamos Kariamos commented Dec 2, 2025

This pull request introduces support for a new hasPlan property in the campaign dossier API response, indicating whether a campaign is associated with a plan. It also refactors the OpenAPI schema to improve the definition of required properties for various objects, ensuring better type safety and documentation accuracy.

API Feature Addition

  • Added a hasPlan boolean property to the dossier API response, reflecting if the campaign has an associated plan (plan_id is not null). This is now included in both the implementation (RouteItem in index.ts) and the OpenAPI schema (src/schema.ts, src/reference/openapi.yml). [1] [2] [3]

Schema Improvements

  • Updated the OpenAPI schema to explicitly declare required fields for campaign objects and nested arrays, improving validation and documentation. This includes moving required declarations for properties like autoApply, autoApprove, closeDate, etc., to the correct location and ensuring array items have their required fields defined. [1] [2] [3] [4] [5] [6] [7]

Testing Enhancements

  • Added new tests in index.spec.ts to verify that the dossier API correctly returns the hasPlan property for campaigns with and without an associated plan.

Implementation Changes

  • Modified the database query to select the plan_id field, enabling the backend logic to determine the value of hasPlan for each campaign.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Tests difference:

New Tests

< Campaign Plan - Should return whether the campaign has a plan or not

@coveralls
Copy link
Collaborator

coveralls commented Dec 2, 2025

Coverage Status

coverage: 78.905%. remained the same
when pulling 5a6d284 on UN-2153-hasPlan-dossier
into d4edaf5 on develop.

@Kariamos Kariamos added core Team Core activity feature labels Dec 2, 2025
feat(schema): add hasPlan property to operations interface

feat(campaign): add hasPlan property to campaign response and related tests

feat: add hasPlan property to operations interface and reorder name field in items

chore: sort openapi
@d-beezee d-beezee force-pushed the UN-2153-hasPlan-dossier branch from 03e319b to 5a6d284 Compare December 5, 2025 08:24
@d-beezee d-beezee merged commit 26cbb0a into develop Dec 5, 2025
4 checks passed
@d-beezee d-beezee deleted the UN-2153-hasPlan-dossier branch December 5, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Team Core activity feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants