correction fixtures, css

This commit is contained in:
Rudy Masson 2023-05-23 16:06:53 +02:00
parent 769860b401
commit 0650f174cc
6 changed files with 70 additions and 18 deletions

View File

@ -101,8 +101,9 @@
}
.gift_cb {
display: grid;
text-align: center;
grid-template-columns: 100%;
grid-template-rows: 75% 25%;
// grid-template-rows: 75% 25%;
grid-template-areas:
"cb"
"number_cb";

View File

@ -15,18 +15,47 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class ApiController extends AbstractController
{
public const REGEX_DON = '/^[0-9]{11}$/';
public const REGEX_GROUP_POCHE = '/[0-9]{6}[A-Z]{2}$/';
public const REGEX_ETIQUETTE = '/^\d{11}[\|]{1}[a-z]{1}$/';
public const REGEX_GROUP_POCHE = '/[0-9]{6}-[A-Z]{2}-POCHE$/';
public const REGEX_ETIQUETTE = '/^\d{11}-[a-zA-Z]{2}$/';
public const NBRE_POCHE = 'nbre_poche';
/** @var DonRepository*/
public $donRepository;
/** @var DmuCatRepository*/
public $dmuCatRepository;
/** @var RequestStack*/
public $requestStack;
public DonRepository $donRepository;
public DmuCatRepository $dmuCatRepository;
public RequestStack $requestStack;
// etiquette durand
// 12345678912-AA
// 12345678912-AB
// 12345678912-AC
// 12345678912-AD
// 12345678912-AE
// 12345678912-AF
// 12345678912-BA
// 12345678912-BB
// 12345678912-BC
// 12345678912-BD
// 12345678912-BE
// 12345678912-BF
// 12345678912-CA
// 12345678912-CB
// 12345678912-CC
// etiquette Gauthier
// 12345678913-AA
// 12345678913-AB
// 12345678913-AC
// 12345678913-AD
// 12345678913-AE
// 12345678913-AF
// 12345678913-BA
// 12345678913-BB
// 12345678913-BC
// 12345678913-BD
// 12345678913-BE
// 12345678913-BF
// 12345678913-CA
// 12345678913-CB
// 12345678913-CC
public function __construct(DonRepository $donRepository, RequestStack $requestStack, DmuCatRepository $dmuCatRepository)
{
$this->donRepository = $donRepository;
@ -104,7 +133,7 @@ class ApiController extends AbstractController
if(preg_match(self::REGEX_ETIQUETTE, $codeBarre)){
$nbrePoche = $session->get('nbre_poche');
$donCodeBarre = $session->get('don_code_barre');
$in = strpos('zz'.$codeBarre, $donCodeBarre);
$in = str_contains($codeBarre, $donCodeBarre);
if(!$in){
return $this->json(['data'=>[
'step'=> '2',
@ -174,7 +203,7 @@ class ApiController extends AbstractController
if(preg_match(self::REGEX_ETIQUETTE, $codeBarre)){
$nbreTube = $session->get('nbre_tube');
$donCodeBarre = $session->get('don_code_barre');
if(!strpos('zz'.$codeBarre, $donCodeBarre)){
if(!str_contains($codeBarre, $donCodeBarre)){
return $this->json(['data'=>[
'step'=>'4',
'status'=>'error_donneur'

View File

@ -11,19 +11,19 @@ class CatDmuFixtures extends Fixture
public function load(ObjectManager $manager): void
{
$dmuCat1 = (new DmuCat())
->setCodeBarre('123456FF')
->setCodeBarre('123456-FF-POCHE')
->setPocheNumber(3)
;
$manager->persist($dmuCat1);
$dmuCat2 = (new DmuCat())
->setCodeBarre('123456BB')
->setCodeBarre('123456-BB-POCHE')
->setPocheNumber(4)
;
$manager->persist($dmuCat2);
$dmuCat3 = (new DmuCat())
->setCodeBarre('123456BB')
->setCodeBarre('123456-CC-POCHE')
->setPocheNumber(5)
;
$manager->persist($dmuCat3);

View File

@ -20,7 +20,7 @@ class DonFixtures extends Fixture implements DependentFixtureInterface
}
public function load(ObjectManager $manager): void
{
$donneur = $this->patientRepository->findBy([], ['lastname'=>'ASC'], 1)[0];
$donneur = $this->patientRepository->findOneBy(['lastname'=>'Durand']);
$donCat = $this->donCatRepository->findBy([], ['name'=>'ASC'], 1)[0];
$donneur = (new Don())
->setCodeBarre('12345678912')
@ -30,6 +30,18 @@ class DonFixtures extends Fixture implements DependentFixtureInterface
;
$manager->persist($donneur);
$manager->flush();
$donneur = $this->patientRepository->findOneBy(['lastname'=>'Gauthier']);
$donCat = $this->donCatRepository->findBy([], ['name'=>'ASC'], 1)[0];
$donneur = (new Don())
->setCodeBarre('12345678913')
->setDonCat($donCat)
->setNbreTube(6)
->setDonneur($donneur)
;
$manager->persist($donneur);
$manager->flush();
}

View File

@ -25,5 +25,15 @@ class PatientFixtures extends Fixture
;
$manager->persist($donneur);
$manager->flush();
$donneur = (new Patient())
->setLastname('Gauthier')
->setFirstname('Isabelle')
->setBirthdate(new DateTime('01-01-1980'))
->setDonneurNumber('123999')
;
$manager->persist($donneur);
$manager->flush();
}
}

View File

@ -39,8 +39,8 @@
<div class="gift_specificity">
<ul>
<li>Type de don : <span id="typeDon"></span></li>
<li>Type de DMU : <span id="typePoche"></span></li>
<li>Nombre de tubes : <span id="nbreTube"></span></li>
<li>DMU à étiqueter: <span id="typePoche"></span></li>
<li>Tubes à étiqueter: <span id="nbreTube"></span></li>
</ul>
</div>
</header>