feat(attendee-detail): enhance attendee detail view with payment and notes sections
- Added payment presentation logic to display payment status and due dates. - Introduced AttendeeNotesSection and AttendeePaymentsSection components for managing notes and payments. - Implemented forms for editing contact information and notes with validation. - Updated API to support attendee updates and added corresponding tests. - Improved attendance summary logic to reflect all visible sessions. - Enhanced UI with loading states and error handling for better user experience.
This commit is contained in:
@@ -59,6 +59,28 @@ export const AttendeePaymentSummarySchema = z.object({
|
||||
});
|
||||
export type AttendeePaymentSummary = z.output<typeof AttendeePaymentSummarySchema>;
|
||||
|
||||
export const AttendeeDetailDtoSchema = AttendeeDtoSchema.extend({
|
||||
payment: AttendeePaymentSummarySchema.nullable(),
|
||||
});
|
||||
export type AttendeeDetailDto = z.output<typeof AttendeeDetailDtoSchema>;
|
||||
|
||||
const EditableAttendeeFieldsSchema = z.object({
|
||||
phone: z.string().trim().nullable(),
|
||||
email: z
|
||||
.string()
|
||||
.trim()
|
||||
.email('Ingresá un email válido')
|
||||
.or(z.literal(''))
|
||||
.nullable(),
|
||||
notes: z.string().trim().nullable(),
|
||||
});
|
||||
|
||||
export const UpdateAttendeeSchema = EditableAttendeeFieldsSchema.partial().refine(
|
||||
(value) => Object.keys(value).length > 0,
|
||||
'Enviá al menos un campo para actualizar',
|
||||
);
|
||||
export type UpdateAttendee = z.output<typeof UpdateAttendeeSchema>;
|
||||
|
||||
/**
|
||||
* Member listing item: `AttendeeDto` plus the summary the row needs so it does
|
||||
* not run dry of data. It is a superset, so every consumer of the plain DTO
|
||||
@@ -153,4 +175,4 @@ export const RemoveAttendeeResultSchema = z.object({
|
||||
removedAttendeeId: z.string(),
|
||||
promoted: GroupWaitlistEntryDtoSchema.nullable(),
|
||||
});
|
||||
export type RemoveAttendeeResult = z.output<typeof RemoveAttendeeResultSchema>;
|
||||
export type RemoveAttendeeResult = z.output<typeof RemoveAttendeeResultSchema>;
|
||||
|
||||
Reference in New Issue
Block a user