Skip to content

Commit 1d0087b

Browse files
authored
Merge pull request #929 from HiEventsDev/develop
2 parents 2b18bd1 + dd54e82 commit 1d0087b

File tree

128 files changed

+15449
-9201
lines changed

Some content is hidden

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

128 files changed

+15449
-9201
lines changed

backend/app/DomainObjects/Generated/EventSettingDomainObjectAbstract.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
6161
final public const TICKET_DESIGN_SETTINGS = 'ticket_design_settings';
6262
final public const ATTENDEE_DETAILS_COLLECTION_METHOD = 'attendee_details_collection_method';
6363
final public const SHOW_MARKETING_OPT_IN = 'show_marketing_opt_in';
64+
final public const HOMEPAGE_THEME_SETTINGS = 'homepage_theme_settings';
6465

6566
protected int $id;
6667
protected int $event_id;
@@ -113,6 +114,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
113114
protected array|string|null $ticket_design_settings = null;
114115
protected string $attendee_details_collection_method = 'PER_TICKET';
115116
protected bool $show_marketing_opt_in = true;
117+
protected array|string|null $homepage_theme_settings = null;
116118

117119
public function toArray(): array
118120
{
@@ -168,6 +170,7 @@ public function toArray(): array
168170
'ticket_design_settings' => $this->ticket_design_settings ?? null,
169171
'attendee_details_collection_method' => $this->attendee_details_collection_method ?? null,
170172
'show_marketing_opt_in' => $this->show_marketing_opt_in ?? null,
173+
'homepage_theme_settings' => $this->homepage_theme_settings ?? null,
171174
];
172175
}
173176

@@ -732,4 +735,15 @@ public function getShowMarketingOptIn(): bool
732735
{
733736
return $this->show_marketing_opt_in;
734737
}
738+
739+
public function setHomepageThemeSettings(array|string|null $homepage_theme_settings): self
740+
{
741+
$this->homepage_theme_settings = $homepage_theme_settings;
742+
return $this;
743+
}
744+
745+
public function getHomepageThemeSettings(): array|string|null
746+
{
747+
return $this->homepage_theme_settings;
748+
}
735749
}

backend/app/DomainObjects/Generated/ProductDomainObjectAbstract.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
3434
final public const IS_HIDDEN = 'is_hidden';
3535
final public const PRODUCT_TYPE = 'product_type';
3636
final public const START_COLLAPSED = 'start_collapsed';
37+
final public const IS_HIGHLIGHTED = 'is_highlighted';
38+
final public const HIGHLIGHT_MESSAGE = 'highlight_message';
3739

3840
protected int $id;
3941
protected int $event_id;
@@ -59,6 +61,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
5961
protected ?bool $is_hidden = false;
6062
protected string $product_type = 'TICKET';
6163
protected bool $start_collapsed = false;
64+
protected bool $is_highlighted = false;
65+
protected ?string $highlight_message = null;
6266

6367
public function toArray(): array
6468
{
@@ -87,6 +91,8 @@ public function toArray(): array
8791
'is_hidden' => $this->is_hidden ?? null,
8892
'product_type' => $this->product_type ?? null,
8993
'start_collapsed' => $this->start_collapsed ?? null,
94+
'is_highlighted' => $this->is_highlighted ?? null,
95+
'highlight_message' => $this->highlight_message ?? null,
9096
];
9197
}
9298

@@ -353,4 +359,26 @@ public function getStartCollapsed(): bool
353359
{
354360
return $this->start_collapsed;
355361
}
362+
363+
public function setIsHighlighted(bool $is_highlighted): self
364+
{
365+
$this->is_highlighted = $is_highlighted;
366+
return $this;
367+
}
368+
369+
public function getIsHighlighted(): bool
370+
{
371+
return $this->is_highlighted;
372+
}
373+
374+
public function setHighlightMessage(?string $highlight_message): self
375+
{
376+
$this->highlight_message = $highlight_message;
377+
return $this;
378+
}
379+
380+
public function getHighlightMessage(): ?string
381+
{
382+
return $this->highlight_message;
383+
}
356384
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects\Generated;
4+
5+
/**
6+
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY.
7+
* @package HiEvents\DomainObjects\Generated
8+
*/
9+
abstract class TicketLookupTokenDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
10+
{
11+
final public const SINGULAR_NAME = 'ticket_lookup_token';
12+
final public const PLURAL_NAME = 'ticket_lookup_tokens';
13+
final public const ID = 'id';
14+
final public const EMAIL = 'email';
15+
final public const TOKEN = 'token';
16+
final public const EXPIRES_AT = 'expires_at';
17+
final public const CREATED_AT = 'created_at';
18+
final public const UPDATED_AT = 'updated_at';
19+
final public const DELETED_AT = 'deleted_at';
20+
21+
protected int $id;
22+
protected string $email;
23+
protected string $token;
24+
protected string $expires_at;
25+
protected ?string $created_at = null;
26+
protected ?string $updated_at = null;
27+
protected ?string $deleted_at = null;
28+
29+
public function toArray(): array
30+
{
31+
return [
32+
'id' => $this->id ?? null,
33+
'email' => $this->email ?? null,
34+
'token' => $this->token ?? null,
35+
'expires_at' => $this->expires_at ?? null,
36+
'created_at' => $this->created_at ?? null,
37+
'updated_at' => $this->updated_at ?? null,
38+
'deleted_at' => $this->deleted_at ?? null,
39+
];
40+
}
41+
42+
public function setId(int $id): self
43+
{
44+
$this->id = $id;
45+
return $this;
46+
}
47+
48+
public function getId(): int
49+
{
50+
return $this->id;
51+
}
52+
53+
public function setEmail(string $email): self
54+
{
55+
$this->email = $email;
56+
return $this;
57+
}
58+
59+
public function getEmail(): string
60+
{
61+
return $this->email;
62+
}
63+
64+
public function setToken(string $token): self
65+
{
66+
$this->token = $token;
67+
return $this;
68+
}
69+
70+
public function getToken(): string
71+
{
72+
return $this->token;
73+
}
74+
75+
public function setExpiresAt(string $expires_at): self
76+
{
77+
$this->expires_at = $expires_at;
78+
return $this;
79+
}
80+
81+
public function getExpiresAt(): string
82+
{
83+
return $this->expires_at;
84+
}
85+
86+
public function setCreatedAt(?string $created_at): self
87+
{
88+
$this->created_at = $created_at;
89+
return $this;
90+
}
91+
92+
public function getCreatedAt(): ?string
93+
{
94+
return $this->created_at;
95+
}
96+
97+
public function setUpdatedAt(?string $updated_at): self
98+
{
99+
$this->updated_at = $updated_at;
100+
return $this;
101+
}
102+
103+
public function getUpdatedAt(): ?string
104+
{
105+
return $this->updated_at;
106+
}
107+
108+
public function setDeletedAt(?string $deleted_at): self
109+
{
110+
$this->deleted_at = $deleted_at;
111+
return $this;
112+
}
113+
114+
public function getDeletedAt(): ?string
115+
{
116+
return $this->deleted_at;
117+
}
118+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects;
4+
5+
class TicketLookupTokenDomainObject extends Generated\TicketLookupTokenDomainObjectAbstract
6+
{
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace HiEvents\Exceptions;
4+
5+
use Exception;
6+
7+
class InvalidTicketLookupTokenException extends Exception
8+
{
9+
10+
}

backend/app/Helper/Url.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Url
1414
public const ATTENDEE_TICKET = 'app.frontend_urls.attendee_product';
1515
public const ORDER_SUMMARY = 'app.frontend_urls.order_summary';
1616
public const ORGANIZER_ORDER_SUMMARY = 'app.frontend_urls.organizer_order_summary';
17+
public const TICKET_LOOKUP = 'app.frontend_urls.ticket_lookup';
1718

1819
public static function getFrontEndUrlFromConfig(string $key, array $queryParams = []): string
1920
{
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace HiEvents\Http\Actions\TicketLookup;
4+
5+
use HiEvents\Exceptions\InvalidTicketLookupTokenException;
6+
use HiEvents\Http\Actions\BaseAction;
7+
use HiEvents\Resources\Order\OrderResourcePublic;
8+
use HiEvents\Services\Application\Handlers\TicketLookup\DTO\GetOrdersByLookupTokenDTO;
9+
use HiEvents\Services\Application\Handlers\TicketLookup\GetOrdersByLookupTokenHandler;
10+
use Illuminate\Http\JsonResponse;
11+
12+
class GetOrdersByLookupTokenAction extends BaseAction
13+
{
14+
public function __construct(
15+
private readonly GetOrdersByLookupTokenHandler $getOrdersByLookupTokenHandler,
16+
) {
17+
}
18+
19+
public function __invoke(string $token): JsonResponse
20+
{
21+
try {
22+
$orders = $this->getOrdersByLookupTokenHandler->handle(
23+
new GetOrdersByLookupTokenDTO(
24+
token: $token,
25+
)
26+
);
27+
28+
return $this->resourceResponse(
29+
resource: OrderResourcePublic::class,
30+
data: $orders,
31+
);
32+
} catch (InvalidTicketLookupTokenException $e) {
33+
return $this->errorResponse(
34+
message: $e->getMessage(),
35+
);
36+
}
37+
}
38+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace HiEvents\Http\Actions\TicketLookup;
4+
5+
use HiEvents\Http\Actions\BaseAction;
6+
use HiEvents\Http\Request\TicketLookup\SendTicketLookupEmailRequest;
7+
use HiEvents\Services\Application\Handlers\TicketLookup\DTO\SendTicketLookupEmailDTO;
8+
use HiEvents\Services\Application\Handlers\TicketLookup\SendTicketLookupEmailHandler;
9+
use Illuminate\Http\JsonResponse;
10+
11+
class SendTicketLookupEmailAction extends BaseAction
12+
{
13+
public function __construct(
14+
private readonly SendTicketLookupEmailHandler $sendTicketLookupEmailHandler,
15+
) {
16+
}
17+
18+
public function __invoke(SendTicketLookupEmailRequest $request): JsonResponse
19+
{
20+
$this->sendTicketLookupEmailHandler->handle(
21+
new SendTicketLookupEmailDTO(
22+
email: $request->validated('email'),
23+
)
24+
);
25+
26+
return $this->jsonResponse(
27+
data: [
28+
'message' => __('If you have tickets associated with this email, we will send you an email with the details.'),
29+
]
30+
);
31+
}
32+
}

backend/app/Http/Request/EventSettings/UpdateEventSettingsRequest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ public function rules(): array
8888

8989
// Marketing settings
9090
'show_marketing_opt_in' => ['boolean'],
91+
92+
// Homepage theme settings
93+
'homepage_theme_settings' => ['nullable', 'array'],
94+
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
95+
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
96+
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
97+
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
9198
];
9299
}
93100

@@ -124,6 +131,12 @@ public function messages(): array
124131
'ticket_design_settings.accent_color' => $colorMessage,
125132
'ticket_design_settings.footer_text.max' => __('The footer text may not be greater than 500 characters.'),
126133
'ticket_design_settings.layout_type.in' => __('The layout type must be default or modern.'),
134+
135+
// Homepage theme settings messages
136+
'homepage_theme_settings.accent' => $colorMessage,
137+
'homepage_theme_settings.background' => $colorMessage,
138+
'homepage_theme_settings.mode.in' => __('The mode must be light or dark.'),
139+
'homepage_theme_settings.background_type.in' => __('The background type must be COLOR or MIRROR_COVER_IMAGE.'),
127140
];
128141
}
129142
}

backend/app/Http/Request/Organizer/Settings/PartialUpdateOrganizerSettingsRequest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public static function rules(): array
5555

5656
// Homepage
5757
'homepage_visibility' => ['nullable', Rule::in(OrganizerHomepageVisibility::valuesArray())],
58-
'homepage_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
59-
'homepage_primary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
60-
'homepage_primary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
61-
'homepage_secondary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
62-
'homepage_secondary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
63-
'homepage_content_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
64-
'homepage_background_type' => ['nullable', Rule::in(HomepageBackgroundType::valuesArray())],
58+
59+
// Homepage theme settings
60+
'homepage_theme_settings' => ['nullable', 'array'],
61+
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
62+
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
63+
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
64+
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
6565

6666
// SEO
6767
'seo_keywords' => ['sometimes', 'nullable', 'string', 'max:255'],

0 commit comments

Comments
 (0)