43 lines
2.8 KiB
Markdown
43 lines
2.8 KiB
Markdown
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 using nullable=false in Customer entity @Column annotations to prevent null fields. Added checks in CheckoutController and CheckoutServiceImpl to validate inputs and prevent invalid updates. Note: javax.validation not used due to pom.xml restrictions.
|
|
|
|
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
|
|
|