[#271]Créer une nouvelle expédition (étape 1) #12

Merged
kevin merged 14 commits from feat/271-expedition-etape-1 into develop 2026-02-12 07:31:41 +00:00
13 changed files with 396 additions and 586 deletions
Showing only changes of commit ba4375f609 - Show all commits

77
.idea/workspace.xml generated
View File

@@ -4,7 +4,21 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : mise à jour du bon de réception WIP" /> <list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : Expedition dev back-end">
<change afterPath="$PROJECT_DIR$/migrations/Version20260204101625.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/migrations/Version20260204102423.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/makefile" beforeDir="false" afterPath="$PROJECT_DIR$/makefile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/migrations/Version20260203152543.php" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/Address.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Address.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/BovinShipment.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/BovinShipment.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/BovineTypeShipment.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/ShipmentType.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/Carrier.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Carrier.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/Customer.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Customer.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/Shipment.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Shipment.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/Vehicle.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Vehicle.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -14,6 +28,11 @@
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath> <pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
<execution /> <execution />
</component> </component>
<component name="CopilotPersistence">
<persistenceIdMap>
<entry key="_//wsl.localhost/Ubuntu-24.04/home/matte/Ferme" value="381AhnCm9yPeOiWgMObKHhtgv2C" />
</persistenceIdMap>
</component>
<component name="EmbeddingIndexingInfo"> <component name="EmbeddingIndexingInfo">
<option name="cachedIndexableFilesCount" value="151" /> <option name="cachedIndexableFilesCount" value="151" />
</component> </component>
@@ -220,15 +239,17 @@
"RunOnceActivity.git.unshallow": "true", "RunOnceActivity.git.unshallow": "true",
"RunOnceActivity.typescript.service.memoryLimit.init": "true", "RunOnceActivity.typescript.service.memoryLimit.init": "true",
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true", "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
"database.data.extractors.current.export.id": "Comma-separated (CSV)_id",
"database.data.extractors.current.id": "Comma-separated (CSV)_id",
"git-widget-placeholder": "feat/271-expedition-etape-1", "git-widget-placeholder": "feat/271-expedition-etape-1",
"junie.onboarding.icon.badge.shown": "true", "junie.onboarding.icon.badge.shown": "true",
"last_opened_file_path": "/home/sroy/Documents/test/Ferme", "last_opened_file_path": "//wsl.localhost/Ubuntu-24.04/home/matte/Ferme/frontend/services",
"node.js.detected.package.eslint": "true", "node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true", "node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm", "nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "configurable.group.appearance", "settings.editor.selected.configurable": "preferences.keymap",
"to.speed.mode.migration.done": "true", "to.speed.mode.migration.done": "true",
"ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external", "ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external",
"vue.rearranger.settings.migration": "true" "vue.rearranger.settings.migration": "true"
@@ -246,6 +267,13 @@
} }
}]]></component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="\\wsl.localhost\Ubuntu-24.04\home\matte\Ferme\frontend\services" />
<recent name="\\wsl.localhost\Ubuntu-24.04\home\matte\Ferme\frontend\services\dto" />
<recent name="\\wsl.localhost\Ubuntu-24.04\home\matte\Ferme\frontend\stores" />
<recent name="\\wsl.localhost\Ubuntu-24.04\home\matte\Ferme\frontend\pages\shipment" />
<recent name="\\wsl.localhost\Ubuntu-24.04\home\matte\Ferme\frontend\components\shipment" />
</key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" /> <recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" />
<recent name="\\wsl.localhost\Ubuntu-24.04\home\tristan\workspace\ferme\templates" /> <recent name="\\wsl.localhost\Ubuntu-24.04\home\tristan\workspace\ferme\templates" />
@@ -257,7 +285,6 @@
<component name="SharedIndexes"> <component name="SharedIndexes">
<attachedChunks> <attachedChunks>
<set> <set>
<option value="bundled-js-predefined-d6986cc7102b-9b0f141eb926-JavaScript-PS-253.30387.85" />
<option value="bundled-php-predefined-a98d8de5180a-0e0d91225499-com.jetbrains.php.sharedIndexes-PS-253.30387.85" /> <option value="bundled-php-predefined-a98d8de5180a-0e0d91225499-com.jetbrains.php.sharedIndexes-PS-253.30387.85" />
</set> </set>
</attachedChunks> </attachedChunks>
@@ -288,15 +315,10 @@
<workItem from="1770055690365" duration="370000" /> <workItem from="1770055690365" duration="370000" />
<workItem from="1770056515646" duration="21000" /> <workItem from="1770056515646" duration="21000" />
<workItem from="1770102495553" duration="2280000" /> <workItem from="1770102495553" duration="2280000" />
<workItem from="1770125858721" duration="10592000" /> <workItem from="1770125858721" duration="10606000" />
</task> <workItem from="1770188542722" duration="1032000" />
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)"> <workItem from="1770189650316" duration="5784000" />
<option name="closed" value="true" /> <workItem from="1770195538424" duration="16730000" />
<created>1768237763998</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1768237763998</updated>
</task> </task>
<task id="LOCAL-00002" summary="feat : Ajout de zod, création d'un composant de chargement loading-dots.vue et finalisation du flow d'une reception"> <task id="LOCAL-00002" summary="feat : Ajout de zod, création d'un composant de chargement loading-dots.vue et finalisation du flow d'une reception">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -682,7 +704,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1770136359244</updated> <updated>1770136359244</updated>
</task> </task>
<option name="localTasksCounter" value="50" /> <task id="LOCAL-00050" summary="feat : mise à jour du bon de réception WIP">
<option name="closed" value="true" />
<created>1770136475283</created>
<option name="number" value="00050" />
<option name="presentableId" value="LOCAL-00050" />
<option name="project" value="LOCAL" />
<updated>1770136475283</updated>
</task>
<option name="localTasksCounter" value="51" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -759,8 +789,27 @@
<MESSAGE value="feat : mise à jour du bon de réception WIP" /> <MESSAGE value="feat : mise à jour du bon de réception WIP" />
<option name="LAST_COMMIT_MESSAGE" value="feat : mise à jour du bon de réception WIP" /> <option name="LAST_COMMIT_MESSAGE" value="feat : mise à jour du bon de réception WIP" />
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/frontend/stores/reception.ts</url>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />
<select /> <select />
</component> </component>
<component name="github-copilot-workspace">
<instructionFileLocations>
<option value=".github/instructions" />
</instructionFileLocations>
<promptFileLocations>
<option value=".github/prompts" />
</promptFileLocations>
</component>
</project> </project>

View File

@@ -79,7 +79,7 @@ migration-migrate:
$(SYMFONY_CONSOLE) --no-interaction doctrine:migrations:migrate --allow-no-migration $(SYMFONY_CONSOLE) --no-interaction doctrine:migrations:migrate --allow-no-migration
fixtures: fixtures:
$(SYMFONY_CONSOLE) doctrine:fixtures:load $(SYMFONY_CONSOLE) --no-interaction doctrine:fixtures:load
# Attention, supprime votre bdd local # Attention, supprime votre bdd local
db-reset: db-reset:

View File

@@ -1,64 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260203152543 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE bovin_shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, nb_bovin_send INT NOT NULL, shipment_id INT DEFAULT NULL, bovine_type_id INT DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_7049F4507BE036FC ON bovin_shipment (shipment_id)');
$this->addSql('CREATE INDEX IDX_7049F4507899F32E ON bovin_shipment (bovine_type_id)');
$this->addSql('CREATE TABLE bovine_type_shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, type_label VARCHAR(255) NOT NULL, type_code VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE TABLE customer (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, customer_label VARCHAR(255) NOT NULL, customer_code VARCHAR(255) NOT NULL, id_adress_id INT DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_81398E094B3458B ON customer (id_adress_id)');
$this->addSql('CREATE TABLE shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, date_receipt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, is_waiting BOOLEAN NOT NULL, licence_plate VARCHAR(255) NOT NULL, test VARCHAR(255) NOT NULL, id_carrier_id INT DEFAULT NULL, id_carrier_1_id INT DEFAULT NULL, id_truck_id INT DEFAULT NULL, licence_plate_1_id INT DEFAULT NULL, id_vehicle_id INT DEFAULT NULL, id_customer_id INT DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_2CB20DC84554740 ON shipment (id_carrier_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC817F550F ON shipment (id_carrier_1_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC964E905B ON shipment (id_truck_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC3B17D73A ON shipment (licence_plate_1_id)');
$this->addSql('CREATE INDEX IDX_2CB20DCF1D99706 ON shipment (id_vehicle_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC8B870E04 ON shipment (id_customer_id)');
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4507BE036FC FOREIGN KEY (shipment_id) REFERENCES shipment (id)');
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4507899F32E FOREIGN KEY (bovine_type_id) REFERENCES bovine_type_shipment (id)');
$this->addSql('ALTER TABLE customer ADD CONSTRAINT FK_81398E094B3458B FOREIGN KEY (id_adress_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC84554740 FOREIGN KEY (id_carrier_id) REFERENCES carrier (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC817F550F FOREIGN KEY (id_carrier_1_id) REFERENCES vehicle (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC964E905B FOREIGN KEY (id_truck_id) REFERENCES vehicle (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC3B17D73A FOREIGN KEY (licence_plate_1_id) REFERENCES carrier (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DCF1D99706 FOREIGN KEY (id_vehicle_id) REFERENCES vehicle (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC8B870E04 FOREIGN KEY (id_customer_id) REFERENCES customer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4507BE036FC');
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4507899F32E');
$this->addSql('ALTER TABLE customer DROP CONSTRAINT FK_81398E094B3458B');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC84554740');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC817F550F');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC964E905B');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC3B17D73A');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DCF1D99706');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC8B870E04');
$this->addSql('DROP TABLE bovin_shipment');
$this->addSql('DROP TABLE bovine_type_shipment');
$this->addSql('DROP TABLE customer');
$this->addSql('DROP TABLE shipment');
}
}

View File

@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260204101625 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE bovin_shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, nb_bovin_send INT NOT NULL, shipment_id INT DEFAULT NULL, shipment_type_id INT DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_7049F4507BE036FC ON bovin_shipment (shipment_id)');
$this->addSql('CREATE INDEX IDX_7049F4502EE48A36 ON bovin_shipment (shipment_type_id)');
$this->addSql('CREATE TABLE customer (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE TABLE customer_address (customer_id INT NOT NULL, address_id INT NOT NULL, PRIMARY KEY (customer_id, address_id))');
$this->addSql('CREATE INDEX IDX_1193CB3F9395C3F3 ON customer_address (customer_id)');
$this->addSql('CREATE INDEX IDX_1193CB3FF5B7AF75 ON customer_address (address_id)');
$this->addSql('CREATE TABLE shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, licence_plate VARCHAR(255) NOT NULL, identification_number VARCHAR(20) DEFAULT NULL, current_step INT DEFAULT 0 NOT NULL, is_valid BOOLEAN NOT NULL, shipment_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, carrier_id INT DEFAULT NULL, vehicle_id INT DEFAULT NULL, truck_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2CB20DC347639A5 ON shipment (identification_number)');
$this->addSql('CREATE INDEX IDX_2CB20DC21DFC797 ON shipment (carrier_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC545317D1 ON shipment (vehicle_id)');
$this->addSql('CREATE INDEX IDX_2CB20DCC6957CCE ON shipment (truck_id)');
$this->addSql('CREATE INDEX IDX_2CB20DC9395C3F3 ON shipment (customer_id)');
$this->addSql('CREATE TABLE shipment_type (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4507BE036FC FOREIGN KEY (shipment_id) REFERENCES shipment (id)');
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4502EE48A36 FOREIGN KEY (shipment_type_id) REFERENCES shipment_type (id)');
$this->addSql('ALTER TABLE customer_address ADD CONSTRAINT FK_1193CB3F9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE customer_address ADD CONSTRAINT FK_1193CB3FF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC21DFC797 FOREIGN KEY (carrier_id) REFERENCES carrier (id) NOT DEFERRABLE');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC545317D1 FOREIGN KEY (vehicle_id) REFERENCES vehicle (id)');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DCC6957CCE FOREIGN KEY (truck_id) REFERENCES truck (id) NOT DEFERRABLE');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4507BE036FC');
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4502EE48A36');
$this->addSql('ALTER TABLE customer_address DROP CONSTRAINT FK_1193CB3F9395C3F3');
$this->addSql('ALTER TABLE customer_address DROP CONSTRAINT FK_1193CB3FF5B7AF75');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC21DFC797');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC545317D1');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DCC6957CCE');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC9395C3F3');
$this->addSql('DROP TABLE bovin_shipment');
$this->addSql('DROP TABLE customer');
$this->addSql('DROP TABLE customer_address');
$this->addSql('DROP TABLE shipment');
$this->addSql('DROP TABLE shipment_type');
}
}

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260204102423 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT fk_2cb20dc545317d1');
$this->addSql('DROP INDEX idx_2cb20dc545317d1');
$this->addSql('ALTER TABLE shipment DROP vehicle_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shipment ADD vehicle_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT fk_2cb20dc545317d1 FOREIGN KEY (vehicle_id) REFERENCES vehicle (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_2cb20dc545317d1 ON shipment (vehicle_id)');
}
}

View File

@@ -35,27 +35,27 @@ class Address
private ?int $id = null; private ?int $id = null;
#[ORM\Column(length: 120)] #[ORM\Column(length: 120)]
#[Groups(['address:read', 'supplier:read', 'reception:read'])] #[Groups(['address:read', 'supplier:read', 'reception:read', 'customer:read', 'shipment:read'])]
private string $label = ''; private string $label = '';
#[ORM\Column(length: 180)] #[ORM\Column(length: 180)]
#[Groups(['address:read', 'supplier:read', 'reception:read'])] #[Groups(['address:read', 'supplier:read', 'reception:read', 'customer:read', 'shipment:read'])]
private string $street = ''; private string $street = '';
#[ORM\Column(name: 'street2', length: 180, nullable: true)] #[ORM\Column(name: 'street2', length: 180, nullable: true)]
#[Groups(['address:read', 'supplier:read', 'reception:read'])] #[Groups(['address:read', 'supplier:read', 'reception:read', 'customer:read', 'shipment:read'])]
private ?string $street2 = null; private ?string $street2 = null;
#[ORM\Column(name: 'postal_code', length: 20)] #[ORM\Column(name: 'postal_code', length: 20)]
#[Groups(['address:read', 'supplier:read', 'reception:read'])] #[Groups(['address:read', 'supplier:read', 'reception:read', 'customer:read', 'shipment:read'])]
private string $postalCode = ''; private string $postalCode = '';
#[ORM\Column(length: 120)] #[ORM\Column(length: 120)]
#[Groups(['address:read', 'supplier:read', 'reception:read'])] #[Groups(['address:read', 'supplier:read', 'reception:read', 'customer:read', 'shipment:read'])]
private string $city = ''; private string $city = '';
#[ORM\Column(name: 'country_code', length: 2)] #[ORM\Column(name: 'country_code', length: 2)]
#[Groups(['address:read', 'supplier:read'])] #[Groups(['address:read', 'supplier:read', 'customer:read'])]
private string $countryCode = ''; private string $countryCode = '';
/** /**
@@ -64,16 +64,9 @@ class Address
#[ORM\ManyToMany(targetEntity: Supplier::class, mappedBy: 'addresses')] #[ORM\ManyToMany(targetEntity: Supplier::class, mappedBy: 'addresses')]
private Collection $suppliers; private Collection $suppliers;
/**
* @var Collection<int, Customer>
*/
#[ORM\OneToMany(targetEntity: Customer::class, mappedBy: 'id_adress')]
private Collection $customers;
public function __construct() public function __construct()
{ {
$this->suppliers = new ArrayCollection(); $this->suppliers = new ArrayCollection();
$this->customers = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@@ -172,34 +165,4 @@ class Address
{ {
return $this->suppliers; return $this->suppliers;
} }
/**
* @return Collection<int, Customer>
*/
public function getCustomers(): Collection
{
return $this->customers;
}
public function addCustomer(Customer $customer): static
{
if (!$this->customers->contains($customer)) {
$this->customers->add($customer);
$customer->setIdAdress($this);
}
return $this;
}
public function removeCustomer(Customer $customer): static
{
if ($this->customers->removeElement($customer)) {
// set the owning side to null (unless already changed)
if ($customer->getIdAdress() === $this) {
$customer->setIdAdress(null);
}
}
return $this;
}
} }

View File

@@ -7,8 +7,6 @@ namespace App\Entity;
use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Serializer\Attribute\Groups;
@@ -23,15 +21,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
new GetCollection( new GetCollection(
normalizationContext: ['groups' => ['bovin-shipment:read']], normalizationContext: ['groups' => ['bovin-shipment:read']],
), ),
new Post(
normalizationContext: ['groups' => ['bovin-shipment:read']],
denormalizationContext: ['groups' => ['bovin-shipment:write']],
),
new Patch(
requirements: ['id' => '\d+'],
normalizationContext: ['groups' => ['bovin-shipment:read']],
denormalizationContext: ['groups' => ['bovin-shipment:write']],
),
// new Get( // new Get(
// uriTemplate: '/receptions/weigh', // uriTemplate: '/receptions/weigh',
// openapi: new OpenApiOperation( // openapi: new OpenApiOperation(
@@ -62,16 +52,16 @@ class BovinShipment
#[Groups(['shipment:read', 'bovine-shipment:read'])] #[Groups(['shipment:read', 'bovine-shipment:read'])]
private ?int $id = null; private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'shipment')] #[ORM\ManyToOne(inversedBy: 'shipment_types')]
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])] #[Groups(['bovine-shipment:read'])]
private ?Shipment $Shipment = null; private ?Shipment $shipment = null;
#[ORM\ManyToOne(inversedBy: 'bovinShipments')] #[ORM\ManyToOne]
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])] #[Groups(['shipment:read', 'bovine-shipment:read'])]
private ?BovineTypeShipment $BovineType = null; private ?ShipmentType $shipmentType = null;
#[ORM\Column] #[ORM\Column]
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])] #[Groups(['shipment:read', 'bovine-shipment:read'])]
private ?int $nbBovinSend = null; private ?int $nbBovinSend = null;
public function getId(): ?int public function getId(): ?int
@@ -79,28 +69,24 @@ class BovinShipment
return $this->id; return $this->id;
} }
public function getIdShipment(): ?Shipment public function getShipment(): ?Shipment
{ {
return $this->Shipment; return $this->shipment;
} }
public function setIdShipment(?Shipment $Shipment): static public function setShipment(?Shipment $shipment): void
{ {
$this->Shipment = $Shipment; $this->shipment = $shipment;
return $this;
} }
public function getIdType(): ?BovineTypeShipment public function getShipmentType(): ?ShipmentType
{ {
return $this->BovineType; return $this->shipmentType;
} }
public function setIdType(?BovineTypeShipment $BovineType): static public function setShipmentType(?ShipmentType $shipmentType): void
{ {
$this->BovineType = $BovineType; $this->shipmentType = $shipmentType;
return $this;
} }
public function getNbBovinSend(): ?int public function getNbBovinSend(): ?int
@@ -108,10 +94,8 @@ class BovinShipment
return $this->nbBovinSend; return $this->nbBovinSend;
} }
public function setNbBovinSend(int $nbBovinSend): static public function setNbBovinSend(?int $nbBovinSend): void
{ {
$this->nbBovinSend = $nbBovinSend; $this->nbBovinSend = $nbBovinSend;
return $this;
} }
} }

View File

@@ -1,110 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class BovineTypeShipment
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['shipment:read', 'bovine-type:read'])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['shipment:read', 'shipment:write', 'bovine-type:read', 'bovine-type:write'])]
private ?string $type_label = null;
#[ORM\Column(length: 255)]
#[Groups(['shipment:read', 'shipment:write', 'bovine-type:read', 'bovine-type:write'])]
private ?string $type_code = null;
/**
* @var Collection<int, BovinShipment>
*/
#[ORM\OneToMany(targetEntity: BovinShipment::class, mappedBy: 'id_type')]
#[Groups(['shipment:read', 'shipment:write', 'bovine-type:read', 'bovine-type:write'])]
private Collection $bovinShipments;
public function __construct()
{
$this->bovinShipments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTypeLabel(): ?string
{
return $this->type_label;
}
public function setTypeLabel(string $type_label): static
{
$this->type_label = $type_label;
return $this;
}
public function getTypeCode(): ?string
{
return $this->type_code;
}
public function setTypeCode(string $type_code): static
{
$this->type_code = $type_code;
return $this;
}
public function getBovineShipment(): ?BovineShipment
{
return $this->bovineShipment;
}
public function setBovineShipment(?BovineShipment $bovineShipment): static
{
$this->bovineShipment = $bovineShipment;
return $this;
}
/**
* @return Collection<int, BovinShipment>
*/
public function getBovinShipments(): Collection
{
return $this->bovinShipments;
}
public function addBovinShipment(BovinShipment $bovinShipment): static
{
if (!$this->bovinShipments->contains($bovinShipment)) {
$this->bovinShipments->add($bovinShipment);
$bovinShipment->setIdType($this);
}
return $this;
}
public function removeBovinShipment(BovinShipment $bovinShipment): static
{
if ($this->bovinShipments->removeElement($bovinShipment)) {
// set the owning side to null (unless already changed)
if ($bovinShipment->getIdType() === $this) {
$bovinShipment->setIdType(null);
}
}
return $this;
}
}

View File

@@ -7,8 +7,6 @@ namespace App\Entity;
use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\GetCollection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Serializer\Attribute\Groups;
@@ -31,35 +29,17 @@ class Carrier
#[ORM\Id] #[ORM\Id]
#[ORM\GeneratedValue] #[ORM\GeneratedValue]
#[ORM\Column] #[ORM\Column]
#[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read'])] #[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read', 'shipment:read'])]
private ?int $id = null; private ?int $id = null;
#[ORM\Column(length: 180)] #[ORM\Column(length: 180)]
#[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read'])] #[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read', 'shipment:read'])]
private string $name = ''; private string $name = '';
#[ORM\Column(length: 30, nullable: true)] #[ORM\Column(length: 30, nullable: true)]
#[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read'])] #[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read', 'shipment:read'])]
private ?string $code = null; private ?string $code = null;
/**
* @var Collection<int, Shipment>
*/
#[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'id_carrier')]
private Collection $id_carrier_1;
/**
* @var Collection<int, Shipment>
*/
#[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'licence_plate_1')]
private Collection $shipments;
public function __construct()
{
$this->id_carrier_1 = new ArrayCollection();
$this->shipments = new ArrayCollection();
}
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; return $this->id;
@@ -88,64 +68,4 @@ class Carrier
return $this; return $this;
} }
/**
* @return Collection<int, Shipment>
*/
public function getIdCarrier1(): Collection
{
return $this->id_carrier_1;
}
public function addIdCarrier1(Shipment $idCarrier1): static
{
if (!$this->id_carrier_1->contains($idCarrier1)) {
$this->id_carrier_1->add($idCarrier1);
$idCarrier1->setIdCarrier($this);
}
return $this;
}
public function removeIdCarrier1(Shipment $idCarrier1): static
{
if ($this->id_carrier_1->removeElement($idCarrier1)) {
// set the owning side to null (unless already changed)
if ($idCarrier1->getIdCarrier() === $this) {
$idCarrier1->setIdCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, Shipment>
*/
public function getShipments(): Collection
{
return $this->shipments;
}
public function addShipment(Shipment $shipment): static
{
if (!$this->shipments->contains($shipment)) {
$this->shipments->add($shipment);
$shipment->setLicencePlate1($this);
}
return $this;
}
public function removeShipment(Shipment $shipment): static
{
if ($this->shipments->removeElement($shipment)) {
// set the owning side to null (unless already changed)
if ($shipment->getLicencePlate1() === $this) {
$shipment->setLicencePlate1(null);
}
}
return $this;
}
} }

View File

@@ -4,11 +4,29 @@ declare(strict_types=1);
namespace App\Entity; namespace App\Entity;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ORM\Entity] #[ORM\Entity]
#[ORM\Table(name: 'customer')]
#[ApiResource(
operations: [
new Get(
requirements: ['id' => '\d+'],
normalizationContext: ['groups' => ['customer:read']],
),
new GetCollection(
normalizationContext: ['groups' => ['customer:read']],
),
],
security: "is_granted('ROLE_USER')",
)]
class Customer class Customer
{ {
#[ORM\Id] #[ORM\Id]
@@ -18,26 +36,25 @@ class Customer
private ?int $id = null; private ?int $id = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
#[Groups(['shipment:read', 'shipment:write', 'customer:read', 'customer:write'])] #[Groups(['customer:read', 'shipment:read'])]
private ?string $customer_label = null; private ?string $label = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
#[Groups(['shipment:read', 'shipment:write', 'customer:read', 'customer:write'])] #[Groups(['customer:read', 'shipment:read'])]
private ?string $customer_code = null; private ?string $code = null;
#[ORM\ManyToOne(inversedBy: 'customers')]
#[Groups(['shipment:read', 'shipment:write', 'customer:read', 'customer:write'])]
private ?Address $id_adress = null;
/** /**
* @var Collection<int, Shipment> * @var Collection<int, Address>
*/ */
#[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'id_customer')] #[ORM\ManyToMany(targetEntity: Address::class, inversedBy: 'customers')]
private Collection $shipments; #[ORM\JoinTable(name: 'customer_address')]
#[Groups(['customer:read'])]
#[ApiProperty(readableLink: true)]
private Collection $addresses;
public function __construct() public function __construct()
{ {
$this->shipments = new ArrayCollection(); $this->addresses = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@@ -45,69 +62,33 @@ class Customer
return $this->id; return $this->id;
} }
public function getCustomerLabel(): ?string public function getLabel(): ?string
{ {
return $this->customer_label; return $this->label;
} }
public function setCustomerLabel(string $customer_label): static public function setLabel(?string $label): void
{ {
$this->customer_label = $customer_label; $this->label = $label;
return $this;
} }
public function getCustomerCode(): ?string public function getCode(): ?string
{ {
return $this->customer_code; return $this->code;
} }
public function setCustomerCode(string $customer_code): static public function setCode(?string $code): void
{ {
$this->customer_code = $customer_code; $this->code = $code;
return $this;
} }
public function getIdAdress(): ?Address public function getAddresses(): Collection
{ {
return $this->id_adress; return $this->addresses;
} }
public function setIdAdress(?Address $id_adress): static public function setAddresses(Collection $addresses): void
{ {
$this->id_adress = $id_adress; $this->addresses = $addresses;
return $this;
}
/**
* @return Collection<int, Shipment>
*/
public function getShipments(): Collection
{
return $this->shipments;
}
public function addShipment(Shipment $shipment): static
{
if (!$this->shipments->contains($shipment)) {
$this->shipments->add($shipment);
$shipment->setIdCustomer($this);
}
return $this;
}
public function removeShipment(Shipment $shipment): static
{
if ($this->shipments->removeElement($shipment)) {
// set the owning side to null (unless already changed)
if ($shipment->getIdCustomer() === $this) {
$shipment->setIdCustomer(null);
}
}
return $this;
} }
} }

View File

@@ -4,16 +4,18 @@ declare(strict_types=1);
namespace App\Entity; namespace App\Entity;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post; use ApiPlatform\Metadata\Post;
use DateTime; use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Context;
use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
#[ORM\Entity] #[ORM\Entity]
#[ORM\Table(name: 'shipment')] #[ORM\Table(name: 'shipment')]
@@ -36,24 +38,24 @@ use Symfony\Component\Serializer\Attribute\Groups;
denormalizationContext: ['groups' => ['shipment:write']], denormalizationContext: ['groups' => ['shipment:write']],
), ),
// new Get( // new Get(
// uriTemplate: '/receptions/weigh', // uriTemplate: '/shipments/weigh',
// openapi: new OpenApiOperation( // openapi: new OpenApiOperation(
// summary: 'Fetch the current weight reading', // summary: 'Fetch the current weight reading',
// description: 'Queries the pont-bascule and returns the weight data.', // description: 'Queries the pont-bascule and returns the weight data.',
// ), // ),
// normalizationContext: ['groups' => ['reception:weigh:read']], // normalizationContext: ['groups' => ['shipment:weigh:read']],
// output: PontBasculeReading::class, // output: PontBasculeReading::class,
// provider: ReceptionWeighingProvider::class, // provider: shipmentWeighingProvider::class,
// ), // ),
// new Get( // new Get(
// uriTemplate: '/receptions/{id}/receipt', // uriTemplate: '/shipments/{id}/receipt',
// requirements: ['id' => '\d+'], // requirements: ['id' => '\d+'],
// openapi: new OpenApiOperation( // openapi: new OpenApiOperation(
// summary: 'Render a reception receipt', // summary: 'Render a shipment receipt',
// description: 'Returns a PDF receipt for the reception.', // description: 'Returns a PDF receipt for the shipment.',
// ), // ),
// output: false, // output: false,
// provider: ReceptionReceiptProvider::class, // provider: shipmentReceiptProvider::class,
// ), // ),
], ],
)] )]
@@ -65,54 +67,53 @@ class Shipment
#[Groups(['shipment:read'])] #[Groups(['shipment:read'])]
private ?int $id = null; private ?int $id = null;
#[ORM\Column]
#[Groups(['shipment:read', 'shipment:write'])]
private ?DateTime $date_receipt = null;
#[ORM\Column]
#[Groups(['shipment:read', 'shipment:write'])]
private ?bool $is_waiting = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?string $licence_plate = null; private ?string $licencePlate = null;
#[ORM\ManyToOne(inversedBy: 'id_carrier_1')] #[ORM\Column(length: 20, unique: true, nullable: true)]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read'])]
private ?carrier $id_carrier = null; private ?string $identificationNumber = null;
#[ORM\ManyToOne(inversedBy: 'shipments')] #[ORM\Column(options: ['default' => 0])]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?vehicle $id_carrier_1 = null; private int $currentStep = 0;
#[ORM\ManyToOne(inversedBy: 'shipments')] #[ORM\Column]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?Vehicle $id_truck = null; private ?bool $isValid = null;
#[ORM\ManyToOne(inversedBy: 'shipments')] #[ORM\Column(name: 'shipment_date', type: 'datetime_immutable')]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?carrier $licence_plate_1 = null; #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
private ?DateTimeImmutable $shipmentDate = null;
#[ORM\ManyToOne(inversedBy: 'shipments')] #[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: true)]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?Vehicle $id_vehicle = null; #[ApiProperty(readableLink: true)]
private ?Carrier $carrier = null;
#[ORM\ManyToOne(inversedBy: 'shipments')] #[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: true)]
#[Groups(['shipment:read', 'shipment:write'])] #[Groups(['shipment:read', 'shipment:write'])]
private ?Customer $id_customer = null; #[ApiProperty(readableLink: true)]
private ?Truck $truck = null;
#[ORM\ManyToOne]
#[Groups(['shipment:read', 'shipment:write'])]
private ?Customer $customer = null;
/** /**
* @var Collection<int, BovinShipment> * @var Collection<int, BovinShipment>
*/ */
#[ORM\OneToMany(targetEntity: BovinShipment::class, mappedBy: 'id_shipment')] #[ORM\OneToMany(targetEntity: BovinShipment::class, mappedBy: 'shipment')]
private Collection $id_type; #[Groups(['shipment:read', 'shipment:write'])]
private Collection $bovinShipments;
#[ORM\Column(length: 255)] public function __construct(Collection $bovinShipments)
private ?string $test = null;
public function __construct()
{ {
$this->id_type = new ArrayCollection(); $this->bovinShipments = $bovinShipments;
} }
public function getId(): ?int public function getId(): ?int
@@ -120,165 +121,124 @@ class Shipment
return $this->id; return $this->id;
} }
public function getDateReceipt(): ?DateTime
{
return $this->date_receipt;
}
public function setDateReceipt(DateTime $date_receipt): static
{
$this->date_receipt = $date_receipt;
return $this;
}
public function isWaiting(): ?bool
{
return $this->is_waiting;
}
public function setIsWaiting(bool $is_waiting): static
{
$this->is_waiting = $is_waiting;
return $this;
}
public function getLicencePlate(): ?string public function getLicencePlate(): ?string
{ {
return $this->licence_plate; return $this->licencePlate;
} }
public function setLicencePlate(string $licence_plate): static public function setLicencePlate(?string $licencePlate): void
{ {
$this->licence_plate = $licence_plate; $this->licencePlate = $licencePlate;
return $this;
} }
public function getIdCarrier(): ?carrier public function getIdentificationNumber(): ?string
{ {
return $this->id_carrier; return $this->identificationNumber;
} }
public function setIdCarrier(?carrier $id_carrier): static public function setIdentificationNumber(?string $identificationNumber): void
{ {
$this->id_carrier = $id_carrier; $this->identificationNumber = $identificationNumber;
return $this;
} }
public function getIdCarrier1(): ?vehicle public function getCurrentStep(): int
{ {
return $this->id_carrier_1; return $this->currentStep;
} }
public function setIdCarrier1(?vehicle $id_carrier_1): static public function setCurrentStep(int $currentStep): void
{ {
$this->id_carrier_1 = $id_carrier_1; $this->currentStep = $currentStep;
return $this;
} }
public function getIdTruck(): ?Vehicle public function getIsValid(): ?bool
{ {
return $this->id_truck; return $this->isValid;
} }
public function setIdTruck(?Vehicle $id_truck): static public function setIsValid(?bool $isValid): void
{ {
$this->id_truck = $id_truck; $this->isValid = $isValid;
return $this;
} }
public function getLicencePlate1(): ?carrier public function getShipmentDate(): ?DateTimeImmutable
{ {
return $this->licence_plate_1; return $this->shipmentDate;
} }
public function setLicencePlate1(?carrier $licence_plate_1): static public function setShipmentDate(?DateTimeImmutable $shipmentDate): void
{ {
$this->licence_plate_1 = $licence_plate_1; $this->shipmentDate = $shipmentDate;
return $this;
} }
public function getIdVehicle(): ?Vehicle public function getCarrier(): ?Carrier
{ {
return $this->id_vehicle; return $this->carrier;
} }
public function setIdVehicle(?Vehicle $id_vehicle): static public function setCarrier(?Carrier $carrier): void
{ {
$this->id_vehicle = $id_vehicle; $this->carrier = $carrier;
return $this;
} }
public function getIdCustomer(): ?Customer public function getVehicle(): ?Vehicle
{ {
return $this->id_customer; return $this->vehicle;
} }
public function setIdCustomer(?Customer $id_customer): static public function setVehicle(?Vehicle $vehicle): void
{ {
$this->id_customer = $id_customer; $this->vehicle = $vehicle;
return $this;
} }
public function getBovineShipment(): ?BovineShipment public function getTruck(): ?Truck
{ {
return $this->bovineShipment; return $this->truck;
} }
public function setBovineShipment(?BovineShipment $bovineShipment): static public function setTruck(?Truck $truck): void
{ {
$this->bovineShipment = $bovineShipment; $this->truck = $truck;
return $this;
} }
/** public function getCustomer(): ?Customer
* @return Collection<int, BovinShipment>
*/
public function getIdType(): Collection
{ {
return $this->id_type; return $this->customer;
} }
public function addIdType(BovinShipment $idType): static public function setCustomer(?Customer $customer): void
{ {
if (!$this->id_type->contains($idType)) { $this->customer = $customer;
$this->id_type->add($idType); }
$idType->setIdShipment($this);
public function getBovinShipments(): Collection
{
return $this->bovinShipments;
}
public function setBovinShipments(Collection $bovinShipments): void
{
$this->bovinShipments = $bovinShipments;
}
public function addPelletBuilding(BovinShipment $bovinShipments): self
{
if (!$this->bovinShipments->contains($bovinShipments)) {
$this->bovinShipments->add($bovinShipments);
$bovinShipments->setReception($this);
} }
return $this; return $this;
} }
public function removeIdType(BovinShipment $idType): static public function removePelletBuilding(BovinShipment $bovinShipments): self
{ {
if ($this->id_type->removeElement($idType)) { if ($this->bovinShipments->removeElement($bovinShipments)) {
// set the owning side to null (unless already changed) if ($bovinShipments->getReception() === $this) {
if ($idType->getIdShipment() === $this) { $bovinShipments->setReception(null);
$idType->setIdShipment(null);
} }
} }
return $this; return $this;
} }
public function getTest(): ?string
{
return $this->test;
}
public function setTest(string $test): static
{
$this->test = $test;
return $this;
}
} }

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ORM\Entity]
#[ORM\Table(name: 'shipment_type')]
#[ApiResource(
operations: [
new Get(
requirements: ['id' => '\d+'],
normalizationContext: ['groups' => ['shipment-type:read']],
),
new GetCollection(
normalizationContext: ['groups' => ['shipment-type:read']],
),
],
security: "is_granted('ROLE_USER')",
)]
class ShipmentType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['shipment-type:read', 'shipment:read'])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['shipment-type:read', 'shipment:read'])]
private ?string $label = null;
#[ORM\Column(length: 255)]
#[Groups(['shipment-type:read', 'shipment:read'])]
private ?string $code = null;
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
}

View File

@@ -8,8 +8,6 @@ use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\GetCollection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Serializer\Attribute\Groups;
@@ -51,17 +49,6 @@ class Vehicle
#[ApiProperty(readableLink: true)] #[ApiProperty(readableLink: true)]
private ?Truck $truck = null; private ?Truck $truck = null;
/**
* @var Collection<int, Shipment>
*/
#[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'id_carrier_1')]
private Collection $shipments;
public function __construct()
{
$this->shipments = new ArrayCollection();
}
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; return $this->id;
@@ -102,34 +89,4 @@ class Vehicle
return $this; return $this;
} }
/**
* @return Collection<int, Shipment>
*/
public function getShipments(): Collection
{
return $this->shipments;
}
public function addShipment(Shipment $shipment): static
{
if (!$this->shipments->contains($shipment)) {
$this->shipments->add($shipment);
$shipment->setIdCarrier1($this);
}
return $this;
}
public function removeShipment(Shipment $shipment): static
{
if ($this->shipments->removeElement($shipment)) {
// set the owning side to null (unless already changed)
if ($shipment->getIdCarrier1() === $this) {
$shipment->setIdCarrier1(null);
}
}
return $this;
}
} }