Skip to content

Commit

Permalink
feat(Tickets): added support for OrderUnits with Tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
phodoval committed Feb 9, 2024
1 parent 20e870e commit bdf9411
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dto/OrderUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
public ?Address $shipping_address = null,

/**
* @var string[]
* @var Ticket[]
*/
public array $tickets = [],
) {}
Expand Down
24 changes: 24 additions & 0 deletions src/Dto/Ticket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);

namespace Phodoval\KauflandMarketplace\Dto;

use DateTime;

class Ticket {
public function __construct(
public string $id_ticket,
/**
* @var int[]
*/
public array $ids_order_units,
public int $id_buyer,
public DateTime $ts_created_iso,
public DateTime $ts_updated_iso,
public TicketStatus $status,
public TicketReason $open_reason,
public ?string $topic,
public string $callback_phone,
public bool $is_seller_responsible,
) {}
}
12 changes: 12 additions & 0 deletions src/Dto/TicketReason.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);

namespace Phodoval\KauflandMarketplace\Dto;

enum TicketReason: string {
case ProductNotAsDescribed = 'product_not_as_described';
case ProductDefect = 'product_defect';
case ProductNotDelivered = 'product_not_delivered';
case ProductReturn = 'product_return';
case ContactOther = 'contact_other';
}
12 changes: 12 additions & 0 deletions src/Dto/TicketStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);

namespace Phodoval\KauflandMarketplace\Dto;

enum TicketStatus: string {
case Opened = 'opened';
case BuyerClosed = 'buyer_closed';
case SellerClosed = 'seller_closed';
case BothClosed = 'both_closed';
case CustomerServiceClosedFinal = 'customer_service_closed_final';
}

0 comments on commit bdf9411

Please sign in to comment.