Skip to content

Commit fa4dae1

Browse files
authored
Merge pull request #341 from HiEventsDev/feature/offline-payments-and-invoicing
2 parents 0b8ea8a + 0c268f2 commit fa4dae1

File tree

164 files changed

+6855
-1170
lines changed

Some content is hidden

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

164 files changed

+6855
-1170
lines changed

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ yarn-error.log
1919
/.vscode
2020
.idea
2121
/app-back
22+
bootstrap/cache

backend/app/DomainObjects/AttendeeDomainObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function getAllowedSorts(): AllowedSorts
2929
[
3030
self::CREATED_AT => [
3131
'asc' => __('Older First'),
32-
'desc' => __('Newer First'),
32+
'desc' => __('Newest First'),
3333
],
3434
self::UPDATED_AT => [
3535
'desc' => __('Recently Updated First'),
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 AttendeeCheckInActionType: string
6+
{
7+
use BaseEnum;
8+
9+
case CHECK_IN = 'check-in';
10+
case CHECK_IN_AND_MARK_ORDER_AS_PAID = 'check-in-and-mark-order-as-paid';
11+
}

backend/app/DomainObjects/Enums/PaymentProviders.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44

55
enum PaymentProviders: string
66
{
7-
case STRIPE = 'Stripe';
7+
use BaseEnum;
8+
9+
case STRIPE = 'STRIPE';
10+
case OFFLINE = 'OFFLINE';
811
}

backend/app/DomainObjects/EventSettingDomainObject.php

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace HiEvents\DomainObjects;
44

55
use HiEvents\DataTransferObjects\AddressDTO;
6+
use HiEvents\Helper\AddressHelper;
67

78
class EventSettingDomainObject extends Generated\EventSettingDomainObjectAbstract
89
{
@@ -25,25 +26,7 @@ public function getGetEmailFooterHtml(): string
2526

2627
public function getAddressString(): string
2728
{
28-
$locationDetails = $this->getLocationDetails();
29-
30-
if (is_null($locationDetails)) {
31-
return '';
32-
}
33-
34-
$addressParts = [
35-
$locationDetails['venue_name'] ?? null,
36-
$locationDetails['address_line_1'] ?? null,
37-
$locationDetails['address_line_2'] ?? null,
38-
$locationDetails['city'] ?? null,
39-
$locationDetails['state_or_region'] ?? null,
40-
$locationDetails['zip_or_postal_code'] ?? null,
41-
$locationDetails['country'] ?? null
42-
];
43-
44-
$filteredAddressParts = array_filter($addressParts, static fn($part) => !is_null($part) && $part !== '');
45-
46-
return implode(', ', $filteredAddressParts);
29+
return AddressHelper::formatAddress($this->getLocationDetails());
4730
}
4831

4932
public function getAddress(): AddressDTO

backend/app/DomainObjects/Generated/EventSettingDomainObjectAbstract.php

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
4545
final public const SHOW_SHARE_BUTTONS = 'show_share_buttons';
4646
final public const HOMEPAGE_BODY_BACKGROUND_COLOR = 'homepage_body_background_color';
4747
final public const HOMEPAGE_BACKGROUND_TYPE = 'homepage_background_type';
48+
final public const ENABLE_INVOICING = 'enable_invoicing';
49+
final public const INVOICE_LABEL = 'invoice_label';
50+
final public const INVOICE_PREFIX = 'invoice_prefix';
51+
final public const INVOICE_START_NUMBER = 'invoice_start_number';
52+
final public const REQUIRE_BILLING_ADDRESS = 'require_billing_address';
53+
final public const ORGANIZATION_NAME = 'organization_name';
54+
final public const ORGANIZATION_ADDRESS = 'organization_address';
55+
final public const INVOICE_TAX_DETAILS = 'invoice_tax_details';
56+
final public const PAYMENT_PROVIDERS = 'payment_providers';
57+
final public const OFFLINE_PAYMENT_INSTRUCTIONS = 'offline_payment_instructions';
58+
final public const ALLOW_ORDERS_AWAITING_OFFLINE_PAYMENT_TO_CHECK_IN = 'allow_orders_awaiting_offline_payment_to_check_in';
59+
final public const INVOICE_PAYMENT_TERMS_DAYS = 'invoice_payment_terms_days';
60+
final public const INVOICE_NOTES = 'invoice_notes';
4861

4962
protected int $id;
5063
protected int $event_id;
@@ -81,6 +94,19 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
8194
protected bool $show_share_buttons = true;
8295
protected ?string $homepage_body_background_color = null;
8396
protected string $homepage_background_type = 'COLOR';
97+
protected bool $enable_invoicing = false;
98+
protected ?string $invoice_label = null;
99+
protected ?string $invoice_prefix = null;
100+
protected int $invoice_start_number = 1;
101+
protected bool $require_billing_address = true;
102+
protected ?string $organization_name = null;
103+
protected ?string $organization_address = null;
104+
protected ?string $invoice_tax_details = null;
105+
protected array|string|null $payment_providers = null;
106+
protected ?string $offline_payment_instructions = null;
107+
protected bool $allow_orders_awaiting_offline_payment_to_check_in = false;
108+
protected ?int $invoice_payment_terms_days = null;
109+
protected ?string $invoice_notes = null;
84110

85111
public function toArray(): array
86112
{
@@ -120,6 +146,19 @@ public function toArray(): array
120146
'show_share_buttons' => $this->show_share_buttons ?? null,
121147
'homepage_body_background_color' => $this->homepage_body_background_color ?? null,
122148
'homepage_background_type' => $this->homepage_background_type ?? null,
149+
'enable_invoicing' => $this->enable_invoicing ?? null,
150+
'invoice_label' => $this->invoice_label ?? null,
151+
'invoice_prefix' => $this->invoice_prefix ?? null,
152+
'invoice_start_number' => $this->invoice_start_number ?? null,
153+
'require_billing_address' => $this->require_billing_address ?? null,
154+
'organization_name' => $this->organization_name ?? null,
155+
'organization_address' => $this->organization_address ?? null,
156+
'invoice_tax_details' => $this->invoice_tax_details ?? null,
157+
'payment_providers' => $this->payment_providers ?? null,
158+
'offline_payment_instructions' => $this->offline_payment_instructions ?? null,
159+
'allow_orders_awaiting_offline_payment_to_check_in' => $this->allow_orders_awaiting_offline_payment_to_check_in ?? null,
160+
'invoice_payment_terms_days' => $this->invoice_payment_terms_days ?? null,
161+
'invoice_notes' => $this->invoice_notes ?? null,
123162
];
124163
}
125164

@@ -507,4 +546,148 @@ public function getHomepageBackgroundType(): string
507546
{
508547
return $this->homepage_background_type;
509548
}
549+
550+
public function setEnableInvoicing(bool $enable_invoicing): self
551+
{
552+
$this->enable_invoicing = $enable_invoicing;
553+
return $this;
554+
}
555+
556+
public function getEnableInvoicing(): bool
557+
{
558+
return $this->enable_invoicing;
559+
}
560+
561+
public function setInvoiceLabel(?string $invoice_label): self
562+
{
563+
$this->invoice_label = $invoice_label;
564+
return $this;
565+
}
566+
567+
public function getInvoiceLabel(): ?string
568+
{
569+
return $this->invoice_label;
570+
}
571+
572+
public function setInvoicePrefix(?string $invoice_prefix): self
573+
{
574+
$this->invoice_prefix = $invoice_prefix;
575+
return $this;
576+
}
577+
578+
public function getInvoicePrefix(): ?string
579+
{
580+
return $this->invoice_prefix;
581+
}
582+
583+
public function setInvoiceStartNumber(int $invoice_start_number): self
584+
{
585+
$this->invoice_start_number = $invoice_start_number;
586+
return $this;
587+
}
588+
589+
public function getInvoiceStartNumber(): int
590+
{
591+
return $this->invoice_start_number;
592+
}
593+
594+
public function setRequireBillingAddress(bool $require_billing_address): self
595+
{
596+
$this->require_billing_address = $require_billing_address;
597+
return $this;
598+
}
599+
600+
public function getRequireBillingAddress(): bool
601+
{
602+
return $this->require_billing_address;
603+
}
604+
605+
public function setOrganizationName(?string $organization_name): self
606+
{
607+
$this->organization_name = $organization_name;
608+
return $this;
609+
}
610+
611+
public function getOrganizationName(): ?string
612+
{
613+
return $this->organization_name;
614+
}
615+
616+
public function setOrganizationAddress(?string $organization_address): self
617+
{
618+
$this->organization_address = $organization_address;
619+
return $this;
620+
}
621+
622+
public function getOrganizationAddress(): ?string
623+
{
624+
return $this->organization_address;
625+
}
626+
627+
public function setInvoiceTaxDetails(?string $invoice_tax_details): self
628+
{
629+
$this->invoice_tax_details = $invoice_tax_details;
630+
return $this;
631+
}
632+
633+
public function getInvoiceTaxDetails(): ?string
634+
{
635+
return $this->invoice_tax_details;
636+
}
637+
638+
public function setPaymentProviders(array|string|null $payment_providers): self
639+
{
640+
$this->payment_providers = $payment_providers;
641+
return $this;
642+
}
643+
644+
public function getPaymentProviders(): array|string|null
645+
{
646+
return $this->payment_providers;
647+
}
648+
649+
public function setOfflinePaymentInstructions(?string $offline_payment_instructions): self
650+
{
651+
$this->offline_payment_instructions = $offline_payment_instructions;
652+
return $this;
653+
}
654+
655+
public function getOfflinePaymentInstructions(): ?string
656+
{
657+
return $this->offline_payment_instructions;
658+
}
659+
660+
public function setAllowOrdersAwaitingOfflinePaymentToCheckIn(
661+
bool $allow_orders_awaiting_offline_payment_to_check_in,
662+
): self {
663+
$this->allow_orders_awaiting_offline_payment_to_check_in = $allow_orders_awaiting_offline_payment_to_check_in;
664+
return $this;
665+
}
666+
667+
public function getAllowOrdersAwaitingOfflinePaymentToCheckIn(): bool
668+
{
669+
return $this->allow_orders_awaiting_offline_payment_to_check_in;
670+
}
671+
672+
public function setInvoicePaymentTermsDays(?int $invoice_payment_terms_days): self
673+
{
674+
$this->invoice_payment_terms_days = $invoice_payment_terms_days;
675+
return $this;
676+
}
677+
678+
public function getInvoicePaymentTermsDays(): ?int
679+
{
680+
return $this->invoice_payment_terms_days;
681+
}
682+
683+
public function setInvoiceNotes(?string $invoice_notes): self
684+
{
685+
$this->invoice_notes = $invoice_notes;
686+
return $this;
687+
}
688+
689+
public function getInvoiceNotes(): ?string
690+
{
691+
return $this->invoice_notes;
692+
}
510693
}

0 commit comments

Comments
 (0)