Skip to content

Commit 2e8584f

Browse files
authored
Merge pull request #838 from HiEventsDev/develop
2 parents c0aab7c + f022412 commit 2e8584f

File tree

319 files changed

+37224
-23840
lines changed

Some content is hidden

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

319 files changed

+37224
-23840
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

Dockerfile.all-in-one

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:alpine AS node-frontend
1+
FROM node:22-alpine AS node-frontend
22

33
WORKDIR /app/frontend
44

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+
}

backend/app/DomainObjects/AttendeeCheckInDomainObject.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class AttendeeCheckInDomainObject extends Generated\AttendeeCheckInDomainObjectA
66
{
77
private ?AttendeeDomainObject $attendee = null;
88

9+
private ?CheckInListDomainObject $checkInList = null;
10+
911
public function getAttendee(): ?AttendeeDomainObject
1012
{
1113
return $this->attendee;
@@ -16,4 +18,15 @@ public function setAttendee(AttendeeDomainObject $attendee): self
1618
$this->attendee = $attendee;
1719
return $this;
1820
}
21+
22+
public function setCheckInList(?CheckInListDomainObject $checkInList): AttendeeCheckInDomainObject
23+
{
24+
$this->checkInList = $checkInList;
25+
return $this;
26+
}
27+
28+
public function getCheckInList(): ?CheckInListDomainObject
29+
{
30+
return $this->checkInList;
31+
}
1932
}

backend/app/DomainObjects/AttendeeDomainObject.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class AttendeeDomainObject extends Generated\AttendeeDomainObjectAbstract implem
1818

1919
public ?AttendeeCheckInDomainObject $checkIn = null;
2020

21+
/** @var Collection<AttendeeCheckInDomainObject>|null */
22+
private ?Collection $checkIns = null;
23+
2124
public static function getDefaultSort(): string
2225
{
2326
return self::CREATED_AT;
@@ -108,8 +111,24 @@ public function setCheckIn(?AttendeeCheckInDomainObject $checkIn): AttendeeDomai
108111
return $this;
109112
}
110113

114+
/**
115+
* Only use in the context when a single check-in is expected (e.g., when loading a list of attendees for a specific check-in list).
116+
*
117+
* @return AttendeeCheckInDomainObject|null
118+
*/
111119
public function getCheckIn(): ?AttendeeCheckInDomainObject
112120
{
113121
return $this->checkIn;
114122
}
123+
124+
public function setCheckIns(?Collection $checkIns): AttendeeDomainObject
125+
{
126+
$this->checkIns = $checkIns;
127+
return $this;
128+
}
129+
130+
public function getCheckIns(): ?Collection
131+
{
132+
return $this->checkIns;
133+
}
115134
}
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
];

0 commit comments

Comments
 (0)