<?php

namespace App\Tests\Entity;

use App\Entity\Customer;
use App\Entity\OrderSession;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\Uuid;

class OrderSessionTest extends TestCase
{
    public function testGettersAndSetters()
    {
        $session = new OrderSession();
        $customer = new Customer();
        $uuid = Uuid::v4();
        $now = new \DateTimeImmutable();

        $session->setUuid($uuid);
        $session->setProducts(['prod1', 'prod2']);
        $session->setCustomer($customer);
        // createdAt is set in constructor and PrePersist callback, so no direct setter test
        // updatedAt is set by PreUpdate callback, so no direct setter test
        $session->setState('completed');
        $session->setBillingAddress('123 Billing St');
        $session->setBillingZipCode('54321');
        $session->setBillingTown('Billingville');
        $session->setAdressEvent('123 Event St');
        $session->setAdress2Event('Apt 4B');
        $session->setAdress3Event('Building C');
        $session->setZipCodeEvent('98765');
        $session->setTownEvent('Eventown');
        $session->setType('personal');
        $session->setDetails('Event details');
        $session->setTypeSol('Hard');
        $session->setPente('medium');
        $session->setAccess('difficult');
        $session->setDistancePower(25.5);

        $this->assertEquals($uuid, $session->getUuid());
        $this->assertEquals(['prod1', 'prod2'], $session->getProducts());
        $this->assertSame($customer, $session->getCustomer());
        $this->assertNotNull($session->getCreatedAt()); // Set by constructor
        $this->assertEquals('completed', $session->getState());
        $this->assertEquals('123 Billing St', $session->getBillingAddress());
        $this->assertEquals('54321', $session->getBillingZipCode());
        $this->assertEquals('Billingville', $session->getBillingTown());
        $this->assertEquals('123 Event St', $session->getAdressEvent());
        $this->assertEquals('Apt 4B', $session->getAdress2Event());
        $this->assertEquals('Building C', $session->getAdress3Event());
        $this->assertEquals('98765', $session->getZipCodeEvent());
        $this->assertEquals('Eventown', $session->getTownEvent());
        $this->assertEquals('personal', $session->getType());
        $this->assertEquals('Event details', $session->getDetails());
        $this->assertEquals('Hard', $session->getTypeSol());
        $this->assertEquals('medium', $session->getPente());
        $this->assertEquals('difficult', $session->getAccess());
        $this->assertEquals(25.5, $session->getDistancePower());
    }
}
