0% found this document useful (0 votes)
64 views4 pages

Credit Card Late Payment Automation System

The document provides instructions for developing a credit card admin system that parses customer data from a file, adds late payment charges to bills if the due date is expired, and persists updated customer details to a database. It includes: 1. Business requirements to automate late fee processing for master credit card customers from a flat file. 2. Functional requirements to parse the input file, add late fees by checking due dates, and save updated accounts to the database. 3. Instructions and constraints for implementing the requirements using a provided code skeleton, including component specifications for parsing input and persisting data.

Uploaded by

Sudheer Ponnada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views4 pages

Credit Card Late Payment Automation System

The document provides instructions for developing a credit card admin system that parses customer data from a file, adds late payment charges to bills if the due date is expired, and persists updated customer details to a database. It includes: 1. Business requirements to automate late fee processing for master credit card customers from a flat file. 2. Functional requirements to parse the input file, add late fees by checking due dates, and save updated accounts to the database. 3. Instructions and constraints for implementing the requirements using a provided code skeleton, including component specifications for parsing input and persisting data.

Uploaded by

Sudheer Ponnada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Credit Card Admin System

Important Instructions:

1. Please read the document thoroughly before you code.


2. Import the given skeleton code into your Eclipse.
3. Use Java 8 for solving the code challenge.
4. Run the database script provided to set up your database.
5. You have to test the code and ensure there are no compilation errors before
submission

I. Business Scenario:

A leading consumer bank wants to automate their process of adding late payment charges to bill amount of
their Master Card Customers. If the due date is expired, add the late payment charges as per given business
rules.

The bill details of ALL the customers will come as a flat file from region wise transactional systems, which is
referred as “source” in the case study. The proposed system has to look up for Master Card holders and update
the Bill Amount by adding late payment charges based on the bill due date as applicable. The Master Card
Account details along with updated bill amount have to be persisted in a database.

II. Functional Requirement Specification:


Req. # Req. Name Req. Description
1 Parse Input The input feed has to be parsed and Master Credit Card
holders have to be filtered

2 Add Late Payment If Due date is expired, add late payment charges to the
Charges, Persist Master bill amount as per business rules (explained in section 5)
Card Account Details for the customers.
Save the master card account details with updated bill
amount into the database.

III. Skeleton File for Development


Import the below attached skeleton code into your eclipse project and implement the required
functionalities. The skeleton also has .SQL file which can be used to set up your database.
Credit Card Admin System

IV. Use case Diagram

V. Technical Requirements
For both the functional requirements 1 and 2, component specification and method specification are given
below. Go in the same order to implement them using the code skeleton.

(1) A. Component Specification:

Requirement
1. Parse Input
Name
Component Helps to parse Input file, and convert into value objects
Definition
Files Included CreditCardAdminService.java, ApplicationUtil.java, CreditCard.java, Inputfeed.txt,
(refer Skeleton) CreditCardAdminSystemException.java
Responsibilities Reads the input file, does validation to check if the record is Master Card, builds the Credit
Card value object and returns it
Design
a) Input file format is .txt and is comma separated (Sample rows are added. You can add
Constraints
any number of rows to test your service class, from main method.
b) Do not hard code the input file path inside any method – has to be used from the input
argument only as per code skeleton.
c) File Structure is like below:
<credit card number>,<customer name>,<customer email>,<customer phone>,<bill
amount>,<due date>,<paid date>
d) In the input feed, filter customers who hold only Master card. You can identify the
master card holder by checking if credit card number of the row starts with ‘5’.
e) Assume that the bill amount is in INR
f) Assume that the Due Date or Paid Date in the file will be in the format yyyy-MM-dd.
g) Do not change the data types of the value object given in POJO.
h) Always convert the due date and paid date values to java.util.date with format, yyyy-
MM-dd before setting in CreditCard value object.
i) Use ApplicationUtil.java for reading file, performing date operations, etc.
Resources inputFeed.txt is the input file that must be parsed. The file, along with file location will be sent
as an argument to the CreditCardService method. File location/path must not be hardcoded
Process Flow
a) The app will be invoked by calling the CreditCardAdminService. addCreditCardDetails
with the input feed (.txt file)
Credit Card Admin System

b) Read the file using File I/O or Java Streams in ApplicationUtil. readFile method
c) Return a list of Master Card rows from input file, from the readFile method
d) Code the method CreditCardAdminService.buildMasterCreditCardList. Call the readFile
method from this method. Read every line from the list returned by readFile method,
split the records based on comma separator
e) Use the ApplicationUtil. convertStringToDate method to convert the date from String
Format to java.util.Date format (yyyy-MM-dd).
f) Build the Credit Card Value Object from the values obtained in every line (Check the
Input file format in Design Constraints row)

Exceptional While doing File I/O in the ApplicationUtil.readFile method, catch all exceptions and throw
Conditions application specific exception, CreditCardAdminSystemException.

(1) B. Method Specification:


Class Name Method Name Input Parameters Output Parameters
CreditCardAdminService addCreditCardDetails() String inputFeed Boolean
ApplicationUtil readFile String fileName static List<String>
CreditCardAdminService buildMasterCreditCardList List<String> records List<CreditCard>
ApplicationUtil convertStringToDate String inputDate Date

(2) A. Component Specification:

Requirement
2. Persist Data into Database
Name
Component Helps to calculate the updated bill amount and add card details to database.
Definition
Files Included CreditCardAdminService.java, ApplicationUtil.java, CreditCard.java, DBConnectionManager.java,
(refer Skeleton) CreditCardAdminSystemException
Responsibilities Updates bill amount if due date is expired. Persists all Master card details to database.
Design
a) The database.properties has connection details required to connect to the backend
Constraints
b) Do not change the keys of the property files, you can update the values based on the local
database settings. For example, do not change the key, db.username. Rather you can have
any value as user name based on local settings.
c) Use only JDBC to establish Database connection
d) Assume the location of the property file will be always as given in the skeleton.
e) Don’t Hardcode the connection string to establish database connection. Read it from
property files.
f) Use Prepared Statement to insert records
g) Close all the resources after use
h) Catch all database related exception and throw Application specific exception only from DAO
or from DBConnectionManager class. There has to be a private constructor in
DBConnectionManager class, to load the database property file and to establish a database
connection using JDBC
i) Rollback the Insert if any SQL exception has occurred. Throw application specific exception,
CreditCardAdminSystemException
Resources database.properties – has connection details, used to establish database connection.
Credit Card Admin System

Process Flow
a) Modify the CreditCardAdminService.buildMasterCreditCardList method check if the due date
is expired (past date). If yes, add 500 INR to the bill amount, and set the updated bill amount
to the Master Credit Card objects.
b) Use CreditCardAdminService .getBillAmountWithLatePaymentCharges method to add 500 to
the bill amount passed as parameter, based on due date.
c) The method CreditCardAdminService .buildMasterCreditCardList must return the list of
master cards with updated bill amount, after adding late payment charges as applicable. For
records where the due date is not expired, let’s persist the records as it is.
d) After reading file, building records as List<CreditCard>, call the CreditCardDAO.
addCreditCardDetails method to insert values to database. You may have to convert the
java.util.date to java.sql.date before storing to database.
e) If Insert has happened successfully, return true; false otherwise.
Exceptional While working with DAO methods, catch all exceptions and throw application specific exception,
Conditions CreditCardAdminSystemException.

(2) B. Method Specification:


Class Name Method Name Input Parameters Output Parameters
CreditCardAdminService getBillAmountWithLatePay Double billAmount Double
mentCharges
CreditCardAdminService buildMasterCreditCardList List<String> records List<CreditCard>
CreditCardAdminService buildMasterCreditCardList List<String> records List<CreditCard>
DBConnectionManager DBConnectionManager() NA NA
DBConnectionManager getInstance() NA DBConnectionManager
CreditCardDAO addCreditCardDetails List<CreditCard> Boolean
Note: You are allowed to modify input file text to incorporate more test data for various test scenarios / boundary
conditions. Test your application by invoking the service methods from the main class, main() method. Follow Java
Naming Conventions, test the code quality by running PMD rules in Eclipse or any other IDE that you use.

You might also like