--- data parity -------------------------------------------------------
signup amounts D7 = D10                                    PASS  9 / 9 keys
referrer amounts D7 = D10                                  PASS  9 / 9 keys
South Carolina referrer amount is 15, not 10               PASS  D7 '15' / D10 '15'
every other state referrer amount is 10                    PASS  10
cookie lifetime D7 = D10                                   PASS  1
goto path D7 = D10                                         PASS  'user/register'
{ce_referral_discount} rows D7 = D10                       PASS  361 / 361
{ce_referral_admin_discount} rows D7 = D10                 PASS  24 / 24
audit trail identical, column for column                   PASS
ledger money columns identical, all rows                   PASS  361 rows

--- settings form parity ----------------------------------------------
elements, and their ORDER, match D7 (weight then name)     PASS  18 elements
"Other" is last, by weight 7 - not sorted under O          PASS
referral_goto_path is present but #access FALSE, as D7     PASS
every label matches D7, state name included                PASS
every discount field is required, as D7                    PASS
every default matches the D7 variable                      PASS
cookie lifetime is NOT required, as D7                     PASS
button reads D7's "Save configuration"                     PASS

--- settings round trip ------------------------------------------------
tid 62 has amounts but no term - the orphan the brief must not lose PASS  stored: '10'
changing South Carolina persists                           PASS  '17.50'
the reloaded form shows the new value                      PASS
⭐ the orphan tid 62 SURVIVED the save (merge, not replace) PASS  still '10'
no other state was touched                                 PASS
South Carolina restored to 15                              PASS
a negative amount is rejected with D7's message            PASS  "Discount amount for referral" should be a positive number.
a non-numeric amount is rejected with D7's message         PASS
a valid submission raises no error                         PASS

--- credit / debit -----------------------------------------------------
found a referrer with an existing ledger row (branch A)    PASS  uid 10721
credit adds to the balance                                 PASS  15 -> 20.00
credit updates the SAME row, not a new one                 PASS
D7's data suffix is appended byte for byte                 PASS
⭐ the audit row records the balance BEFORE the change    PASS  15.00 (before was 15)
the audit row records the amount and the type              PASS
debit subtracts, returning to the original balance         PASS
an over-large debit clamps at zero, never negative         PASS  0.00
found a user with no ledger row (branch B)                 PASS  uid 6
a first adjustment creates a ledger row                    PASS
🛑 PRESERVED D7 DEFECT: a DEBIT on a user with no row CREDITS them 12.00 PASS  balance is now 12.00 after a DEBIT
the new row's uid is the ADMIN, referrer_uid is the target (D7) PASS  uid=1 referrer_uid=6
the new row carries D7's data string                       PASS
the branch-B audit row records a zero prior balance        PASS
neither username nor email -> D7's message                 PASS
both username and email -> D7's message                    PASS
a malformed email -> D7's message, bound to the field      PASS
an unknown user writes NOTHING                             PASS

--- restore ------------------------------------------------------------
{ce_referral_discount} restored, row for row               PASS  361 rows
{ce_referral_admin_discount} restored, row for row         PASS  24 rows
ce_referral.settings restored                              PASS
row counts match D7 again                                  PASS  361 / 24
South Carolina is 15 again                                 PASS

All checks passed.
 [error]  Message: "Discount amount for referral" should be a positive number.
 
 [error]  Message: "Discount amount for referrer" should be a positive number.
 
 [error]  Message: Please enter either a username or email.
 
 [error]  Message: Please enter either a username or email, not both.
 
 [error]  Message: Enter Correct Email
 
 [error]  Message: User with username /no-such-user-xyzzy/ or email // not found.
 
 [notice] Message: The configuration options have been saved.

