Skip to content

RichardGSchmidt/d288-back-end-programming

Repository files navigation

**DO NOT DISTRIBUTE OR PUBLICLY POST SOLUTIONS TO THESE LABS. MAKE ALL FORKS OF THIS REPOSITORY WITH SOLUTION CODE PRIVATE. PLEASE REFER TO THE STUDENT CODE OF CONDUCT AND ETHICAL EXPECTATIONS FOR COLLEGE OF INFORMATION TECHNOLOGY STUDENTS FOR SPECIFICS. **

WESTERN GOVERNORS UNIVERSITY

D288 – BACK-END PROGRAMMING

Welcome to Back-End Programming! This is an opportunity for students to develop object-oriented applications that can be integrated with relational databases, write code for object-oriented applications using Spring framework, and implements design patterns for object-oriented applications. FOR SPECIFIC TASK INSTRUCTIONS AND REQUIREMENTS FOR THIS ASSESSMENT, PLEASE REFER TO THE COURSE PAGE.

BASIC INSTRUCTIONS

For this project, you will be building your project using IntelliJ IDEA (Ultimate Edition) in a WGU-provided lab environment. You will be working with an existing MySQL database and Angular front-end, which are supplied for you in the lab environment. You will share this project to a private external GitLab repository and backup regularly. If you wish to work on it on your local machine, you will also need to download the Angular front-end application and create your own MySQL database. Use the links on your course page to install the integrated development environments (IDE), MySQL WorkBench, and IntelliJ IDEA, and pull the project from the lab environment.

Requirements

Task B. Create your subgroup and project by logging into GitLab using the web link provided and do the following:

Connected my project to Gitlab

Task C. Construct four new packages, one for each of the following: controllers, entities, dao, and services. The packages will need to be used for a checkout form and vacations packages list.

Constructed four new packages controllers, entities, dao, and services. Created a package named config and copied RestDataConfig.java into it and corrected the import.

Task D. Write code for the entities package that includes entity classes and the enum designed to match the UML diagram.

Wrote Entities Classes Cart.java, CartItem.java, Country.java, Customer.java, Division.java, Excursion.java, and Vacation.java. Also made the Enum status. All are designed to match the UML diagram.

Task E. Write code for the dao package that includes repository interfaces for the entities that extend JpaRepository, and add cross-origin support.

Wrote CartItemRepository.java, CartRepository.java, CountryRepository.java, CustomerRepository.java, DivisionRepository.java, ExcursionRepository.java, and VacationRepository.java. These interfaces all extend JpaRepository and add cross-origin support.

Task F. Write code for the services package that includes each of the following:

• a purchase data class with a customer cart and a set of cart items

• a purchase response data class that contains an order tracking number

• a checkout service interface

• a checkout service implementation class

Wrote CheckoutService.java a checkout service interface, CheckoutServiceImpl.java a checkout service implementation class, Purchase.java a purchase data class with a customer cart and a set of cart items, and PurchaseResponse.java containing the order tracking number

Task G. Write code to include validation to enforce the inputs needed by the Angular front-end.

Added validation for user input field, a new customer will not be generated if any submitted field is null via the nullable=False attribute in @Column statements in the Customer entity file. The other user input to enter an empty vacation also ensures the back end will not update if inputs are not valid (CheckoutController line 24) or if the vacation cost is zero somehow (CheckoutServiceImpl line 57-60) . javax.validation.Validation and javax.validation.Validator both require changes to the pom file that are forbidden, so using the Validator class and @Valid is not an option.

Task H. Write code for the controllers package that includes a REST controller checkout controller class with a post mapping to place orders.

REST controller checkout controller class with post mapping to place order in file CheckoutController.java.

Task I. Add five sample customers to the application programmatically.

Five Sample customers added to the java application, this information is only updated if the customer database has 1 or less members, meaning it will not run after the first run on a new database.

Task J. Run your integrated application by adding a customer order for a vacation with two excursions using the unmodified Angular front-end. Provide screenshots for the following:

• that your application does not generate a network error when adding the data

• your database tables using MySQL Workbench to show the data was successfully added

prepurchase.png no-error.png carts.png cart_items.png excursion_cartitem.png

About

College project on back end programming in java using spring and mysql

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages