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 @@ -62,6 +62,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
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';
final public const PASS_PLATFORM_FEE_TO_BUYER = 'pass_platform_fee_to_buyer';

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

public function toArray(): array
{
Expand Down Expand Up @@ -171,6 +173,7 @@ public function toArray(): array
'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,
'pass_platform_fee_to_buyer' => $this->pass_platform_fee_to_buyer ?? null,
];
}

Expand Down Expand Up @@ -746,4 +749,15 @@ public function getHomepageThemeSettings(): array|string|null
{
return $this->homepage_theme_settings;
}

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

public function getPassPlatformFeeToBuyer(): bool
{
return $this->pass_platform_fee_to_buyer;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
final public const TOTAL_SERVICE_FEE = 'total_service_fee';
final public const TAXES_AND_FEES_ROLLUP = 'taxes_and_fees_rollup';
final public const PRODUCT_TYPE = 'product_type';
final public const BUNDLE_GROUP_ID = 'bundle_group_id';
final public const IS_BUNDLE_PRIMARY = 'is_bundle_primary';

protected int $id;
protected int $order_id;
Expand All @@ -41,6 +43,8 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
protected ?float $total_service_fee = 0.0;
protected array|string|null $taxes_and_fees_rollup = null;
protected string $product_type = 'TICKET';
protected ?string $bundle_group_id = null;
protected bool $is_bundle_primary = false;

public function toArray(): array
{
Expand All @@ -60,6 +64,8 @@ public function toArray(): array
'total_service_fee' => $this->total_service_fee ?? null,
'taxes_and_fees_rollup' => $this->taxes_and_fees_rollup ?? null,
'product_type' => $this->product_type ?? null,
'bundle_group_id' => $this->bundle_group_id ?? null,
'is_bundle_primary' => $this->is_bundle_primary ?? null,
];
}

Expand Down Expand Up @@ -227,4 +233,26 @@ public function getProductType(): string
{
return $this->product_type;
}

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

public function getBundleGroupId(): ?string
{
return $this->bundle_group_id;
}

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

public function getIsBundlePrimary(): bool
{
return $this->is_bundle_primary;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
final public const LOCATION_DETAILS = 'location_details';
final public const DEFAULT_ATTENDEE_DETAILS_COLLECTION_METHOD = 'default_attendee_details_collection_method';
final public const DEFAULT_SHOW_MARKETING_OPT_IN = 'default_show_marketing_opt_in';
final public const DEFAULT_PASS_PLATFORM_FEE_TO_BUYER = 'default_pass_platform_fee_to_buyer';

protected int $id;
protected int $organizer_id;
Expand All @@ -45,6 +46,7 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
protected array|string|null $location_details = null;
protected string $default_attendee_details_collection_method = 'PER_TICKET';
protected bool $default_show_marketing_opt_in = true;
protected bool $default_pass_platform_fee_to_buyer = false;

public function toArray(): array
{
Expand All @@ -66,6 +68,7 @@ public function toArray(): array
'location_details' => $this->location_details ?? null,
'default_attendee_details_collection_method' => $this->default_attendee_details_collection_method ?? null,
'default_show_marketing_opt_in' => $this->default_show_marketing_opt_in ?? null,
'default_pass_platform_fee_to_buyer' => $this->default_pass_platform_fee_to_buyer ?? null,
];
}

Expand Down Expand Up @@ -256,4 +259,15 @@ public function getDefaultShowMarketingOptIn(): bool
{
return $this->default_show_marketing_opt_in;
}

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

public function getDefaultPassPlatformFeeToBuyer(): bool
{
return $this->default_pass_platform_fee_to_buyer;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php

namespace HiEvents\DomainObjects\Generated;

/**
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY.
* @package HiEvents\DomainObjects\Generated
*/
abstract class ProductPriceTaxAndFeesDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
{
final public const SINGULAR_NAME = 'product_price_tax_and_fees';
final public const PLURAL_NAME = 'product_price_tax_and_fees';
final public const ID = 'id';
final public const PRODUCT_PRICE_ID = 'product_price_id';
final public const TAX_AND_FEE_ID = 'tax_and_fee_id';
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 int $product_price_id;
protected int $tax_and_fee_id;
protected ?string $created_at = null;
protected ?string $updated_at = null;
protected ?string $deleted_at = null;

public function toArray(): array
{
return [
'id' => $this->id ?? null,
'product_price_id' => $this->product_price_id ?? null,
'tax_and_fee_id' => $this->tax_and_fee_id ?? 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 setProductPriceId(int $product_price_id): self
{
$this->product_price_id = $product_price_id;
return $this;
}

public function getProductPriceId(): int
{
return $this->product_price_id;
}

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

public function getTaxAndFeeId(): int
{
return $this->tax_and_fee_id;
}

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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace HiEvents\DomainObjects;

class ProductPriceTaxAndFeesDomainObject extends Generated\ProductPriceTaxAndFeesDomainObjectAbstract
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public function rules(): array
// Marketing settings
'show_marketing_opt_in' => ['boolean'],

// Platform fee settings
'pass_platform_fee_to_buyer' => ['boolean'],

// Homepage theme settings
'homepage_theme_settings' => ['nullable', 'array'],
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static function rules(): array
// Event defaults
'default_attendee_details_collection_method' => ['sometimes', 'nullable', Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
'default_show_marketing_opt_in' => ['sometimes', 'nullable', 'boolean'],
'default_pass_platform_fee_to_buyer' => ['sometimes', 'nullable', 'boolean'],

// Social handles
'facebook_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
Expand Down
3 changes: 3 additions & 0 deletions backend/app/Resources/Event/EventSettingsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public function toArray($request): array
// Marketing settings
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),

// Platform fee settings
'pass_platform_fee_to_buyer' => $this->getPassPlatformFeeToBuyer(),

// Homepage theme settings
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
];
Expand Down
3 changes: 3 additions & 0 deletions backend/app/Resources/Event/EventSettingsResourcePublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function toArray($request): array
// Marketing settings
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),

// Platform fee settings
'pass_platform_fee_to_buyer' => $this->getPassPlatformFeeToBuyer(),

// Homepage theme settings
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function toArray($request): array
'organizer_id' => $this->getOrganizerId(),
'default_attendee_details_collection_method' => $this->getDefaultAttendeeDetailsCollectionMethod(),
'default_show_marketing_opt_in' => $this->getDefaultShowMarketingOptIn(),
'default_pass_platform_fee_to_buyer' => $this->getDefaultPassPlatformFeeToBuyer(),
'social_media_handles' => $this->getSocialMediaHandles(),
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
'homepage_visibility' => $this->getHomepageVisibility(),
Expand Down
1 change: 1 addition & 0 deletions backend/app/Resources/Product/ProductResourcePublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function toArray(Request $request): array
ProductPriceResourcePublic::SHOW_QUANTITY_AVAILABLE => $this->getShowQuantityRemaining(),
]),
),
// todo: this should be taxes_and_fees
'taxes' => $this->when(
(bool)$this->getTaxAndFees(),
fn() => TaxAndFeeResource::collection($this->getTaxAndFees())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function __construct(
// Marketing settings
public readonly bool $show_marketing_opt_in = true,

// Platform fee settings
public readonly bool $pass_platform_fee_to_buyer = false,

// Homepage theme settings
public readonly ?array $homepage_theme_settings = null,
)
Expand Down Expand Up @@ -146,6 +149,9 @@ public static function createWithDefaults(
// Marketing defaults
show_marketing_opt_in: true,

// Platform fee defaults
pass_platform_fee_to_buyer: false,

// Homepage theme defaults (simplified 2-color + mode system)
homepage_theme_settings: [
'accent' => '#8b5cf6',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function handle(PartialUpdateEventSettingsDTO $eventSettingsDTO): EventSe
// Marketing settings
'show_marketing_opt_in' => $eventSettingsDTO->settings['show_marketing_opt_in'] ?? $existingSettings->getShowMarketingOptIn(),

// Platform fee settings
'pass_platform_fee_to_buyer' => $eventSettingsDTO->settings['pass_platform_fee_to_buyer'] ?? $existingSettings->getPassPlatformFeeToBuyer(),

// Homepage theme settings
'homepage_theme_settings' => array_key_exists('homepage_theme_settings', $eventSettingsDTO->settings)
? $eventSettingsDTO->settings['homepage_theme_settings']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public function handle(UpdateEventSettingsDTO $settings): EventSettingDomainObje
// Marketing settings
'show_marketing_opt_in' => $settings->show_marketing_opt_in,

// Platform fee settings
'pass_platform_fee_to_buyer' => $settings->pass_platform_fee_to_buyer,

// Homepage theme settings
'homepage_theme_settings' => $settings->homepage_theme_settings,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function __construct(
#[WithCast(EnumCast::class, AttendeeDetailsCollectionMethod::class)]
public readonly AttendeeDetailsCollectionMethod|Optional|null $defaultAttendeeDetailsCollectionMethod,
public readonly bool|Optional|null $defaultShowMarketingOptIn,
public readonly bool|Optional|null $defaultPassPlatformFeeToBuyer,

// Social
public readonly string|Optional|null $facebookHandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public function handle(PartialUpdateOrganizerSettingsDTO $dto): OrganizerSetting
$organizerSettings->getDefaultShowMarketingOptIn()
),

'default_pass_platform_fee_to_buyer' => $dto->getProvided(
'defaultPassPlatformFeeToBuyer',
$organizerSettings->getDefaultPassPlatformFeeToBuyer()
),

'social_media_handles' => array_filter([
'facebook' => $dto->getProvided('facebookHandle', $organizerSettings->getSocialMediaHandle('facebook')),
'instagram' => $dto->getProvided('instagramHandle', $organizerSettings->getSocialMediaHandle('instagram')),
Expand Down
1 change: 1 addition & 0 deletions backend/app/Services/Domain/Event/CreateEventService.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private function createEventSettings(

'attendee_details_collection_method' => $organizerSettings->getDefaultAttendeeDetailsCollectionMethod(),
'show_marketing_opt_in' => $organizerSettings->getDefaultShowMarketingOptIn(),
'pass_platform_fee_to_buyer' => $organizerSettings->getDefaultPassPlatformFeeToBuyer(),
'ticket_design_settings' => [
'accent_color' => $homepageThemeSettings['accent'] ?? '#333',
],
Expand Down
Loading
Loading