# Audit checklist — what to check, how, the rule it proves, and the last result (16 Nov 2026)

Use this list for every audit (TravelClip runs the system checks; the owner and accountant do the manual ones). Each line:
check — how — the rule it proves — result on 16 Nov 2026. Repeat monthly and after every big change. Method: handbook 25.

## A. Code and build
| # | Check | How | Rule | Result 16 Nov |
|---|---|---|---|---|
| A1 | PHP syntax | `php -l` on every PHP file | nothing broken ships | 224 files, 0 errors |
| A2 | JavaScript syntax | `node --check` on admin, booker, sites, tools | same | 91 files, 0 errors |
| A3 | Debug leftovers / TODO | search for var_dump, print_r, console.log, TODO | no data leaks in output | none |
| A4 | Screens open without errors | open each screen, read the console | every screen works | Finance → Every sale and Rates → money map open clean |

## B. Security
| # | Check | How | Rule | Result |
|---|---|---|---|---|
| B1 | Security self-test | `tools/security-audit.php` | sessions hashed, throttles, gateway amount, payout changes, two-step sign-in, signed links, sealed audit log | 74 / 74 |
| B2 | Forensic sweep | `tools/security-sweep.php` (256 actions × 5 visitors) | access, isolation, money tables, injection | 10 859 calls; 14 flags all checked: no real vulnerability; X-Powered-By on the local server fixed |
| B3 | Secrets not in git | `git diff --cached` search for sqlite, keys, config, memory | no personal data or keys committed | clean (old travelclip/ memory copy ignored) |
| B4 | TravelClip doors | code review | owner-only, signed pass, deny lists, read-only SQL, tech mode by secret | sound; pass lasts 1 h |
| B5 | Who is admin and has two-step sign-in | Logins screen | money actions need two-step from go-live | owner to check at go-live |

## C. Money engine
| # | Check | How | Rule | Result |
|---|---|---|---|---|
| C1 | Self-test | `tools/backoffice-audit.php` with GW_AUDIT_SOURCE = baseline | every money rule end to end | 522 / 522 (528 / 528 later the same day, with the launch-phase tests) |
| C2 | Books proof | `tools/books-proof.php` (or ask TravelClip "audit") | 53 accounting identities | all hold (handbook 24) |
| C3 | Ledger stress test | fuzz tool | random sales of every kind add up | 5 331 / 5 331 |
| C4 | Books stress test | fuzz tool | refunds, chargebacks, statements over months | 1 314 / 1 314 |
| C5 | Every sale adds up | Finance → Platform → Every sale — who gets what | Check = R0.00 on every line | 191 sales, all R0.00 |
| C6 | Same figure on every screen | dashboard vs Finance vs Reports per month | one source per figure | identical (handbook 24) |
| C7 | Reconciliation | Finance → Platform → Reconciliation | every card payment ↔ a booking | clean |

## D. Pricing, fees and splits
| # | Check | How | Rule | Result |
|---|---|---|---|---|
| D1 | Every deal earns on every sale type | sample sale for us, each agent, each corporate at usual / R500 / R20 000 | no sale loses money | none lose; thin on big corporate tickets |
| D2 | Margins and gateway set | dashboard money checks | no zero margin, gateway rate entered | set (flights 10%, stays 10%, cars 10%, coaches 8%; gateway 2.9% + R2; card fee 1%) |
| D3 | Owners' split rules | Fees & margins step 2 | live 50/50, Getaway packages 70/30, agent packages 50/50, fees 50/50 | as agreed (fees now fixed 50%) |
| D4 | Agents paid only on their deal | Agent → Deal; trading rule | no deal = cannot trade | enforced |
| D5 | Packages above net cost | package wizard net-cost guard | no loss-making package | enforced |

## E. Refunds and cancellations
| # | Check | How | Rule | Result |
|---|---|---|---|---|
| E1 | Refunds due are visible | dashboard, Finance | a cancelled paid booking shows refund_due until recorded | yes |
| E2 | Refund recorded fully | Record the refund | amount, reference, supplier penalty, our fee, gateway fee; credit note | yes, two-step required |
| E3 | Agent commission reversed | statements | reversed, or clawed back if already paid | yes |
| E4 | Corporate cancellation | booker cancel | refund_due, admins told; travelled/refunded cannot cancel | yes |
| E5 | Manual (EFT) refunds | same action with the bank reference | tracked even outside the gateway | yes |

## F. Data
| # | Check | How | Rule | Result |
|---|---|---|---|---|
| F1 | No on-account bookings | data | payment before every booking | 13 old corporate test trips (3–4 Nov), cancelled, R0 — none since |
| F2 | Test data cleared before go-live | go-live tool | live books start clean | to do at go-live |

## G. Manual (outside the system) — owner / accountant
Bank statement vs Reconciliation; gateway settlement report; supplier statements vs Suppliers owed; VAT201 vs VAT register;
agent statement queries; invoice legal details (go-live refuses without them).
