Application Name: Insurance Report Generation
CITIZEN_ID NUMBER PRIMARY KEY CITIZEN_NAME VARCHAR GENDER VARCHAR PLAN_NAME VARCHAR PLAN_STATUS VARCHAR PLAN_START_DATE VARCHAR PLAN_END_DATE VARCHAR BENIFIT_AMOUNT NUMBER DENIAL_REASON VARCHAR TERMINATED_DATE DATE TERMINATED_REASON VARCHAR
a)Persistance(Database) Layer Component
- CitizenPlan.java (Entity Class used to Map with database table)
- CitizenPlanRepository.java (Interface) (Used to perform operation with the table) (Will be JpaRepository)
b) Service(Business Logic) Layer Component
3) RepoertService.java (Interface) (Write abstract method here.)[Always]
4) ReportServiceImpl.java (class) (Implemention of above abstract method.)
5) PdfGenerator.java (class)
6) ExcelGenerator.java (class)
7) EmailUtils.java (class)
c)Controller (Deals with taking the request and giving respone of the data.)(Usually, how many screen available in UI that many controller are written.)
8) ReportController.java (class)
9) SearchRequest.java (class)(Capture data from the UI and search it.) [This class also called as -> form binding/ command /DTO(Data Transfer Object) class]
Runner(used to load the data to database table)
10) DataLoader.java (runner class)
Presentation File
11) index.html (Thymeleaf)
To work with
i) Excel ----> Apache Poi(third party)
ii) Pdf ----> itext pdf / open pdf / aspose
i) Add mail-starter dependency in pom.xml file.
ii)LogIn into your gmail account, enable 2 step verification then generate app password and copy that(save it).
EX: https://myaccount.google.com/
iii) We need to configure SMTP properties to application.properties file.(To Communicate with Mail server to send email.).
iv) Create Email Utility class to send email from our application by suing JavaMailSender.
Note: In JavaMailSender we have send() method...
v) Send method can take SimpleMessage / MimeMessage as parameter
SimpleMessage : To send Plain emails(Text format)
MimeMessage : Email with Attachment