DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`claim_beforeInsert`
	BEFORE INSERT ON `claim`
	FOR EACH ROW
BEGIN
	SET NEW.editorFk = account.myUser_getId();

	IF (SELECT shipped FROM ticket WHERE id = NEW.ticketFk) > util.VN_NOW() THEN
   		CALL util.throw('Future ticket date not allowed');
	END IF;
END$$
DELIMITER ;
