diff --git a/src/Entities/Adjustment.php b/src/Entities/Adjustment.php index aa3dd97..3391d1f 100644 --- a/src/Entities/Adjustment.php +++ b/src/Entities/Adjustment.php @@ -42,7 +42,7 @@ private function __construct( public array $taxRatesUsed, public \DateTimeInterface $createdAt, public \DateTimeInterface|null $updatedAt, - public AdjustmentType|null $type, + public AdjustmentType $type, ) { } @@ -64,7 +64,7 @@ public static function from(array $data): self taxRatesUsed: array_map(fn (array $taxRateUsed): AdjustmentTaxRatesUsed => AdjustmentTaxRatesUsed::from($taxRateUsed), $data['tax_rates_used'] ?? []), createdAt: DateTime::from($data['created_at']), updatedAt: DateTime::from($data['updated_at']), - type: isset($data['type']) ? AdjustmentType::from($data['type']) : null, + type: AdjustmentType::from($data['type']), ); } } diff --git a/tests/Functional/Resources/Adjustments/_fixtures/response/full_entity.json b/tests/Functional/Resources/Adjustments/_fixtures/response/full_entity.json index 9b8f6bf..84e0afa 100644 --- a/tests/Functional/Resources/Adjustments/_fixtures/response/full_entity.json +++ b/tests/Functional/Resources/Adjustments/_fixtures/response/full_entity.json @@ -2,6 +2,7 @@ "data": { "id": "adj_01h8c65c2ggq5nxswnnwv78e75", "action": "refund", + "type": "partial", "transaction_id": "txn_01h8bxpvx398a7zbawb77y0kp5", "subscription_id": "sub_01h8bxswamxysj44zt5n48njwh", "customer_id": "ctm_01h8441jn5pcwrfhwh78jqt8hk", diff --git a/tests/Functional/Resources/Adjustments/_fixtures/response/list_default.json b/tests/Functional/Resources/Adjustments/_fixtures/response/list_default.json index 746c380..8e777bb 100644 --- a/tests/Functional/Resources/Adjustments/_fixtures/response/list_default.json +++ b/tests/Functional/Resources/Adjustments/_fixtures/response/list_default.json @@ -3,6 +3,7 @@ { "id": "adj_01h8c65c2ggq5nxswnnwv78e75", "action": "refund", + "type": "partial", "transaction_id": "txn_01h8bxpvx398a7zbawb77y0kp5", "subscription_id": "sub_01h8bxswamxysj44zt5n48njwh", "customer_id": "ctm_01h8441jn5pcwrfhwh78jqt8hk", @@ -55,6 +56,7 @@ { "id": "adj_01h8bxezh16gm6t8rx21dx271b", "action": "credit", + "type": "partial", "credit_applied_to_balance": true, "transaction_id": "txn_01h8bx69629a16wwm9z8rjmak3", "subscription_id": "sub_01h8bx8fmywym11t6swgzba704", @@ -114,6 +116,7 @@ { "id": "adj_01h7jgzjqt2s8sab70e03ptkhv", "action": "credit", + "type": "partial", "credit_applied_to_balance": true, "transaction_id": "txn_01h7jgd9bkwjscj3ae15g5d3vs", "subscription_id": "sub_01h7ht5z5wdg9pz18jx1fagp8k", @@ -173,6 +176,7 @@ { "id": "adj_01h7jf6ptkfsc93hzc20fgf8wy", "action": "credit", + "type": "partial", "credit_applied_to_balance": true, "transaction_id": "txn_01h7je77vc1qmzxntem45ebb5q", "subscription_id": "sub_01h7ht5z5wdg9pz18jx1fagp8k", @@ -232,6 +236,7 @@ { "id": "adj_01h468w41ttb2j2bh8av74gwt1", "action": "credit", + "type": "partial", "credit_applied_to_balance": true, "transaction_id": "txn_01h468crc3b3fe98a5ft53recb", "subscription_id": "sub_01h468kv3jhs5jk330gszncsgt", diff --git a/tests/Functional/Resources/Adjustments/_fixtures/response/minimal_entity.json b/tests/Functional/Resources/Adjustments/_fixtures/response/minimal_entity.json index 3a7c419..3d8e904 100644 --- a/tests/Functional/Resources/Adjustments/_fixtures/response/minimal_entity.json +++ b/tests/Functional/Resources/Adjustments/_fixtures/response/minimal_entity.json @@ -2,6 +2,7 @@ "data": { "id": "adj_01h8c65c2ggq5nxswnnwv78e75", "action": "refund", + "type": "partial", "transaction_id": "txn_01h8bxpvx398a7zbawb77y0kp5", "subscription_id": "sub_01h8bxswamxysj44zt5n48njwh", "customer_id": "ctm_01h8441jn5pcwrfhwh78jqt8hk",