Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ yarn-error.log
/.vscode
.idea
/app-back
bootstrap/cache
2 changes: 1 addition & 1 deletion backend/app/DomainObjects/AttendeeDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function getAllowedSorts(): AllowedSorts
[
self::CREATED_AT => [
'asc' => __('Older First'),
'desc' => __('Newer First'),
'desc' => __('Newest First'),
],
self::UPDATED_AT => [
'desc' => __('Recently Updated First'),
Expand Down
11 changes: 11 additions & 0 deletions backend/app/DomainObjects/Enums/AttendeeCheckInActionType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum AttendeeCheckInActionType: string
{
use BaseEnum;

case CHECK_IN = 'check-in';
case CHECK_IN_AND_MARK_ORDER_AS_PAID = 'check-in-and-mark-order-as-paid';
}
5 changes: 4 additions & 1 deletion backend/app/DomainObjects/Enums/PaymentProviders.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@

enum PaymentProviders: string
{
case STRIPE = 'Stripe';
use BaseEnum;

case STRIPE = 'STRIPE';
case OFFLINE = 'OFFLINE';
}
21 changes: 2 additions & 19 deletions backend/app/DomainObjects/EventSettingDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace HiEvents\DomainObjects;

use HiEvents\DataTransferObjects\AddressDTO;
use HiEvents\Helper\AddressHelper;

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

public function getAddressString(): string
{
$locationDetails = $this->getLocationDetails();

if (is_null($locationDetails)) {
return '';
}

$addressParts = [
$locationDetails['venue_name'] ?? null,
$locationDetails['address_line_1'] ?? null,
$locationDetails['address_line_2'] ?? null,
$locationDetails['city'] ?? null,
$locationDetails['state_or_region'] ?? null,
$locationDetails['zip_or_postal_code'] ?? null,
$locationDetails['country'] ?? null
];

$filteredAddressParts = array_filter($addressParts, static fn($part) => !is_null($part) && $part !== '');

return implode(', ', $filteredAddressParts);
return AddressHelper::formatAddress($this->getLocationDetails());
}

public function getAddress(): AddressDTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
final public const SHOW_SHARE_BUTTONS = 'show_share_buttons';
final public const HOMEPAGE_BODY_BACKGROUND_COLOR = 'homepage_body_background_color';
final public const HOMEPAGE_BACKGROUND_TYPE = 'homepage_background_type';
final public const ENABLE_INVOICING = 'enable_invoicing';
final public const INVOICE_LABEL = 'invoice_label';
final public const INVOICE_PREFIX = 'invoice_prefix';
final public const INVOICE_START_NUMBER = 'invoice_start_number';
final public const REQUIRE_BILLING_ADDRESS = 'require_billing_address';
final public const ORGANIZATION_NAME = 'organization_name';
final public const ORGANIZATION_ADDRESS = 'organization_address';
final public const INVOICE_TAX_DETAILS = 'invoice_tax_details';
final public const PAYMENT_PROVIDERS = 'payment_providers';
final public const OFFLINE_PAYMENT_INSTRUCTIONS = 'offline_payment_instructions';
final public const ALLOW_ORDERS_AWAITING_OFFLINE_PAYMENT_TO_CHECK_IN = 'allow_orders_awaiting_offline_payment_to_check_in';
final public const INVOICE_PAYMENT_TERMS_DAYS = 'invoice_payment_terms_days';
final public const INVOICE_NOTES = 'invoice_notes';

protected int $id;
protected int $event_id;
Expand Down Expand Up @@ -81,6 +94,19 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
protected bool $show_share_buttons = true;
protected ?string $homepage_body_background_color = null;
protected string $homepage_background_type = 'COLOR';
protected bool $enable_invoicing = false;
protected ?string $invoice_label = null;
protected ?string $invoice_prefix = null;
protected int $invoice_start_number = 1;
protected bool $require_billing_address = true;
protected ?string $organization_name = null;
protected ?string $organization_address = null;
protected ?string $invoice_tax_details = null;
protected array|string|null $payment_providers = null;
protected ?string $offline_payment_instructions = null;
protected bool $allow_orders_awaiting_offline_payment_to_check_in = false;
protected ?int $invoice_payment_terms_days = null;
protected ?string $invoice_notes = null;

public function toArray(): array
{
Expand Down Expand Up @@ -120,6 +146,19 @@ public function toArray(): array
'show_share_buttons' => $this->show_share_buttons ?? null,
'homepage_body_background_color' => $this->homepage_body_background_color ?? null,
'homepage_background_type' => $this->homepage_background_type ?? null,
'enable_invoicing' => $this->enable_invoicing ?? null,
'invoice_label' => $this->invoice_label ?? null,
'invoice_prefix' => $this->invoice_prefix ?? null,
'invoice_start_number' => $this->invoice_start_number ?? null,
'require_billing_address' => $this->require_billing_address ?? null,
'organization_name' => $this->organization_name ?? null,
'organization_address' => $this->organization_address ?? null,
'invoice_tax_details' => $this->invoice_tax_details ?? null,
'payment_providers' => $this->payment_providers ?? null,
'offline_payment_instructions' => $this->offline_payment_instructions ?? null,
'allow_orders_awaiting_offline_payment_to_check_in' => $this->allow_orders_awaiting_offline_payment_to_check_in ?? null,
'invoice_payment_terms_days' => $this->invoice_payment_terms_days ?? null,
'invoice_notes' => $this->invoice_notes ?? null,
];
}

Expand Down Expand Up @@ -507,4 +546,148 @@ public function getHomepageBackgroundType(): string
{
return $this->homepage_background_type;
}

public function setEnableInvoicing(bool $enable_invoicing): self
{
$this->enable_invoicing = $enable_invoicing;
return $this;
}

public function getEnableInvoicing(): bool
{
return $this->enable_invoicing;
}

public function setInvoiceLabel(?string $invoice_label): self
{
$this->invoice_label = $invoice_label;
return $this;
}

public function getInvoiceLabel(): ?string
{
return $this->invoice_label;
}

public function setInvoicePrefix(?string $invoice_prefix): self
{
$this->invoice_prefix = $invoice_prefix;
return $this;
}

public function getInvoicePrefix(): ?string
{
return $this->invoice_prefix;
}

public function setInvoiceStartNumber(int $invoice_start_number): self
{
$this->invoice_start_number = $invoice_start_number;
return $this;
}

public function getInvoiceStartNumber(): int
{
return $this->invoice_start_number;
}

public function setRequireBillingAddress(bool $require_billing_address): self
{
$this->require_billing_address = $require_billing_address;
return $this;
}

public function getRequireBillingAddress(): bool
{
return $this->require_billing_address;
}

public function setOrganizationName(?string $organization_name): self
{
$this->organization_name = $organization_name;
return $this;
}

public function getOrganizationName(): ?string
{
return $this->organization_name;
}

public function setOrganizationAddress(?string $organization_address): self
{
$this->organization_address = $organization_address;
return $this;
}

public function getOrganizationAddress(): ?string
{
return $this->organization_address;
}

public function setInvoiceTaxDetails(?string $invoice_tax_details): self
{
$this->invoice_tax_details = $invoice_tax_details;
return $this;
}

public function getInvoiceTaxDetails(): ?string
{
return $this->invoice_tax_details;
}

public function setPaymentProviders(array|string|null $payment_providers): self
{
$this->payment_providers = $payment_providers;
return $this;
}

public function getPaymentProviders(): array|string|null
{
return $this->payment_providers;
}

public function setOfflinePaymentInstructions(?string $offline_payment_instructions): self
{
$this->offline_payment_instructions = $offline_payment_instructions;
return $this;
}

public function getOfflinePaymentInstructions(): ?string
{
return $this->offline_payment_instructions;
}

public function setAllowOrdersAwaitingOfflinePaymentToCheckIn(
bool $allow_orders_awaiting_offline_payment_to_check_in,
): self {
$this->allow_orders_awaiting_offline_payment_to_check_in = $allow_orders_awaiting_offline_payment_to_check_in;
return $this;
}

public function getAllowOrdersAwaitingOfflinePaymentToCheckIn(): bool
{
return $this->allow_orders_awaiting_offline_payment_to_check_in;
}

public function setInvoicePaymentTermsDays(?int $invoice_payment_terms_days): self
{
$this->invoice_payment_terms_days = $invoice_payment_terms_days;
return $this;
}

public function getInvoicePaymentTermsDays(): ?int
{
return $this->invoice_payment_terms_days;
}

public function setInvoiceNotes(?string $invoice_notes): self
{
$this->invoice_notes = $invoice_notes;
return $this;
}

public function getInvoiceNotes(): ?string
{
return $this->invoice_notes;
}
}
Loading
Loading