Project

General

Profile

Actions

None #10158

closed

New Feature #10155: Apple Volume purchasing program - VPP

CRUDs for the the VPP syncing tables

Added by Inosh Perara over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
None
Assignee:
Start date:
27/06/2023
Due date:
14/07/2023
% Done:

100%

Estimated time:
(Total: 0:00 h)
Device Type:
Component:
Type:

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
);


Subtasks 4 (0 open4 closed)

Task #10169: Add DAO operations for User managementClosedOshani Silva27/06/202314/07/2023

Actions
Task #10179: Add DAO operations for Asset managementClosedOshani Silva29/06/202314/07/2023

Actions
Task #10186: Add DAO operations for Association managementClosedOshani Silva05/07/202314/07/2023

Actions
None #10231: Add dbscripts for VPP tablesClosedOshani Silva18/07/2023

Actions
Actions #1

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
);

Actions #2

Updated by Oshani Silva over 1 year ago

  • Subtask #10169 added
Actions #3

Updated by Oshani Silva over 1 year ago

  • Subtask #10179 added
Actions #4

Updated by Oshani Silva over 1 year ago

  • Subtask #10186 added
Actions #5

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
);

Actions #6

Updated by Oshani Silva over 1 year ago

  • Subtask #10231 added
Actions #7

Updated by Arshana Atapattu over 1 year ago

  • Status changed from New to QA
Actions #8

Updated by Arshana Atapattu over 1 year ago

  • Status changed from QA to QA Accept

VPP flow is working

Actions #9

Updated by Arshana Atapattu over 1 year ago

  • Status changed from QA Accept to Closed

Closing due to QA accept

Actions

Also available in: Atom PDF