Commit Graph

12 Commits

Author SHA1 Message Date
bhursey f7a0c8618f feat(media): primary media storage, growth goals, retention and delivery tools
CI / build (push) Has been cancelled
Event photos and videos are now stored only on the NFS/local share named in
Settings -> Media storage. Uploads, photo editing, video processing and the
per-event filing step refuse to run until that share is configured and
writable, so nothing is silently written inside the container. Video
originals, renditions, posters and sidecars share one folder on the share.

Also adds volunteer growth goals with a mentor queue, an admin retention and
storage sweep with a cron entry point, cached gallery thumbnails with
per-folder ZIP downloads, a server-rendered booth-sheet PDF, and in-app
confirm/release for every upcoming assignment.

Service reminders now ignore the one-off event reminder rule, which had been
queueing an extra bogus reminder for each published service.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-20 23:21:34 +00:00
Tiel Coder 5adf1cef1f push to maple-street 2026-11-20 04:07:02 +00:00
Tiel Coder b664de65f5 unit(D8): audit_log table + migration + audit-row builder (rule 12) 2026-11-18 18:25:30 +00:00
Tiel Coder deb4f35fb8 unit(D4): blackout CRUD + isUnavailable(user, date)
Blackout / unavailability (ARCHITECTURE §4.7 / §5.3 rule 5 / §5.4):
- src/domain/availability.ts — pure isUnavailable(records, date); a record
  covers the date if active and its inclusive range [starts_on, ends_on]
  contains it OR its rrule matches. No DB imports.
- src/domain/availability.test.ts — 11 tests named after the rule, incl.
  the inclusive-end case (2026-11-21..2026-11-28 covers 11-28).
- src/db/schema.ts — unavailability table: CHECK ends_on >= starts_on,
  CHECK span <= 365 days, unique (user_id, starts_on, ends_on) WHERE active.
- src/db/unavailability.ts — list/get/create/update/cancel (soft-delete);
  range + rrule validated on write.
- src/app/api/dev/unavailability/route.ts — GET/POST/PATCH; bad range/rrule
  -> 400, cancel flips status=cancelled.
- drizzle/0008_needy_stryfe.sql + migration applied to DB on :5433.

date columns stored as strings (mode: string) to match the YYYY-MM-DD
domain; Postgres date is mode-agnostic so the migration is unchanged.
Constraints enforced twice: validateUnavailabilityRange at the API,
chk_unavailability_* at the DB.

.env added to .gitignore (real secret was not ignored; .env.* missed the
bare .env).
2026-11-18 11:25:43 +00:00
Tiel Coder 676751c489 unit(C6): growth goals + shadow pairing validation
Adds the growth_goals table (ARCHITECTURE §4.3, §5.8.6) with its migration and a
pure nextGoalStatus() state machine (requested -> mentor_assigned -> in_progress
-> achieved, with pause/resume and decline). Adds validateShadowPairing()
(src/domain/shadows.ts): a shadow/trainee slot requires a paired mentor in the
same instance who is mentor-ready for that exact skill (C5) — rejects a shadow
with no paired mentor, enforced by the pure rule and the chk_shadow_paired CHECK
constraint on slots. Verified the migration applies and the CHECK rejects a
trainee slot without a paired mentor. 22 tests named after each rule.
2026-11-18 04:43:07 +00:00
Tiel Coder bc1dc91e35 C3 — Admin skills matrix + verify-level modal
Adds the append-only skill_assessments history and the verify path, so a
level can only move together with the row recording who moved it, from
what level, and the comfort they saw.
2026-11-18 04:19:04 +00:00
Tiel Coder a77f47d5bd C2 — Volunteer profile sliders (self_comfort; verified_level untouched)
Adds the user_skills record and slider save path so a volunteer can rate
their own comfort without ever moving the verified level, which stays
C3's to write.
2026-11-18 04:14:06 +00:00
Tiel Coder 5c789f63cc B4 — Positions + skills + requirements editor
Positions (schedulable seats) CRUD + requirements editor. Governing rule:
a position with no is_core skill refuses to save as publishable.
Schema (src/db/schema.ts):
- skills table (B4 prerequisite of position_skills): id, slug (unique),
  name, category_id/technology_id/function_id FKs, dedupe_key
  (category|technology|function, NULLs -> ''), mentor_min_level (default
  'expert'), stale_after_days (default 120), recert_required, sort_order,
  active, created_at, updated_at. All FKs ON DELETE RESTRICT.
- position_skills join: position_id, skill_id, weight, required_level,
  is_core; PK (position_id, skill_id).
- roles (positions) gained active (default true) + updated_at for
  soft-delete/pickers/audit.
Data layer (src/db/positions.ts): list/create/update/deactivate for
positions and skills; getPositionSkills (skills merged into
position_skills in JS); setPositionSkills (replaces the whole set);
dedupeKey() helper.
Domain (src/domain/positions.ts + .test.ts): pure publishability rule —
isPublishable(skills) = has >=1 is_core skill. 8 tests named after the
rule.
API:
- src/app/api/dev/skills/route.ts — GET/POST/PATCH (slug + dedupe_key
  generated at create; slug frozen on update).
- src/app/api/dev/positions/route.ts — GET/POST/PATCH (rename/edit or
  deactivate via active:false).
- src/app/api/dev/positions/requirements/route.ts — GET (list a
  position's requirements) + POST (set requirements; enforces the
  publishability gate: published:true with no core skill -> 400).
Migration drizzle/0004_hesitant_ezekiel.sql.
Verification: typecheck ✓ lint ✓ test ✓ (44, +8) build ✓ db:migrate ✓;
runtime smoke /tmp/b4.sh (24 checks) — publish-with-core 200,
publish-without-core 400, weight-out-of-range 400, rename slug frozen,
deactivate hides from picker but row persists.
Decisions: skills table is a B4 prerequisite; requirements editor takes
positionId in the body (Next 15.5.29 rejects an explicitly-typed
{ params: { id } } route-handler second arg); publishability gate lives
in the domain and is enforced in the route; join resolved in JS
(drizzle 0.45.4 exports no join).
2026-11-18 01:34:24 +00:00
Tiel Coder 9f7a65b136 B3: catalog taxonomy CRUD (categories, vendors, technologies, functions)
Create/rename/deactivate for the four taxonomy tables. Deactivate not
delete; slug frozen after creation; FKs ON DELETE RESTRICT.
- src/db/schema.ts: four tables + relations (ON DELETE RESTRICT FKs)
- src/lib/slug.ts: slugify (lowercase, ASCII-fold, collapse runs) + 6 tests
- src/db/catalog.ts: listCatalog (active filter), deactivateCatalog (soft
  delete), per-entity create*/update* (slug generated at create, frozen on
  update; update patches only present fields)
- src/app/api/dev/catalog/route.ts: GET/POST/PATCH; Zod per entity; DB
  constraint errors mapped to 409 (dup slug) / 400 (dangling FK) via cause
  chain
- drizzle/0003_whole_crystal.sql
Verification: typecheck, lint, 36 unit tests (+6), build, db:migrate all
exit 0. Runtime smoke: create -> rename keeps slug -> deactivate hides from
pickers but row persists (all four types); partial PATCH preserves omitted
fields; validation 400/400/400/409.
2026-11-18 01:00:10 +00:00
Tiel Coder 26b31978e2 B2: profile + notification_preferences + SMS consent capture (TCPA)
- notification_preferences table (user_id PK->users, email/sms toggles,
  sms_consent_at/source/ip evidence, quiet hours, digest) + migration 0002
- src/domain/consent.ts: pure TCPA rule (phoneChanged/buildConsent/resetConsent)
- src/db/profile.ts: updateProfile (partial update; resets consent on phone
  change) + setSmsConsent (opt-in) + getProfile
- PATCH/POST /api/dev/profile routes
- seed: per-user prefs row (email on, SMS off)
- 6 unit tests named after the rules
2026-11-18 00:09:05 +00:00
Tiel Coder a68e1c6277 A2: schema core (6 tables, migration, idempotent seed)
- users/roles/services/service_instances/slots/assignments with spec rules:
  - chk_slots_single_parent (Rule 26): slot has exactly one parent
  - uq_active_assignment (Rule 27): partial unique, one active assignment per slot
  - slug immutability, deactivate-only, UTC storage, America/New_York default
- uuidv7 (src/lib/uuid.ts), DST-safe tz helpers (src/lib/tz.ts)
- idempotent seed: 3 roles, 2 services, next 2 Sundays x services, 12 slots, 6 users
- migration drizzle/0000 + 0001
Verified: typecheck/lint/test/build + db:migrate + db:seed all exit 0;
service_instances=4; re-run seed idempotent; CHECK + partial unique enforced.
2026-11-17 18:52:35 +00:00
Tiel Coder c595865496 A1: foundation scaffold (Next.js 15, shadcn/Radix, Drizzle+Postgres, Vitest, Docker)
- Next.js 15 + TS strict + Tailwind 4 + ESLint 9
- shadcn/ui initialized (Radix, CSS variables); cn() util
- Drizzle + postgres driver + Zod; db client + schema placeholder (A2)
- Vitest with passing cn() test; GitHub Actions CI
- Portable container stack: multi-stage non-root Dockerfile, docker-compose (app + Postgres on host 5433)
- Verified: typecheck, lint, test (3), build, docker build, HTTP 200 on :3000
- Records the 5 pre-build decisions (email-only launch, SMS deferred)
2026-11-17 18:09:24 +00:00