fix(sat): unify Campaign/CampaignSummary status into a shared enum schema - #63
Open
dmchaledev wants to merge 1 commit into
Open
fix(sat): unify Campaign/CampaignSummary status into a shared enum schema#63dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
Campaign.status was an untyped free-form string while the identical conceptual field on CampaignSummary carried the real enum (Created/Queued/In progress/Emails Sent/Completed/Draft/In Review/Approved). Callers of getCampaign/listCampaigns got no schema-level validation or generated typing for status, unlike callers of the summary endpoints, even though both surface the same underlying value. Factor the enum out into a shared CampaignStatus schema referenced by both. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NduBfA4wkj37PDwy343fc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sat/openapi.yaml'sCampaignSummary.statusfield is a validated enum (Created,Queued,In progress,Emails Sent,Completed,Draft,In Review,Approved), but the identical conceptual field onCampaign(the schema returned bygetCampaign/listCampaigns) was a plain, untypedstring— no enum at all.submit-review,approve,reject) confirmDraft/In Review/Approvedare real states shared across both representations, so this was a real modeling gap, not an intentional difference: a client hitting the full-detailgetCampaignendpoint got no schema-level validation or generated typing forstatus, while the same value via the summary endpoint did.Fix: factored the enum into a new shared
CampaignStatuscomponent schema and pointed bothCampaign.statusandCampaignSummary.statusat it via$ref.Pre-flight duplicate check
Related issues/PRs
None — no existing open issue or PR touches
Campaign/CampaignSummarystatus modeling.Testing
spectral lint sat/openapi.yaml --ruleset .spectral.yaml --fail-severity error→ 0 errors (same 8 pre-accepted trailing-slash warnings as before).python3 -c "import yaml; yaml.safe_load(open('sat/openapi.yaml'))"→ parses cleanly.Generated by Claude Code