Commit f27d366
committed
PM-4957: Trigger finance on challenge cancellation
What was broken
Cancelled challenges in Appeals Response could be saved in challenge-api-v6 without ever calling tc-finance-api, so reviewer payments were not generated and billing-account ledger rows were not updated.
Root cause
The challenge update flow only requested finance payment generation for task challenges transitioning to COMPLETED. Cancelled status transitions reused phase-closing logic but had no matching finance trigger.
What was changed
Added a shared cancelled-status helper in ChallengeService and call finance after a challenge first transitions into any cancelled terminal status. The call runs after the database transaction commits, matching the existing completed-task payment generation pattern.
Any added/updated tests
Added a ChallengeService unit test that stubs the finance helper and verifies a challenge transitioning to CANCELLED_CLIENT_REQUEST requests payment generation.1 parent 8fca740 commit f27d366
2 files changed
Lines changed: 70 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
61 | 82 | | |
62 | 83 | | |
63 | 84 | | |
| |||
2792 | 2813 | | |
2793 | 2814 | | |
2794 | 2815 | | |
| 2816 | + | |
| 2817 | + | |
2795 | 2818 | | |
2796 | 2819 | | |
2797 | 2820 | | |
| |||
3005 | 3028 | | |
3006 | 3029 | | |
3007 | 3030 | | |
| 3031 | + | |
| 3032 | + | |
3008 | 3033 | | |
3009 | 3034 | | |
3010 | 3035 | | |
| |||
3015 | 3040 | | |
3016 | 3041 | | |
3017 | 3042 | | |
3018 | | - | |
3019 | | - | |
3020 | | - | |
3021 | | - | |
3022 | | - | |
3023 | | - | |
3024 | | - | |
3025 | | - | |
3026 | | - | |
3027 | | - | |
3028 | | - | |
3029 | | - | |
3030 | | - | |
3031 | | - | |
3032 | | - | |
3033 | | - | |
| 3043 | + | |
3034 | 3044 | | |
3035 | 3045 | | |
3036 | 3046 | | |
| |||
3584 | 3594 | | |
3585 | 3595 | | |
3586 | 3596 | | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
3587 | 3610 | | |
3588 | 3611 | | |
3589 | 3612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1803 | 1834 | | |
1804 | 1835 | | |
1805 | 1836 | | |
| |||
0 commit comments