Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
final public const TICKET_DESIGN_SETTINGS = 'ticket_design_settings';
final public const ATTENDEE_DETAILS_COLLECTION_METHOD = 'attendee_details_collection_method';
final public const SHOW_MARKETING_OPT_IN = 'show_marketing_opt_in';
final public const HOMEPAGE_THEME_SETTINGS = 'homepage_theme_settings';

protected int $id;
protected int $event_id;
Expand Down Expand Up @@ -113,6 +114,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
protected array|string|null $ticket_design_settings = null;
protected string $attendee_details_collection_method = 'PER_TICKET';
protected bool $show_marketing_opt_in = true;
protected array|string|null $homepage_theme_settings = null;

public function toArray(): array
{
Expand Down Expand Up @@ -168,6 +170,7 @@ public function toArray(): array
'ticket_design_settings' => $this->ticket_design_settings ?? null,
'attendee_details_collection_method' => $this->attendee_details_collection_method ?? null,
'show_marketing_opt_in' => $this->show_marketing_opt_in ?? null,
'homepage_theme_settings' => $this->homepage_theme_settings ?? null,
];
}

Expand Down Expand Up @@ -732,4 +735,15 @@ public function getShowMarketingOptIn(): bool
{
return $this->show_marketing_opt_in;
}

public function setHomepageThemeSettings(array|string|null $homepage_theme_settings): self
{
$this->homepage_theme_settings = $homepage_theme_settings;
return $this;
}

public function getHomepageThemeSettings(): array|string|null
{
return $this->homepage_theme_settings;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
final public const IS_HIDDEN = 'is_hidden';
final public const PRODUCT_TYPE = 'product_type';
final public const START_COLLAPSED = 'start_collapsed';
final public const IS_HIGHLIGHTED = 'is_highlighted';
final public const HIGHLIGHT_MESSAGE = 'highlight_message';

protected int $id;
protected int $event_id;
Expand All @@ -59,6 +61,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
protected ?bool $is_hidden = false;
protected string $product_type = 'TICKET';
protected bool $start_collapsed = false;
protected bool $is_highlighted = false;
protected ?string $highlight_message = null;

public function toArray(): array
{
Expand Down Expand Up @@ -87,6 +91,8 @@ public function toArray(): array
'is_hidden' => $this->is_hidden ?? null,
'product_type' => $this->product_type ?? null,
'start_collapsed' => $this->start_collapsed ?? null,
'is_highlighted' => $this->is_highlighted ?? null,
'highlight_message' => $this->highlight_message ?? null,
];
}

Expand Down Expand Up @@ -353,4 +359,26 @@ public function getStartCollapsed(): bool
{
return $this->start_collapsed;
}

public function setIsHighlighted(bool $is_highlighted): self
{
$this->is_highlighted = $is_highlighted;
return $this;
}

public function getIsHighlighted(): bool
{
return $this->is_highlighted;
}

public function setHighlightMessage(?string $highlight_message): self
{
$this->highlight_message = $highlight_message;
return $this;
}

public function getHighlightMessage(): ?string
{
return $this->highlight_message;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

namespace HiEvents\DomainObjects\Generated;

/**
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY.
* @package HiEvents\DomainObjects\Generated
*/
abstract class TicketLookupTokenDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
{
final public const SINGULAR_NAME = 'ticket_lookup_token';
final public const PLURAL_NAME = 'ticket_lookup_tokens';
final public const ID = 'id';
final public const EMAIL = 'email';
final public const TOKEN = 'token';
final public const EXPIRES_AT = 'expires_at';
final public const CREATED_AT = 'created_at';
final public const UPDATED_AT = 'updated_at';
final public const DELETED_AT = 'deleted_at';

protected int $id;
protected string $email;
protected string $token;
protected string $expires_at;
protected ?string $created_at = null;
protected ?string $updated_at = null;
protected ?string $deleted_at = null;

public function toArray(): array
{
return [
'id' => $this->id ?? null,
'email' => $this->email ?? null,
'token' => $this->token ?? null,
'expires_at' => $this->expires_at ?? null,
'created_at' => $this->created_at ?? null,
'updated_at' => $this->updated_at ?? null,
'deleted_at' => $this->deleted_at ?? null,
];
}

public function setId(int $id): self
{
$this->id = $id;
return $this;
}

public function getId(): int
{
return $this->id;
}

public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}

public function getEmail(): string
{
return $this->email;
}

public function setToken(string $token): self
{
$this->token = $token;
return $this;
}

public function getToken(): string
{
return $this->token;
}

public function setExpiresAt(string $expires_at): self
{
$this->expires_at = $expires_at;
return $this;
}

public function getExpiresAt(): string
{
return $this->expires_at;
}

public function setCreatedAt(?string $created_at): self
{
$this->created_at = $created_at;
return $this;
}

public function getCreatedAt(): ?string
{
return $this->created_at;
}

public function setUpdatedAt(?string $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}

public function getUpdatedAt(): ?string
{
return $this->updated_at;
}

public function setDeletedAt(?string $deleted_at): self
{
$this->deleted_at = $deleted_at;
return $this;
}

public function getDeletedAt(): ?string
{
return $this->deleted_at;
}
}
7 changes: 7 additions & 0 deletions backend/app/DomainObjects/TicketLookupTokenDomainObject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace HiEvents\DomainObjects;

class TicketLookupTokenDomainObject extends Generated\TicketLookupTokenDomainObjectAbstract
{
}
10 changes: 10 additions & 0 deletions backend/app/Exceptions/InvalidTicketLookupTokenException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace HiEvents\Exceptions;

use Exception;

class InvalidTicketLookupTokenException extends Exception
{

}
1 change: 1 addition & 0 deletions backend/app/Helper/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Url
public const ATTENDEE_TICKET = 'app.frontend_urls.attendee_product';
public const ORDER_SUMMARY = 'app.frontend_urls.order_summary';
public const ORGANIZER_ORDER_SUMMARY = 'app.frontend_urls.organizer_order_summary';
public const TICKET_LOOKUP = 'app.frontend_urls.ticket_lookup';

public static function getFrontEndUrlFromConfig(string $key, array $queryParams = []): string
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace HiEvents\Http\Actions\TicketLookup;

use HiEvents\Exceptions\InvalidTicketLookupTokenException;
use HiEvents\Http\Actions\BaseAction;
use HiEvents\Resources\Order\OrderResourcePublic;
use HiEvents\Services\Application\Handlers\TicketLookup\DTO\GetOrdersByLookupTokenDTO;
use HiEvents\Services\Application\Handlers\TicketLookup\GetOrdersByLookupTokenHandler;
use Illuminate\Http\JsonResponse;

class GetOrdersByLookupTokenAction extends BaseAction
{
public function __construct(
private readonly GetOrdersByLookupTokenHandler $getOrdersByLookupTokenHandler,
) {
}

public function __invoke(string $token): JsonResponse
{
try {
$orders = $this->getOrdersByLookupTokenHandler->handle(
new GetOrdersByLookupTokenDTO(
token: $token,
)
);

return $this->resourceResponse(
resource: OrderResourcePublic::class,
data: $orders,
);
} catch (InvalidTicketLookupTokenException $e) {
return $this->errorResponse(
message: $e->getMessage(),
);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace HiEvents\Http\Actions\TicketLookup;

use HiEvents\Http\Actions\BaseAction;
use HiEvents\Http\Request\TicketLookup\SendTicketLookupEmailRequest;
use HiEvents\Services\Application\Handlers\TicketLookup\DTO\SendTicketLookupEmailDTO;
use HiEvents\Services\Application\Handlers\TicketLookup\SendTicketLookupEmailHandler;
use Illuminate\Http\JsonResponse;

class SendTicketLookupEmailAction extends BaseAction
{
public function __construct(
private readonly SendTicketLookupEmailHandler $sendTicketLookupEmailHandler,
) {
}

public function __invoke(SendTicketLookupEmailRequest $request): JsonResponse
{
$this->sendTicketLookupEmailHandler->handle(
new SendTicketLookupEmailDTO(
email: $request->validated('email'),
)
);

return $this->jsonResponse(
data: [
'message' => __('If you have tickets associated with this email, we will send you an email with the details.'),
]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public function rules(): array

// Marketing settings
'show_marketing_opt_in' => ['boolean'],

// Homepage theme settings
'homepage_theme_settings' => ['nullable', 'array'],
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
];
}

Expand Down Expand Up @@ -124,6 +131,12 @@ public function messages(): array
'ticket_design_settings.accent_color' => $colorMessage,
'ticket_design_settings.footer_text.max' => __('The footer text may not be greater than 500 characters.'),
'ticket_design_settings.layout_type.in' => __('The layout type must be default or modern.'),

// Homepage theme settings messages
'homepage_theme_settings.accent' => $colorMessage,
'homepage_theme_settings.background' => $colorMessage,
'homepage_theme_settings.mode.in' => __('The mode must be light or dark.'),
'homepage_theme_settings.background_type.in' => __('The background type must be COLOR or MIRROR_COVER_IMAGE.'),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public static function rules(): array

// Homepage
'homepage_visibility' => ['nullable', Rule::in(OrganizerHomepageVisibility::valuesArray())],
'homepage_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_primary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_primary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_secondary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_secondary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_content_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
'homepage_background_type' => ['nullable', Rule::in(HomepageBackgroundType::valuesArray())],

// Homepage theme settings
'homepage_theme_settings' => ['nullable', 'array'],
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],

// SEO
'seo_keywords' => ['sometimes', 'nullable', 'string', 'max:255'],
Expand Down
2 changes: 2 additions & 0 deletions backend/app/Http/Request/Product/UpsertProductRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function rules(): array
'product_type' => ['required', Rule::in(ProductType::valuesArray())],
'tax_and_fee_ids' => 'array',
'product_category_id' => ['required', 'integer'],
'is_highlighted' => 'boolean',
'highlight_message' => 'string|nullable|max:255',
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace HiEvents\Http\Request\TicketLookup;

use Illuminate\Foundation\Http\FormRequest;

class SendTicketLookupEmailRequest extends FormRequest
{
public function rules(): array
{
return [
'email' => 'required|email',
];
}
}
Loading
Loading