Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

 Users

◦ individuals or corporate that applies for a document processing service.


 User interface
◦ the interface where the user interacts to send the documents
◦ user interface can be of multiple types
▪ Desktop Application
▪ Browser
▪ Mobile phone
◦ All user Interface connects to the submit service unless a special service is needed for a
certain user interface.
 Submit
◦ This is a web service that the interface calls for submitting a transaction
◦ After a transaction is submitted the submit service will:
▪ Create a json file with the following fields:
 user_id – id of the user that submitted the transaction
 service_code – the service code of the transaction
 file_name – name of the files 1. . . . n, where the name of the file will have a
sequence number
 timestamp – timestamp of file 1. . . n
▪ Create the blob (ser file). Blob contains the json file and the files uploaded
▪ Store the blob on a temporary storage
◦ The File name of the blob created by the submit service will consider the following:
▪ service code
▪ date created
▪ sequence number
 Storage
◦ to be discussed. . .
 Sort
◦ This is a backend process where it will read the list of files on the storage and classify it
by its service code.
◦ This will create a text file.
▪ Text file will be name by service code
▪ The contents of the text file are the names of the blob in the storage
◦ it will send the text file to a system for further processing
 Process
◦ this can be one or multiple unit that process a file depending on the service code
◦ this will get the files from the temporary storage.
◦ this is also where the decision table is use for further processing.
 Transfer
◦ This is the part where it gets the processed file or files from process. sort it to its
designated folder.
◦ Designated folder will be synch so that the files will be transferred to aws s3 location

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

 User has to decide when folder is to be transmitted to the principal.


a. User is using a mobile phone
b. User is using a desktop
c. User can send batches of folders containing documents and files from desktops
only; process of uploading is synching of a designated directory folder using AWS
CLI
d. User can just upload from the mobile phone a single folder with multiple
documents or files; with or without document types
◦ Folders for delivery are then synched to the GFS of the principal. Principal GFS folder
structure is
◦ Folder name => principal > Service Code > day of the month  
- Filenames in the folder => GFS seq no, Source, seq no.
?? ?? ?? gfs gfs
principal principal icon desc date created service code name ptr to config
name code location
principal #1
principal #2
principal #3

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

Y or N – perform the process


Number – convert format to the format the number represents
9 means file convert to pdf
2 means file convert to jpg

Tables
 Diagram
There will be multiple services in one principal id

note: all timestamp is mmddyyyy hh:mm

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

Service Schema Format


 description – for inputting instructions for the user to follow
 upload – an array of documents to be uploaded
◦ type – either single or multiple. If single the app should allow for a single file to be
uploaded
◦ file_name – the name of the file that will reflect on the gfs table
◦ doc_type – if blank user is allowed to upload any files
◦ folder – root means it will be put on the transaction folder root else it will have a folder on
its own in the transaction folder
◦ size_limit – allowable size to be uploaded per file in kilobytes (kb)

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: “”

You might also like