Skip to content

Commit

Permalink
Merge branch 'main' into feature/product-and-prices-new-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vifer authored Mar 13, 2024
2 parents 8d44e20 + 79c1c5c commit abb1e99
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Entities/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Address implements Entity
{
private function __construct(
public string $id,
public string $customerId,
public string|null $description,
public string|null $firstLine,
public string|null $secondLine,
Expand All @@ -39,6 +40,7 @@ public static function from(array $data): self
{
return new self(
id: $data['id'],
customerId: $data['customer_id'],
description: $data['description'] ?? null,
firstLine: $data['first_line'] ?? null,
secondLine: $data['second_line'] ?? null,
Expand Down
2 changes: 2 additions & 0 deletions src/Entities/Business.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Business implements Entity
private function __construct(
public string $id,
public string $name,
public string $customerId,
public string|null $companyNumber,
public string|null $taxIdentifier,
public Status $status,
Expand All @@ -40,6 +41,7 @@ public static function from(array $data): self
return new self(
id: $data['id'],
name: $data['name'],
customerId: $data['customer_id'],
companyNumber: $data['company_number'] ?? null,
taxIdentifier: $data['tax_identifier'] ?? null,
status: Status::from($data['status']),
Expand Down
14 changes: 14 additions & 0 deletions src/Entities/Report/ReportFilterName.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
* @method static ReportFilterName CollectionMode()
* @method static ReportFilterName CurrencyCode()
* @method static ReportFilterName Origin()
* @method static ReportFilterName PriceStatus()
* @method static ReportFilterName PriceType()
* @method static ReportFilterName PriceUpdatedAt()
* @method static ReportFilterName ProductStatus()
* @method static ReportFilterName ProductType()
* @method static ReportFilterName ProductUpdatedAt()
* @method static ReportFilterName Status()
* @method static ReportFilterName Type()
* @method static ReportFilterName UpdatedAt()
*/
final class ReportFilterName extends PaddleEnum
Expand All @@ -27,6 +34,13 @@ final class ReportFilterName extends PaddleEnum
private const CollectionMode = 'collection_mode';
private const CurrencyCode = 'currency_code';
private const Origin = 'origin';
private const PriceStatus = 'price_status';
private const PriceType = 'price_type';
private const PriceUpdatedAt = 'price_updated_at';
private const ProductStatus = 'product_status';
private const ProductType = 'product_type';
private const ProductUpdatedAt = 'product_updated_at';
private const Status = 'status';
private const Type = 'type';
private const UpdatedAt = 'updated_at';
}
4 changes: 4 additions & 0 deletions src/Entities/Report/ReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
/**
* @method static ReportType Adjustments()
* @method static ReportType AdjustmentLineItems()
* @method static ReportType Discounts()
* @method static ReportType ProductsPrices()
* @method static ReportType Transactions()
* @method static ReportType TransactionLineItems()
*/
final class ReportType extends PaddleEnum
{
private const Adjustments = 'adjustments';
private const AdjustmentLineItems = 'adjustment_line_items';
private const Discounts = 'discounts';
private const ProductsPrices = 'products_prices';
private const Transactions = 'transactions';
private const TransactionLineItems = 'transaction_line_items';
}
2 changes: 2 additions & 0 deletions src/Notifications/Entities/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private function __construct(
public \DateTimeInterface $createdAt,
public \DateTimeInterface $updatedAt,
public ImportMeta|null $importMeta,
public string|null $customerId,
) {
}

Expand All @@ -51,6 +52,7 @@ public static function from(array $data): self
createdAt: DateTime::from($data['created_at']),
updatedAt: DateTime::from($data['updated_at']),
importMeta: isset($data['import_meta']) ? ImportMeta::from($data['import_meta']) : null,
customerId: $data['customer_id'] ?? null,
);
}
}
2 changes: 2 additions & 0 deletions src/Notifications/Entities/Business.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private function __construct(
public \DateTimeInterface $updatedAt,
public CustomData|null $customData,
public ImportMeta|null $importMeta,
public string|null $customerId,
) {
}

Expand All @@ -48,6 +49,7 @@ public static function from(array $data): self
updatedAt: DateTime::from($data['updated_at']),
customData: isset($data['custom_data']) ? new CustomData($data['custom_data']) : null,
importMeta: isset($data['import_meta']) ? ImportMeta::from($data['import_meta']) : null,
customerId: $data['customer_id'] ?? null,
);
}
}
14 changes: 14 additions & 0 deletions src/Notifications/Entities/Report/ReportFilterName.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
* @method static ReportFilterName CollectionMode()
* @method static ReportFilterName CurrencyCode()
* @method static ReportFilterName Origin()
* @method static ReportFilterName PriceStatus()
* @method static ReportFilterName PriceType()
* @method static ReportFilterName PriceUpdatedAt()
* @method static ReportFilterName ProductStatus()
* @method static ReportFilterName ProductType()
* @method static ReportFilterName ProductUpdatedAt()
* @method static ReportFilterName Status()
* @method static ReportFilterName Type()
* @method static ReportFilterName UpdatedAt()
*/
final class ReportFilterName extends PaddleEnum
Expand All @@ -27,6 +34,13 @@ final class ReportFilterName extends PaddleEnum
private const CollectionMode = 'collection_mode';
private const CurrencyCode = 'currency_code';
private const Origin = 'origin';
private const PriceStatus = 'price_status';
private const PriceType = 'price_type';
private const PriceUpdatedAt = 'price_updated_at';
private const ProductStatus = 'product_status';
private const ProductType = 'product_type';
private const ProductUpdatedAt = 'product_updated_at';
private const Status = 'status';
private const Type = 'type';
private const UpdatedAt = 'updated_at';
}
4 changes: 4 additions & 0 deletions src/Notifications/Entities/Report/ReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
/**
* @method static ReportType Adjustments()
* @method static ReportType AdjustmentLineItems()
* @method static ReportType Discounts()
* @method static ReportType ProductsPrices()
* @method static ReportType Transactions()
* @method static ReportType TransactionLineItems()
*/
final class ReportType extends PaddleEnum
{
private const Adjustments = 'adjustments';
private const AdjustmentLineItems = 'adjustment_line_items';
private const Discounts = 'discounts';
private const ProductsPrices = 'products_prices';
private const Transactions = 'transactions';
private const TransactionLineItems = 'transaction_line_items';
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"data": {
"id": "add_01h848pep46enq8y372x7maj0p",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"description": "Head Office",
"first_line": "4050 Jefferson Plaza, 41st Floor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"data": [
{
"id": "add_01h848pep46enq8y372x7maj0p",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"description": "Head Office",
"first_line": "4050 Jefferson Plaza, 41st Floor",
Expand All @@ -16,6 +17,7 @@
},
{
"id": "add_01h8494f4w5rwfp8b12yqh8fp1",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"description": "London Office",
"first_line": "81 Richmond Road",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"data": {
"id": "add_01he8brnckeq87t52hajkgfrg5",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"description": null,
"first_line": null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"data": {
"id": "biz_01h84a7hr4pzhsajkm8tev89ev",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"name": "ChatApp Inc.",
"company_number": "555775291485",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"data": [
{
"id": "biz_01h84a7hr4pzhsajkm8tev89ev",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"name": "ChatApp Inc.",
"company_number": "555775291485",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"data": {
"id": "biz_01h84a7hr4pzhsajkm8tev89ev",
"customer_id": "ctm_01h844p3h41s12zs5mn4axja51",
"status": "active",
"name": "ChatApp Inc.",
"company_number": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
},
"address": {
"id": "add_01h848pep46enq8y372x7maj0p",
"customer_id": "ctm_01h8441jn5pcwrfhwh78jqt8hk",
"description": "Head Office",
"first_line": "4050 Jefferson Plaza, 41st Floor",
"second_line": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
},
"business": {
"id": "biz_01hen2ng2290g84twtefdn5s00",
"customer_id": "ctm_01he849dseyj0zgrc589eeb1c7",
"name": "Michael's Bizniz",
"company_number": "",
"tax_identifier": "",
Expand All @@ -187,6 +188,7 @@
},
"address": {
"id": "add_01hen28ebw1ew99y295jhd4n3n",
"customer_id": "ctm_01he849dseyj0zgrc589eeb1c7",
"description": "",
"first_line": "1 Manual Collection Drive",
"second_line": "",
Expand Down

0 comments on commit abb1e99

Please sign in to comment.