Skip to content

Commit e0b34a9

Browse files
committed
Merge remote-tracking branch 'origin/v2.0.0-alpha.1' into v2.0.0-alpha.1
# Conflicts: # frontend/src/locales/de.js # frontend/src/locales/de.po # frontend/src/locales/en.js # frontend/src/locales/en.po # frontend/src/locales/es.js # frontend/src/locales/es.po # frontend/src/locales/fr.js # frontend/src/locales/fr.po # frontend/src/locales/hu.js # frontend/src/locales/hu.po # frontend/src/locales/it.js # frontend/src/locales/it.po # frontend/src/locales/nl.js # frontend/src/locales/nl.po # frontend/src/locales/pl.js # frontend/src/locales/pl.po # frontend/src/locales/pt-br.js # frontend/src/locales/pt-br.po # frontend/src/locales/pt.js # frontend/src/locales/pt.po # frontend/src/locales/ru.js # frontend/src/locales/ru.po # frontend/src/locales/se.js # frontend/src/locales/se.po # frontend/src/locales/tr.js # frontend/src/locales/tr.po # frontend/src/locales/vi.js # frontend/src/locales/vi.po # frontend/src/locales/zh-cn.js # frontend/src/locales/zh-cn.po # frontend/src/locales/zh-hk.js # frontend/src/locales/zh-hk.po
2 parents 9b593f3 + 112778a commit e0b34a9

98 files changed

Lines changed: 11121 additions & 3158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/app/DomainObjects/Generated/CheckInListDomainObjectAbstract.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ abstract class CheckInListDomainObjectAbstract extends \HiEvents\DomainObjects\A
2020
final public const DELETED_AT = 'deleted_at';
2121
final public const CREATED_AT = 'created_at';
2222
final public const UPDATED_AT = 'updated_at';
23+
final public const PUBLIC_SHOW_ATTENDEE_NOTES = 'public_show_attendee_notes';
24+
final public const PUBLIC_SHOW_QUESTION_ANSWERS = 'public_show_question_answers';
25+
final public const PUBLIC_SHOW_ORDER_DETAILS = 'public_show_order_details';
2326

2427
protected int $id;
2528
protected int $event_id;
@@ -31,6 +34,9 @@ abstract class CheckInListDomainObjectAbstract extends \HiEvents\DomainObjects\A
3134
protected ?string $deleted_at = null;
3235
protected ?string $created_at = null;
3336
protected ?string $updated_at = null;
37+
protected bool $public_show_attendee_notes = true;
38+
protected bool $public_show_question_answers = true;
39+
protected bool $public_show_order_details = true;
3440

3541
public function toArray(): array
3642
{
@@ -45,6 +51,9 @@ public function toArray(): array
4551
'deleted_at' => $this->deleted_at ?? null,
4652
'created_at' => $this->created_at ?? null,
4753
'updated_at' => $this->updated_at ?? null,
54+
'public_show_attendee_notes' => $this->public_show_attendee_notes ?? null,
55+
'public_show_question_answers' => $this->public_show_question_answers ?? null,
56+
'public_show_order_details' => $this->public_show_order_details ?? null,
4857
];
4958
}
5059

@@ -157,4 +166,37 @@ public function getUpdatedAt(): ?string
157166
{
158167
return $this->updated_at;
159168
}
169+
170+
public function setPublicShowAttendeeNotes(bool $public_show_attendee_notes): self
171+
{
172+
$this->public_show_attendee_notes = $public_show_attendee_notes;
173+
return $this;
174+
}
175+
176+
public function getPublicShowAttendeeNotes(): bool
177+
{
178+
return $this->public_show_attendee_notes;
179+
}
180+
181+
public function setPublicShowQuestionAnswers(bool $public_show_question_answers): self
182+
{
183+
$this->public_show_question_answers = $public_show_question_answers;
184+
return $this;
185+
}
186+
187+
public function getPublicShowQuestionAnswers(): bool
188+
{
189+
return $this->public_show_question_answers;
190+
}
191+
192+
public function setPublicShowOrderDetails(bool $public_show_order_details): self
193+
{
194+
$this->public_show_order_details = $public_show_order_details;
195+
return $this;
196+
}
197+
198+
public function getPublicShowOrderDetails(): bool
199+
{
200+
return $this->public_show_order_details;
201+
}
160202
}

backend/app/DomainObjects/Generated/WebhookDomainObjectAbstract.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ abstract class WebhookDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
1313
final public const ID = 'id';
1414
final public const USER_ID = 'user_id';
1515
final public const EVENT_ID = 'event_id';
16-
final public const ORGANIZER_ID = 'organizer_id';
1716
final public const ACCOUNT_ID = 'account_id';
17+
final public const ORGANIZER_ID = 'organizer_id';
1818
final public const URL = 'url';
1919
final public const EVENT_TYPES = 'event_types';
2020
final public const LAST_RESPONSE_CODE = 'last_response_code';
@@ -29,8 +29,8 @@ abstract class WebhookDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
2929
protected int $id;
3030
protected int $user_id;
3131
protected ?int $event_id = null;
32-
protected ?int $organizer_id = null;
3332
protected int $account_id;
33+
protected ?int $organizer_id = null;
3434
protected string $url;
3535
protected array|string $event_types;
3636
protected ?int $last_response_code = null;
@@ -48,8 +48,8 @@ public function toArray(): array
4848
'id' => $this->id ?? null,
4949
'user_id' => $this->user_id ?? null,
5050
'event_id' => $this->event_id ?? null,
51-
'organizer_id' => $this->organizer_id ?? null,
5251
'account_id' => $this->account_id ?? null,
52+
'organizer_id' => $this->organizer_id ?? null,
5353
'url' => $this->url ?? null,
5454
'event_types' => $this->event_types ?? null,
5555
'last_response_code' => $this->last_response_code ?? null,
@@ -96,26 +96,26 @@ public function getEventId(): ?int
9696
return $this->event_id;
9797
}
9898

99-
public function setOrganizerId(?int $organizer_id): self
99+
public function setAccountId(int $account_id): self
100100
{
101-
$this->organizer_id = $organizer_id;
101+
$this->account_id = $account_id;
102102
return $this;
103103
}
104104

105-
public function getOrganizerId(): ?int
105+
public function getAccountId(): int
106106
{
107-
return $this->organizer_id;
107+
return $this->account_id;
108108
}
109109

110-
public function setAccountId(int $account_id): self
110+
public function setOrganizerId(?int $organizer_id): self
111111
{
112-
$this->account_id = $account_id;
112+
$this->organizer_id = $organizer_id;
113113
return $this;
114114
}
115115

116-
public function getAccountId(): int
116+
public function getOrganizerId(): ?int
117117
{
118-
return $this->account_id;
118+
return $this->organizer_id;
119119
}
120120

121121
public function setUrl(string $url): self

backend/app/Http/Actions/CheckInLists/CreateCheckInListAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public function __invoke(UpsertCheckInListRequest $request, int $eventId): JsonR
3333
productIds: $request->validated('product_ids'),
3434
expiresAt: $request->validated('expires_at'),
3535
activatesAt: $request->validated('activates_at'),
36+
publicShowAttendeeNotes: $request->validated('public_show_attendee_notes') ?? true,
37+
publicShowQuestionAnswers: $request->validated('public_show_question_answers') ?? true,
38+
publicShowOrderDetails: $request->validated('public_show_order_details') ?? true,
3639
)
3740
);
3841
} catch (UnrecognizedProductIdException $exception) {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace HiEvents\Http\Actions\CheckInLists\Public;
4+
5+
use HiEvents\Http\Actions\BaseAction;
6+
use HiEvents\Resources\Attendee\AttendeeDetailPublicResource;
7+
use HiEvents\Services\Application\Handlers\CheckInList\Public\GetCheckInListAttendeeDetailPublicHandler;
8+
use HiEvents\Services\Domain\Auth\AuthUserService;
9+
use Illuminate\Http\JsonResponse;
10+
use Throwable;
11+
12+
class GetCheckInListAttendeeDetailPublicAction extends BaseAction
13+
{
14+
public function __construct(
15+
private readonly GetCheckInListAttendeeDetailPublicHandler $handler,
16+
private readonly AuthUserService $authUserService,
17+
)
18+
{
19+
}
20+
21+
public function __invoke(string $checkInListShortId, string $attendeePublicId): JsonResponse
22+
{
23+
$detail = $this->handler->handle(
24+
shortId: $checkInListShortId,
25+
attendeePublicId: $attendeePublicId,
26+
staffAccountId: $this->resolveStaffAccountId(),
27+
);
28+
29+
return $this->resourceResponse(
30+
resource: AttendeeDetailPublicResource::class,
31+
data: $detail,
32+
);
33+
}
34+
35+
/**
36+
* The detail endpoint is public but should reveal all attendee fields to authenticated staff
37+
* whose account matches the event's account. Returns null for anonymous / invalid tokens /
38+
* any auth resolution failure — those callers get data filtered by the list's visibility flags.
39+
*/
40+
private function resolveStaffAccountId(): ?int
41+
{
42+
try {
43+
return $this->authUserService->getAuthenticatedAccountId();
44+
} catch (Throwable) {
45+
return null;
46+
}
47+
}
48+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace HiEvents\Http\Actions\CheckInLists\Public;
4+
5+
use HiEvents\Http\Actions\BaseAction;
6+
use HiEvents\Resources\CheckInList\CheckInListStatsPublicResource;
7+
use HiEvents\Services\Application\Handlers\CheckInList\Public\GetCheckInListStatsPublicHandler;
8+
use Illuminate\Http\JsonResponse;
9+
10+
class GetCheckInListStatsPublicAction extends BaseAction
11+
{
12+
public function __construct(
13+
private readonly GetCheckInListStatsPublicHandler $getCheckInListStatsPublicHandler,
14+
)
15+
{
16+
}
17+
18+
public function __invoke(string $checkInListShortId): JsonResponse
19+
{
20+
$stats = $this->getCheckInListStatsPublicHandler->handle($checkInListShortId);
21+
22+
return $this->resourceResponse(
23+
resource: CheckInListStatsPublicResource::class,
24+
data: $stats,
25+
);
26+
}
27+
}

backend/app/Http/Actions/CheckInLists/UpdateCheckInListAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public function __invoke(UpsertCheckInListRequest $request, int $eventId, int $c
3434
expiresAt: $request->validated('expires_at'),
3535
activatesAt: $request->validated('activates_at'),
3636
id: $checkInListId,
37+
publicShowAttendeeNotes: $request->validated('public_show_attendee_notes') ?? true,
38+
publicShowQuestionAnswers: $request->validated('public_show_question_answers') ?? true,
39+
publicShowOrderDetails: $request->validated('public_show_order_details') ?? true,
3740
)
3841
);
3942
} catch (UnrecognizedProductIdException $exception) {

backend/app/Http/Request/CheckInList/UpsertCheckInListRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ public function rules(): array
1111
{
1212
return [
1313
'name' => RulesHelper::REQUIRED_STRING,
14-
'description' => ['nullable', 'string', 'max:255'],
14+
'description' => ['nullable', 'string', 'max:2000'],
1515
'expires_at' => ['nullable', 'date'],
1616
'activates_at' => ['nullable', 'date'],
1717
'product_ids' => ['required', 'array', 'min:1'],
18+
'public_show_attendee_notes' => ['nullable', 'boolean'],
19+
'public_show_question_answers' => ['nullable', 'boolean'],
20+
'public_show_order_details' => ['nullable', 'boolean'],
1821
];
1922
}
2023

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace HiEvents\Repository\DTO;
4+
5+
use HiEvents\DataTransferObjects\BaseDTO;
6+
7+
class CheckInListProductStatDTO extends BaseDTO
8+
{
9+
public function __construct(
10+
public int $productId,
11+
public string $productTitle,
12+
public int $totalAttendees,
13+
public int $checkedInAttendees,
14+
)
15+
{
16+
}
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace HiEvents\Repository\DTO;
4+
5+
use HiEvents\DataTransferObjects\BaseDTO;
6+
7+
class CheckInListRecentCheckInDTO extends BaseDTO
8+
{
9+
public function __construct(
10+
public string $attendeePublicId,
11+
public string $firstName,
12+
public string $lastName,
13+
public ?string $productTitle,
14+
public string $checkedInAt,
15+
)
16+
{
17+
}
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace HiEvents\Repository\DTO;
4+
5+
use HiEvents\DataTransferObjects\BaseDTO;
6+
7+
class CheckInListStatsDTO extends BaseDTO
8+
{
9+
/**
10+
* @param CheckInListProductStatDTO[] $perProduct
11+
* @param CheckInListRecentCheckInDTO[] $recentCheckIns
12+
*/
13+
public function __construct(
14+
public int $totalAttendees,
15+
public int $checkedInAttendees,
16+
public array $perProduct,
17+
public array $recentCheckIns,
18+
)
19+
{
20+
}
21+
}

0 commit comments

Comments
 (0)