Skip to content

Commit e7f611a

Browse files
daveearleydependabot[bot]creativeindustriesgroupsundeepnarangArdakilic
authored
v1.2.0-alpha.1 (#735)
Co-authored-by: Dave Earley <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: creativeindustriesgroup <[email protected]> Co-authored-by: Sundeep Narang <[email protected]> Co-authored-by: Arda Kılıçdağı <[email protected]>
1 parent af1c041 commit e7f611a

File tree

292 files changed

+35137
-21926
lines changed

Some content is hidden

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

292 files changed

+35137
-21926
lines changed

.github/workflows/post-release-push-images.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
push_to_registry:
1010
name: Push Docker images to Docker Hub
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- name: Check out the repo
1415
uses: actions/checkout@v4
@@ -28,6 +29,9 @@ jobs:
2829
uses: docker/metadata-action@v3
2930
with:
3031
images: daveearley/hi.events-all-in-one
32+
tags: |
33+
type=ref,event=tag
34+
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
3135
3236
- name: Build and push All-in-one Docker image
3337
uses: docker/build-push-action@v3
@@ -44,6 +48,9 @@ jobs:
4448
uses: docker/metadata-action@v3
4549
with:
4650
images: daveearley/hi.events-backend
51+
tags: |
52+
type=ref,event=tag
53+
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
4754
4855
- name: Build and push Backend Docker image
4956
uses: docker/build-push-action@v3
@@ -60,6 +67,9 @@ jobs:
6067
uses: docker/metadata-action@v3
6168
with:
6269
images: daveearley/hi.events-frontend
70+
tags: |
71+
type=ref,event=tag
72+
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
6373
6474
- name: Build and push Frontend Docker image
6575
uses: docker/build-push-action@v3

backend/app/DomainObjects/AccountDomainObject.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
namespace HiEvents\DomainObjects;
44

55
use HiEvents\DomainObjects\DTO\AccountApplicationFeeDTO;
6+
use HiEvents\DomainObjects\Enums\StripePlatform;
7+
use Illuminate\Support\Collection;
68

79
class AccountDomainObject extends Generated\AccountDomainObjectAbstract
810
{
911
private ?AccountConfigurationDomainObject $configuration = null;
1012

13+
/** @var Collection<int, AccountStripePlatformDomainObject>|null */
14+
private ?Collection $stripePlatforms = null;
15+
1116
public function getApplicationFee(): AccountApplicationFeeDTO
1217
{
1318
/** @var AccountConfigurationDomainObject $applicationFee */
@@ -28,4 +33,68 @@ public function setConfiguration(AccountConfigurationDomainObject $configuration
2833
{
2934
$this->configuration = $configuration;
3035
}
36+
37+
public function getAccountStripePlatforms(): ?Collection
38+
{
39+
return $this->stripePlatforms;
40+
}
41+
42+
public function setAccountStripePlatforms(Collection $stripePlatforms): void
43+
{
44+
$this->stripePlatforms = $stripePlatforms;
45+
}
46+
47+
/**
48+
* Get the primary active Stripe platform for this account
49+
* Returns the platform with setup completed, preferring the most recent
50+
*/
51+
public function getPrimaryStripePlatform(): ?AccountStripePlatformDomainObject
52+
{
53+
if (!$this->stripePlatforms || $this->stripePlatforms->isEmpty()) {
54+
return null;
55+
}
56+
57+
return $this->stripePlatforms
58+
->filter(fn($platform) => $platform->getStripeSetupCompletedAt() !== null)
59+
->sortByDesc(fn($platform) => $platform->getCreatedAt())
60+
->first();
61+
}
62+
63+
/**
64+
* Get the Stripe platform for a specific platform type
65+
* Handles null platform for open-source installations
66+
*/
67+
public function getStripePlatformByType(?StripePlatform $platformType): ?AccountStripePlatformDomainObject
68+
{
69+
if (!$this->stripePlatforms || $this->stripePlatforms->isEmpty()) {
70+
return null;
71+
}
72+
73+
return $this->stripePlatforms
74+
->filter(fn($platform) => $platform->getStripeConnectPlatform() === $platformType?->value)
75+
->first();
76+
}
77+
78+
public function getActiveStripeAccountId(): ?string
79+
{
80+
return $this->getPrimaryStripePlatform()?->getStripeAccountId();
81+
}
82+
83+
public function getActiveStripePlatform(): ?StripePlatform
84+
{
85+
$primaryPlatform = $this->getPrimaryStripePlatform();
86+
if (!$primaryPlatform || !$primaryPlatform->getStripeConnectPlatform()) {
87+
return null;
88+
}
89+
90+
return StripePlatform::fromString($primaryPlatform->getStripeConnectPlatform());
91+
}
92+
93+
/**
94+
* Check if Stripe is set up and ready for payments
95+
*/
96+
public function isStripeSetupComplete(): bool
97+
{
98+
return $this->getPrimaryStripePlatform() !== null;
99+
}
31100
}
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 AccountStripePlatformDomainObject extends Generated\AccountStripePlatformDomainObjectAbstract
6+
{
7+
}
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 EmailTemplateDomainObject extends Generated\EmailTemplateDomainObjectAbstract
6+
{
7+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects\Enums;
4+
5+
enum EmailTemplateEngine: string
6+
{
7+
use BaseEnum;
8+
9+
case LIQUID = 'liquid';
10+
case BLADE = 'blade'; // For future use
11+
12+
public function label(): string
13+
{
14+
return match ($this) {
15+
self::LIQUID => __('Liquid'),
16+
self::BLADE => __('Blade'),
17+
};
18+
}
19+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects\Enums;
4+
5+
enum EmailTemplateType: string
6+
{
7+
use BaseEnum;
8+
9+
case ORDER_CONFIRMATION = 'order_confirmation';
10+
case ATTENDEE_TICKET = 'attendee_ticket';
11+
12+
public function label(): string
13+
{
14+
return match ($this) {
15+
self::ORDER_CONFIRMATION => __('Order Confirmation'),
16+
self::ATTENDEE_TICKET => __('Attendee Ticket'),
17+
};
18+
}
19+
20+
public function description(): string
21+
{
22+
return match ($this) {
23+
self::ORDER_CONFIRMATION => __('Sent to the customer after placing an order'),
24+
self::ATTENDEE_TICKET => __('Sent to each attendee with their ticket'),
25+
};
26+
}
27+
}

backend/app/DomainObjects/Enums/ImageType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ enum ImageType
1515

1616
// Event images
1717
case EVENT_COVER;
18+
case TICKET_LOGO;
1819

1920
// Organizer images
2021
case ORGANIZER_LOGO;
@@ -24,6 +25,7 @@ public static function eventImageTypes(): array
2425
{
2526
return [
2627
self::EVENT_COVER,
28+
self::TICKET_LOGO,
2729
];
2830
}
2931

@@ -47,6 +49,7 @@ public static function getMinimumDimensionsMap(ImageType $imageType): array
4749
$map = [
4850
self::GENERIC->name => [50, 50],
4951
self::EVENT_COVER->name => [600, 50],
52+
self::TICKET_LOGO->name => [100, 100],
5053
self::ORGANIZER_LOGO->name => [100, 100],
5154
self::ORGANIZER_COVER->name => [600, 50],
5255
];
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace HiEvents\DomainObjects\Enums;
4+
5+
enum StripePlatform: string
6+
{
7+
case CANADA = 'ca';
8+
case IRELAND = 'ie';
9+
10+
public static function fromString(?string $value): ?self
11+
{
12+
if ($value === null) {
13+
return null;
14+
}
15+
16+
return self::tryFrom($value);
17+
}
18+
19+
public function toString(): string
20+
{
21+
return $this->value;
22+
}
23+
24+
public static function getAllValues(): array
25+
{
26+
return array_column(self::cases(), 'value');
27+
}
28+
}

backend/app/DomainObjects/Generated/AccountDomainObjectAbstract.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ 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';
2322
final public const SHORT_ID = 'short_id';
24-
final public const STRIPE_CONNECT_SETUP_COMPLETE = 'stripe_connect_setup_complete';
2523
final public const ACCOUNT_VERIFIED_AT = 'account_verified_at';
26-
final public const STRIPE_CONNECT_ACCOUNT_TYPE = 'stripe_connect_account_type';
2724
final public const IS_MANUALLY_VERIFIED = 'is_manually_verified';
2825

2926
protected int $id;
@@ -35,11 +32,8 @@ abstract class AccountDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
3532
protected ?string $deleted_at = null;
3633
protected string $name;
3734
protected string $email;
38-
protected ?string $stripe_account_id = null;
3935
protected string $short_id;
40-
protected ?bool $stripe_connect_setup_complete = false;
4136
protected ?string $account_verified_at = null;
42-
protected ?string $stripe_connect_account_type = null;
4337
protected bool $is_manually_verified = false;
4438

4539
public function toArray(): array
@@ -54,11 +48,8 @@ public function toArray(): array
5448
'deleted_at' => $this->deleted_at ?? null,
5549
'name' => $this->name ?? null,
5650
'email' => $this->email ?? null,
57-
'stripe_account_id' => $this->stripe_account_id ?? null,
5851
'short_id' => $this->short_id ?? null,
59-
'stripe_connect_setup_complete' => $this->stripe_connect_setup_complete ?? null,
6052
'account_verified_at' => $this->account_verified_at ?? null,
61-
'stripe_connect_account_type' => $this->stripe_connect_account_type ?? null,
6253
'is_manually_verified' => $this->is_manually_verified ?? null,
6354
];
6455
}
@@ -162,17 +153,6 @@ public function getEmail(): string
162153
return $this->email;
163154
}
164155

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-
176156
public function setShortId(string $short_id): self
177157
{
178158
$this->short_id = $short_id;
@@ -184,17 +164,6 @@ public function getShortId(): string
184164
return $this->short_id;
185165
}
186166

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-
198167
public function setAccountVerifiedAt(?string $account_verified_at): self
199168
{
200169
$this->account_verified_at = $account_verified_at;
@@ -206,17 +175,6 @@ public function getAccountVerifiedAt(): ?string
206175
return $this->account_verified_at;
207176
}
208177

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-
220178
public function setIsManuallyVerified(bool $is_manually_verified): self
221179
{
222180
$this->is_manually_verified = $is_manually_verified;

0 commit comments

Comments
 (0)