diff --git a/Api/Resource/PayzenEmbeddedTransactionHistory.php b/Api/Resource/PayzenEmbeddedTransactionHistory.php new file mode 100644 index 0000000..a3d3dbd --- /dev/null +++ b/Api/Resource/PayzenEmbeddedTransactionHistory.php @@ -0,0 +1,219 @@ + [ + [ + 'name' => 'orderId', + 'in' => 'query', + 'description' => 'Filter by order ID', + 'schema' => ['type' => 'integer'], + ], + [ + 'name' => 'customerId', + 'in' => 'query', + 'description' => 'Filter by customer ID', + 'schema' => ['type' => 'integer'], + ], + ] + ], + paginationEnabled: true, + provider: PropelCollectionProvider::class + ), + new Get( + uriTemplate: 'admin/payzen-embedded/transaction-history/{id}', + requirements: ['id' => '\d+'], + openapiContext: [ + 'parameters' => [ + [ + 'name' => 'id', + 'in' => 'path', + 'description' => 'ID of the transaction history', + 'schema' => ['type' => 'integer'], + ], + [ + 'name' => 'customerId', + 'in' => 'query', + 'description' => 'Filter by customer ID', + 'schema' => ['type' => 'integer'], + ], + ] + ], + provider: PropelItemProvider::class, + ) + ], + normalizationContext: ['groups' => [self::GROUP_ADMIN_READ]] +)] + +#[ApiFilter( + filterClass: SearchFilter::class, + properties: [ + 'id', + 'orderId', + 'customerId', + ] +)] +class PayzenEmbeddedTransactionHistory implements PropelResourceInterface, ResourceAddonInterface +{ + use ResourceAddonTrait; + use PropelResourceTrait; + + public const GROUP_ADMIN_READ = 'transaction_history:admin:read'; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?int $id = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?int $orderId = null; + + #[Groups([Customer::GROUP_ADMIN_READ, Customer::GROUP_ADMIN_WRITE, Customer::GROUP_FRONT_READ_SINGLE])] + public ?int $customerId = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?int $adminId = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?string $transactionRef = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?string $status = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?string $detailedStatus = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?int $amount = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?int $currencyId = null; + + #[Groups([self::GROUP_ADMIN_READ])] + public ?string $creationDate = null; + + public function getId(): ?int + { + return $this->id; + } + public function setId(?int $id): void + { + $this->id = $id; + } + + public function getOrderId(): ?int + { + return $this->orderId; + } + public function setOrderId(?int $orderId): void + { + $this->orderId = $orderId; + } + + public function getCustomerId(): ?int + { + return $this->customerId; + } + public function setCustomerId(?int $customerId): void + { + $this->customerId = $customerId; + } + + public function getAdminId(): ?int + { + return $this->adminId; + } + public function setAdminId(?int $adminId): void + { + $this->adminId = $adminId; + } + + public function getTransactionRef(): ?string + { + return $this->transactionRef; + } + public function setTransactionRef(?string $transactionRef): void + { + $this->transactionRef = $transactionRef; + } + + public function getStatus(): ?string + { + return $this->status; + } + public function setStatus(?string $status): void + { + $this->status = $status; + } + + public function getDetailedStatus(): ?string + { + return $this->detailedStatus; + } + public function setDetailedStatus(?string $detailedStatus): void + { + $this->detailedStatus = $detailedStatus; + } + + public function getAmount(): ?int + { + return $this->amount; + } + public function setAmount(?int $amount): void + { + $this->amount = $amount; + } + + public function getCurrencyId(): ?int + { + return $this->currencyId; + } + public function setCurrencyId(?int $currencyId): void + { + $this->currencyId = $currencyId; + } + + public function getCreationDate(): ?string + { + return $this->creationDate; + } + public function setCreationDate(?string $creationDate): void + { + $this->creationDate = $creationDate; + } + + #[Ignore] + public static function getPropelRelatedTableMap(): ?TableMap + { + return PayzenEmbeddedTransactionHistoryTableMap::getTableMap(); + } + + public static function getResourceParent(): string + { + return Customer::class; + } +} diff --git a/PayzenEmbedded.php b/PayzenEmbedded.php index 744e175..f70a031 100644 --- a/PayzenEmbedded.php +++ b/PayzenEmbedded.php @@ -208,7 +208,7 @@ public function destroy(ConnectionInterface $con = null, $deleteModuleData = fal public static function configureServices(ServicesConfigurator $servicesConfigurator): void { $servicesConfigurator->load(self::getModuleCode().'\\', __DIR__) - ->exclude([THELIA_MODULE_DIR . ucfirst(self::getModuleCode()). "/I18n/*"]) + ->exclude(["/I18n/*"]) ->autowire(true) ->autoconfigure(true); }