Skip to content

MichaelPaonam/reward-dining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reward Dining (from Spring Academy)

Reward Dining

The idea that customers can save money every time they eat at one of the restaurants participating in the "Rewards" network. - "A Frequent Flyer" program for restaurants.

The Rewards Application

The "rewards" application rewards an account for dining at a restaurant participating in the reward network. A reward takes the form of a monetary contribution to an account that is distributed among the account's beneficiaries. Here is how this application is used:

  1. When they are hungry, members dine at participating restaurants using their regular credit cards.


2. Every two weeks, a file containing the dining credit card transactions made by memberes during that period is generated.

3. A standalone `DiningBatchProcessor` application reads this file and submits each Dining record to the rewards application for processing.

Public Application Interface

The RewardNetwork is the central interface clients such as the DiningBatchProcessor use to invoke the application.

A RewardNetwork rewards an account for dining by making a monetary contribution to the account that is in turn distributed among the account's beneficiaries. The sequence diagram below shows a client's interaction with the application illustrating this process:

A client calling the RewardNetwork to reward an account for dining

Internal Application Implementation

Internally, the RewardNetwork implementation delegates to domaon objects to carry out a rewardAccountFor(Dining) transaction. Classes exist for the two central domain concepts of the application: Account and Restaurant.

This flow is shown below:

Objects working together to carry out the rewardAccountFor(Dining) use case

The RewardNetwork asks the Restaurant to calculate how much benefit to award, then continues that amount to the Account.

Reward Dining Database Schema

The Reward Dining applications use a database with this schema:

The Reward Dining database Schema

About

The Reward Dining application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages