Skip to content

Commit

Permalink
feat: add lote title to registration export
Browse files Browse the repository at this point in the history
  • Loading branch information
willianspraciano committed May 4, 2024
1 parent dd101c9 commit 80e989c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ import {
Participant,
Event,
Address,
EventTicket,
} from '@prisma/client';

export type FindManyByEventResponseDto = EventRegistration & {
payment: Payment | null;
payment:
| null
| (Payment & {
tickets: EventTicket;
});
participant: Participant & {
addresses: Address[];
user: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export async function exportRegistrationsController(
registration.payment?.paymentMethod,
String(registration.payment?.price),
'1º Lote', //registration.payment?.eventTicketId,
registration.payment?.tickets?.title ?? ' Lote X',
translatePaymentStatus(registration.payment?.status),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class PrismaRegistrationsRepository implements RegistrationsRepository {
},
},
},
payment: true,
payment: { include: { tickets: true } },
event: { include: { addresses: true } },
},
orderBy: { createdAt: 'desc' },
Expand Down

0 comments on commit 80e989c

Please sign in to comment.