You are on page 1of 12

BGA

(Bank Guarantee Application)


DESIGN DOCUMENT

Prepared by:
SANDEEP KUMAR
Date: June 26th, 2015

1
Revision History
Date Version Revision comment Updated By
26-June-2015 1.0 Initial creation Sandeep Kumar

Sign-Off
Name Purpose Date Comment
Suraj Ramesh Review
Kshitij Gupta Review
Bhushan Review
Mithilesh K Signature

2
1.0 Requirement Overview
 Bank Guarantee Application (BGA) document is required for sending along with the LC
application but the System is not supporting.
 For solving this problem, system will introduce Bank Guarantee Application Form under
finance section.
 This BGA form will accept all the required data as an input for generating the BGA. After
saving the BGA detail user can generate draft as well as original.

2.0 High Level Design


BGA (Bank Guarantee Application) is a Finance section document which will be generated only
by Buyer. For BGA document, Transaction selection is mandatory. After filling all the required
fields, we can save this application, after saving once we can generate Draft as well as original
of this document. Next time when user will come with the same transaction then user can only
update the application. Once BGA is created it should be visible in Transaction document and
repository – other section.

3.0 Low Level Design


Java Changes
3.1 Class Diagram
3.2 Controller
3.3 Service
3.4 DOA
3.5 PDF Generator Handler
3.6 POJO
3.7 Constant
3.8 XHTML Change
3.9 Hbm
3.10 Event, Alert and Inbox
3.11 Database script

3
3.1 Class Diagram

4
3.2 Controller
/* This is the main controller which receives all the request from the user and gives
the response back to the user */
BankGuaranteeAppController
/* This method is responsible for identifying the corresponding handler based on
request */
public String showBankGuaranteeAppForm(){}

/* This method is responsible for show inbox data of Bank Guarantee Application */
public String showInbox(){}

/* This method is responsible for save the Bank Guarantee Application data */
public String saveBankGuaranteeApplication(){}

/* This method is responsible for update the Bank Guarantee Application data */
public String updateBankGuaranteeApplication(){}

/* This method is responsible for generate the Bank Guarantee PDF document */
public String generateBankGuaranteePdf(){}

/* This is the intermediate controller which receives all the request from immediate
parent controller */
WinswayBankGuaranteeAppController
/* This method is responsible for identifying the corresponding handler based on
request */
public String showBankGuaranteeAppForm(){}

/* This method is responsible for show inbox data of Bank Guarantee Application */
public String showInbox(){}

/* This method is responsible for save the Bank Guarantee Application data */
public String saveBankGuaranteeApplication(){}

5
/* This method is responsible for update the Bank Guarantee Application data */
public String updateBankGuaranteeApplication(){}

/* This method is responsible for generate the Bank Guarantee PDF document */
public String generateBankGuaranteePdf(){}

/* This is a Rabobank specific handler. This handler is responsible for perform the
operation related to Rabobank. */
RabobankBankGuaranteeController
/* This method is responsible for populating data on the page */
public String showBankGuaranteeForm(){}

/* This method is responsible for show inbox data of Bank Guarantee */


public String showInbox(){}

/* This method is responsible for save the Bank Guarantee Application data */
public String saveBankGuaranteeApplication(){}

/* This method is responsible for update the Bank Guarantee Application data */
public String updateBankGuaranteeApplication(){}

/* This method is responsible for generate the Bank Guarantee PDF document */
public String generateBankGuaranteePdf(){}

3.3 Service
BankGuaranteeAppService
/* This service is responsible for saving the Bank Guarantee Application data */
void saveBankGuaranteeApp(BankGuaranteeApplication bga, User user) throws Exception;

/* This service is responsible for updating the Bank Guarantee Application data */
void updateBankGuaranteeApp(BankGuaranteeApplication bga, User user) throws Exception;

6
/* This service is responsible for retrieves Bank Guarantee Application data based
on Transaction Id*/
BankGuaranteeApplication getBankGuaranteeAppByTxnId(Integer txnId) throws Exception;

/* This service is responsible for retrieves Bank Guarantee Application data based
on Id */
BankGuaranteeApplication getBankGuaranteeAppById(Integer bgaId)throws Exception;

/* This service is responsible for generating PDF for Bank Guarantee Application
document */
boolean generateBankGauranteeAppPdf(BankGuaranteeApplication bga, User user)
throws Exception;

3.4 DAO
BankGuaranteeAppDao
void saveBankGuaranteeApp(BankGuaranteeApplication bga);
void updateBankGuaranteeApp(BankGuaranteeApplication bga);
BankGuaranteeApplication getBankGuaranteeAppByTxnId(Integer txnId) throws Exception;
BankGuaranteeApplication getBankGuaranteeAppById(Integer bgaId) throws Exception;

3.5 Pdf generator Handler


com.singaporeinfotech.core.document.itext.handler.wwy.RabobankSgBGAHandler.java
/* This method generate PDF document of BGA*/
generateRabobankBgaPdf(BankGuaranteeApplication){}

3.6 POJO
com.singaporeinfotech.trading.hibernate.orm.BankGuaranteeApplication.java

3.7 Constant
BankGuaranteeAppConstant.java

7
3.8 XHTML
BankGuaranteeApplication.xhtml
BankGuaranteeApplicationView.xhtml
BankGuaranteeApplicationSuccess.xhtml
BankGuaranteeApplicationSuccessView.xhtml
BankGuaranteeApplicationPdfView.xhtml

3.9 Hbm
BankGuaranteeApplication.hbm.xml

3.10 Event, Alert and Inbox


Note : After saving or updating Bank Guarantee Application document, every time the newly
generated document will go to the logged-in user inbox automatically. For this we have to
configure following changes:
a). In the ‘events’ table, add the event-"BANK_GUARANTEE_DOCUMENT_GENERATED"
b) With the id of that event : register in "alert_preferences" table with the name
BANK_GUARANTEE_DOCUMENT_GENERATED
c) From the table "organisation_alert_preference", delete every record
corresponding to that organisation id.
d) From the admin login of that organization, configure the events and save them.

3.11 Database script


Insert in documenttype table
INSERT INTO `singaporeinfotech`.`documenttype` (`DOCUMENTTYPE`, `DOCUMENTDESC`,
`STANDARD_DOCUMENT`, `PARENT_DOCUMENT_ID`, `DOCUMENT_HANDLER_REFERNCE_KEY`,
`DEALREQUIEDDOCSYN`) VALUES ('BANK_GUARANTEE_APPLICATION', 'Bank Guarantee
Application', 'Y', 0, 'bankGuaranteeApplicationHandler', 'N');

Insert in tradefinops_formats table


INSERT INTO `singaporeinfotech`.`tradefinops_formats` (`FORMAT_NAME`, `DESCRIPTION`,
`DOCUMENT_TYPE`, `FORMAT_TYPE`, `ORG_ID`, `ITEXT_HANDLER`) VALUES
('WWY_RABO_BANK_BGA', 'Winsway Bank Guarantee Application',
'BANK_GUARANTEE_APPLICATION', 'CUSTOM', (SELECT organisationid FROM
singaporeinfotech.organisation where organisation_code is = `WWY`),

8
'zONIcQ75OuwQYnvwiKH548kPw1msb18e60mDNGYMISgxKI3oj0i6Dhk0o8EZEUKMXX8kUJ1/tn9YV
pag4nI56OeHUZp0WiDyE7ckNSNQr7etLXKDE4VQgw==');

Insert in subject table


INSERT INTO `singaporeinfotech`.`subject` (`SUBJECTNAME`, `SUBJECTDESCRIPTION`) VALUES
('Bank Guarantee Document Generated', 'Bank Guarantee Document Generated');

INSERT INTO `singaporeinfotech`.`subject` (`SUBJECTNAME`, `SUBJECTDESCRIPTION`) VALUES


('Bank Guarantee Document Modified', 'Bank Guarantee Document Modified');

INSERT INTO `singaporeinfotech`.`subject` (`SUBJECTNAME`, `SUBJECTDESCRIPTION`) VALUES


('Bank Guarantee Document Draft', 'Bank Guarantee Document Draft');

INSERT INTO `singaporeinfotech`.`subject` (`SUBJECTNAME`, `SUBJECTDESCRIPTION`) VALUES


('Bank Guarantee Document Original', 'Bank Guarantee Document Original');

Insert in event table


INSERT INTO `singaporeinfotech`.`events` (`DEAL_OPERATION_MODE_ID`, `EVENT_CODE`,
`EVENT_DECRIPTION`, `DISABLE`) VALUES ((SELECT DEAL_OPERATION_MODE_ID FROM
singaporeinfotech.deal_operation_mode where deal_operation_mode_type = 'Finance'),
'BANK_GUARANTEE_DOCUMENT_DRAFT_GENERATED', 'Bank Guarantee Document Draft
Generated', '0');

INSERT INTO `singaporeinfotech`.`events` (`DEAL_OPERATION_MODE_ID`, `EVENT_CODE`,


`EVENT_DECRIPTION`, `DISABLE`) VALUES ((SELECT DEAL_OPERATION_MODE_ID FROM
singaporeinfotech.deal_operation_mode where deal_operation_mode_type = 'Finance'),
'BANK_GUARANTEE_DOCUMENT_ORIGINAL_GENERATED, 'Bank Guarantee Document Original
Generated', '0');

INSERT INTO `singaporeinfotech`.`events` (`DEAL_OPERATION_MODE_ID`, `EVENT_CODE`,


`EVENT_DECRIPTION`, `DISABLE`) VALUES ((SELECT DEAL_OPERATION_MODE_ID FROM
singaporeinfotech.deal_operation_mode where deal_operation_mode_type = 'Finance'),
'BANK_GUARANTEE_DOCUMENT_GENERATED', 'Bank Guarantee Document Generated', '0');

Insert in inbox_type table


INSERT INTO `singaporeinfotech`.`inbox_type` (`INBOX_TYPE_NAME`, `INBOX_TYPE_DESC`) VALUES
('BANK_GUARANTEE_DOCUMENT_INBOX', 'Bank Gurantee Document Inbox');

Insert in alert_preference table


INSERT INTO `singaporeinfotech`.`alert_preference` (`event`, `alert_name`, `description`, `email`,
`imail`, `sms`) VALUES ((select event_id from singaporeinfotech.event where event_code =
'BANK_GUARANTEE_DOCUMENT_GENERATED'), 'BANK_GUARANTEE_DOCUMENT_GENERATED',
'Bank Guarantee Document Generated', 'Y', 'Y', 'Y');

INSERT INTO `singaporeinfotech`.`alert_preference` (`event`, `alert_name`, `description`, `email`,


`imail`, `sms`) VALUES ((select event_id from singaporeinfotech.event where event_code =
'BANK_GUARANTEE_DOCUMENT_DRAFT_GENERATED'), 'BANK_GUARANTEE_DOCUMENT_DRAFT',
'Bank Guarantee Document Draft Generated', 'Y', 'Y', 'Y');

INSERT INTO `singaporeinfotech`.`alert_preference` (`event`, `alert_name`, `description`, `email`,


`imail`, `sms`) VALUES ((select event_id from singaporeinfotech.event where event_code = `

9
BANK_GUARANTEE_DOCUMENT_ORIGINAL_GENERATED`),
'BANK_GUARANTEE_DOCUMENT_ORIGINAL', 'Bank Guarantee Document Original Generated', 'Y', 'Y',
'Y');

Insert in tfo_work_flow_handler table


INSERT INTO `singaporeinfotech`.`tfo_work_flow_handler` (`document_type`, `organisation_id`,
`handler`, `handler_name`) VALUES ('BANK_GUARANTEE_APPLICATION', (SELECT organisationid
FROM singaporeinfotech.organisation where organisation_code is = `WWY`),
'NRvtjRb6ABR05AM/ZBhredsXjpqMpxnqr7F2HRusnjFEcfj4JNVJ41X1DVopt+aXs9r77g5UOJHJ+WP1
NyNITC9ck475VyLW', 'winswayBGAController');

Database related changes


Bank_guarantee_application
DataType & Not Default Comment
Column_Name PK
Size Null
bga_id INT(11) Y Y Primary Key of the table
deal_id INT(11) Y N FK of Quotation
bga_to_id INT(11) Y N FK of Organisation
bga_To_address VARCHAR(250) Y N
issue_document_name VARCHAR(4) N N
issue_document_condition VARCHAR(3) N N
applicant_id INT(11) N N FK of Organisation
applicant_name_and_address VARCHAR(500) N N
applicant_contact_person INT(11) N N FK of Contact_info
beneficiary_id INT(11) N N FK of Organisation
beneficiary_name_address VARCHAR(500) N N
advising_bank VARCHAR(100) N N
expiry_date DATE Y N
place_of_presentation VARCHAR(45) N N
currency VARCHAR(3) N N
amount DECIMAL(65,2) N N
amount_in_words VARCHAR(500) N N
sblc_available_with INT(11) N N FK of Parameters
sblc_available_by INT(11) N N FK of Parameters
sblc_available_at INT(11) N N FK of Parameters
draft_drawn_on INT(11) N N FK of Parameters
gov_rules_for_sblc INT(11) N N FK of Parameters
gov_rules_for_guarntee INT(11) N N FK of Parameters
guarantee_law VARCHAR(100) N N
doc_transportation_mode_selected CHAR(1) N N ‘F’ All documents are to be
forwarded to Rabobank.
is_partial_drawing CHAR(1) N N ‘F’ Partial Drawing is
applicable or not.
is_partial_drawing_allowed CHAR(1) N N ‘F’ Partial drawing is
allowed or not.
is_issue_sblc_in_the_form_attached CHAR(1) N N ‘F’ Issue the SBLC in the

10
form attached or not.
outside_bank_charges CHAR(1) N N ‘F’ All bank charges outside
Hong Kong or not.
outside_bank_chrg_applicant CHAR(1) N N ‘F’ Outside bank charges for
the account of applicant
or beneficiary.
is_debit_account_for_charges CHAR(1) N N ‘F’ Debit our account for
any charges.
is_debit_account_for_margin CHAR(1) N N ‘F’ Debit our account for
margin held.
account_no_for_charges VARCHAR(45) N N Account no for any
chages
account_no_for_margin VARCHAR(45) N N Account no for any
margin held
created_by INT(11) Y N Store created user id
created_date TIMESTAMP Y N CURRENT Store created date time
_TIMESTA
MP
updated_by INT(11) Y N Store updated user id
updated_date TIMESTAMP Y N CURRENT Store updated date time
_TIMESTA
MP
format_name VARCHAR(45) Y N Format Name
reference_number VARCHAR(45) N N
custom_reference_number VARCHAR(45) N N
global_reference_number VARCHAR(45) N N
internal_reference_number VARCHAR(45) N N

4.0 Testing
Prerequisite – Transaction id selection is mandatory
4.1 Save BGA
4.2 Update BGA
4.3 Retrieve BGA
4.4 BGA PDF generation

11
4.5 BGA PDF retrieval by transaction id
4.6 BGA PDF retrieval by bga id.

5.0 Appendix

bga_initial_script.sql
Database Script

12

You might also like