-
Task
-
Resolution: Done
-
Undefined
-
None
-
None
-
3
-
False
-
-
False
-
subs-swatch-lightning
-
-
-
Swatch Lightning Sprint 10
Our contract termination test plan and component tests incorrectly claim that the backend uses the status field (SUBSCRIBED/UNSUBSCRIBED) from partner entitlement messages to determine whether a contract is active or terminated. After reviewing the backend code, this is wrong – swatch-contracts completely ignores the status field and relies exclusively on startDate and endDate from the partner entitlement message to determine contract lifecycle state.
The status field exists in the PartnerEntitlementV1 API schema, but ContractService, ContractEntityMapper, and all related processing logic never call getStatus(). There is no status column in ContractEntity or SubscriptionEntity. Active/terminated state is purely date-driven: a contract is active when startDate <= now and endDate IS NULL OR endDate >= now.
This means that 5 test plan entries in the "Contract Termination" section of swatch-contracts/TEST_PLAN.md (TC001 through TC005) have misleading descriptions that frame the tests around SUBSCRIBED/UNSUBSCRIBED status validation, when in reality the behavior being tested is driven by the contract dates. The corresponding component tests in ContractsTerminationComponentTest.java pass by coincidence, but their names, comments, and setup logic (using forContractWithStatus()) incorrectly suggest that the status field is the variable under test.
Acceptance Criteria
- Update TEST_PLAN.md – Contract Termination section (TC001 to TC005): Rewrite descriptions to remove references to "status"
- Update/Refactor ContractsTerminationComponentTest.java (TC001 to TC005) around the SUBSCRIBED and UNSUBSCRIBED constants
- PartnerApiStubs.java: Evaluate whether forContractWithStatus() should be removed or simplified