
Bytt hver

Uansett hvor god tannbørstehygiene du har, vil det hope seg opp med bakterier på tannbørsten. Tannleger anbefales derfor å bytte tannbørsten eller børstehodet hver tredje måned. Med vårt tannbørste abonnement er familien trygg. Vi sender deg rett å slett vi nye hver 3 mnd...
Abonner nå
Abonner nå
Shift management system for Sense Garn AS (Sandnes, Norway). Replaces Google Sheets with a simple web app for shift planning, swap requests, and payroll calculation.
CLAUDE.md — update Current Implementation StatusSPEC.md — update relevant sections if changes affect:
supabase/migrations/00X_description.sql| Context | Language |
|---|---|
| Code (variables, functions, comments) | English |
Documentation (CLAUDE.md, SPEC.md, README.md) |
English |
| Git commits | English |
| UI text (buttons, labels, messages) | Norwegian |
Type: Short description in English
- Detail 1
- Detail 2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allowed types: Add, Fix, Update, Refactor, Docs, DB
Never push to main without explicit user approval.
Pushing to main triggers production deployment to Vercel.
admin — full access (employees, payroll, requests, settings)employee — own payroll and shift actionsAll user-facing text must be Norwegian.
API routes:
POST /api/email/notify — swap notifications
swap_request_created → adminsswap_request_approved → employeeswap_request_rejected → employeedirect_swap → adminsPOST /api/email/schedule — bulk schedule overview (period)SPEC.md — source of truth for data model, business rules, UI spec, RLSsupabase/migrations/ — database migrations (versioned)src/lib/pay-calculator.ts — payroll calculation logicsrc/lib/email.ts — Resend email templates and sendingsrc/lib/supabase.ts — Supabase client helperssrc/
app/
(auth)/
login/page.tsx
(dashboard)/
page.tsx # My shifts (employee) / Schedule (admin)
calendar/page.tsx # All shifts
payroll/page.tsx # Payroll report (admin)
my-pay/page.tsx # My pay (employee)
employees/page.tsx # Employees (admin)
requests/page.tsx # Swap requests (admin) - auto refresh
settings/page.tsx # Settings
api/
auth/login/ # custom auth (phone + PIN)
email/notify/ # swap notifications
email/schedule/ # bulk schedule emails
employees/ # employee CRUD + unlock
shifts/transfer/ # direct shift transfer (service role, bypasses RLS)
components/
ui/ # shadcn/ui
shift-card.tsx
week-calendar.tsx
swap-modal.tsx
pay-summary.tsx
lib/
supabase.ts
auth.ts
pay-calculator.ts
email.ts
utils.ts
supabase/
migrations/
001_initial_schema.sql
functions/
send-swap-notification/ # placeholder / optional future
weekly-schedule-email/ # placeholder / optional future
employees — phone, bcrypt PIN hash, hourly rate, role, color, real email for notificationsshifts — date, time, assigned employee, notes, approval_statusswap_requests — swap workflow, including auto_approved for direct swapssupplement_rules — pre-populated supplement ruleshourly_rate_history — historical changes (“from now”, no future planning)payroll_entries — tracks which months have been paid per employeecompany_settings — singleton settings row (name/logo)failed_login_attempts — lockout tracking{phone}@flowplanner.local (internal only)SG{pin} (e.g., SG1234){phone}@flowplanner.local + password SG{pin}employees with phone, pin_hash (bcrypt), real email, role, hourly_rate, etc.POST /api/shifts/transferresend.yourdomain.com)onboarding@resend.dev) only sends to account ownerEnvironment variables:
RESEND_API_KEY
RESEND_FROM_EMAIL
npm run dev
# Supabase local (optional)
supabase start
supabase db reset
supabase stop
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY
RESEND_API_KEY
RESEND_FROM_EMAIL
Migrations live in supabase/migrations/ and must be numbered:
001_initial_schema.sql
002_some_change.sql
003_another_change.sql
...
IF NOT EXISTS, etc.)supabase db resetRun manually in Supabase Dashboard SQL editor before deploying code that depends on them.
| Name | Phone | PIN | Role | Hourly Rate |
|---|---|---|---|---|
| Kristine | 90000001 | 1234 | admin | 195 |
| Emma | 90000002 | 1234 | employee | 175 |
| Jonas | 90000003 | 1234 | employee | 175 |
| Sofie | 90000004 | 1234 | employee | 175 |
main # Production - auto deploy on push
feature/xyz # New feature branches
fix/xyz # Bug fix branches
git checkout main
git pull origin main
git checkout -b feature/my-feature
# develop
git add .
git commit -m "Add: short description"
git push -u origin feature/my-feature
# Open PR - merge only after explicit approval

Visste du at Nordmenn er blant de dårligste til å skifte tannbørste? Tannleger og tannpleiere anbefaler oss å bytte tannbørste hver 3 måned. Har du glemt å bytte og så plutselig en dag ser du at busten på tannbørsten står til alle kanter? Da er du ikke alene! Nå kan du gjøre noe med det og vi hjelper deg...
Abonner nå
Abonner nå

Har du



