feat(logistics): departure-after-arrival validation + travel/visa CSV export
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m11s

- upsertFlightDetail throws BAD_REQUEST when departureAt < arrivalAt
- Travel tab: Download CSV button (project/attendee/email/flight fields/status/visa)
- Visas tab: Download CSV button (project/attendee/nationality/status/dates/notes)
- TDD: 2 new tests (rejects invalid, accepts valid); all 6 flight tests pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-06-04 16:56:22 +02:00
parent 53b623fb20
commit 97951deb68
4 changed files with 203 additions and 9 deletions

View File

@@ -162,6 +162,12 @@ export const logisticsRouter = router({
for (const [k, v] of Object.entries(rest)) {
if (v !== undefined) data[k] = v
}
if (input.arrivalAt && input.departureAt && input.departureAt < input.arrivalAt) {
throw new TRPCError({
code: 'BAD_REQUEST',
message: 'Departure must be after arrival',
})
}
const detail = await ctx.prisma.flightDetail.upsert({
where: { attendingMemberId },
create: { attendingMemberId, ...(data as object) },