* Adding flexible reminder options to birthdays * Fix database migration merge conflict * Truncate calendar popup descriptions * Log app version on backend startup * Add host-mounted data and backup folders * feat: add housekeeping module * fix: align housekeeping UI and add task creation * refactor: rebuild housekeeping experience * feat: support multiple housekeeping staff * feat: integrate housekeeping visits with calendar * feat: refine housekeeping visits and payments * feat: add housekeeping staff visit logs * feat: add housekeeping receipts and document folders * feat: localize housekeeping folders and chores * feat: refine housekeeping tabs and document folders * fix: sync housekeeping tab active state * feat: use configured app name in onboarding and manifest
3.4 KiB
Housekeeping Implementation
Backend
The module is implemented in server/routes/housekeeping.js and registered in server/index.js under:
/api/v1/housekeeping
The registration happens after the global authenticated /api/v1 middleware, so the module follows the existing Oikos security model:
- Session or API-token authentication required.
- CSRF required for state-changing session requests.
- API rate limiting inherited from
/api/. - No unauthenticated housekeeping route.
Database schema is migration 33 in server/db.js. The migration creates:
housekeeping_work_sessionshousekeeping_decay_taskshousekeeping_supply_requestshousekeeping_maintenance_log
Migration 34 adds:
housekeeping_workershousekeeping_work_sessions.paid_at
Migration 35 adds per-staff visit tracking:
housekeeping_workers.calendar_colorhousekeeping_work_sessions.worker_idhousekeeping_work_sessions.calendar_event_id
Each staff profile links to users.id. These users are hidden from the normal family list by filtering rows associated with housekeeping_workers, while contact and birthday sync remains shared with the existing family-member artifact flow.
The quick supply endpoint uses a SQLite transaction:
- Resolve the first existing shopping list, or create
Housekeeping. - Insert a
shopping_itemsrow. - Insert a
housekeeping_supply_requestsrow linked to the shopping item.
If any step fails, the transaction rolls back.
Frontend
The SPA route /housekeeping is registered in public/router.js and loads:
public/pages/housekeeping.jspublic/styles/housekeeping.css
The page uses the existing API wrapper in public/api.js, so CSRF tokens and auth expiry behavior remain centralized. The UI now follows the standard Oikos module layout: sticky toolbar, horizontal tab chips, and regular cards.
Check-in/check-out actions live beside each staff member on the Dashboard and are disabled until at least one staff member exists.
Calendar integration creates a local calendar event at check-in, assigns it to the staff user, uses the staff calendar color, and updates the end time on check-out. Calendar event icon selection now opens a dedicated icon picker dialog instead of expanding inline inside the event modal.
The UI intentionally avoids innerHTML; rendering uses replaceChildren() and insertAdjacentHTML() with escaped dynamic values.
Localization
The module adds:
nav.housekeepinghousekeeping.*
to every JSON locale under public/locales.
Portuguese is the primary text for the cleaner-facing target workflow, with localized strings for the most common existing languages and English fallback text for remaining locales.
Validation
Backend validation covers:
- Required strings and max lengths.
- Positive integer
frequency_days. - Non-negative
daily_rateandextras. YYYY-MMmonth filters.- Maintenance photos limited to PNG, JPEG, or WebP data URLs under 6 MB.
Manual Use
- Navigate to
/housekeeping. - Use the check-in/check-out button next to the staff member on the Dashboard.
- Review the Dashboard metrics and payment chart.
- On Tasks, choose suggested chores or create a custom recurring chore.
- On Reports, take/upload a photo and submit a maintenance description.
- On Staff, create or update one or more housekeepers, contacts, birthdays, rates, and payment schedules.