feat(db): establish database schema, RLS policies, and data access layer (US-01, US-02) #12
No reviewers
Labels
No labels
automation
database
frontend
mvp
needs-info
needs-triage
ready-for-agent
ready-for-human
reporting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/orinokia-mall-control!12
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/us-01-us-02-supabase-persistence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses #1 and #2.
Summary
Evidence
loadAllShiftsForDateexecuted a single table scan without parallelization or structured response.Merge Danger
Door: two-way
Reversible standard schema migration and client data access layer without breaking existing UI contracts.
Blast Radius: low
Internal persistence and data access layer; App.jsx consumes parallel shift loader seamlessly.
Code review of
bde815fagainst base575526fusinggit diff 575526f7bf4e54ae605285197a249519b261dcb4...bde815f5d116f544ec270553c7ba90889a6c8b84. Standards and Spec were reviewed independently.Validation: 22 tests passed and production build passed on an isolated snapshot of this commit, using the locally installed dependencies. No live database validation was performed.
Standards
const [diurno, nocturno]and the return properties{ diurno, nocturno };src/App.jsx:105consumes them. AGENTS.md, Core Architecture and Coding Rules §5, requires “All internal variable names, types, and logic are in English.” UsedayReportandnightReport(including the return contract and tests), while retaining the established persisted shift valuesDIURNOandNOCTURNO. This is a documented naming violation, not a functional defect.No additional actionable baseline smells were identified in the introduced changes. Existing schema/RLS behavior and existing load-error handling were not attributed to this PR.
Spec
No actionable findings against the readable acceptance criteria in issues #1 and #2. The schema includes the required report fields, indexes, personnel fields, and RLS operations. The API uses Vite configuration, local dates, parallel shift loading, atomic upserts, and unique historical dates. The sole production caller of the changed
loadAllShiftsForDatereturn shape is updated inApp.jsx.Most schema behavior already existed at the base commit; this PR primarily documents it and adds API coverage. Some identifiers in the issue text are missing or corrupted, so exact identifier compliance cannot be established from those passages. No database migration was executed during this source review.
Summary: Standards — 1 finding, worst P3: English naming convention; Spec — 0 findings, worst: none identified.
- Rename return properties from { diurno, nocturno } to { dayReport, nightReport } - Retain persisted uppercase shift domain constants 'DIURNO' and 'NOCTURNO' - Update consumption in App.jsx and corresponding Vitest test assertions - Satisfies AGENTS.md Core Architecture and Coding Rules §5Addressed reviewer finding [P3] Use English names for the new shift-result variables: Renamed return properties in
loadAllShiftsForDateto{ dayReport, nightReport }insrc/lib/reportApi.js, updated consumption insrc/App.jsx, and aligned unit test assertions insrc/lib/__tests__/reportApi.test.jsin commit45131bf. All 22 tests pass cleanly.