Création module PlanificationLivraison pour gérer le stockage en BDD du planning de livraison
This commit is contained in:
14
local/modules/PlanificationLivraison/Config/config.xml
Normal file
14
local/modules/PlanificationLivraison/Config/config.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<services>
|
||||
<service id="planiflivraison.delivery.service" class="PlanificationLivraison\EventListeners\DeliveryListener">
|
||||
<argument type="service" id="request_stack" />
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
</config>
|
||||
28
local/modules/PlanificationLivraison/Config/module.xml
Normal file
28
local/modules/PlanificationLivraison/Config/module.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
|
||||
<fullnamespace>PlanificationLivraison\PlanificationLivraison</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Schedule your order delivery</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Permet de planifier votre livraison</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.0.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Laurent LE CORRE</name>
|
||||
<email>laurent@thecoredev.fr</email>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<thelia>2.4.x</thelia>
|
||||
<stability>alpha</stability>
|
||||
<mandatory>0</mandatory>
|
||||
<hidden>0</hidden>
|
||||
</module>
|
||||
26
local/modules/PlanificationLivraison/Config/schema.xml
Normal file
26
local/modules/PlanificationLivraison/Config/schema.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<database defaultIdMethod="native" name="thelia" namespace="PlanificationLivraison\Model">
|
||||
|
||||
<table name="order_delivery_schedule">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="order_id" type="INTEGER" />
|
||||
<column name="delivery_address_id" required="true" type="INTEGER" />
|
||||
|
||||
<column name="schedule_id" required="true" type="INTEGER" />
|
||||
<column name="due_delivery_time_start" required="true" type="TIMESTAMP" />
|
||||
<column name="due_delivery_time_end" required="true" type="TIMESTAMP" />
|
||||
|
||||
<foreign-key foreignTable="order" name="fk_order_delivery_schedule_order_id">
|
||||
<reference foreign="id" local="order_id" />
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="order_address" name="fk_order_delivery_address_id">
|
||||
<reference foreign="id" local="delivery_address_id" />
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="lps_area_schedule" name="fk_order_delivery_schedule_id">
|
||||
<reference foreign="id" local="schedule_id" />
|
||||
</foreign-key>
|
||||
|
||||
</table>
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
<external-schema filename="local/modules/LivraisonParSecteurs/Config/schema.xml" referenceOnly="true" />
|
||||
|
||||
</database>
|
||||
2
local/modules/PlanificationLivraison/Config/sqldb.map
Normal file
2
local/modules/PlanificationLivraison/Config/sqldb.map
Normal file
@@ -0,0 +1,2 @@
|
||||
# Sqlfile -> Database map
|
||||
thelia.sql=thelia
|
||||
36
local/modules/PlanificationLivraison/Config/thelia.sql
Normal file
36
local/modules/PlanificationLivraison/Config/thelia.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- order_delivery_schedule
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `order_delivery_schedule`;
|
||||
|
||||
CREATE TABLE `order_delivery_schedule`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`order_id` INTEGER,
|
||||
`delivery_address_id` INTEGER NOT NULL,
|
||||
`schedule_id` INTEGER NOT NULL,
|
||||
`due_delivery_time_start` DATETIME NOT NULL,
|
||||
`due_delivery_time_end` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_order_delivery_schedule_order_id` (`order_id`),
|
||||
INDEX `fi_order_delivery_address_id` (`delivery_address_id`),
|
||||
INDEX `fi_order_delivery_schedule_id` (`schedule_id`),
|
||||
CONSTRAINT `fk_order_delivery_schedule_order_id`
|
||||
FOREIGN KEY (`order_id`)
|
||||
REFERENCES `order` (`id`),
|
||||
CONSTRAINT `fk_order_delivery_address_id`
|
||||
FOREIGN KEY (`delivery_address_id`)
|
||||
REFERENCES `order_address` (`id`),
|
||||
CONSTRAINT `fk_order_delivery_schedule_id`
|
||||
FOREIGN KEY (`schedule_id`)
|
||||
REFERENCES `lps_area_schedule` (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user