deb4f35fb8
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).
46 lines
534 B
Plaintext
46 lines
534 B
Plaintext
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
|
|
# dependencies
|
|
/node_modules
|
|
/.pnp
|
|
.pnp.*
|
|
.yarn/*
|
|
!.yarn/patches
|
|
!.yarn/plugins
|
|
!.yarn/releases
|
|
!.yarn/versions
|
|
|
|
# testing
|
|
/coverage
|
|
/test-results
|
|
|
|
# next.js
|
|
/.next/
|
|
/out/
|
|
|
|
# production
|
|
/build
|
|
|
|
# misc
|
|
.DS_Store
|
|
*.pem
|
|
|
|
# debug
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
yarn-error.log*
|
|
.pnpm-debug.log*
|
|
|
|
# env files (commit .env.example only, never real secrets)
|
|
.env
|
|
.env.local
|
|
.env.*
|
|
!.env.example
|
|
|
|
# vercel
|
|
.vercel
|
|
|
|
# typescript
|
|
*.tsbuildinfo
|
|
next-env.d.ts
|