Skip to content

Commit d1846ee

Browse files
authored
Feature: Allow passing platform fee to buyers (#956)
1 parent 722e9ac commit d1846ee

Some content is hidden

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

53 files changed

+1856
-959
lines changed

backend/app/DomainObjects/Generated/EventSettingDomainObjectAbstract.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
6262
final public const ATTENDEE_DETAILS_COLLECTION_METHOD = 'attendee_details_collection_method';
6363
final public const SHOW_MARKETING_OPT_IN = 'show_marketing_opt_in';
6464
final public const HOMEPAGE_THEME_SETTINGS = 'homepage_theme_settings';
65+
final public const PASS_PLATFORM_FEE_TO_BUYER = 'pass_platform_fee_to_buyer';
6566

6667
protected int $id;
6768
protected int $event_id;
@@ -115,6 +116,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
115116
protected string $attendee_details_collection_method = 'PER_TICKET';
116117
protected bool $show_marketing_opt_in = true;
117118
protected array|string|null $homepage_theme_settings = null;
119+
protected bool $pass_platform_fee_to_buyer = false;
118120

119121
public function toArray(): array
120122
{
@@ -171,6 +173,7 @@ public function toArray(): array
171173
'attendee_details_collection_method' => $this->attendee_details_collection_method ?? null,
172174
'show_marketing_opt_in' => $this->show_marketing_opt_in ?? null,
173175
'homepage_theme_settings' => $this->homepage_theme_settings ?? null,
176+
'pass_platform_fee_to_buyer' => $this->pass_platform_fee_to_buyer ?? null,
174177
];
175178
}
176179

@@ -746,4 +749,15 @@ public function getHomepageThemeSettings(): array|string|null
746749
{
747750
return $this->homepage_theme_settings;
748751
}
752+
753+
public function setPassPlatformFeeToBuyer(bool $pass_platform_fee_to_buyer): self
754+
{
755+
$this->pass_platform_fee_to_buyer = $pass_platform_fee_to_buyer;
756+
return $this;
757+
}
758+
759+
public function getPassPlatformFeeToBuyer(): bool
760+
{
761+
return $this->pass_platform_fee_to_buyer;
762+
}
749763
}

backend/app/DomainObjects/Generated/OrderItemDomainObjectAbstract.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
2525
final public const TOTAL_SERVICE_FEE = 'total_service_fee';
2626
final public const TAXES_AND_FEES_ROLLUP = 'taxes_and_fees_rollup';
2727
final public const PRODUCT_TYPE = 'product_type';
28+
final public const BUNDLE_GROUP_ID = 'bundle_group_id';
29+
final public const IS_BUNDLE_PRIMARY = 'is_bundle_primary';
2830

2931
protected int $id;
3032
protected int $order_id;
@@ -41,6 +43,8 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
4143
protected ?float $total_service_fee = 0.0;
4244
protected array|string|null $taxes_and_fees_rollup = null;
4345
protected string $product_type = 'TICKET';
46+
protected ?string $bundle_group_id = null;
47+
protected bool $is_bundle_primary = false;
4448

4549
public function toArray(): array
4650
{
@@ -60,6 +64,8 @@ public function toArray(): array
6064
'total_service_fee' => $this->total_service_fee ?? null,
6165
'taxes_and_fees_rollup' => $this->taxes_and_fees_rollup ?? null,
6266
'product_type' => $this->product_type ?? null,
67+
'bundle_group_id' => $this->bundle_group_id ?? null,
68+
'is_bundle_primary' => $this->is_bundle_primary ?? null,
6369
];
6470
}
6571

@@ -227,4 +233,26 @@ public function getProductType(): string
227233
{
228234
return $this->product_type;
229235
}
236+
237+
public function setBundleGroupId(?string $bundle_group_id): self
238+
{
239+
$this->bundle_group_id = $bundle_group_id;
240+
return $this;
241+
}
242+
243+
public function getBundleGroupId(): ?string
244+
{
245+
return $this->bundle_group_id;
246+
}
247+
248+
public function setIsBundlePrimary(bool $is_bundle_primary): self
249+
{
250+
$this->is_bundle_primary = $is_bundle_primary;
251+
return $this;
252+
}
253+
254+
public function getIsBundlePrimary(): bool
255+
{
256+
return $this->is_bundle_primary;
257+
}
230258
}

backend/app/DomainObjects/Generated/OrganizerSettingDomainObjectAbstract.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
2727
final public const LOCATION_DETAILS = 'location_details';
2828
final public const DEFAULT_ATTENDEE_DETAILS_COLLECTION_METHOD = 'default_attendee_details_collection_method';
2929
final public const DEFAULT_SHOW_MARKETING_OPT_IN = 'default_show_marketing_opt_in';
30+
final public const DEFAULT_PASS_PLATFORM_FEE_TO_BUYER = 'default_pass_platform_fee_to_buyer';
3031

3132
protected int $id;
3233
protected int $organizer_id;
@@ -45,6 +46,7 @@ abstract class OrganizerSettingDomainObjectAbstract extends \HiEvents\DomainObje
4546
protected array|string|null $location_details = null;
4647
protected string $default_attendee_details_collection_method = 'PER_TICKET';
4748
protected bool $default_show_marketing_opt_in = true;
49+
protected bool $default_pass_platform_fee_to_buyer = false;
4850

4951
public function toArray(): array
5052
{
@@ -66,6 +68,7 @@ public function toArray(): array
6668
'location_details' => $this->location_details ?? null,
6769
'default_attendee_details_collection_method' => $this->default_attendee_details_collection_method ?? null,
6870
'default_show_marketing_opt_in' => $this->default_show_marketing_opt_in ?? null,
71+
'default_pass_platform_fee_to_buyer' => $this->default_pass_platform_fee_to_buyer ?? null,
6972
];
7073
}
7174

@@ -256,4 +259,15 @@ public function getDefaultShowMarketingOptIn(): bool
256259
{
257260
return $this->default_show_marketing_opt_in;
258261
}
262+
263+
public function setDefaultPassPlatformFeeToBuyer(bool $default_pass_platform_fee_to_buyer): self
264+
{
265+
$this->default_pass_platform_fee_to_buyer = $default_pass_platform_fee_to_buyer;
266+
return $this;
267+
}
268+
269+
public function getDefaultPassPlatformFeeToBuyer(): bool
270+
{
271+
return $this->default_pass_platform_fee_to_buyer;
272+
}
259273
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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 ProductPriceTaxAndFeesDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
10+
{
11+
final public const SINGULAR_NAME = 'product_price_tax_and_fees';
12+
final public const PLURAL_NAME = 'product_price_tax_and_fees';
13+
final public const ID = 'id';
14+
final public const PRODUCT_PRICE_ID = 'product_price_id';
15+
final public const TAX_AND_FEE_ID = 'tax_and_fee_id';
16+
final public const CREATED_AT = 'created_at';
17+
final public const UPDATED_AT = 'updated_at';
18+
final public const DELETED_AT = 'deleted_at';
19+
20+
protected int $id;
21+
protected int $product_price_id;
22+
protected int $tax_and_fee_id;
23+
protected ?string $created_at = null;
24+
protected ?string $updated_at = null;
25+
protected ?string $deleted_at = null;
26+
27+
public function toArray(): array
28+
{
29+
return [
30+
'id' => $this->id ?? null,
31+
'product_price_id' => $this->product_price_id ?? null,
32+
'tax_and_fee_id' => $this->tax_and_fee_id ?? null,
33+
'created_at' => $this->created_at ?? null,
34+
'updated_at' => $this->updated_at ?? null,
35+
'deleted_at' => $this->deleted_at ?? null,
36+
];
37+
}
38+
39+
public function setId(int $id): self
40+
{
41+
$this->id = $id;
42+
return $this;
43+
}
44+
45+
public function getId(): int
46+
{
47+
return $this->id;
48+
}
49+
50+
public function setProductPriceId(int $product_price_id): self
51+
{
52+
$this->product_price_id = $product_price_id;
53+
return $this;
54+
}
55+
56+
public function getProductPriceId(): int
57+
{
58+
return $this->product_price_id;
59+
}
60+
61+
public function setTaxAndFeeId(int $tax_and_fee_id): self
62+
{
63+
$this->tax_and_fee_id = $tax_and_fee_id;
64+
return $this;
65+
}
66+
67+
public function getTaxAndFeeId(): int
68+
{
69+
return $this->tax_and_fee_id;
70+
}
71+
72+
public function setCreatedAt(?string $created_at): self
73+
{
74+
$this->created_at = $created_at;
75+
return $this;
76+
}
77+
78+
public function getCreatedAt(): ?string
79+
{
80+
return $this->created_at;
81+
}
82+
83+
public function setUpdatedAt(?string $updated_at): self
84+
{
85+
$this->updated_at = $updated_at;
86+
return $this;
87+
}
88+
89+
public function getUpdatedAt(): ?string
90+
{
91+
return $this->updated_at;
92+
}
93+
94+
public function setDeletedAt(?string $deleted_at): self
95+
{
96+
$this->deleted_at = $deleted_at;
97+
return $this;
98+
}
99+
100+
public function getDeletedAt(): ?string
101+
{
102+
return $this->deleted_at;
103+
}
104+
}
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 ProductPriceTaxAndFeesDomainObject extends Generated\ProductPriceTaxAndFeesDomainObjectAbstract
6+
{
7+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ public function rules(): array
8989
// Marketing settings
9090
'show_marketing_opt_in' => ['boolean'],
9191

92+
// Platform fee settings
93+
'pass_platform_fee_to_buyer' => ['boolean'],
94+
9295
// Homepage theme settings
9396
'homepage_theme_settings' => ['nullable', 'array'],
9497
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public static function rules(): array
1717
// Event defaults
1818
'default_attendee_details_collection_method' => ['sometimes', 'nullable', Rule::in(AttendeeDetailsCollectionMethod::valuesArray())],
1919
'default_show_marketing_opt_in' => ['sometimes', 'nullable', 'boolean'],
20+
'default_pass_platform_fee_to_buyer' => ['sometimes', 'nullable', 'boolean'],
2021

2122
// Social handles
2223
'facebook_handle' => ['sometimes', 'nullable', 'string', 'max:255'],

backend/app/Resources/Event/EventSettingsResource.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public function toArray($request): array
7171
// Marketing settings
7272
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
7373

74+
// Platform fee settings
75+
'pass_platform_fee_to_buyer' => $this->getPassPlatformFeeToBuyer(),
76+
7477
// Homepage theme settings
7578
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
7679
];

backend/app/Resources/Event/EventSettingsResourcePublic.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public function toArray($request): array
7777
// Marketing settings
7878
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
7979

80+
// Platform fee settings
81+
'pass_platform_fee_to_buyer' => $this->getPassPlatformFeeToBuyer(),
82+
8083
// Homepage theme settings
8184
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
8285
];

backend/app/Resources/Organizer/OrganizerSettingsResource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function toArray($request): array
1717
'organizer_id' => $this->getOrganizerId(),
1818
'default_attendee_details_collection_method' => $this->getDefaultAttendeeDetailsCollectionMethod(),
1919
'default_show_marketing_opt_in' => $this->getDefaultShowMarketingOptIn(),
20+
'default_pass_platform_fee_to_buyer' => $this->getDefaultPassPlatformFeeToBuyer(),
2021
'social_media_handles' => $this->getSocialMediaHandles(),
2122
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
2223
'homepage_visibility' => $this->getHomepageVisibility(),

0 commit comments

Comments
 (0)