docs: update README, obsidian docs, dev scripts, and SQL init

Update documentation and configuration:

- README: reflect new test patterns and architecture
- Obsidian docs: update Technical Manual, Overview, Testing Architecture
- init-script.sql: schema updates
- local-dev-2.sh: dev script adjustments

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-21 19:29:32 +01:00
co-authored by Sisyphus
parent 220a0ef6e8
commit d171117e53
6 changed files with 330 additions and 79 deletions
+19 -9
View File
@@ -1154,15 +1154,6 @@ BEGIN
) ORDER BY ap.created_at DESC), '[]'::json)
FROM affiliate_payouts ap WHERE ap.affiliate_id = target_user_id
),
'verification_codes', (
SELECT COALESCE(json_agg(json_build_object(
'purpose', vc.purpose,
'created_at', vc.created_at,
'used_at', vc.used_at,
'expires_at', vc.expires_at
) ORDER BY vc.created_at DESC), '[]'::json)
FROM verification_codes vc WHERE vc.user_id = target_user_id
),
'forgiven_no_shows', (
SELECT COALESCE(json_agg(json_build_object(
'id', fns.id,
@@ -1195,6 +1186,25 @@ BEGIN
FROM gift_card_transactions gct
WHERE gct.user_id = target_user_id
),
'gift_cards', (
SELECT COALESCE(json_agg(json_build_object(
'id', gc.id,
'total_funds_added', gc.total_funds_added,
'amount_remaining', gc.amount_remaining,
'expiry_date', gc.expiry_date,
'redeemed_at', gc.redeemed_at,
'created_at', gc.created_at
) ORDER BY gc.created_at DESC), '[]'::json)
FROM gift_cards gc WHERE gc.redeemed_by = target_user_id
),
'admin_audit_log', (
SELECT COALESCE(json_agg(json_build_object(
'action_type', aal.action_type,
'details', aal.details,
'created_at', aal.created_at
) ORDER BY aal.created_at DESC), '[]'::json)
FROM admin_audit_log aal WHERE aal.target_user_id = export_all_user_data.target_user_id
),
'login_audit', (
SELECT COALESCE(json_agg(json_build_object(
'attempt_type', la.attempt_type,