feat(logistics): departure-after-arrival validation + travel/visa CSV export
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m11s
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:
@@ -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) },
|
||||
|
||||
Reference in New Issue
Block a user