# Rollout
## Context
Nowadays the Pilot Program -- and so the Attachment Requirement -- it's under a **feature flag** controlled by [rollout](https://github.com/fetlife/rollout) gem.
## How it is
**TimeSheet** has a `required_attachment` field being enforced with `false` by the `set_required_attachment` callback before saving.
**Payroll** has a `required_attachment` field filled during `run_before_save_hooks` callback before save. It will call the `required_attachment?` method whos look if there's a `Timekeeping::Rule` with `required_attachment` flag as `true`.
## How will it be
**TimeSheet** must have `required_attachment` field filled during `set_required_attachment` callback before save. It will call the `required_attachment?` method -- **which is under rollout flag**.
**Payroll** must have `required_attachment` field filled during `run_before_save_hooks` callback before save. It will delegate the `required_attachment?` call to `TimeSheet`.
## Rollout phase
### Phase 1
[BO-1398](https://trusted-health.atlassian.net/browse/BO-1398) - Rollback changes done on PR [#11364](https://github.com/trusted/trusted-api/pull/11364). It will remove the `false` flag on every `TimeSheet`
### Phase 2
Turn on the `attachment_required_allow_list` feature via console or RolloutUI.
#### Via console
Run in production console `bin/rollout attachment_required_allow_list --activate`
#### Via RolloutUI
- In production, the address is https://admin.trustedhealth.com/rollout
- Click on our feature key `attachment_required_allow_list`
- Set to 100% and update
