Professional Documents
Culture Documents
Sender Module Revisedv2-2
Sender Module Revisedv2-2
Sender Module Revisedv2-2
Input
Files with or without Document Types
Single or multiple Files
Files that the system accepts are as follows:
◦ Document
◦ Images
◦ Scanned images
Maximum size limit of each file … (to be discuss)
Input will come from multiple User interfaces:
◦ Mobile phone
◦ Browser
◦ Desktop application
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
?? ?? ?? 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
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: “”