None #10158
closedNew Feature #10155: Apple Volume purchasing program - VPP
CRUDs for the the VPP syncing tables
100%
Description
Using the following table structure, write the DAO layer
-- -----------------------------------------------------
-- Table `VPP`.`VPP_USER`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_USER` (
`ID` INT NOT NULL AUTO_INCREMENT,
`CLIENT_USER_ID` VARCHAR NULL,
`DM_USERNAME` VARCHAR NOT NULL,
`TENANT_ID` VARCHAR NOT NULL,
`EMAIL` VARCHAR NULL,
`INVITE_CODE` VARCHAR NULL,
`STATUS` VARCHAR NULL,
`CREATED_TIME` BIGINT NULL,
`LAST_UPDATED_TIME` BIGINT NULL,
`MANAGED_ID` VARCHAR NULL,
`TEMP_PASSWORD` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`ASSETS`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ASSETS` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ADAM_ID` VARCHAR NULL,
`APP_ID` INT NULL,
`ASSIGNED_COUNT` INT NULL,
`DEVICE_ASSIGNABLE` TINYINT NULL,
`PRICING_PARAMS` VARCHAR NULL,
`PRODUCT_TYPE` VARCHAR NULL,
`RETIRED_COUNT` INT NULL,
`REVOCABLE` TINYINT NULL,
`TENANT_ID` VARCHAR NOT NULL,
`SUPPORTED_PLATFORMS` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`VPP_ASSOCIATION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_ASSOCIATION` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ASSET_ID` INT,
`USER_ID` INT,
`TENANT_ID` VARCHAR NOT NULL,
`ASSOCIATION_TYPE` VARCHAR NOT NULL,
`PRICING_PARAMS` VARCHAR NULL,
PRIMARY KEY (`ID`),
CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE
);
Updated by Inosh Perara over 1 year ago
-- -----------------------------------------------------
-- Table `VPP`.`VPP_USER`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_USER` (
`ID` INT NOT NULL AUTO_INCREMENT,
`CLIENT_USER_ID` VARCHAR NULL,
`DM_USERNAME` VARCHAR NOT NULL,
`TENANT_ID` INT NOT NULL,
`EMAIL` VARCHAR NULL,
`INVITE_CODE` VARCHAR NULL,
`STATUS` VARCHAR NULL,
`CREATED_TIME` BIGINT NULL,
`LAST_UPDATED_TIME` BIGINT NULL,
`MANAGED_ID` VARCHAR NULL,
`TEMP_PASSWORD` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`ASSETS`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ASSETS` (
`ID` INT NOT NULL AUTO_INCREMENT,
`APP_ID` INT NULL,
`TENANT_ID` INT NOT NULL,
`CREATED_TIME` BIGINT NULL,
`LAST_UPDATED_TIME` BIGINT NULL,
`ADAM_ID` VARCHAR NULL,
`ASSIGNED_COUNT` INT NULL,
`DEVICE_ASSIGNABLE` TINYINT NULL,
`PRICING_PARAMS` VARCHAR NULL,
`PRODUCT_TYPE` VARCHAR NULL,
`RETIRED_COUNT` INT NULL,
`REVOCABLE` TINYINT NULL,
`SUPPORTED_PLATFORMS` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`VPP_ASSOCIATION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_ASSOCIATION` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ASSET_ID` INT,
`USER_ID` INT,
`TENANT_ID` INT NOT NULL,
`ASSOCIATION_TYPE` VARCHAR NOT NULL,
`PRICING_PARAMS` VARCHAR NULL,
PRIMARY KEY (`ID`),
CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE
);
Updated by Oshani Silva over 1 year ago
Updated DB queries
-- -----------------------------------------------------
-- Table AP_VPP_USER
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_VPP_USER (
ID INT NOT NULL AUTO_INCREMENT,
CLIENT_USER_ID VARCHAR NULL,
DM_USERNAME VARCHAR NOT NULL,
TENANT_ID INT NOT NULL,
EMAIL VARCHAR NULL,
INVITE_CODE VARCHAR NULL,
STATUS VARCHAR NULL,
CREATED_TIME BIGINT NULL,
LAST_UPDATED_TIME BIGINT NULL,
MANAGED_ID VARCHAR NULL,
TEMP_PASSWORD VARCHAR NULL,
PRIMARY KEY (ID));
-- -----------------------------------------------------
-- Table AP_ASSETS
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AP_ASSETS (
ID INT NOT NULL AUTO_INCREMENT,
APP_ID INT NULL,
TENANT_ID INT NOT NULL,
CREATED_TIME BIGINT NULL,
LAST_UPDATED_TIME BIGINT NULL,
ADAM_ID VARCHAR NULL,
ASSIGNED_COUNT VARCHAR NULL,
DEVICE_ASSIGNABLE VARCHAR NULL,
PRICING_PARAMS VARCHAR NULL,
PRODUCT_TYPE VARCHAR NULL,
RETIRED_COUNT VARCHAR NULL,
REVOCABLE VARCHAR NULL,
SUPPORTED_PLATFORMS VARCHAR NULL,
PRIMARY KEY (ID));
-- -----------------------------------------------------
-- Table AP_VPP_ASSOCIATION
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `AP_VPP_ASSOCIATION` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ASSET_ID` INT,
`USER_ID` INT,
`TENANT_ID` INT NOT NULL,
`ASSOCIATION_TYPE` VARCHAR NOT NULL,
`PRICING_PARAMS` VARCHAR NULL,
PRIMARY KEY (`ID`),
CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES AP_ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES AP_VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE
);
Updated by Arshana Atapattu over 1 year ago
- Status changed from QA Accept to Closed
Closing due to QA accept