Browse Source

Modèles et respositories Merchant, Section, TaxRate

feature/ticket
Guillaume 3 years ago
parent
commit
e4bc430f40
8 changed files with 110 additions and 19 deletions
  1. +20
    -0
      Controller/Admin/DashboardController.php
  2. +5
    -0
      Model/Merchant/MerchantModel.php
  3. +21
    -4
      Model/Section/SectionModel.php
  4. +6
    -5
      Repository/Common/TaxRateRepository.php
  5. +5
    -5
      Repository/Merchant/MerchantRepository.php
  6. +5
    -5
      Repository/Section/SectionRepository.php
  7. +24
    -0
      Resources/translations/admin.fr.yaml
  8. +24
    -0
      Resources/views/adminlte/layout.html.twig

+ 20
- 0
Controller/Admin/DashboardController.php View File

<?php

namespace Lc\CaracoleBundle\Controller\Admin;

use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use Lc\SovBundle\Controller\Admin\DashboardController as SovDashboardController ;

class DashboardController extends SovDashboardController
{
public function configureCrud(): Crud
{
$crud = parent::configureCrud();

$crud
->overrideTemplate('layout', '@LcCaracole/adminlte/layout.html.twig');

return $crud ;
}

}

+ 5
- 0
Model/Merchant/MerchantModel.php View File

$this->newsletters = new ArrayCollection(); $this->newsletters = new ArrayCollection();
} }


public function __toString()
{
return $this->getTitle() ;
}

public function getCreditConfig(): ?CreditConfigInterface public function getCreditConfig(): ?CreditConfigInterface
{ {
return $this->creditConfig; return $this->creditConfig;

+ 21
- 4
Model/Section/SectionModel.php View File

*/ */
protected $cycle; protected $cycle;


const SECTION_CYCLE_DAY = 'day';
const SECTION_CYCLE_WEEK = 'week';
const SECTION_CYCLE_MONTH = 'month';
const SECTION_CYCLE_YEAR = 'year';
const CYCLE_DAY = 'day';
const CYCLE_WEEK = 'week';
const CYCLE_MONTH = 'month';
const CYCLE_YEAR = 'year';

/**
* @ORM\Column(type="string", length=32)
*/
protected $color;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", mappedBy="sections") * @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", mappedBy="sections")
return $this; return $this;
} }


public function getColor(): ?string
{
return $this->color;
}

public function setColor(string $color): self
{
$this->color = $color;

return $this;
}

public function getCycle(): ?string public function getCycle(): ?string
{ {
return $this->cycle; return $this->cycle;

+ 6
- 5
Repository/Common/TaxRateRepository.php View File



namespace Lc\CaracoleBundle\Repository\Common; namespace Lc\CaracoleBundle\Repository\Common;


use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Lc\CaracoleBundle\Model\Common\TaxRateInterface; use Lc\CaracoleBundle\Model\Common\TaxRateInterface;
use Lc\SovBundle\Repository\AbstractRepository;


/** /**
* @method TaxRateInterface|null find($id, $lockMode = null, $lockVersion = null) * @method TaxRateInterface|null find($id, $lockMode = null, $lockVersion = null)
* @method TaxRateInterface[] findAll() * @method TaxRateInterface[] findAll()
* @method TaxRateInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method TaxRateInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class TaxRateRepository extends ServiceEntityRepository
class TaxRateRepository extends AbstractRepository
{ {
public function __construct(ManagerRegistry $registry)
public function getInterfaceClass()
{ {
parent::__construct($registry, TaxRateInterface::class);
return TaxRateInterface::class;
} }


} }

+ 5
- 5
Repository/Merchant/MerchantRepository.php View File



namespace Lc\CaracoleBundle\Repository\Merchant; namespace Lc\CaracoleBundle\Repository\Merchant;


use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Repository\AbstractRepository;


/** /**
* @method MerchantInterface|null find($id, $lockMode = null, $lockVersion = null) * @method MerchantInterface|null find($id, $lockMode = null, $lockVersion = null)
* @method MerchantInterface[] findAll() * @method MerchantInterface[] findAll()
* @method MerchantInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method MerchantInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class MerchantRepository extends ServiceEntityRepository
class MerchantRepository extends AbstractRepository
{ {
public function __construct(ManagerRegistry $registry)
public function getInterfaceClass()
{ {
parent::__construct($registry, MerchantInterface::class);
return MerchantInterface::class;
} }

} }

+ 5
- 5
Repository/Section/SectionRepository.php View File



namespace Lc\CaracoleBundle\Repository\Section; namespace Lc\CaracoleBundle\Repository\Section;


use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Repository\AbstractRepository;


/** /**
* @method SectionInterface|null find($id, $lockMode = null, $lockVersion = null) * @method SectionInterface|null find($id, $lockMode = null, $lockVersion = null)
* @method SectionInterface[] findAll() * @method SectionInterface[] findAll()
* @method SectionInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method SectionInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class SectionRepository extends ServiceEntityRepository
class SectionRepository extends AbstractRepository
{ {
public function __construct(ManagerRegistry $registry)
public function getInterfaceClass()
{ {
parent::__construct($registry, SectionInterface::class);
return SectionInterface::class;
} }

} }

+ 24
- 0
Resources/translations/admin.fr.yaml View File


menu:
admin: Administration
admin_merchant: Marchands
admin_section: Sections
admin_tva: TVA

entity:
default:
fields:
merchant: Marchand
taxRate: Règle de taxe
Merchant:
label: Marchand
label_plurial: Marchands
Section:
label: Section
label_plurial: Sections
fields:
cycle: Cycle de vente
TaxRate:
label: Règle de taxe
label_plurial: Règles de taxes


+ 24
- 0
Resources/views/adminlte/layout.html.twig View File

{% extends '@LcSov/adminlte/layout.html.twig' %}

{% block navbar_header %}
{{ parent() }}

<nav class="navbar navbar-expand navbar-light main-header">
<ul class="navbar-nav">
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Marché</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Repas du midi</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Retrait journée</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
Switch merchant
</li>
</ul>
</nav>
{% endblock %}

Loading…
Cancel
Save