diff --git a/frontend/src/pages/Import.svelte b/frontend/src/pages/Import.svelte index a3f9ccc..17bff4d 100644 --- a/frontend/src/pages/Import.svelte +++ b/frontend/src/pages/Import.svelte @@ -53,7 +53,7 @@ Supported formats: CrowdWork / ticketing platform: columns Patron Name, Patron Email, Tier Name, Order Number Generic: columns name, email, ticket_id, ticket_type, note - Duplicate names are skipped. + Duplicate tickets (same source + external ID) are skipped. Participants are matched or created by email. diff --git a/frontend/src/pages/Participants.svelte b/frontend/src/pages/Participants.svelte index 0003bf0..2495958 100644 --- a/frontend/src/pages/Participants.svelte +++ b/frontend/src/pages/Participants.svelte @@ -53,7 +53,8 @@ .filter(p => { if (!s) return true return p.preferred_name?.toLowerCase().includes(s) || - p.email?.toLowerCase().includes(s) + p.email?.toLowerCase().includes(s) || + p.phone?.toLowerCase().includes(s) }) .sort((a, b) => (a.preferred_name || a.email).localeCompare(b.preferred_name || b.email)) }) @@ -177,6 +178,18 @@ } } + async function deleteParticipant(id) { + if (!confirm('Permanently delete this participant and all their records?')) return + error = '' + try { + await api.participants.delete(id) + await db.participants.delete(id) + editId = null + } catch (err) { + error = err.message + } + } + async function addTicket(e, participantId) { e.preventDefault() addingTicket = true; error = '' @@ -327,6 +340,8 @@ {saving ? 'Saving…' : 'Save'} editId = null}>Cancel + + deleteParticipant(editId)}>Delete diff --git a/frontend/src/pages/Volunteers.svelte b/frontend/src/pages/Volunteers.svelte index 98a0a01..39bc98b 100644 --- a/frontend/src/pages/Volunteers.svelte +++ b/frontend/src/pages/Volunteers.svelte @@ -14,7 +14,6 @@ let adding = $state(false) let newName = $state('') let newEmail = $state('') - let newPhone = $state('') let newDeptID = $state('') let newIsLead = $state(false) let newNote = $state('') @@ -25,6 +24,7 @@ const allVolunteers = liveQuery(() => db.volunteers.filter(v => !v.deleted_at).toArray() ) + const allParticipants = liveQuery(() => db.participants.toArray()) const allDepts = liveQuery(() => db.departments.filter(d => !d.deleted_at).toArray() .then(arr => arr.sort((a, b) => a.name.localeCompare(b.name))) @@ -62,7 +62,6 @@ const data = { name: newName, email: newEmail, - phone: newPhone, is_lead: newIsLead, note: newNote, } @@ -70,7 +69,7 @@ const v = await api.volunteers.create(data) await db.volunteers.put(v) showAdd = false - newName = newEmail = newPhone = newNote = '' + newName = newEmail = newNote = '' newDeptID = '' newIsLead = false } catch (err) { @@ -93,6 +92,10 @@ function deptFor(id) { return ($allDepts ?? []).find(d => d.id === id) } + + function participantFor(id) { + return ($allParticipants ?? []).find(p => p.id === id) ?? null + } @@ -121,10 +124,6 @@ Email - - Phone - - Department @@ -195,12 +194,19 @@ {#each filtered as v (v.id)} {@const dept = deptFor(v.department_id)} + {@const participant = participantFor(v.participant_id)} {v.name} {#if v.is_lead} Lead {/if} + {#if !v.participant_id} + No ticket + {/if} + {#if v.email} + {v.email} + {/if} {#if v.note} {v.note} {/if}
Patron Name
Patron Email
Tier Name
Order Number
name
email
ticket_id
ticket_type
note