Professional Documents
Culture Documents
Sdswhduehfiudvnic
Sdswhduehfiudvnic
Diagram
Each User will have a folder structure principal>Service Code > folders
◦ where user will have multiple principal folder, principal will have multiple service code
folder and service code folder will have multiple temp folder depending on the user
uploading
principal #n
1 2 3 4 5 6 7 8 9 =>
service table decision table pki jpg tiff audio video word excel 72jpg 300 jpg pdf =>
svc c 1 y 9 9- - 9 9y y -
svc c 2 n
svc 3 y
svc n
Tables
Diagram
There will be multiple services in one principal id
Principal Table
Field Name Field Type Is key Description
principal_id id true Id given to a principal (not yet defined)
principal_name text Name of the principal
icon_location text Absolute path of the icon (ex. /home/icon.jpg)
description text Short description of the client for user to see
date_created timestamp Date when the client registered and added to the
database
Service Table
Field Name Field Type Is key
service_code Id true Id given to a service define as CCCxx where CCC is the
name of principal ex. SEC01, BPI01
principal_id text true The principal id of which the service is under of
description text Short description of the service
service_name text Name of the service (ex. Credit Card Applications)
schema_location text Absolute path of the schema use for front end
(ex. /home/schema.json)
destination text Destination of File after submitting
(ex. {bucket}/principal)
storage_code text Storage of file used(aws, local, glacier . . . etc)
access_key text A key given to users in order to access this service
date_created timestamp Date when the service is created and added to the
database
Transaction Table
Field Name Field Type Is key
transaction_id id true
user text true
status text
service_code id true
date_created timestamp
date_last_updated timestamp
folder_location text
Schema
Web Services
Register service – to be followed
Get Principal
◦ service to get the list of registered principal
◦ path: /principal
◦ type: GET
◦ Process
▪ Query principal table
▪ return json
principal_code
principal_name
Get Services
◦ service to get the list of service code that the principal offers
◦ path: /{principal_code}/services
◦ type: GET
◦ Process
▪ Query Service table using principal_code
▪ return json
service_code
description
service_name
Get Service Shema
◦ service to get the list of service schema for the steps
◦ path: /{service_code}/schema
◦ type: GET
◦ Process
▪ Query Service table using service_code
▪ read json file in schema_location
▪ return json from schema location
json will differ from one service code to another
Generate temp folder
◦ a service the creates the temp folder for the uploading
◦ path: /folder
◦ type: POST
◦ data: json
▪ code: {service_code}
◦ Process
▪ Generate Folder Name CCCXX-UUUU-DDMMYYHHSS
CCCXX – service code
UUUU – userId
DDMMYYHHSS – timestamp
▪ Put folder to temp directory
▪ return json
folder_name: {CCCXX-UUUU-DDMMYYHHSS}
Upload Document
◦ uploads the document to the specified temp folder
◦ path: /doc
◦ type: POST
◦ data: form multipart
▪ folder_name:{CCCXX-UUUU-DDMMYYHHSS} or empty
▪ {doc_type}: blob
▪ service_code: {CCCXX}
◦ process
▪ get folder name
▪ get blob
▪ if folder_name is empty create temp folder with id CCCXX-UUUU-DDMMYYHHSS
CCCXX – service code
UUUU – userId
DDMMYYHHSS – timestamp
▪ create file to {folder_name} from blob where file name is {doc_type}_n.{extension of
file} where n is sequence number starting from 1
if {doc_type}.{extension of file} file will be name as {doc_type}_n.{extension of file},
where n is sequence number starting from 1
▪ return json
is_successful: true/false
info:
folder: {CCCXX-UUUU-DDMMYYHHSS}
Submit
◦ Submits the document to the specified shared folder
◦ path: /submit
◦ type: POST
◦ data: json
▪ folder_name: {CCCXX-UUUU-DDMMYYHHSS}
◦ Process
▪ get userId from jwt token
▪ generate document Id {CCCXXDDMMYYYYSSSSSS}
CCCXX – service code
DDMMYYYY - date
SSSSS – sequence number
▪ create document in principal folder of the service code
folder can be found by getting the service code CCCXXX from the data json
▪ move content of temp folder {CCCXX-UUUU-SSSS} to shared GFS
{CCCXXDDMMYYYYSSSSSS}.ser
▪ return json
is_successful: true/false
info: “”