# Phase 5A manual test script: Directs, the branch register and branch lifecycle

For the HQ Administrator, HQ Finance and a branch treasurer. About 25 minutes. The rules are also proved by
`tests/Feature/BranchLifecycleTest.php`:
- Directs is for Headquarters only;
- a suspended branch cannot be changed by anyone;
- a locked branch cannot sign in;
- a close moves every balance by one journal, confirmed by someone else;
- a merge moves members, assets, bank accounts and open items.

This script checks what people see.

A close or merge cannot be undone. Use the local demo church, never live books.

**Addresses:** staff app http://localhost/church_acct_app/public/app, 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;
- a second HQ person to confirm a close: make one under Users & roles with the HQ Finance Officer role and
  no branch;
- **auditor@demo.church.test**: read-only check.

Make a test branch first under Setup › Branches, e.g. "Test Parish" (code TST), and a treasurer for it under
Users & roles. Record one giving batch in it so it has balances.

## A. Directs

1. [ ] As the administrator, the menu shows **Headquarters (Directs) › Branch register**. It lists every
   branch under its region, with status, pastor, users, last posting and last year's year end.
2. [ ] Filter by name, and by status with the buttons.
3. [ ] Open a branch: its record, people, recent journals (newest first) and history. Change the pastor's
   name and save.
4. [ ] As the auditor, Directs opens read-only: no Status card, fields greyed out, no "Add a branch".
5. [ ] As the branch treasurer, open `/directs/branches`: "Not found".

## B. Suspend, lock, resume

6. [ ] On the test branch press **Suspend…** with a reason. Sign in as its treasurer: an amber banner
   shows the reason. Pages open, but saving anything (e.g. a new member) is refused with a plain message.
   Downloads still work.
7. [ ] As the administrator, try to post a journal into the suspended branch: refused.
8. [ ] **Make active again…**, then **Lock…**. The treasurer is signed out at the next click and cannot
   sign in ("locked by Headquarters"). Make it active again.
9. [ ] Headquarters' own page has no Status card: it cannot be suspended, locked, closed or merged.

## C. Close or merge

10. [ ] **Close or merge…**: with merge ticked and a receiving branch chosen, anything still open (e.g. an
    open giving batch) is listed and the button stays off. Clear it.
11. [ ] Ask for the merge with a reason. The branch shows "Closing (waiting for HQ Finance)", and its
    people can only look.
12. [ ] As the same administrator, there is no Confirm button. **Cancel the request…** works: the branch
    goes back to how it was. Ask again.
13. [ ] As the HQ Finance person, type the wrong code: refused. Type the branch code: "merged".
    - The branch page links to the **transfer journal**, which moves each balance out of the branch and
      into the receiving branch.
    - The branch's members, assets and bank accounts now appear under the receiving branch.
    - The branch's users are switched off.
14. [ ] **Reports › Trial Balance** for the whole church is unchanged by the merge, and the merged
    branch's own trial balance is nil.

## Sign-off

| Section | Checked by | Date | Notes |
|---|---|---|---|
| A Directs | | | |
| B Suspend, lock, resume | | | |
| C Close or merge | | | |
