Assign a Milestone to a Contract
What problem does this solve?
Applicants and verifiers can create Milestones themselves from their portals, choosing either an Application or a Contract to attach the Milestone to. If they don't pick a Contract — the field is optional, since a Milestone can validly stand against an Application or an Applicant alone — the Milestone stays an Application (or Applicant) Milestone even when the Application does have an active Contract it should have been linked to. Previously the only way to fix this was a Rails console command, which meant an engineer had to be looped in for what is otherwise a routine admin correction.
How it works
On any Milestone that isn't already a Contract Milestone, admins now see an Assign to Contract action. Clicking it opens a dialog with a dropdown of eligible Contracts:
For a Milestone attached to an Application, the dropdown lists that Application's Contracts.
For a Milestone attached directly to an Applicant (no Application), the dropdown lists that Applicant's Contracts.
In both cases the list only includes Contracts in an active/eligible state (the same rule the applicant/verifier creation modal already uses), and the dropdown auto-selects the Contract when there's only one. If there are no eligible Contracts, the dialog explains that instead of showing an empty dropdown.
Selecting a Contract and confirming converts the Milestone into a Contract Milestone: it's re-owned by the Contract's Applicant, and any of its payments move across with it.
UI changes
New Assign to Contract action in the Milestone's action list (both the show page and the Milestones list row menu), shown whenever the Milestone isn't already a Contract Milestone.
New "Assign to Contract" dialog with a Contract dropdown, scoped to the Milestone's Application or Applicant.
Last updated
Was this helpful?