ListerAssister / issues

ListerAssister Issue Tracker
0 stars 0 forks source link

Coupon Code Generator #661

Open sean8300 opened 4 years ago

sean8300 commented 4 years ago

COUPON CODE GENERATOR It will be a single use, flat dollar amount. No condition on service, location, date, package, anything. Just use a code, it gives X off, no other conditions. Once used, it cannot be used again. During meeting it was stressed that there will be zero other conditions. Customer, package, location, nothing. Enter code, X dollars off. If you enter a 50 code for a 25 order then its used, done, over, that extra 25 is lost.

Submitted By: Sean O'Donnell

sean8300 commented 4 years ago

ALTER TABLE order ADD discount_code VARCHAR(50) NULL AFTER payment_description, ADD discount_amount INT(4) NULL AFTER discount_code;

sean8300 commented 4 years ago

CREATE TABLE lister_assister.discount_code ( id INT(11) NOT NULL AUTO_INCREMENT , admin_id INT(10) UNSIGNED NOT NULL , order_id INT(10) UNSIGNED NULL , amount INT(11) NOT NULL , code VARCHAR(50) NOT NULL , PRIMARY KEY (id)) ENGINE = InnoDB;

sean8300 commented 4 years ago

ALTER TABLE discount_code ADD CONSTRAINT fk_discount_admin_id FOREIGN KEY (admin_id) REFERENCES admin(id) ON DELETE NO ACTION ON UPDATE NO ACTION;

sean8300 commented 4 years ago

ALTER TABLE discount_code ADD CONSTRAINT fk_order_id FOREIGN KEY (order_id) REFERENCES order(id) ON DELETE NO ACTION ON UPDATE NO ACTION;