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
This commit is contained in:
2026-02-20 18:46:38 +00:00
parent eb1a719fc3
commit 41dc839830
13 changed files with 385 additions and 1647 deletions
@@ -116,6 +116,13 @@
wasOpen = open;
});
// Refetch services when selected user changes (for eligibility)
$effect(() => {
if (open && selectedUserId) {
fetchServices();
}
});
function resetState() {
currentStep = 1;
userType = 'member';
@@ -159,7 +166,12 @@
async function fetchServices() {
loadingServices = true;
try {
const response = await fetch('/api/services', {
let url = '/api/services';
// If a user is selected, get eligibility for that user
if (selectedUserId) {
url = `/api/services/eligible-for/${selectedUserId}`;
}
const response = await fetch(url, {
headers: { Authorization: `Bearer ${authStore.currentToken}` }
});
if (response.ok) {
@@ -553,6 +565,7 @@
selected={selectedServices}
loading={loadingServices}
ontoggle={toggleService}
showContactLink={false}
/>
{/if}