Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Classic Yoga Center

1.0Introduction

1.1 Functional Requirements


Classic yoga center offers various packages to the Participants to join in their center. They are in need
of a web application for their new Participants to show their available packages and the estimated cost
based on the package and the number of session per week. Create a Spring MVC Spring Boot
Application for developing this application. Design a enrollment Page to choose an appropriate
package (Asanas or Pranayama or Kriyas or Meditation or TeachingPractice) and to type the participant
name, phone number, number of sessions per week. On clicking package cost, the application should
calculate the package cost depending on the package chosen and the quantities given by the Participant.
The Participant has to then be redirected to estimationPage.jsp page that displays the message
“Welcome <<participant name>> , Cost for <<package name>>is Rs. .<<packageCost>>”.

1.2. Use Case Diagram

2.0 Technical Specifications

2.1 Process Flow

 The first page of the application is enrollment.jsp page, this page should have the below form
components.
Component Component Type Component ID
Participant name Textbox participantName
Phone Number Textbox phoneNumber
Package Name Drop down packagetName
Number of sessions/week Textbox sessionsPerWeek
Package cost Submit submit

 In the same page we have the provision to choose language English, German and French. By
default, the page content will be displayed in English. If we choose the language as French the
label content and the error message in the page should displayed in French and if we choose the
language as German the label content and the error message in the page should displayed in
German. Ensure you implement the concept of Internationalization.
 In the enrollmentPage.jsp page, ensure you use the component type and id correctly as
specified in the above table.
 The values in the packageName drop-down must be auto populated from the controller with
the values as given in the below table. They should not be populated/hardcoded inside the JSP.
Package Name
Asanas
Pranayama
Kriyas
Meditation
TeachingPractice

 Sample enrollmentPage.jsp for displaying the page content in English

 Sample enrollmentPage.jsp for displaying the page content in German


 Sample enrollmentPage.jsp for displaying the page content in French

The package cost button, on-click after all successful validations (Refer 2.2 for validation), must
generate the package cost based on the package and the sessionsPerWeek in the estimationPage.jsp
file. In this page the message should be displayed as “Welcome <<participant name>>, Cost for
<<package name>>is Rs. .<<packageCost>>”. The result should be rendered inside the <h2> tag.
Refer 2.3 for the logic to be followed for doing calculation.
2.2Business Validation

 Rule:Participant Name field is mandatory.


 Message: Required Participant Name in<<locale>>
o If validation fails, UI should display the error message - “: Required Participant Name
in<<locale>>”.
 Rule:Phone Number cannot be empty
 Message: Required Phone Number in<<locale>>
o If validation fails, UI should display the error message - “Required Phone Number
in<<locale>>”.

 Rule:Minimum value for sessions per week should be 1.


 Message: Minimum value should be 1 in<<locale>>
o If the validation fails, UI should display the error message - “Minimum value should be
1 in <<locale>>”
 Rule:Maximum value for sessions per week should be 5.
 Message: Maximum value should be 5 in<<locale>>
o If the validation fails, UI should display the error message - “Maximum value should be
5 in <<locale>>”

 Note: The messages have to be retrieved from the appropriate properties file. The Property file
has been given as part of code skeleton. Do not change/modify the property file

2.2Control Flow
 By giving the request /enrollmentPage from the browser (Eg:
http://localhost:8080/enrollmentPage),the user should be redirected to the enrollmentPage.jsp
 User will enter the Participant name, Phone number, choose the package name and enter
sessionsPerWeek.
 On clicking package cost button, Participant name, Phone number and the sessionsPerWeek
should be validated as per the business rules & validations.
 The package cost should be calculated and displayed in the page is estimationPage.jsp
2.3 Business Rules
 Amount for each product is given in the table below.
Cost per session
Package Name

Asanas Rs.250.0
Pranayama Rs.150.0
Kriyas Rs.225.0
Meditation Rs.299.0
TeachingPractic
Rs.399.0
e

 For example:
 If the package name is Asanas and sessionsPerWeek is 3 then
 cost = 3*250.0*4=3000.0
 Calculate the package cost and display the same in estimationPage.jsp.

3.0Component Specification
3.0.1Controller
 The PackageController should be configured via annotation as a Controller
PackageController
Attribute Attribute Type Access Specifier Constraints
Name
service PackageService private Use annotation to
autowire

Method Name Method Return RequestMapping


Argument type URL & Request
name:type Method
enrollmentPage modelAttribute String /enrollmentPage&
“pack”: Package GET
calculateCost modelAttribute String /
“pack”: Package, estimationPage&POS
result:BindingResu T
lt,
model:ModelMap
populatePackageNam List<String Should be annotated
es > with ModelAttribute
with name
“packageList”
 Inside the populatePackageNames method you should add all the 5-package names into the List
and return the List.
 PackageService class should be autowired inside the Controller via annotations
 calculateCost method in PackageService class must calculate the package cost based on the
package and the sessionsPerWeek provided by the user.

3.0.2 Service
 PackageService class should be configured via annotation as Service

Method Method Argument Return type Responsibilities


Name name:type
calculateCos “packageBean”: double This method should
t Package calculate the Package
cost based on the
packageName and
sessionsPerWeek.

3.0.3Model

Class(Model Property Methods


)
Package participantName : String //getters and setters
phoneNumber : String
packageName : String
sessionsPerWeek: int

 Include the needed annotations inside the Order Entity class for various validations already
mentioned. The error messages should be retrieved from the properties file

3.0.4 Internationalization
 Override the methods in InternationalizationConfig class provided as part of the code skeleton
to support Internationalization.
 Note: For the LocaleChangeInterceptor, to internationalize the page based on the new Locale,
use the parameter "language".
 Hint: Request from the UI (enrollmentPage.jsp) for all the three hyperlinks have language
parameter added to a request. Do not modify/change the hyper link /the values already provided
as part of the code skeleton in the enrollmentPage.jsp

3.1 Request Mapping Tasks

/enrollmentPage Redirect the user to enrollmentPage.jsp


/estimationPage Should invoke calculateCost method of the Controller after
submitting all the valid Participant details from
enrollmentPage.jsp, which in turn should invoke the
calculateCost method of the PackageService and redirect to
estimationPage.jsp with the appropriate values depicted in the
screen design. If there are validation errors it should be
redirected to enrollmentPage.jsp page

4.0 Overall Design Constraints


1) Implement the code using the best design standards.
2) Use Internationalization for all the labels and messages in the Bill Generation page.
3) Enrollment page should support Internationalization for three languages English, German
and French. The error messages and the labels should be displayed from the properties file
depending on the locale. The properties file is already provided as part of the code
skeleton.
4) Spring Validator should be used for all the Validations. Use only annotation for performing
the validations.
5) ClassicYogaCenterApplication which is the main class is already provided as part of the
code skeleton. Include only the required annotations to auto scan the Controller, Service
classes.
6) Do not change the property name given in the application.properties files, you can
change the value and you can include additional property if needed.
7) In the pom.xml you are provided with all the dependencies needed for developing the
application.
8) You will not be evaluated based on the UI design (layout, color, formatting, etc.). You are
free to have a basic UI with all the required UI components (input fields, buttons, labels,
etc.). Expected components with the id alone should be designed as per the requirement.
9) Adhere to the design specifications mentioned in the case study.
10) Do not change or delete the class/method names or return types which are provided to you
as a part of the base code skeleton.
11) Also do not change the name or id of the HTML component which are provided to you as a
part of the base code skeleton.
12) Please make sure that your code does not have any compilation errors while
submitting your case study solution.

You might also like