Revisiones
This commit is contained in:
@ -96,27 +96,42 @@ class QueueTest extends TestCase
|
||||
$propiedad = $propiedadRepository->create($propiedadData);
|
||||
$propiedad = $propiedadRepository->save($propiedad);
|
||||
$fecha = $faker->date;
|
||||
$pieData = [
|
||||
'valor' => 10000,
|
||||
'cuotas' => 12,
|
||||
'fecha' => $fecha,
|
||||
];
|
||||
$pieRepository = $this->container->get(Repository\Venta\Pie::class);
|
||||
$pie = $pieRepository->create($pieData);
|
||||
$pie = $pieRepository->save($pie);
|
||||
$ventaData = [
|
||||
'fecha' => $fecha,
|
||||
'propietario' => $propietario->rut,
|
||||
'propiedad' => $propiedad->id,
|
||||
'fecha_ingreso' => new DateTimeImmutable($fecha)->add(new DateInterval('P3D'))->format('Y-m-d'),
|
||||
'pie' => $pie->id,
|
||||
];
|
||||
$ventaRepository = $this->container->get(Repository\Venta::class);
|
||||
$venta = $ventaRepository->create($ventaData);
|
||||
$venta = $ventaRepository->save($venta);
|
||||
$bancoData = [
|
||||
'nombre' => $faker->word,
|
||||
];
|
||||
$bancoRepository = $this->container->get(Repository\Contabilidad\Banco::class);
|
||||
$banco = $bancoRepository->create($bancoData);
|
||||
$banco = $bancoRepository->save($banco);
|
||||
|
||||
$cuotaData = [
|
||||
'venta' => $venta->id,
|
||||
'pie' => $pie->id,
|
||||
'fecha' => '2022-01-01',
|
||||
'valor' => 10000,
|
||||
'banco' => $banco->id,
|
||||
];
|
||||
$cuotaService = $this->container->get(Service\Venta\Cuota::class);
|
||||
$cuota = $cuotaService->add($cuotaData);
|
||||
|
||||
$this->assertEquals(0.0, $cuota->pago->uf);
|
||||
|
||||
$queueService = $this->container->get(Service\Queue::class);
|
||||
$queueService->run();
|
||||
|
||||
$cuota = $cuotaService->getById($cuota->id);
|
||||
|
Reference in New Issue
Block a user