contact_request and deliveryDate_get
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pako Natek 2024-02-15 14:37:09 +01:00
parent ec9604323d
commit 7413644295
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,20 @@
DROP PROCEDURE IF EXISTS floranet.contact_Request;
DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost`
PROCEDURE floranet.contact_Request(
vName VARCHAR(100),
vPhone VARCHAR(15),
vEmail VARCHAR(100),
vMessage TEXT)
READS SQL DATA
BEGIN
/**
* Set actions for contact request
*
* @param vPostalCode Delivery address postal code
*/
END$$
DELIMITER ;

View File

@ -0,0 +1,35 @@
DROP PROCEDURE IF EXISTS floranet.deliveryDate_get;
DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.deliveryDate_get(vPostalCode VARCHAR(15))
READS SQL DATA
BEGIN
/**
* Returns available dates for this postalCode
*
* @param vPostalCode Delivery address postal code
*/
CREATE OR REPLACE TEMPORARY TABLE tmp.deliveryDate
(dated DATE PRIMARY KEY)
ENGINE = MEMORY;
IF vPostalCode != "00000" THEN
INSERT INTO tmp.deliveryDate
SET dated = CURDATE() + INTERVAL 1 DAY;
INSERT INTO tmp.deliveryDate
SET dated = CURDATE() + INTERVAL 2 DAY;
INSERT INTO tmp.deliveryDate
SET dated = CURDATE() + INTERVAL 4 DAY;
INSERT INTO tmp.deliveryDate
SET dated = CURDATE() + INTERVAL 7 DAY;
END IF;
SELECT * FROM tmp.deliveryDate;
DROP TEMPORARY TABLE tmp.deliveryDate;
END$$
DELIMITER ;