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
91 lines
2.5 KiB
PHP
Executable File
91 lines
2.5 KiB
PHP
Executable File
<?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,
|
|
];
|
|
}
|
|
}
|