55use Carbon \Carbon ;
66use HiEvents \DomainObjects \AttendeeDomainObject ;
77use HiEvents \DomainObjects \Enums \QuestionTypeEnum ;
8+ use HiEvents \DomainObjects \Enums \TicketType ;
89use HiEvents \DomainObjects \QuestionDomainObject ;
10+ use HiEvents \DomainObjects \TicketDomainObject ;
11+ use HiEvents \DomainObjects \TicketPriceDomainObject ;
912use HiEvents \Resources \Attendee \AttendeeResource ;
1013use HiEvents \Services \Domain \Question \QuestionAnswerFormatter ;
1114use Illuminate \Contracts \Pagination \LengthAwarePaginator ;
@@ -51,6 +54,7 @@ public function headings(): array
5154 'Is Checked In ' ,
5255 'Checked In At ' ,
5356 'Ticket ID ' ,
57+ 'Ticket Name ' ,
5458 'Event ID ' ,
5559 'Public ID ' ,
5660 'Short ID ' ,
@@ -75,6 +79,16 @@ public function map($attendee): array
7579 );
7680 });
7781
82+ /** @var TicketDomainObject $ticket */
83+ $ ticket = $ attendee ->getTicket ();
84+ $ ticketName = $ ticket ->getTitle ();
85+ if ($ attendee ->getTicket ()?->getType() === TicketType::TIERED ->name ) {
86+ $ ticketName .= ' - ' . $ ticket
87+ ->getTicketPrices ()
88+ ->first (fn (TicketPriceDomainObject $ tp ) => $ tp ->getId () === $ attendee ->getTicketPriceId ())
89+ ->getLabel ();
90+ }
91+
7892 return array_merge ([
7993 $ attendee ->getId (),
8094 $ attendee ->getFirstName (),
@@ -86,6 +100,7 @@ public function map($attendee): array
86100 ? Carbon::parse ($ attendee ->getCheckIn ()->getCreatedAt ())->format ('Y-m-d H:i:s ' )
87101 : '' ,
88102 $ attendee ->getTicketId (),
103+ $ ticketName ,
89104 $ attendee ->getEventId (),
90105 $ attendee ->getPublicId (),
91106 $ attendee ->getShortId (),
0 commit comments