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
@@ -0,0 +1,11 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum AttendeeDetailsCollectionMethod: string
{
use BaseEnum;

case PER_TICKET = 'PER_TICKET';
case PER_ORDER = 'PER_ORDER';
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ abstract class AccountDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
final public const DELETED_AT = 'deleted_at';
final public const NAME = 'name';
final public const EMAIL = 'email';
final public const STRIPE_ACCOUNT_ID = 'stripe_account_id';
final public const SHORT_ID = 'short_id';
final public const STRIPE_CONNECT_SETUP_COMPLETE = 'stripe_connect_setup_complete';
final public const ACCOUNT_VERIFIED_AT = 'account_verified_at';
final public const STRIPE_CONNECT_ACCOUNT_TYPE = 'stripe_connect_account_type';
final public const IS_MANUALLY_VERIFIED = 'is_manually_verified';

protected int $id;
Expand All @@ -32,8 +35,11 @@ abstract class AccountDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
protected ?string $deleted_at = null;
protected string $name;
protected string $email;
protected ?string $stripe_account_id = null;
protected string $short_id;
protected ?bool $stripe_connect_setup_complete = false;
protected ?string $account_verified_at = null;
protected ?string $stripe_connect_account_type = null;
protected bool $is_manually_verified = false;

public function toArray(): array
Expand All @@ -48,8 +54,11 @@ public function toArray(): array
'deleted_at' => $this->deleted_at ?? null,
'name' => $this->name ?? null,
'email' => $this->email ?? null,
'stripe_account_id' => $this->stripe_account_id ?? null,
'short_id' => $this->short_id ?? null,
'stripe_connect_setup_complete' => $this->stripe_connect_setup_complete ?? null,
'account_verified_at' => $this->account_verified_at ?? null,
'stripe_connect_account_type' => $this->stripe_connect_account_type ?? null,
'is_manually_verified' => $this->is_manually_verified ?? null,
];
}
Expand Down Expand Up @@ -153,6 +162,17 @@ public function getEmail(): string
return $this->email;
}

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

public function getStripeAccountId(): ?string
{
return $this->stripe_account_id;
}

public function setShortId(string $short_id): self
{
$this->short_id = $short_id;
Expand All @@ -164,6 +184,17 @@ public function getShortId(): string
return $this->short_id;
}

public function setStripeConnectSetupComplete(?bool $stripe_connect_setup_complete): self
{
$this->stripe_connect_setup_complete = $stripe_connect_setup_complete;
return $this;
}

public function getStripeConnectSetupComplete(): ?bool
{
return $this->stripe_connect_setup_complete;
}

public function setAccountVerifiedAt(?string $account_verified_at): self
{
$this->account_verified_at = $account_verified_at;
Expand All @@ -175,6 +206,17 @@ public function getAccountVerifiedAt(): ?string
return $this->account_verified_at;
}

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

public function getStripeConnectAccountType(): ?string
{
return $this->stripe_connect_account_type;
}

public function setIsManuallyVerified(bool $is_manually_verified): self
{
$this->is_manually_verified = $is_manually_verified;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
final public const INVOICE_PAYMENT_TERMS_DAYS = 'invoice_payment_terms_days';
final public const INVOICE_NOTES = 'invoice_notes';
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';

protected int $id;
protected int $event_id;
Expand Down Expand Up @@ -109,6 +111,8 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
protected ?int $invoice_payment_terms_days = null;
protected ?string $invoice_notes = null;
protected array|string|null $ticket_design_settings = null;
protected string $attendee_details_collection_method = 'PER_TICKET';
protected bool $show_marketing_opt_in = true;

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

Expand Down Expand Up @@ -704,4 +710,26 @@ public function getTicketDesignSettings(): array|string|null
{
return $this->ticket_design_settings;
}

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

public function getAttendeeDetailsCollectionMethod(): string
{
return $this->attendee_details_collection_method;
}

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

public function getShowMarketingOptIn(): bool
{
return $this->show_marketing_opt_in;
}
}
14 changes: 14 additions & 0 deletions backend/app/DomainObjects/Generated/OrderDomainObjectAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ abstract class OrderDomainObjectAbstract extends \HiEvents\DomainObjects\Abstrac
final public const PAYMENT_PROVIDER = 'payment_provider';
final public const NOTES = 'notes';
final public const STATISTICS_DECREMENTED_AT = 'statistics_decremented_at';
final public const OPTED_INTO_MARKETING_AT = 'opted_into_marketing_at';

protected int $id;
protected int $event_id;
Expand Down Expand Up @@ -77,6 +78,7 @@ abstract class OrderDomainObjectAbstract extends \HiEvents\DomainObjects\Abstrac
protected ?string $payment_provider = null;
protected ?string $notes = null;
protected ?string $statistics_decremented_at = null;
protected ?string $opted_into_marketing_at = null;

public function toArray(): array
{
Expand Down Expand Up @@ -114,6 +116,7 @@ public function toArray(): array
'payment_provider' => $this->payment_provider ?? null,
'notes' => $this->notes ?? null,
'statistics_decremented_at' => $this->statistics_decremented_at ?? null,
'opted_into_marketing_at' => $this->opted_into_marketing_at ?? null,
];
}

Expand Down Expand Up @@ -479,4 +482,15 @@ public function getStatisticsDecrementedAt(): ?string
{
return $this->statistics_decremented_at;
}

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

public function getOptedIntoMarketingAt(): ?string
{
return $this->opted_into_marketing_at;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
final public const UPDATED_AT = 'updated_at';
final public const DELETED_AT = 'deleted_at';
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';

protected int $id;
protected int $organizer_id;
Expand All @@ -41,6 +43,8 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
protected ?string $updated_at = null;
protected ?string $deleted_at = null;
protected array|string|null $location_details = null;
protected string $default_attendee_details_collection_method = 'PER_TICKET';
protected bool $default_show_marketing_opt_in = true;

public function toArray(): array
{
Expand All @@ -60,6 +64,8 @@ public function toArray(): array
'updated_at' => $this->updated_at ?? null,
'deleted_at' => $this->deleted_at ?? null,
'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,
];
}

Expand Down Expand Up @@ -227,4 +233,27 @@ public function getLocationDetails(): array|string|null
{
return $this->location_details;
}

public function setDefaultAttendeeDetailsCollectionMethod(
string $default_attendee_details_collection_method,
): self {
$this->default_attendee_details_collection_method = $default_attendee_details_collection_method;
return $this;
}

public function getDefaultAttendeeDetailsCollectionMethod(): string
{
return $this->default_attendee_details_collection_method;
}

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

public function getDefaultShowMarketingOptIn(): bool
{
return $this->default_show_marketing_opt_in;
}
}
2 changes: 2 additions & 0 deletions backend/app/Exports/OrdersExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function headings(): array
__('Billing Address'),
__('Notes'),
__('Promo Code'),
__('Opted In To Marketing'),
], $questionTitles);
}

Expand Down Expand Up @@ -109,6 +110,7 @@ public function map($order): array
$order->getBillingAddressString(),
$order->getNotes(),
$order->getPromoCode(),
$order->getOptedIntoMarketingAt() ? 'Yes' : 'No',
], $answers->toArray());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __invoke(CompleteOrderRequest $request, int $eventId, string $or
'questions' => $request->has('order.questions')
? $request->input('order.questions')
: null,
'opted_into_marketing' => $request->boolean('order.opted_into_marketing'),
]),
'products' => $request->input('products'),
'event_id' => $eventId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace HiEvents\Http\Request\EventSettings;

use HiEvents\DomainObjects\Enums\AttendeeDetailsCollectionMethod;
use HiEvents\DomainObjects\Enums\HomepageBackgroundType;
use HiEvents\DomainObjects\Enums\PaymentProviders;
use HiEvents\DomainObjects\Enums\PriceDisplayMode;
Expand All @@ -22,6 +23,7 @@ public function rules(): array
'continue_button_text' => ['string', 'nullable', 'max:100'],
'support_email' => ['email', 'nullable'],
'require_attendee_details' => ['boolean'],
'attendee_details_collection_method' => [Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
'order_timeout_in_minutes' => ['numeric', "min:1", "max:120"],

'homepage_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
Expand Down Expand Up @@ -83,6 +85,9 @@ public function rules(): array
'ticket_design_settings.footer_text' => ['nullable', 'string', 'max:500'],
'ticket_design_settings.layout_type' => ['nullable', 'string', Rule::in(['default', 'modern'])],
'ticket_design_settings.enabled' => ['boolean'],

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace HiEvents\Http\Request\Organizer\Settings;

use HiEvents\DomainObjects\Enums\AttendeeDetailsCollectionMethod;
use HiEvents\DomainObjects\Enums\HomepageBackgroundType;
use HiEvents\DomainObjects\Enums\OrganizerHomepageVisibility;
use HiEvents\Http\Request\BaseRequest;
Expand All @@ -13,6 +14,10 @@ class PartialUpdateOrganizerSettingsRequest extends BaseRequest
public static function rules(): array
{
return [
// Event defaults
'default_attendee_details_collection_method' => ['sometimes', 'nullable', Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
'default_show_marketing_opt_in' => ['sometimes', 'nullable', 'boolean'],

// Social handles
'facebook_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
'instagram_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
Expand Down
3 changes: 2 additions & 1 deletion backend/app/Models/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ protected function getCastMap(): array
'point_in_time_data' => 'array',
'address' => 'array',
'taxes_and_fees_rollup' => 'array',
'statistics_decremented_at' => 'datetime'
'statistics_decremented_at' => 'datetime',
'opted_into_marketing_at' => 'datetime',
];
}
}
4 changes: 4 additions & 0 deletions backend/app/Resources/Event/EventSettingsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function toArray($request): array
'product_page_message' => $this->getProductPageMessage(),
'continue_button_text' => $this->getContinueButtonText(),
'required_attendee_details' => $this->getRequireAttendeeDetails(),
'attendee_details_collection_method' => $this->getAttendeeDetailsCollectionMethod(),
'email_footer_message' => $this->getEmailFooterMessage(),
'support_email' => $this->getSupportEmail(),
'order_timeout_in_minutes' => $this->getOrderTimeoutInMinutes(),
Expand Down Expand Up @@ -66,6 +67,9 @@ public function toArray($request): array
'invoice_tax_details' => $this->getInvoiceTaxDetails(),
'invoice_notes' => $this->getInvoiceNotes(),
'invoice_payment_terms_days' => $this->getInvoicePaymentTermsDays(),

// Marketing settings
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
];
}
}
4 changes: 4 additions & 0 deletions backend/app/Resources/Event/EventSettingsResourcePublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function toArray($request): array
'product_page_message' => $this->getProductPageMessage(),
'continue_button_text' => $this->getContinueButtonText(),
'required_attendee_details' => $this->getRequireAttendeeDetails(),
'attendee_details_collection_method' => $this->getAttendeeDetailsCollectionMethod(),
'email_footer_message' => $this->getEmailFooterMessage(),
'support_email' => $this->getSupportEmail(),
'order_timeout_in_minutes' => $this->getOrderTimeoutInMinutes(),
Expand Down Expand Up @@ -72,6 +73,9 @@ public function toArray($request): array
// Invoice settings
'require_billing_address' => $this->getRequireBillingAddress(),
'invoice_label' => $this->getInvoiceLabel(),

// Marketing settings
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
];
}
}
2 changes: 2 additions & 0 deletions backend/app/Resources/Organizer/OrganizerSettingsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public function toArray($request): array
return [
'id' => $this->getId(),
'organizer_id' => $this->getOrganizerId(),
'default_attendee_details_collection_method' => $this->getDefaultAttendeeDetailsCollectionMethod(),
'default_show_marketing_opt_in' => $this->getDefaultShowMarketingOptIn(),
'social_media_handles' => $this->getSocialMediaHandles(),
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
'homepage_visibility' => $this->getHomepageVisibility(),
Expand Down
Loading
Loading