Skip to content

Commit

Permalink
continued work on migration from tickets to products
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley committed Oct 19, 2024
1 parent d007041 commit 3a671d0
Show file tree
Hide file tree
Showing 171 changed files with 11,919 additions and 4,777 deletions.
13 changes: 13 additions & 0 deletions backend/app/DomainObjects/EventDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class EventDomainObject extends Generated\EventDomainObjectAbstract implements I
{
private ?Collection $products = null;

private ?Collection $productCategories = null;

private ?Collection $questions = null;

private ?Collection $images = null;
Expand Down Expand Up @@ -259,4 +261,15 @@ public function setEventStatistics(?EventStatisticDomainObject $eventStatistics)
$this->eventStatistics = $eventStatistics;
return $this;
}

public function setProductCategories(?Collection $productCategories): EventDomainObject
{
$this->productCategories = $productCategories;
return $this;
}

public function getProductCategories(): ?Collection
{
return $this->productCategories;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract class EventDailyStatisticDomainObjectAbstract extends \HiEvents\DomainO
final public const VERSION = 'version';
final public const TOTAL_REFUNDED = 'total_refunded';
final public const TOTAL_VIEWS = 'total_views';
final public const ATTENDEES_REGISTERED = 'attendees_registered';

protected int $id;
protected int $event_id;
Expand All @@ -41,6 +42,7 @@ abstract class EventDailyStatisticDomainObjectAbstract extends \HiEvents\DomainO
protected int $version = 0;
protected float $total_refunded = 0.0;
protected int $total_views = 0;
protected int $attendees_registered = 0;

public function toArray(): array
{
Expand All @@ -60,6 +62,7 @@ public function toArray(): array
'version' => $this->version ?? null,
'total_refunded' => $this->total_refunded ?? null,
'total_views' => $this->total_views ?? null,
'attendees_registered' => $this->attendees_registered ?? null,
];
}

Expand Down Expand Up @@ -227,4 +230,15 @@ public function getTotalViews(): int
{
return $this->total_views;
}

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

public function getAttendeesRegistered(): int
{
return $this->attendees_registered;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class EventDomainObjectAbstract extends \HiEvents\DomainObjects\Abstrac
final public const DELETED_AT = 'deleted_at';
final public const LOCATION = 'location';
final public const SHORT_ID = 'short_id';
final public const PRODUCT_QUANTITY_AVAILABLE = 'ticket_quantity_available';
final public const TICKET_QUANTITY_AVAILABLE = 'ticket_quantity_available';

protected int $id;
protected int $account_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract class EventStatisticDomainObjectAbstract extends \HiEvents\DomainObject
final public const VERSION = 'version';
final public const ORDERS_CREATED = 'orders_created';
final public const TOTAL_REFUNDED = 'total_refunded';
final public const ATTENDEES_REGISTERED = 'attendees_registered';

protected int $id;
protected int $event_id;
Expand All @@ -41,6 +42,7 @@ abstract class EventStatisticDomainObjectAbstract extends \HiEvents\DomainObject
protected int $version = 0;
protected int $orders_created = 0;
protected float $total_refunded = 0.0;
protected int $attendees_registered = 0;

public function toArray(): array
{
Expand All @@ -60,6 +62,7 @@ public function toArray(): array
'version' => $this->version ?? null,
'orders_created' => $this->orders_created ?? null,
'total_refunded' => $this->total_refunded ?? null,
'attendees_registered' => $this->attendees_registered ?? null,
];
}

Expand Down Expand Up @@ -227,4 +230,15 @@ public function getTotalRefunded(): float
{
return $this->total_refunded;
}

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

public function getAttendeesRegistered(): int
{
return $this->attendees_registered;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
final public const TOTAL_GROSS = 'total_gross';
final public const TOTAL_SERVICE_FEE = 'total_service_fee';
final public const TAXES_AND_FEES_ROLLUP = 'taxes_and_fees_rollup';
final public const PRODUCT_TYPE = 'product_type';

protected int $id;
protected int $order_id;
Expand All @@ -39,6 +40,7 @@ abstract class OrderItemDomainObjectAbstract extends \HiEvents\DomainObjects\Abs
protected ?float $total_gross = null;
protected ?float $total_service_fee = 0.0;
protected array|string|null $taxes_and_fees_rollup = null;
protected string $product_type = 'TICKET';

public function toArray(): array
{
Expand All @@ -57,6 +59,7 @@ public function toArray(): array
'total_gross' => $this->total_gross ?? null,
'total_service_fee' => $this->total_service_fee ?? null,
'taxes_and_fees_rollup' => $this->taxes_and_fees_rollup ?? null,
'product_type' => $this->product_type ?? null,
];
}

Expand Down Expand Up @@ -213,4 +216,15 @@ public function getTaxesAndFeesRollup(): array|string|null
{
return $this->taxes_and_fees_rollup;
}

public function setProductType(string $product_type): self
{
$this->product_type = $product_type;
return $this;
}

public function getProductType(): string
{
return $this->product_type;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?php

namespace HiEvents\DomainObjects\Generated;

/**
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY.
* @package HiEvents\DomainObjects\Generated
*/
abstract class ProductCategoryDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
{
final public const SINGULAR_NAME = 'product_category';
final public const PLURAL_NAME = 'product_categories';
final public const ID = 'id';
final public const EVENT_ID = 'event_id';
final public const NAME = 'name';
final public const NO_PRODUCTS_MESSAGE = 'no_products_message';
final public const DESCRIPTION = 'description';
final public const IS_HIDDEN = 'is_hidden';
final public const ORDER = 'order';
final public const CREATED_AT = 'created_at';
final public const UPDATED_AT = 'updated_at';
final public const DELETED_AT = 'deleted_at';

protected int $id;
protected int $event_id;
protected string $name;
protected ?string $no_products_message = null;
protected ?string $description = null;
protected bool $is_hidden = false;
protected int $order = 0;
protected ?string $created_at = null;
protected ?string $updated_at = null;
protected ?string $deleted_at = null;

public function toArray(): array
{
return [
'id' => $this->id ?? null,
'event_id' => $this->event_id ?? null,
'name' => $this->name ?? null,
'no_products_message' => $this->no_products_message ?? null,
'description' => $this->description ?? null,
'is_hidden' => $this->is_hidden ?? null,
'order' => $this->order ?? null,
'created_at' => $this->created_at ?? null,
'updated_at' => $this->updated_at ?? null,
'deleted_at' => $this->deleted_at ?? null,
];
}

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

public function getId(): int
{
return $this->id;
}

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

public function getEventId(): int
{
return $this->event_id;
}

public function setName(string $name): self
{
$this->name = $name;
return $this;
}

public function getName(): string
{
return $this->name;
}

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

public function getNoProductsMessage(): ?string
{
return $this->no_products_message;
}

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

public function getDescription(): ?string
{
return $this->description;
}

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

public function getIsHidden(): bool
{
return $this->is_hidden;
}

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

public function getOrder(): int
{
return $this->order;
}

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

public function getCreatedAt(): ?string
{
return $this->created_at;
}

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

public function getUpdatedAt(): ?string
{
return $this->updated_at;
}

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

public function getDeletedAt(): ?string
{
return $this->deleted_at;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
final public const PLURAL_NAME = 'products';
final public const ID = 'id';
final public const EVENT_ID = 'event_id';
final public const PRODUCT_CATEGORY_ID = 'product_category_id';
final public const TITLE = 'title';
final public const SALE_START_DATE = 'sale_start_date';
final public const SALE_END_DATE = 'sale_end_date';
Expand All @@ -35,6 +36,7 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr

protected int $id;
protected int $event_id;
protected ?int $product_category_id = null;
protected string $title;
protected ?string $sale_start_date = null;
protected ?string $sale_end_date = null;
Expand All @@ -54,13 +56,14 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
protected ?string $deleted_at = null;
protected string $type = 'PAID';
protected ?bool $is_hidden = false;
protected string $product_type = 'PRODUCT';
protected string $product_type = 'TICKET';

public function toArray(): array
{
return [
'id' => $this->id ?? null,
'event_id' => $this->event_id ?? null,
'product_category_id' => $this->product_category_id ?? null,
'title' => $this->title ?? null,
'sale_start_date' => $this->sale_start_date ?? null,
'sale_end_date' => $this->sale_end_date ?? null,
Expand Down Expand Up @@ -106,6 +109,17 @@ public function getEventId(): int
return $this->event_id;
}

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

public function getProductCategoryId(): ?int
{
return $this->product_category_id;
}

public function setTitle(string $title): self
{
$this->title = $title;
Expand Down
Loading

0 comments on commit 3a671d0

Please sign in to comment.