|
|
@@ -3,6 +3,8 @@ |
|
|
|
namespace Lc\CaracoleBundle\Controller\PointSale; |
|
|
|
|
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\MoneyField; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; |
|
|
|
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer; |
|
|
@@ -13,6 +15,7 @@ use Lc\CaracoleBundle\Resolver\MerchantResolver; |
|
|
|
use Lc\SovBundle\Controller\AbstractAdminController; |
|
|
|
use Lc\SovBundle\Field\BooleanField; |
|
|
|
use Lc\SovBundle\Field\StatusField; |
|
|
|
use Lc\SovBundle\Field\ToggleField; |
|
|
|
|
|
|
|
abstract class PointSaleAdminController extends AbstractAdminController |
|
|
|
{ |
|
|
@@ -20,34 +23,31 @@ abstract class PointSaleAdminController extends AbstractAdminController |
|
|
|
|
|
|
|
public function configureFields(string $pageName): iterable |
|
|
|
{ |
|
|
|
|
|
|
|
return array_merge( |
|
|
|
[ |
|
|
|
FormField::addPanel('general'), |
|
|
|
TextField::new('title'), |
|
|
|
NumberField::new('orderAmountMin') |
|
|
|
->setCustomOption('appendHtml','€') |
|
|
|
->hideOnIndex(), |
|
|
|
NumberField::new('deliveryPrice') |
|
|
|
->setCustomOption('appendHtml','€') |
|
|
|
->hideOnIndex(), |
|
|
|
BooleanField::new('isPublic'), |
|
|
|
BooleanField::new('isDepository'), |
|
|
|
StatusField::new('status') |
|
|
|
->hideOnIndex(), |
|
|
|
FormField::addPanel('address'), |
|
|
|
AddressField::new('address') |
|
|
|
->setRequired(true) |
|
|
|
], |
|
|
|
$this->getSeoPanel(), |
|
|
|
$this->getConfPanel(), |
|
|
|
[ |
|
|
|
FormField::addPanel('general'), |
|
|
|
IntegerField::new('id')->onlyOnIndex(), |
|
|
|
TextField::new('title'), |
|
|
|
MoneyField::new('orderAmountMin')->setCurrency('EUR'), |
|
|
|
NumberField::new('deliveryPrice') |
|
|
|
->setCustomOption('appendHtml', '€') |
|
|
|
->hideOnIndex(), |
|
|
|
StatusField::new('status'), |
|
|
|
ToggleField::new('isPublic'), |
|
|
|
ToggleField::new('isDepository'), |
|
|
|
FormField::addPanel('address'), |
|
|
|
AddressField::new('address') |
|
|
|
->setRequired(true) |
|
|
|
], |
|
|
|
$this->getSeoPanel(), |
|
|
|
$this->getConfPanel(), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public function createEntity(string $entityFqcn) |
|
|
|
{ |
|
|
|
return $this->get(PointSaleContainer::class) |
|
|
|
->getFactory() |
|
|
|
->create($this->get(MerchantResolver::class)->getCurrent()); |
|
|
|
->getFactory() |
|
|
|
->create($this->get(MerchantResolver::class)->getCurrent()); |
|
|
|
} |
|
|
|
} |