Squashed commit message
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
This commit is contained in:
90
backend/src/app/DTO/Settings/StoreDTO.php
Executable file
90
backend/src/app/DTO/Settings/StoreDTO.php
Executable file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\DTO\Settings;
|
||||
|
||||
final class StoreDTO
|
||||
{
|
||||
private bool $featureCoupons;
|
||||
private bool $featureVouchers;
|
||||
private bool $showCategoryProductsButton;
|
||||
private string $productInteractionMode;
|
||||
private ?string $managerUsername;
|
||||
private string $ocDefaultCurrency;
|
||||
private bool $ocConfigTax;
|
||||
private int $ocStoreId;
|
||||
|
||||
public function __construct(
|
||||
bool $featureCoupons,
|
||||
bool $featureVouchers,
|
||||
bool $showCategoryProductsButton,
|
||||
string $productInteractionMode,
|
||||
?string $managerUsername,
|
||||
string $ocDefaultCurrency,
|
||||
bool $ocConfigTax,
|
||||
int $ocStoreId
|
||||
) {
|
||||
$this->featureCoupons = $featureCoupons;
|
||||
$this->featureVouchers = $featureVouchers;
|
||||
$this->showCategoryProductsButton = $showCategoryProductsButton;
|
||||
$this->productInteractionMode = $productInteractionMode;
|
||||
$this->managerUsername = $managerUsername;
|
||||
$this->ocDefaultCurrency = $ocDefaultCurrency;
|
||||
$this->ocConfigTax = $ocConfigTax;
|
||||
$this->ocStoreId = $ocStoreId;
|
||||
}
|
||||
|
||||
public function isFeatureCoupons(): bool
|
||||
{
|
||||
return $this->featureCoupons;
|
||||
}
|
||||
|
||||
public function isFeatureVouchers(): bool
|
||||
{
|
||||
return $this->featureVouchers;
|
||||
}
|
||||
|
||||
public function isShowCategoryProductsButton(): bool
|
||||
{
|
||||
return $this->showCategoryProductsButton;
|
||||
}
|
||||
|
||||
public function getProductInteractionMode(): string
|
||||
{
|
||||
return $this->productInteractionMode;
|
||||
}
|
||||
|
||||
public function getManagerUsername(): ?string
|
||||
{
|
||||
return $this->managerUsername;
|
||||
}
|
||||
|
||||
public function getOcDefaultCurrency(): string
|
||||
{
|
||||
return $this->ocDefaultCurrency;
|
||||
}
|
||||
|
||||
public function isOcConfigTax(): bool
|
||||
{
|
||||
return $this->ocConfigTax;
|
||||
}
|
||||
|
||||
public function getOcStoreId(): int
|
||||
{
|
||||
return $this->ocStoreId;
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
// enable_store больше не сериализуется, так как заменен на product_interaction_mode
|
||||
'feature_coupons' => $this->featureCoupons,
|
||||
'feature_vouchers' => $this->featureVouchers,
|
||||
'show_category_products_button' => $this->showCategoryProductsButton,
|
||||
'product_interaction_mode' => $this->productInteractionMode,
|
||||
'manager_username' => $this->managerUsername,
|
||||
'oc_default_currency' => $this->ocDefaultCurrency,
|
||||
'oc_config_tax' => $this->ocConfigTax,
|
||||
'oc_store_id' => $this->ocStoreId,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user