package DB::Test::InventoryCount;
use strict;
use warnings;
use parent 'DB::Test';

sub inventoryCountProduct {
"CREATE TABLE inventoryCountProduct (
  inventoryCountProductID INTEGER PRIMARY KEY,
  inventoryCountID,
  productID,
  foundAt,
  finalCount,
  finalCountAt,
  attempts,
  adjustment,
  recount,
  inventoryReview,
  onHand,
  cost,
  lastCountAmount,
  totalCounts,
  overstockCount,
  variance
)"
}

sub inventoryCountProductCount {
"CREATE TABLE inventoryCountProductCount (
  inventoryCountProductCountID INTEGER PRIMARY KEY,
  inventoryCountProductID,
  userID,
  locID,
  onShelf,
  cost,
  count,
  countAt,
  isActive,
  missingProductLabel,
  overstock,
  review
)"
}

#64009
sub location {
"CREATE TABLE location (
  locID INTEGER PRIMARY KEY,
  isle,
  line,
  row,
  position,
  type,
  size,
  mixed,
  dynamic,
  active,
  locFunctionID,
  warehouseID,
  warehouseZoneID,
  sortOrder,
  estimate
)"
}

sub productAltLocation {
"CREATE TABLE productAltLocation ( 
  productID INTEGER PRIMARY KEY,
  locID,
  qty,
  dtAssigned,
  dtUpdated
)"   
}

sub product {
"CREATE TABLE product ( 
  productID INTEGER PRIMARY KEY,
  partnumber,
  stat_date,
  date_modified,
  previous_stockstatus,
  APRTune,
  autoprint,
  avg_90day,
  avg_qty,
  brakekit,
  brandID,
  country_origin,
  cust_max_qty,
  date_added,
  default_price_retail,
  description,
  discontinueUnitMatch,
  discontinueUnits,
  donotstock,
  featured,
  groupPricing,
  harmonizedCode,
  imageURL,
  isService,
  loc_method,
  loc_size,
  loc_type,
  locID,
  mainedoc,
  mainimage,
  manufacturerPartNumber,
  newPics,
  newrslmin,
  newrslmax,
  nla,
  nlaUnitMatch,
  nlaUnits,
  noCancelReturn,
  noindividual,
  noSplash,
  rsl_max,
  rsl_min,
  rslLastModified,
  rslOutOfDate,
  scratchdent,
  stockstatus,
  supersession_productID,
  lastSupersessionProductID,
  taxExempt,
  thumbURL,
  Type,
  ts,
  UPCCode,
  vendor_override,
  stat_cur,
  bagging,
  title,
  seName,
  purpose,
  qiRequired,
  recentIndividualSales,
  xoNumber,
  xoType,
  popCode,
  poLead,
  active,
  vendorETA,
  costSpecial,
  costSpecialExpireDate,
  ruleOverride,
  vendorPartNumber,
  OEM
)"   
}

sub productDescription {
"CREATE TABLE productDescription ( 
  productID INTEGER PRIMARY KEY,
  poDescription,
  description2,
  descriptionlong,
  globalAppDescription,
  homeNewsAppDescription,
  tsModified
)"   
}

sub productDimension {
"CREATE TABLE productDimension ( 
  productID INTEGER PRIMARY KEY,
  weight,
  length,
  width,
  height,
  dimSize,
  dimSet,
  dtModified,
  isLiquid TEXT CHECK( isLiquid IN ('YES','NO')) NOT NULL DEFAULT 'NO'
)"   
}

sub productShippingDimension {
"CREATE TABLE productShippingDimension ( 
  productID INTEGER PRIMARY KEY,
  weight,
  length,
  width,
  height,
  dtModified,
  dropship,
  multiBox
)"   
}

sub productRecommend {
 "CREATE TABLE productRecommend (
  productID INTEGER PRIMARY KEY
 )"
}

sub productStocking {
"CREATE TABLE productStocking ( 
  productID INTEGER PRIMARY KEY,
  wwwLead,maxStockDay,rslMinManual,rslMaxManual,rslManualDateIn,rslManualExpDays,activeStockingRuleID,rslType,targetStockQty,  targetOverstockQty,receiveToOverstock,storeOffsite,tsModified
)"   
}

sub productStock {
"CREATE TABLE productStock ( 
  productID INTEGER PRIMARY KEY,
  onHand,onOrder,onRma,lastCost,cost,tsModified
)"   
}

sub productResource {
"CREATE TABLE productResource ( 
  productID INTEGER PRIMARY KEY,
  resourceID,tsModified
)"   
}

sub productReviewSummary {
"CREATE TABLE productReviewSummary ( 
  productID INTEGER PRIMARY KEY,
  ratingCount,ratingAverage,recommendCount,fitCount,fitAverage,installTimeCount,installTimeAverage,installCostCount,installCostAverage
)"   
}
sub productCategoryInfo {
"CREATE TABLE productCategoryInfo ( 
  productID INTEGER PRIMARY KEY,
  categoryInfoID
)"   
}

sub productFreeShipEligible {
"CREATE TABLE productFreeShipEligible ( 
  productID INTEGER PRIMARY KEY,
  freeShipEligible
)"   
}
sub rniProduct {
"CREATE TABLE rniProduct ( 
  rniProductID INTEGER PRIMARY KEY,
  productID,poItemID,qtyReceived 
)"   
}
sub sdsLatest {
"CREATE TABLE sdsLatest ( 
  productID INTEGER PRIMARY KEY,
  sdsLogID
)"   
}
sub sdsLog {
"CREATE TABLE sdsLog ( 
  sdsLogID INTEGER PRIMARY KEY,
  productID,curStage,curRetail,ts
)"   
}
sub pdkRef {
"CREATE TABLE pdkRef ( 
  pdkRefID INTEGER PRIMARY KEY,
  pdkProductID,kitProductID
)"   
}
sub productVendor {
"CREATE TABLE productVendor ( 
  productID INTEGER PRIMARY KEY,
  vendorID,currentVendor, 
  onsale,price_costoverride,sale_units,sale_end,sale_start,price_sale,price_retail,price_vendor_retail
)"   
}

sub productClearance {
	"CREATE TABLE productClearance (
		productID INTEGER NOT NULL
	)"
}

sub productWarehouseZone {
	"CREATE TABLE productWarehouseZone (
		productID INTEGER NOT NULL,
		warehouseZoneID INTEGER NOT NULL DEFAULT 8
	)"
}

sub inventoryCount {
	"CREATE TABLE inventoryCount (
  		inventoryCountID INTEGER PRIMARY KEY NOT NULL,
  		isActive TEXT CHECK( isActive IN ('YES','NO')) NOT NULL DEFAULT 'YES',
		beginsAt TIMESTAMP,
		endsAt TIMESTAMP 
	)"
}

sub scanner_user {
	"CREATE TABLE scanner_user (
  id INTEGER PRIMARY KEY,
  userID INT NOT NULL DEFAULT 0,
  name varchar(24) NOT NULL,
  userName varchar(12) DEFAULT NULL,
  active TEXT CHECK( active IN ('Y','N')) DEFAULT 'Y',
  manager TEXT CHECK( manager IN ('Y','N')) DEFAULT NULL,
  superManager TEXT CHECK( superManager IN ('Y','N')) DEFAULT 'N'
 )";
}

sub scanner_role {
	"CREATE TABLE scanner_role (
  		suID int(10) NOT NULL,
  		role varchar(12) NOT NULL
	)";
}

sub scannerLogin {
	"CREATE TABLE scannerLogin (
	  scannerLoginID INTEGER PRIMARY KEY,
	  userID INTEGER DEFAULT 0,
	  ipAddress INTEGER UNSIGNED NOT NULL,
	  tsLoginTime timestamp NULL DEFAULT( datetime('now') ),
	  loginMessage varchar DEFAULT NULL
	)"
}

sub inventoryCountEmployee {
"CREATE TABLE inventoryCountEmployee (
	  inventoryCountEmployeeID INTEGER PRIMARY KEY, 
	  inventoryCountID INTEGER unsigned NOT NULL,
	  userID INTEGER unsigned NOT NULL,
  	isActive TEXT CHECK( isActive IN ('YES','NO')) NOT NULL DEFAULT 'YES',
	  warehouseID INTEGER unsigned NOT NULL DEFAULT '1',
	  assignedAisle varchar(2) DEFAULT NULL,
  	inventoryReview TEXT CHECK( inventoryReview IN ('YES','NO')) NOT NULL DEFAULT 'NO',
  	fetchDirection TEXT CHECK( fetchDirection IN ('ASC','DESC')) NOT NULL DEFAULT 'ASC',
  	middleStart TEXT CHECK( middleStart IN ('YES','NO')) NOT NULL DEFAULT 'NO'
)";
}

sub inventoryCountEmployeeLocation {
	"CREATE TABLE inventoryCountEmployeeLocation (
	  inventoryCountEmployeeLocationID INTEGER PRIMARY KEY,
	  inventoryCountEmployeeID INTEGER UNSIGNED NOT NULL,
	  fromIsle varchar(2) DEFAULT NULL,
	  toIsle varchar(2) DEFAULT NULL,
	  fromRow varchar(2) DEFAULT NULL,
	  toRow varchar(2) DEFAULT NULL,
	  fromLine varchar(2) DEFAULT NULL,
	  toLine varchar(2) DEFAULT NULL,
	  fromPosition varchar(2) DEFAULT NULL,
	  toPosition varchar(2) DEFAULT NULL,
  	isActive TEXT CHECK( isActive IN ('YES','NO')) NOT NULL DEFAULT 'YES'
	)";
}
	

1;


