Commit Graph
85 Commits
Author SHA1 Message Date
popertotsandSisyphus 9ba4949d37 docs: update all documentation for referral codes, admin schedule page, BookingFlow welcome step, format utilities, and patch_test_duration_hours
- README: add new features (referral codes, admin schedule page, welcome step, format utils, patch_test_duration_hours, created_by_name, admin login redirect), update project structure, update test count to 446/449

- Overview: add referral code support to Auth section, created_by_name to Booking System, admin schedule page to Scheduling and Admin Features, welcome step to Customer Features, update test coverage

- Technical Manual: add format.ts utilities to Shared Utilities, add /admin/schedule route, update handler descriptions (auth, bookings, services), add Referral Code System, Admin Schedule Page, BookingFlow Welcome Step, and patch_test_duration_hours sections, update test coverage

- Admin Manual: add Schedule page to main pages list, add full Schedule (Weekly Calendar View) section, add patch test duration to service creation, update referral history description

- User Manual: add referral code field to registration, add welcome step explanation to Step 1

- Future Work: update header, add #52-58 completed items, update #21 referral system status, add Phase 6 execution order

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-29 16:21:18 +01:00
popertotsandSisyphus 2b56c5640d docs: update all documentation for reschedule modal, time blockers UI, and booking flow improvements
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-28 16:48:56 +01:00
popertots 8574bf2221 feat: enriched edit request system with side-by-side snapshots, calendar preloading, and admin review UI
Backend:
- Add enriched response types (EditSnapshot, EnrichedEditRequest) with original vs proposed snapshots
- Add 4 new GET endpoints for viewing edit requests (user and admin scoped)
- Remove github.com/lib/pq dependency — use native PostgreSQL array scanning
- Clean up edit requests, time blockers, and notifications on booking cancellation
- Validate exceptional closed hours on admin approve (409 Conflict)
- Notification upsert on edit request replace (no duplicate admin notifications)

Frontend:
- New user EditRequestModal with time/services/both modes and lunch protection
- New admin EditRequestModal with side-by-side diff (date/time, services, notes)
- Integrate edit requests into PendingApprovals card and notifications page
- Preload 3 months of availability to prevent calendar snap-back
- Apply lunch protection to isDateUnavailable in BookingFlow and BookingCreateModal
- Fix accessibility: card list items use <button> instead of <div>

Dev & Docs:
- Seed edit requests in local-dev-2.sh
- Update all Obsidian manuals with enriched edit request documentation
- 42 new tests (438/441 passing)
2026-05-26 11:59:07 +01:00
popertotsandSisyphus 97c9d1643f docs: update all documentation for multi-method payments and saved cards
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 18:04:53 +01:00
popertots 8cd393f95d docs: update all documentation for Square payment integration
- README: add Square payments to features, expand project structure, update test count
- Overview: mark Square as active, add payment integration + saved cards sections
- Technical Manual: add payment handlers, API endpoints, 4 new DB tables, build tags
- Admin Manual: update Take Payment from stub to live Square Terminal flow
- User Manual: add paying deposits online + leaving tips sections
- Future Work: mark E1-E4 (Square items) as complete
2026-05-23 11:44:39 +01:00
popertots d0e82e7d79 style: fix indentation in notification preferences section and backlog table formatting 2026-05-17 00:37:21 +01:00
popertots b08df624a8 feat: user notification preferences UI and API endpoints
GET/PUT /api/user/notification-preferences with partial update support.
Toggle section in /account Admin tab (Email, SMS, Browser push).
3 new tests: defaults, full update, partial update.
Fix pre-existing timezone bug in exceptional hours tests (Truncate vs time.Date).
Update README, Technical Manual, and gap backlog (#15 struck out).
2026-05-17 00:24:13 +01:00
popertots 7fc58f58d9 feat: admin notification system with priority ordering, bell icon, and /notifications page
Two-tier notification system: new_booking (all public bookings) + pending_booking (notes/today).
Priority-sorted queue, unread count polling, enriched responses with user_name/booking_start_time.
Fix critical bug: edit_requested cleanup was broken (wrong reason string in 3 handlers).
Add 15 new tests covering priority ordering, enrichment, and notification creation flows.
Update Admin Manual, Technical Manual, and gap backlog docs.
2026-05-16 23:41:18 +01:00
popertots c3501ae89a dependancies and docs 2026-05-16 19:06:33 +01:00
popertots 924bf487ed docs: reorganise Obsidian docs from monolith into multi-page knowledge base
Split Crussell Nails.md (822 lines) into 5 focused documents:
- README.md: slimmed to 84 lines (elevator pitch + run instructions)
- Overview.md: expanded landing page with architecture diagram and quick links
- User Manual.md: 358 lines, customer-facing journeys in plain English
- Admin Manual.md: 493 lines, staff operations guide with zero technical jargon
- Technical Manual.md: 736 lines, full API reference, schema, key systems

All user/admin manuals rewritten for non-technical audiences — no API
endpoints, component names, or implementation details.
2026-05-16 19:05:47 +01:00
popertots a4ea994c69 docs: update README, Obsidian docs, and gap backlog for booking edit modal
Reflect new PUT /api/admin/bookings/{id} services endpoint, EditBookingModal
component, and updated test count (306/308). Mark handleEdit() stub resolved
in gap backlog.
2026-05-16 17:32:32 +01:00
popertots aa4a569a43 docs: update README, Obsidian docs, and gap backlog after test optimization
- Update test count: 286/288 passing (was 222/224)
- Document TestMain per-package architecture
- Document TruncateTables optimization (~60% faster)
- Add local-dev-2.sh tee streaming for real-time test output
- Fix flaky admin reserve walk-in tests (time.Now → noon tomorrow)
- Add gap backlog item #51 for completed test optimization work
2026-05-10 19:48:36 +01:00
popertots 83c62ffb97 feat: edit request time blockers, today closing time, UI polish, and test fixes
- Add time blocker management for booking edit requests
- Add closing_time field to admin today/current-next endpoint
- Update UserBookingModal and CurrentAppointment UI components
- Fix fmt import in bookings_test.go (was missing)
- Fix created_by FK in TestAdminApproveEditRequest_TimeBlockerOverlap
- Update test coverage for edit request time blocker overlap
- Update gap backlog documentation
2026-05-10 16:53:17 +01:00
popertots fa10134d41 feat: user booking cancel/reschedule, estimated subtotal wording
- Add Cancel Booking button with confirmation dialog (future bookings only, pending/confirmed status)
- If payments exist, dialog shows warning: amount paid retained as credit towards future appointment
- Add Reschedule button with inline form (date/time picker + optional notes)
- Reschedule submits to POST /api/bookings/{id}/edit-request
- Change 'Amount Due' to 'Estimated Subtotal' for future bookings
- Footer: Cancel (left) | Reschedule, Add to Calendar, Close (right)
- Mobile-first: flex-wrap layout for footer buttons
2026-05-08 22:02:16 +01:00
popertots bec4100e4d feat: customer relationship view, idempotency keys, approval decline, seed payments, backlog cleanup
- #3: Wire ApprovalModal handleDecline to POST /api/admin/bookings/{id}/cancel
- #25: New GET /api/admin/users/{id}/relationship endpoint with spend, tips, visits, customer-for duration, top services
- #25: UserModal reorganized — Personal Info, Booking History, Customer Relationship, Loyalty, Patch Tests
- #36: Idempotency keys on user and admin booking creation (UUID header, duplicate detection)
- local-dev-2.sh: seed payments via PL/pgSQL for completed bookings (5 randomized scenarios)
- local-dev-2.sh: shrink guest/time-blocker output, add payments to summary
- Backlog: mark #3/#25/#35/#36/#49 done, plan #36/#45, remove #46/#48, update #45 with milestone campaigns
- Remove notes history table, avg visits/year metric, Account Information, Privacy & Consent from UserModal
2026-05-04 12:20:03 +01:00
popertots 88ee265603 refactor: remove auto deposit penalty on no-shows, add comprehensive tests
- Remove automatic deposits_required=3 on no-shows, give admin flexibility
- Add tests for no-show deposit logic (forgiven, over 24h, under 24h)
- Add tests for reservation cleanup TTL (admin walk-in/call-in 15min)
- Add tests for EXIF GPS data stripping in portfolio images
- Add tests for contact info endpoint
- Add tests for guest account anonymization
2026-05-03 15:59:40 +01:00
popertots 6808752e0d feat: unify walk-in and call-in reservation flows with 15min TTL, guest booking support, and slot awareness
- backend/handlers/bookings/admin_reserve.go:
  - Add explicit reservation_type field ("walkin" | "callin") to request struct
  - Remove TTL-based heuristic for type detection
  - Walk-in: uses duration_minutes, allows null user_id, 1min past grace
  - Call-in: requires service_ids, validates future time, calculates duration from services
  - Both types now use 15-minute TTL

- backend/handlers/scheduling/time-blockers.go:
  - Update CleanupOldReservations: both walkin and callin use 15min TTL (was 10min/60min)

- frontend/WalkInBooking.svelte:
  - Full rewrite of reservation logic
  - If available now and >15min remaining: reserve from now to slot end
  - If <=15min or not available: reserve next full slot
  - Always reserves before opening modal (never open without hold)
  - Passes reservedDuration to modal
  - TTL changed from 5 to 15 minutes

- frontend/WalkInCreateModal.svelte:
  - Replace dead commented-out guest code with working guest creation
  - Guest account created at submit time (not earlier)
  - Phone defaults to +447700900000 if blank
  - Phone field marked optional with helper text
  - Name split into firstName/lastName for backend
  - Validation relaxed: only name required for guests

- frontend/BookingCreateModal.svelte:
  - TTL changed from 60 to 15 minutes
  - Add reservation_type: "callin" to reserve payload
  - Guest creation uses correct firstName/lastName fields
  - Default guest phone to +447700900000
  - Reservation no longer requires selectedUserId (works for guests)

- docs: Update Future Work backlog to mark completed items
2026-05-03 15:09:50 +01:00
popertots bff86a6660 feat: 10 quick wins — account deletion, health check, debug cleanup, UX polish, graceful shutdown
- backend/handlers/user/account.go: Wire DELETE /api/user/account to call
  anonymize_user() for registered users and delete_guest_user() for guests,
  with CardDAV contact cleanup
- backend/handlers/user/profile_test.go: Add TestAccount_DeleteGuest and
  enhance TestAccount_Delete to verify anonymization results
- backend/main.go: Add GET /api/health endpoint with DB ping and S3 status
  check; add HSTS and Referrer-Policy security headers; replace
  http.ListenAndServe with http.Server + graceful SIGTERM/SIGINT shutdown
- frontend/routes/+layout.svelte: Replace alert() with toast notifications
  for email verification flow
- frontend/routes/login/+page.svelte: Replace alert() with toast.info for
  social login prototype buttons
- frontend/booking/BookingFlow.svelte: Remove 2 console.log debug calls;
  add cancellation policy note in Step 3; add timezone policy comment
- frontend/ImageUpload.svelte: Comment out debug console.log
- init-scripts/init-script.sql: Add delete_guest_user() SQL function
- docs: Update README.md and Obsidian notes to reflect completed items
2026-05-01 11:33:27 +01:00
popertots 94adc7f54c test: clarify 1h advance requirement is USER-ONLY, add admin walk-in tests
FIXES:
- Clarified that 1-hour minimum advance requirement applies to USER bookings only
- Admins can create walk-in bookings with no advance notice via AdminCreateBookingForUserHandler
- Updated test comments to reflect this distinction

NEW TESTS ADDED:
- TestAdminBookings_Create_WalkIn: Admin creates booking with < 1h notice (walk-in)
- TestAdminBookings_Create_WalkInWithDeposits: Admin walk-in with outstanding deposits + enforce_deposits=false

TEST SCENARIOS VERIFIED:
✓ User: Cannot book < 1h in advance (400 error)
✓ Admin: CAN book < 1h in advance (walk-in, 201 created)
✓ Admin: Can create walk-ins even with user deposits (with enforce_deposits bypass)
✓ Admin: Can bypass minimum advance requirement

BUILD STATUS:
✓ go build -tags test ./handlers/bookings
✓ go build -tags test ./handlers/admin
✓ go build -tags dev ./main.go

Documentation now clearly distinguishes:
- User journey: 1h minimum advance (universal)
- Admin journey: No minimum advance (accept walk-ins)
2026-03-07 18:05:17 +00:00
popertots f9610c8392 docs: update obsidian deposits section to reflect 24h rule, optional forgiveness, and admin enforcement toggle 2026-03-07 17:46:15 +00:00
popertots 1e13ccda05 docs 2026-03-02 22:32:56 +00:00
popertots 2c94a4d9c3 docs 2026-02-25 00:06:55 +00:00
popertots 89d848ee72 docs 2026-02-23 01:19:53 +00:00
popertots 970cc5554d feat: add email verification, profile pictures, deposits, and calendar
export
Backend:
- Add email verification code generation and verification endpoints
- Add profile picture upload with S3 storage and image processing
- Add deposit_required field to users with 48h advance booking
  requirement
- Add loyalty stamps that accumulate on completed bookings
- Auto-transition bookings: confirmed → in_progress → completed
- Add booking cancellation handler with no-show detection
- Add ICS calendar file download endpoint for bookings
- Sync bookings to CalDAV on confirmation
  Frontend:
- Add schedule page route
- Add avatar and image-cropper UI components
- Update shadcn-svelte components (button, dialog)
- Add "Add to Calendar" button in booking modal
  Database:
- Add verification_codes table
- Add profile_pic_url, loyalty_stamps, deposits_required to users
- Various schema updates
2026-02-21 18:48:29 +00:00
popertots 7b0259c0db fix(admin): pagination, patch tests, and per-page limits
Backend:
- Fix GetAllAdminBookingsHandler and SearchAdminBookingsHandler to
  return totalPages in response
- Auto-record patch tests when booking status progresses to "completed"
- Add GET/POST /api/admin/users/{id}/patch-tests endpoints
  Frontend:
- BookingsCard: proper pagination with 4 per page, prev/next buttons
- UsersCard, BookingCreateModal, WalkInCreateModal: per_page=4 for user
  search
- Add PatchTestModal for manual patch test entry in UserModal
- Hide patch test section when user has no eligible services
  Database:
- Add UNIQUE constraint on user_service_patch_tests(user_id, service_id)
2026-02-20 22:17:37 +00:00
popertots 41dc839830 feat(booking): add service eligibility based on age and patch tests
- Add eligibility filtering to /api/services: exclude services below
  user's
  age, gray out services requiring patch tests that are missing/expired
- Add new endpoint /api/services/eligible-for/{user_id} for admin
  booking
  flows to check eligibility for a specific user
- Add image metadata stripping: uploads now strip all EXIF/GPS data
  via imaging library (security improvement)
- Update ServiceCard frontend: show grayed-out state for ineligible
  services with "contact us" link (public) or just warning (admin)
- Add 2 patch test services to seed data: Gel Polish Full Set,
  Luxury Gel Manicure (48h each)
- Remove deprecated local-dev.sh script
2026-02-20 18:46:38 +00:00
popertots b4d91d5dc0 Security pass 2026-02-20 12:59:10 +00:00
popertots a5a2ffd83e Security: add rate limiting, input validation, and filter category
validation
Backend:
- Add rate limiting middleware (mw/ratelimit.go) - in-memory per-IP
  limiter
- Apply rate limits per endpoint group:
  - Public read-only: 120/min
  - Registration: 10/min
  - Portfolio filters: 60/min
  - Authenticated users: 120/min
  - Admin: none (trusted)
- Add 256 char input length validation on portfolio endpoints
- Validate filter categories exist in DB before querying
- Secure GetImage endpoint: only allow UUID or numeric timestamp (15-20
  digits)
- Remove pattern-based image lookup to prevent enumeration
- Add services validation: name (100), duration (1-480), patch test
  (0-168)
  Frontend:
- Add maxlength=256 to portfolio tag/search inputs
- Add maxlength to registration: name (50), email (255), phone (20),
  password (72)
- Add maxlength=100 to service name input
2026-02-20 12:03:14 +00:00
popertots 9259de9393 Portfolio: add filtering, URL sharing, and improved tag input
- Add category filters with dynamic counts that reduce as filters
  applied
- Add ?filter[category]=value URL params for filterable links
- Add ?img= timestamp param that bypasses filters to show specific image
- Update URL when opening/navigating/closing modal for shareable links
- Backend: add /api/portfolio/filters endpoint with filter logic
- Backend: add timestamp lookup fallback for GetImage endpoint
  Frontend:
- Portfolio page: filter dropdowns, keyboard nav, mobile improvements
- ImageUpload: live tag suggestions from API, arrow/Tab navigation,
  confirmation modal before upload, mobile-optimized touch targets
- Add scrollbar-hide utility and fix filter dropdown overflow
- Move Clear all button, add vertical separator on desktop
2026-02-20 00:32:09 +00:00
popertots d43d7ebc5e readme 2026-02-17 22:38:22 +00:00
popertots e20263b717 Update readme 2026-02-17 21:47:11 +00:00
popertots 50746595e7 feat(bookings): improve admin booking wizard and user dashboard
Backend:
- Enriched GetAllUserBookings response with calculated total_amount,
  amount_paid, and duration_minutes.
- Refactored GetBookingHandler to return a flat booking object matching
  frontend expectations.
- Added account_role to admin user list response and sorted users by
  booking activity.
- Corrected function name oo to AdminCreateBookingForUserHandler.

Frontend:
- Rebuilt BookingCreateModal into a 4-step wizard supporting guest
  bookings, service overrides, and real-time availability checks.
- Fixed account dashboard logic to correctly identify upcoming vs past
  bookings and sort unpaid items to the top.
- Extracted booking flow into a shared BookingFlow component.
- Redirected admin users from home page to /today.
2026-02-12 22:15:10 +00:00
popertots 28815d3b25 Update readme 2025-11-06 16:05:33 +00:00
popertots f1dc375c5f update obsidian 2025-11-03 23:47:58 +00:00
popertots 2b7ec96d37 obsidian 1 2025-11-03 23:25:04 +00:00