CREATE TABLE `sumApplicationOutcomes` (
  `customerApplicationID` bigint(20) unsigned NOT NULL,
  `customerInsertDT` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `masterCustomerID` bigint(20) unsigned NOT NULL,
  `introducerFeedID` bigint(20) unsigned NOT NULL,
  `customerApplicationCost` float DEFAULT NULL,
  `outcomeid` bigint(20) unsigned NOT NULL,
  `outcomeDT` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `outcomeBuyerCampaignID` int(10) unsigned NOT NULL,
  `outcomeStatus` enum('Accepted','Rejected','Error','FailCriteria','Processing','RejectedFallback') CHARACTER SET latin1 DEFAULT NULL,
  `outcomeAPIValue` float unsigned DEFAULT NULL,
  `outcomeActualValue` float unsigned DEFAULT NULL,
  `outcomepaidvalue` float unsigned DEFAULT NULL,
  `outcomeIsRedirect` tinyint(1) unsigned DEFAULT NULL,
  `loanAmount` decimal(7,2) unsigned DEFAULT NULL,
  `loanTerm` smallint(5) unsigned DEFAULT NULL,
  `loanPurpose` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `gender` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `dobYear` mediumint(4) unsigned DEFAULT NULL,
  `maritalStatus` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `dependants` tinyint(3) unsigned DEFAULT NULL,
  `postcode` varchar(15) CHARACTER SET latin1 DEFAULT NULL,
  `tenancy` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `timeAtAddressYears` tinyint(3) unsigned DEFAULT NULL,
  `employmentStatus` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `employmentIndustry` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `lengthOfEmploymentYears` tinyint(3) unsigned DEFAULT NULL,
  `lengthOfEmploymentMonths` tinyint(2) unsigned DEFAULT NULL,
  `income` decimal(7,2) unsigned DEFAULT NULL,
  `directPayment` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `paymentFrequency` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `cardType` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `rentPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `loanPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `otherPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `utilityPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `transportPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `foodPayment` decimal(6,2) unsigned DEFAULT 0.00,
  `otherIncome` decimal(7,2) unsigned DEFAULT 0.00,
  PRIMARY KEY (`customerApplicationID`,`masterCustomerID`,`introducerFeedID`,`outcomeid`,`outcomeBuyerCampaignID`),
  KEY `idx_customerInsertDT` (`customerInsertDT`),
  KEY `idx_outcomeDT` (`outcomeDT`),
  KEY `idx_outcomeStatus` (`outcomeStatus`),
  KEY `idx_outcomepaidvalue` (`outcomepaidvalue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
