# Phase 5B manual test script: the provisioning wizard and go-live

For the HQ Administrator and a second HQ person, and the new branch admin. About 25 minutes. The rules are
also proved by `tests/Feature/ProvisioningWizardTest.php`:
- the wizard end to end;
- opening balances balanced per fund and posted by someone else;
- a one-time activation link;
- the import with its error messages;
- the plan limit.

This script checks what people see.

**Addresses:** Directs http://localhost/church_acct_app/public/directs
**Logins (demo church):**
- **admin@demo.church.test**: HQ Administrator, with the password you set on 18 Oct;
- **accountant@demo.church.test**: posts the opening balances;
- the new branch admin you create: use an email you can read, or check `storage/logs/laravel.log` if mail
  goes to the log locally.

## A. The wizard

1. [ ] **Headquarters (Directs) › Branch set-ups › New branch**. Enter "Ajah Parish", code AJH, level Parish,
   under Headquarters. Create it: the wizard moves to step 2, and the steps list ticks step 1.
2. [ ] Step 2: "Someone new", name and email. Save.
3. [ ] Leave the wizard (go to the dashboard), then come back under **Branch set-ups**. It shows "step 2 of 7"
   and **Continue** returns to step 3.
4. [ ] Step 3 lists the accounts open to branch sub-accounts. Continue.
5. [ ] Step 4: today's date. Saved: "its periods are open".
6. [ ] Step 5: make a CSV with a title row, then `Code,Fund,Debit,Credit`, then `11010,GEN,250000,`,
   `21010,,,40000` and `99999,,5,`. Read it: refused, naming row 5 and code 99999. Remove that row and read
   it again: two lines appear in the grid. Notes below the grid show what goes to Opening Balance Equity.
   **Save opening balances**: it is saved as a draft journal, "waiting for a checker".
7. [ ] Step 6 shows the plan and branches used. Confirm.
8. [ ] Step 7 ticks everything. **Activate and send the admin's link**: you land on the branch's Directs page,
   whose **Go-live** card lists what is still to do.

## B. The second person and the new admin

9. [ ] As the accountant, open the opening journal from Journals and **Post** it. On the branch's Go-live
   card, "Opening balances posted" is ticked.
10. [ ] As the new admin, open the link in the email. Choose a password that is too short: refused. Choose
    a proper one: you are signed in and taken to **Account security** to set up two-factor login.
11. [ ] Open the same link again: "expired or already used". As the HQ administrator, **Send a new link**
    on the branch page works.

## C. Limits

12. [ ] As the accountant (not an HQ Administrator), `/directs/provisioning/new` is not allowed.
13. [ ] (Optional) On a plan with no branches left, **New branch** is refused with the plan's limit.

## Sign-off

| Section | Checked by | Date | Notes |
|---|---|---|---|
| A Wizard | | | |
| B Second person and admin | | | |
| C Limits | | | |
