/*
 Navicat MySQL Data Transfer

 Source Server         : BuyerKiosk Production
 Source Server Type    : MariaDB
 Source Server Version : 100518 (10.5.18-MariaDB)
 Source Host           : localhost:3306
 Source Schema         : kiosk_ou20856

 Target Server Type    : MariaDB
 Target Server Version : 100518 (10.5.18-MariaDB)
 File Encoding         : 65001

 Date: 23/01/2023 18:31:38
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for LiveFinancials
-- ----------------------------
DROP TABLE IF EXISTS `LiveFinancials`;
CREATE TABLE `LiveFinancials` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `buysGoal` varchar(15) DEFAULT NULL,
  `buysCurrent` varchar(15) DEFAULT NULL,
  `salesGoal` varchar(15) DEFAULT NULL,
  `salesCurrent` varchar(15) DEFAULT NULL,
  `buysOutstanding` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1202 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of LiveFinancials
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bsActions
-- ----------------------------
DROP TABLE IF EXISTS `bsActions`;
CREATE TABLE `bsActions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employeeID` int(11) NOT NULL,
  `action` smallint(6) NOT NULL,
  `categoryID` int(11) DEFAULT NULL COMMENT '0 = Emptying; 1= Adding; 2 = Removing Some; 3 = Removing All',
  `oldLocationID` int(11) DEFAULT NULL,
  `newLocationID` int(11) DEFAULT NULL,
  `timePerformed` timestamp NULL DEFAULT NULL,
  `binID` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `bsActions_employeeID_IDX` (`employeeID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=340 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of bsActions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bsBin_Cat
-- ----------------------------
DROP TABLE IF EXISTS `bsBin_Cat`;
CREATE TABLE `bsBin_Cat` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `binID` int(11) DEFAULT NULL,
  `catID` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `binID` (`binID`) USING BTREE,
  CONSTRAINT `bsbin_cat_ibfk_1` FOREIGN KEY (`binID`) REFERENCES `bsBins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7603 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of bsBin_Cat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bsBins
-- ----------------------------
DROP TABLE IF EXISTS `bsBins`;
CREATE TABLE `bsBins` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(8) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `mainCategory` int(11) DEFAULT NULL,
  `subCat1` int(11) DEFAULT NULL,
  `subCat2` int(11) DEFAULT NULL,
  `subCat3` int(11) DEFAULT NULL,
  `dateCreated` timestamp NULL DEFAULT NULL,
  `location` int(11) DEFAULT NULL,
  `deleted` tinyint(4) NOT NULL DEFAULT 0,
  `ageDate` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bsBins_uuid` (`uuid`),
  KEY `bsBins_mainCategory_IDX` (`mainCategory`) USING BTREE,
  KEY `bsBins_location_IDX` (`location`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=748 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of bsBins
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bsCategories
-- ----------------------------
DROP TABLE IF EXISTS `bsCategories`;
CREATE TABLE `bsCategories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(150) NOT NULL,
  `color` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=255 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of bsCategories
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bsLocations
-- ----------------------------
DROP TABLE IF EXISTS `bsLocations`;
CREATE TABLE `bsLocations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(150) NOT NULL,
  `onsite` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of bsLocations
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for buyQueue
-- ----------------------------
DROP TABLE IF EXISTS `buyQueue`;
CREATE TABLE `buyQueue` (
  `buyID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `drsBuyID` varchar(16) DEFAULT NULL,
  `tabletID` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `dailyNum` int(3) unsigned NOT NULL,
  `timeEntered` timestamp NOT NULL DEFAULT current_timestamp(),
  `sortStarted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `sortCompleted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `sorterID` int(10) unsigned DEFAULT NULL,
  `timeStarted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `timeCompleted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `buyerID` int(10) unsigned DEFAULT NULL,
  `numContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `textMe` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `inStore` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `returnTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `isProcessed` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `isReturning` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `processedContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `remainingContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `customerID` int(10) unsigned NOT NULL,
  `doCount` tinyint(1) unsigned NOT NULL DEFAULT 1,
  `twilioSent` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `isNewCustomer` tinyint(4) NOT NULL DEFAULT 0,
  `clearFlags` tinyint(3) NOT NULL DEFAULT 0,
  `remote` tinyint(1) NOT NULL DEFAULT 0,
  `dropOffTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `hasDroppedOff` tinyint(1) NOT NULL DEFAULT 0,
  `checkOutTime` timestamp NULL DEFAULT NULL,
  `checkedOut` tinyint(1) NOT NULL DEFAULT 0,
  `upperBound` smallint(5) unsigned NOT NULL DEFAULT 0,
  `lowerBound` smallint(5) unsigned NOT NULL DEFAULT 0,
  `waitTime` smallint(5) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`buyID`),
  UNIQUE KEY `drsBuyID` (`drsBuyID`) USING BTREE,
  KEY `customerID` (`customerID`),
  KEY `buyerID` (`buyerID`),
  KEY `customerID_2` (`customerID`)
) ENGINE=InnoDB AUTO_INCREMENT=78457 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of buyQueue
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for closeSalesReport
-- ----------------------------
DROP TABLE IF EXISTS `closeSalesReport`;
CREATE TABLE `closeSalesReport` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date DEFAULT NULL,
  `timeSubmitted` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `grossSalesRetail` decimal(10,2) DEFAULT NULL,
  `grossSalesCost` decimal(10,2) DEFAULT NULL,
  `grossSalesNumber` smallint(6) DEFAULT NULL,
  `grossSalesGM` decimal(10,2) DEFAULT NULL,
  `returnsCost` decimal(10,2) DEFAULT NULL,
  `returnsRetail` decimal(10,2) DEFAULT NULL,
  `returnsNumber` smallint(6) DEFAULT NULL,
  `returnsGM` decimal(10,2) DEFAULT NULL,
  `netSalesContinuingForFee` decimal(10,2) DEFAULT NULL,
  `continuingFee` decimal(10,2) DEFAULT NULL,
  `netSalesCost` decimal(10,2) DEFAULT NULL,
  `netSalesRetail` decimal(10,2) DEFAULT NULL,
  `netSalesGM` decimal(10,2) DEFAULT NULL,
  `salesCount` smallint(6) DEFAULT NULL,
  `buysCost` decimal(10,2) DEFAULT NULL,
  `buysRetail` decimal(10,2) DEFAULT NULL,
  `buysGM` decimal(10,2) DEFAULT NULL,
  `buysCount` smallint(6) DEFAULT NULL,
  `averageRetail` decimal(10,2) DEFAULT NULL,
  `tradeCount` smallint(6) DEFAULT NULL,
  `tradeAmount` decimal(10,2) DEFAULT NULL,
  `buysGoal` decimal(10,2) DEFAULT NULL,
  `salesGoal` decimal(10,2) DEFAULT NULL,
  `buysOutstanding` smallint(6) DEFAULT NULL,
  `laborPercentage` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=398 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of closeSalesReport
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contactNumbers
-- ----------------------------
DROP TABLE IF EXISTS `contactNumbers`;
CREATE TABLE `contactNumbers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `number` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of contactNumbers
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customerAlerts
-- ----------------------------
DROP TABLE IF EXISTS `customerAlerts`;
CREATE TABLE `customerAlerts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customerID` int(11) NOT NULL,
  `type` tinyint(1) unsigned NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `class` varchar(50) DEFAULT NULL,
  `repeat` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0 = Indefinitely, 1 = Once, ',
  `cleared` tinyint(1) DEFAULT NULL,
  `dateAdded` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `Customer ID` (`customerID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of customerAlerts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customerRatings
-- ----------------------------
DROP TABLE IF EXISTS `customerRatings`;
CREATE TABLE `customerRatings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customerID` int(11) NOT NULL,
  `rating` tinyint(2) unsigned NOT NULL,
  `employeeID` tinyint(2) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1505 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of customerRatings
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customerSurvey
-- ----------------------------
DROP TABLE IF EXISTS `customerSurvey`;
CREATE TABLE `customerSurvey` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customerID` int(11) NOT NULL,
  `buyID` int(11) NOT NULL,
  `step1` tinyint(4) NOT NULL,
  `step2` tinyint(4) NOT NULL,
  `step3` tinyint(4) NOT NULL,
  `step4` tinyint(4) NOT NULL,
  `step5` tinyint(4) NOT NULL,
  `dateSubmitted` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `userAgent` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `type` tinyint(4) NOT NULL DEFAULT 1,
  `comments` text DEFAULT NULL,
  `comment` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1626 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- ----------------------------
-- Records of customerSurvey
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customers
-- ----------------------------
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
  `customerID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `dateAdded` timestamp NOT NULL DEFAULT current_timestamp(),
  `firstName` varchar(50) NOT NULL,
  `lastName` varchar(50) NOT NULL,
  `email` varchar(50) DEFAULT NULL,
  `address` varchar(255) NOT NULL,
  `city` varchar(50) NOT NULL,
  `state` varchar(2) NOT NULL,
  `zipcode` varchar(5) NOT NULL,
  `phone` varchar(10) NOT NULL,
  `onSMS` tinyint(1) unsigned DEFAULT 0,
  `onEmail` tinyint(1) unsigned DEFAULT 0,
  `driversLicense` varchar(50) NOT NULL,
  `referralCode` varchar(10) NOT NULL DEFAULT '000000',
  `addedToSMS` timestamp NULL DEFAULT NULL,
  `addedToEmail` timestamp NULL DEFAULT NULL,
  `driversLicenseDOB` date DEFAULT NULL,
  `driversLicenseExpiration` date DEFAULT NULL,
  PRIMARY KEY (`customerID`),
  KEY `dl` (`driversLicense`)
) ENGINE=InnoDB AUTO_INCREMENT=24741 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of customers
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for dailySalesData
-- ----------------------------
DROP TABLE IF EXISTS `dailySalesData`;
CREATE TABLE `dailySalesData` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transID` varchar(8) NOT NULL,
  `type` tinyint(2) NOT NULL,
  `date` date NOT NULL,
  `employee` varchar(60) DEFAULT NULL,
  `phoneNum` varchar(10) NOT NULL,
  `firstName` varchar(60) DEFAULT NULL,
  `lastName` varchar(60) DEFAULT NULL,
  `salesAmount` double(6,2) DEFAULT NULL,
  `buyAmount` double(6,2) DEFAULT NULL,
  `taxAmount` double(6,2) DEFAULT NULL,
  `returnAmount` double(6,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transID` (`transID`) USING BTREE,
  KEY `phone` (`phoneNum`) USING BTREE,
  KEY `date` (`date`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=61245 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of dailySalesData
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for deletedBuys
-- ----------------------------
DROP TABLE IF EXISTS `deletedBuys`;
CREATE TABLE `deletedBuys` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `timeDeleted` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `buyID` int(10) unsigned NOT NULL,
  `tabletID` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `dailyNum` int(3) unsigned NOT NULL,
  `timeEntered` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `sortStarted` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `sortCompleted` timestamp NULL DEFAULT '0000-00-00 00:00:00',
  `sorterID` int(10) unsigned DEFAULT NULL,
  `timeStarted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `timeCompleted` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `buyerID` int(10) unsigned DEFAULT NULL,
  `numContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `textMe` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `inStore` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `returnTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `isProcessed` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `isReturning` tinyint(1) unsigned NOT NULL DEFAULT 0,
  `processedContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `remainingContainers` tinyint(2) unsigned NOT NULL DEFAULT 0,
  `customerID` int(10) unsigned NOT NULL,
  `doCount` tinyint(1) unsigned NOT NULL DEFAULT 1,
  `twilioSent` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `isNewCustomer` tinyint(4) NOT NULL DEFAULT 0,
  `clearFlags` tinyint(3) NOT NULL DEFAULT 0,
  `remote` tinyint(1) NOT NULL DEFAULT 0,
  `dropOffTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `hasDroppedOff` tinyint(1) NOT NULL DEFAULT 0,
  `checkOutTime` timestamp NULL DEFAULT NULL,
  `checkedOut` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`,`buyID`)
) ENGINE=InnoDB AUTO_INCREMENT=222 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of deletedBuys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for dsLoop
-- ----------------------------
DROP TABLE IF EXISTS `dsLoop`;
CREATE TABLE `dsLoop` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `startDate` date NULL DEFAULT NULL,
  `expireDate` date DEFAULT NULL,
  `slideID` int(8) unsigned NOT NULL,
  `position` int(3) unsigned NOT NULL,
  `duration` int(3) unsigned NOT NULL,
  `animation` varchar(15) NOT NULL DEFAULT 'puffIn',
  `slideUploader` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `scheduled` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=470 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of dsLoop
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for dsSlides
-- ----------------------------
DROP TABLE IF EXISTS `dsSlides`;
CREATE TABLE `dsSlides` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT '0=IMG;1=VID;3=QUEUE',
  `slideName` varchar(255) NOT NULL,
  `fileName` varchar(255) NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL,
  `dateAdded` timestamp NOT NULL DEFAULT current_timestamp(),
  `plays` int(10) unsigned DEFAULT 0,
  `embed` text NULL DEFAULT NULL,
  `videoDuration` smallint(6) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=358 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of dsSlides
-- ----------------------------
BEGIN;
INSERT INTO `dsSlides` (`id`, `type`, `slideName`, `fileName`, `enabled`, `dateAdded`, `plays`) VALUES (1, 3, 'Buy Queue', '', 1, '2016-03-01 15:56:05', 0);
COMMIT;

-- ----------------------------
-- Table structure for employees
-- ----------------------------
DROP TABLE IF EXISTS `employees`;
CREATE TABLE `employees` (
  `employeeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `login` varchar(20) NOT NULL,
  `password` varchar(60) NOT NULL,
  `employeeFirstName` varchar(20) NOT NULL,
  `employeeLastName` varchar(20) NOT NULL,
  `role` tinyint(2) unsigned NOT NULL DEFAULT 4,
  `averagePerContainer` decimal(10,0) NOT NULL DEFAULT 0,
  `averagePerBuy` decimal(10,0) NOT NULL DEFAULT 0,
  `active` tinyint(3) unsigned NOT NULL DEFAULT 1,
  PRIMARY KEY (`employeeID`)
) ENGINE=InnoDB AUTO_INCREMENT=44844539 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of employees
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fiveStarsPoints
-- ----------------------------
DROP TABLE IF EXISTS `fiveStarsPoints`;
CREATE TABLE `fiveStarsPoints` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL DEFAULT current_timestamp(),
  `phone` varchar(10) NOT NULL,
  `totalSales` double(6,2) DEFAULT NULL,
  `totalBuys` double(6,2) DEFAULT NULL,
  `totalTax` double(6,2) DEFAULT NULL,
  `points` smallint(6) NOT NULL,
  `pointsRedeemed` smallint(6) DEFAULT NULL,
  `slug` varchar(32) GENERATED ALWAYS AS (md5(concat_ws('',`date`,`phone`,`totalSales`,`totalBuys`,`totalTax`))) STORED,
  `totalReturns` double(6,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `slug` (`slug`) USING BTREE,
  KEY `phoneNum` (`phone`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=262269 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of fiveStarsPoints
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for loyaltyConfig
-- ----------------------------
DROP TABLE IF EXISTS `loyaltyConfig`;
CREATE TABLE `loyaltyConfig` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `dateChanged` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
  `type` tinyint(3) NOT NULL DEFAULT 0,
  `d2p` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `p2d` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `minToRedeem` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `maxPointsRedeemable` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `threshold` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `percentOff` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `dollarsOff` varchar(10) DEFAULT NULL,
  `expirePoints` varchar(10) NOT NULL DEFAULT '120',
  `maximumDiscount` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of loyaltyConfig
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for loyaltyData
-- ----------------------------
DROP TABLE IF EXISTS `loyaltyData`;
CREATE TABLE `loyaltyData` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `loyaltyID` int(11) NOT NULL,
  `date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
  `salesTotal` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `items` int(10) NOT NULL,
  `redeemed` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `loyaltyID` (`loyaltyID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of loyaltyData
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for loyaltyKiosk
-- ----------------------------
DROP TABLE IF EXISTS `loyaltyKiosk`;
CREATE TABLE `loyaltyKiosk` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dateAdded` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `firstName` varchar(30) NOT NULL,
  `lastName` varchar(30) NOT NULL,
  `phone` varchar(10) NOT NULL,
  `email` varchar(100) NOT NULL,
  `smsOptIn` tinyint(4) NOT NULL,
  `emailOptIn` tinyint(4) NOT NULL,
  `referrer` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of loyaltyKiosk
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for qbLiveMap
-- ----------------------------
DROP TABLE IF EXISTS `qbLiveMap`;
CREATE TABLE `qbLiveMap` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `journalEntry` varchar(10) DEFAULT NULL,
  `fieldName` varchar(100) DEFAULT NULL,
  `fieldDescription` varchar(255) DEFAULT NULL,
  `acctType` varchar(100) DEFAULT NULL,
  `acctName` varchar(255) DEFAULT NULL,
  `acctID` int(11) DEFAULT NULL,
  `acctSubType` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of qbLiveMap
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for realTimeData
-- ----------------------------
DROP TABLE IF EXISTS `realTimeData`;
CREATE TABLE `realTimeData` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `buyersTimeStamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `numBuyers` tinyint(3) unsigned NOT NULL,
  `textTimeStamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of realTimeData
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for shiftNotes
-- ----------------------------
DROP TABLE IF EXISTS `shiftNotes`;
CREATE TABLE `shiftNotes` (
  `internalID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id` varchar(10) DEFAULT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `itemType` tinyint(1) unsigned DEFAULT NULL,
  `itemPriority` tinyint(1) unsigned DEFAULT NULL,
  `itemSubmitter` varchar(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `itemTitle` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `itemComment` text DEFAULT NULL,
  `itemCloser` varchar(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `itemStatus` tinyint(2) unsigned DEFAULT NULL,
  `timeClosed` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`internalID`) USING BTREE,
  KEY `timeStamp` (`timeStamp`) USING BTREE,
  KEY `id` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=746 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of shiftNotes
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for shopifyProduct
-- ----------------------------
DROP TABLE IF EXISTS `shopifyProduct`;
CREATE TABLE `shopifyProduct` (
  `id` int(100) unsigned NOT NULL AUTO_INCREMENT,
  `productID` varchar(60) DEFAULT NULL,
  `sku` varchar(16) DEFAULT NULL,
  `sent` tinyint(1) unsigned DEFAULT 0,
  `title` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `tags` text DEFAULT NULL,
  `color` varchar(64) DEFAULT NULL,
  `size` varchar(64) DEFAULT NULL,
  `price` varchar(10) DEFAULT NULL,
  `quantity` tinyint(4) DEFAULT NULL,
  `images` varchar(255) DEFAULT NULL,
  `added` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of shopifyProduct
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for statsEmployeeDaily
-- ----------------------------
DROP TABLE IF EXISTS `statsEmployeeDaily`;
CREATE TABLE `statsEmployeeDaily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `avgTotal` int(10) unsigned NOT NULL,
  `sortTime` int(10) unsigned NOT NULL,
  `sortDelay` int(11) DEFAULT 0,
  `avgPerContainer` int(10) unsigned NOT NULL,
  `numBuys` tinyint(3) unsigned NOT NULL,
  `numContainers` smallint(5) unsigned NOT NULL,
  `firstBuy` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastBuy` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `firstSort` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastSort` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `numSorts` smallint(5) unsigned NOT NULL DEFAULT 0,
  `sortContainers` smallint(5) unsigned NOT NULL DEFAULT 0,
  `sortTimePerContainer` int(10) unsigned NOT NULL DEFAULT 0,
  `employeeID` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8297 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of statsEmployeeDaily
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for statsStoreDaily
-- ----------------------------
DROP TABLE IF EXISTS `statsStoreDaily`;
CREATE TABLE `statsStoreDaily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `avgDelay` int(10) unsigned NOT NULL,
  `sortDelay` int(10) unsigned NOT NULL,
  `sortTime` int(10) unsigned NOT NULL,
  `avgTotal` int(10) unsigned NOT NULL,
  `avgPerContainer` int(10) unsigned NOT NULL,
  `numBuys` tinyint(10) unsigned NOT NULL,
  `numContainers` smallint(10) unsigned NOT NULL,
  `numBuyers` tinyint(10) unsigned NOT NULL,
  `firstBuy` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastBuy` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `buysStranded` tinyint(10) unsigned NOT NULL,
  `uniqueCustomers` tinyint(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `date_2` (`date`),
  KEY `date` (`date`)
) ENGINE=InnoDB AUTO_INCREMENT=1994 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of statsStoreDaily
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for surveyLinks
-- ----------------------------
DROP TABLE IF EXISTS `surveyLinks`;
CREATE TABLE `surveyLinks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `link` text DEFAULT NULL,
  `active` tinyint(1) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of surveyLinks
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tablets
-- ----------------------------
DROP TABLE IF EXISTS `tablets`;
CREATE TABLE `tablets` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `tabletID` tinyint(3) unsigned NOT NULL,
  `description` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `numBuys` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `microBlinkAPI` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tabletID` (`tabletID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of tablets
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for taskData
-- ----------------------------
DROP TABLE IF EXISTS `taskData`;
CREATE TABLE `taskData` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `taskGroup` int(11) DEFAULT NULL,
  `timeCompleted` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `comments` text DEFAULT NULL,
  `employeeName` varchar(60) DEFAULT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of taskData
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for taskGroups
-- ----------------------------
DROP TABLE IF EXISTS `taskGroups`;
CREATE TABLE `taskGroups` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `groupName` varchar(60) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of taskGroups
-- ----------------------------
BEGIN;
INSERT INTO `taskGroups` (`id`, `groupName`) VALUES (1, 'OPENING');
INSERT INTO `taskGroups` (`id`, `groupName`) VALUES (2, 'CLOSING');
COMMIT;

-- ----------------------------
-- Table structure for tasks
-- ----------------------------
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE `tasks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `taskName` varchar(60) DEFAULT NULL,
  `comment` varchar(500) DEFAULT NULL,
  `taskGroup` int(10) unsigned DEFAULT NULL,
  `recurOn` varchar(60) DEFAULT 'SUN MON TUE WED THU FRI SAT',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of tasks
-- ----------------------------
BEGIN;
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (1, 'Open All Registers', 'Test Comment', 1, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (2, 'Close All Registers', NULL, 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (3, 'Turn OFF Open Sign', NULL, 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (4, 'Turn ON Open Sign', 'After Unlocking Door', 1, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (6, 'Run All Clothes on Rack', NULL, 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (7, 'Finish All Tagging', NULL, 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (8, 'Print and Archive Buy Log', NULL, 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (12, 'Collect Trash', 'Bathrooms | Behind Counter | Breakroom ', 2, 'SUN MON TUE WED THU FRI SAT');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (13, 'Unlock Door', '', 1, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (14, 'Lock Door', '', 2, 'MON TUE WED THU FRI SAT SUN ');
INSERT INTO `tasks` (`id`, `taskName`, `comment`, `taskGroup`, `recurOn`) VALUES (26, 'Take Money Out of Safe', '', 1, 'MON TUE WED THU FRI SAT SUN ');
COMMIT;

-- ----------------------------
-- Table structure for texts
-- ----------------------------
DROP TABLE IF EXISTS `texts`;
CREATE TABLE `texts` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `customerID` int(11) DEFAULT NULL,
  `employeeNumber` varchar(15) DEFAULT NULL,
  `type` tinyint(2) unsigned DEFAULT 0,
  `message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `phoneNumber` varchar(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=76064 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of texts
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
