Skip to content

Commit 1b11ccd

Browse files
authored
Feature: Checkout UI Improvements (#915)
1 parent 714a654 commit 1b11ccd

File tree

91 files changed

+8547
-3996
lines changed

Some content is hidden

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

91 files changed

+8547
-3996
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects\Enums;
4+
5+
enum AttendeeDetailsCollectionMethod: string
6+
{
7+
use BaseEnum;
8+
9+
case PER_TICKET = 'PER_TICKET';
10+
case PER_ORDER = 'PER_ORDER';
11+
}

backend/app/DomainObjects/Generated/AccountDomainObjectAbstract.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ abstract class AccountDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
1919
final public const DELETED_AT = 'deleted_at';
2020
final public const NAME = 'name';
2121
final public const EMAIL = 'email';
22+
final public const STRIPE_ACCOUNT_ID = 'stripe_account_id';
2223
final public const SHORT_ID = 'short_id';
24+
final public const STRIPE_CONNECT_SETUP_COMPLETE = 'stripe_connect_setup_complete';
2325
final public const ACCOUNT_VERIFIED_AT = 'account_verified_at';
26+
final public const STRIPE_CONNECT_ACCOUNT_TYPE = 'stripe_connect_account_type';
2427
final public const IS_MANUALLY_VERIFIED = 'is_manually_verified';
2528

2629
protected int $id;
@@ -32,8 +35,11 @@ abstract class AccountDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
3235
protected ?string $deleted_at = null;
3336
protected string $name;
3437
protected string $email;
38+
protected ?string $stripe_account_id = null;
3539
protected string $short_id;
40+
protected ?bool $stripe_connect_setup_complete = false;
3641
protected ?string $account_verified_at = null;
42+
protected ?string $stripe_connect_account_type = null;
3743
protected bool $is_manually_verified = false;
3844

3945
public function toArray(): array
@@ -48,8 +54,11 @@ public function toArray(): array
4854
'deleted_at' => $this->deleted_at ?? null,
4955
'name' => $this->name ?? null,
5056
'email' => $this->email ?? null,
57+
'stripe_account_id' => $this->stripe_account_id ?? null,
5158
'short_id' => $this->short_id ?? null,
59+
'stripe_connect_setup_complete' => $this->stripe_connect_setup_complete ?? null,
5260
'account_verified_at' => $this->account_verified_at ?? null,
61+
'stripe_connect_account_type' => $this->stripe_connect_account_type ?? null,
5362
'is_manually_verified' => $this->is_manually_verified ?? null,
5463
];
5564
}
@@ -153,6 +162,17 @@ public function getEmail(): string
153162
return $this->email;
154163
}
155164

165+
public function setStripeAccountId(?string $stripe_account_id): self
166+
{
167+
$this->stripe_account_id = $stripe_account_id;
168+
return $this;
169+
}
170+
171+
public function getStripeAccountId(): ?string
172+
{
173+
return $this->stripe_account_id;
174+
}
175+
156176
public function setShortId(string $short_id): self
157177
{
158178
$this->short_id = $short_id;
@@ -164,6 +184,17 @@ public function getShortId(): string
164184
return $this->short_id;
165185
}
166186

187+
public function setStripeConnectSetupComplete(?bool $stripe_connect_setup_complete): self
188+
{
189+
$this->stripe_connect_setup_complete = $stripe_connect_setup_complete;
190+
return $this;
191+
}
192+
193+
public function getStripeConnectSetupComplete(): ?bool
194+
{
195+
return $this->stripe_connect_setup_complete;
196+
}
197+
167198
public function setAccountVerifiedAt(?string $account_verified_at): self
168199
{
169200
$this->account_verified_at = $account_verified_at;
@@ -175,6 +206,17 @@ public function getAccountVerifiedAt(): ?string
175206
return $this->account_verified_at;
176207
}
177208

209+
public function setStripeConnectAccountType(?string $stripe_connect_account_type): self
210+
{
211+
$this->stripe_connect_account_type = $stripe_connect_account_type;
212+
return $this;
213+
}
214+
215+
public function getStripeConnectAccountType(): ?string
216+
{
217+
return $this->stripe_connect_account_type;
218+
}
219+
178220
public function setIsManuallyVerified(bool $is_manually_verified): self
179221
{
180222
$this->is_manually_verified = $is_manually_verified;

backend/app/DomainObjects/Generated/EventSettingDomainObjectAbstract.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
5959
final public const INVOICE_PAYMENT_TERMS_DAYS = 'invoice_payment_terms_days';
6060
final public const INVOICE_NOTES = 'invoice_notes';
6161
final public const TICKET_DESIGN_SETTINGS = 'ticket_design_settings';
62+
final public const ATTENDEE_DETAILS_COLLECTION_METHOD = 'attendee_details_collection_method';
63+
final public const SHOW_MARKETING_OPT_IN = 'show_marketing_opt_in';
6264

6365
protected int $id;
6466
protected int $event_id;
@@ -109,6 +111,8 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
109111
protected ?int $invoice_payment_terms_days = null;
110112
protected ?string $invoice_notes = null;
111113
protected array|string|null $ticket_design_settings = null;
114+
protected string $attendee_details_collection_method = 'PER_TICKET';
115+
protected bool $show_marketing_opt_in = true;
112116

113117
public function toArray(): array
114118
{
@@ -162,6 +166,8 @@ public function toArray(): array
162166
'invoice_payment_terms_days' => $this->invoice_payment_terms_days ?? null,
163167
'invoice_notes' => $this->invoice_notes ?? null,
164168
'ticket_design_settings' => $this->ticket_design_settings ?? null,
169+
'attendee_details_collection_method' => $this->attendee_details_collection_method ?? null,
170+
'show_marketing_opt_in' => $this->show_marketing_opt_in ?? null,
165171
];
166172
}
167173

@@ -704,4 +710,26 @@ public function getTicketDesignSettings(): array|string|null
704710
{
705711
return $this->ticket_design_settings;
706712
}
713+
714+
public function setAttendeeDetailsCollectionMethod(string $attendee_details_collection_method): self
715+
{
716+
$this->attendee_details_collection_method = $attendee_details_collection_method;
717+
return $this;
718+
}
719+
720+
public function getAttendeeDetailsCollectionMethod(): string
721+
{
722+
return $this->attendee_details_collection_method;
723+
}
724+
725+
public function setShowMarketingOptIn(bool $show_marketing_opt_in): self
726+
{
727+
$this->show_marketing_opt_in = $show_marketing_opt_in;
728+
return $this;
729+
}
730+
731+
public function getShowMarketingOptIn(): bool
732+
{
733+
return $this->show_marketing_opt_in;
734+
}
707735
}

backend/app/DomainObjects/Generated/OrderDomainObjectAbstract.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ abstract class OrderDomainObjectAbstract extends \HiEvents\DomainObjects\Abstrac
4343
final public const PAYMENT_PROVIDER = 'payment_provider';
4444
final public const NOTES = 'notes';
4545
final public const STATISTICS_DECREMENTED_AT = 'statistics_decremented_at';
46+
final public const OPTED_INTO_MARKETING_AT = 'opted_into_marketing_at';
4647

4748
protected int $id;
4849
protected int $event_id;
@@ -77,6 +78,7 @@ abstract class OrderDomainObjectAbstract extends \HiEvents\DomainObjects\Abstrac
7778
protected ?string $payment_provider = null;
7879
protected ?string $notes = null;
7980
protected ?string $statistics_decremented_at = null;
81+
protected ?string $opted_into_marketing_at = null;
8082

8183
public function toArray(): array
8284
{
@@ -114,6 +116,7 @@ public function toArray(): array
114116
'payment_provider' => $this->payment_provider ?? null,
115117
'notes' => $this->notes ?? null,
116118
'statistics_decremented_at' => $this->statistics_decremented_at ?? null,
119+
'opted_into_marketing_at' => $this->opted_into_marketing_at ?? null,
117120
];
118121
}
119122

@@ -479,4 +482,15 @@ public function getStatisticsDecrementedAt(): ?string
479482
{
480483
return $this->statistics_decremented_at;
481484
}
485+
486+
public function setOptedIntoMarketingAt(?string $opted_into_marketing_at): self
487+
{
488+
$this->opted_into_marketing_at = $opted_into_marketing_at;
489+
return $this;
490+
}
491+
492+
public function getOptedIntoMarketingAt(): ?string
493+
{
494+
return $this->opted_into_marketing_at;
495+
}
482496
}

backend/app/DomainObjects/Generated/OrganizerSettingDomainObjectAbstract.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
2525
final public const UPDATED_AT = 'updated_at';
2626
final public const DELETED_AT = 'deleted_at';
2727
final public const LOCATION_DETAILS = 'location_details';
28+
final public const DEFAULT_ATTENDEE_DETAILS_COLLECTION_METHOD = 'default_attendee_details_collection_method';
29+
final public const DEFAULT_SHOW_MARKETING_OPT_IN = 'default_show_marketing_opt_in';
2830

2931
protected int $id;
3032
protected int $organizer_id;
@@ -41,6 +43,8 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
4143
protected ?string $updated_at = null;
4244
protected ?string $deleted_at = null;
4345
protected array|string|null $location_details = null;
46+
protected string $default_attendee_details_collection_method = 'PER_TICKET';
47+
protected bool $default_show_marketing_opt_in = true;
4448

4549
public function toArray(): array
4650
{
@@ -60,6 +64,8 @@ public function toArray(): array
6064
'updated_at' => $this->updated_at ?? null,
6165
'deleted_at' => $this->deleted_at ?? null,
6266
'location_details' => $this->location_details ?? null,
67+
'default_attendee_details_collection_method' => $this->default_attendee_details_collection_method ?? null,
68+
'default_show_marketing_opt_in' => $this->default_show_marketing_opt_in ?? null,
6369
];
6470
}
6571

@@ -227,4 +233,27 @@ public function getLocationDetails(): array|string|null
227233
{
228234
return $this->location_details;
229235
}
236+
237+
public function setDefaultAttendeeDetailsCollectionMethod(
238+
string $default_attendee_details_collection_method,
239+
): self {
240+
$this->default_attendee_details_collection_method = $default_attendee_details_collection_method;
241+
return $this;
242+
}
243+
244+
public function getDefaultAttendeeDetailsCollectionMethod(): string
245+
{
246+
return $this->default_attendee_details_collection_method;
247+
}
248+
249+
public function setDefaultShowMarketingOptIn(bool $default_show_marketing_opt_in): self
250+
{
251+
$this->default_show_marketing_opt_in = $default_show_marketing_opt_in;
252+
return $this;
253+
}
254+
255+
public function getDefaultShowMarketingOptIn(): bool
256+
{
257+
return $this->default_show_marketing_opt_in;
258+
}
230259
}

backend/app/Exports/OrdersExport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function headings(): array
6666
__('Billing Address'),
6767
__('Notes'),
6868
__('Promo Code'),
69+
__('Opted In To Marketing'),
6970
], $questionTitles);
7071
}
7172

@@ -109,6 +110,7 @@ public function map($order): array
109110
$order->getBillingAddressString(),
110111
$order->getNotes(),
111112
$order->getPromoCode(),
113+
$order->getOptedIntoMarketingAt() ? 'Yes' : 'No',
112114
], $answers->toArray());
113115
}
114116

backend/app/Http/Actions/Orders/Public/CompleteOrderActionPublic.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function __invoke(CompleteOrderRequest $request, int $eventId, string $or
3232
'questions' => $request->has('order.questions')
3333
? $request->input('order.questions')
3434
: null,
35+
'opted_into_marketing' => $request->boolean('order.opted_into_marketing'),
3536
]),
3637
'products' => $request->input('products'),
3738
'event_id' => $eventId,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace HiEvents\Http\Request\EventSettings;
44

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

2729
'homepage_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
@@ -83,6 +85,9 @@ public function rules(): array
8385
'ticket_design_settings.footer_text' => ['nullable', 'string', 'max:500'],
8486
'ticket_design_settings.layout_type' => ['nullable', 'string', Rule::in(['default', 'modern'])],
8587
'ticket_design_settings.enabled' => ['boolean'],
88+
89+
// Marketing settings
90+
'show_marketing_opt_in' => ['boolean'],
8691
];
8792
}
8893

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace HiEvents\Http\Request\Organizer\Settings;
44

5+
use HiEvents\DomainObjects\Enums\AttendeeDetailsCollectionMethod;
56
use HiEvents\DomainObjects\Enums\HomepageBackgroundType;
67
use HiEvents\DomainObjects\Enums\OrganizerHomepageVisibility;
78
use HiEvents\Http\Request\BaseRequest;
@@ -13,6 +14,10 @@ class PartialUpdateOrganizerSettingsRequest extends BaseRequest
1314
public static function rules(): array
1415
{
1516
return [
17+
// Event defaults
18+
'default_attendee_details_collection_method' => ['sometimes', 'nullable', Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
19+
'default_show_marketing_opt_in' => ['sometimes', 'nullable', 'boolean'],
20+
1621
// Social handles
1722
'facebook_handle' => ['sometimes', 'nullable', 'string', 'max:255'],
1823
'instagram_handle' => ['sometimes', 'nullable', 'string', 'max:255'],

backend/app/Models/Order.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ protected function getCastMap(): array
6363
'point_in_time_data' => 'array',
6464
'address' => 'array',
6565
'taxes_and_fees_rollup' => 'array',
66-
'statistics_decremented_at' => 'datetime'
66+
'statistics_decremented_at' => 'datetime',
67+
'opted_into_marketing_at' => 'datetime',
6768
];
6869
}
6970
}

0 commit comments

Comments
 (0)