updated
This commit is contained in:
@@ -43,10 +43,17 @@ public interface Api {
|
||||
InventoryManager.getInstance().add(make(new Sculpture()));
|
||||
InventoryManager.getInstance().add(make(new Sculpture()));
|
||||
|
||||
/* Add Customer */
|
||||
//CustomerManager.getInstance().add(new Customer("Kate", "Demsey", "310-676-4844", "kate@museum.com"));
|
||||
//CustomerManager.getInstance().add(new Customer("Jim", "Gumbly", "203-676-4844", "jim@homedeco.com"));
|
||||
CustomerManager.getInstance().load();
|
||||
if (CustomerManager.getInstance().CUSTOMERS.isEmpty()) {
|
||||
/* Add Customer */
|
||||
CustomerManager.getInstance().add(new Customer("Kate", "Demsey", "310-676-4844", "kate@museum.com"));
|
||||
CustomerManager.getInstance().add(new Customer("Jim", "Gumbly", "203-676-4844", "jim@homedeco.com"));
|
||||
CustomerManager.getInstance().add(new Customer("Evan", "Hao", "203-676-8943", "evan@homedeco.com"));
|
||||
|
||||
/* Update Customer List */
|
||||
CustomerManager.getInstance().save();
|
||||
}
|
||||
|
||||
/*
|
||||
* 2. Remove art object from the inventory
|
||||
*/
|
||||
@@ -59,6 +66,10 @@ public interface Api {
|
||||
/*
|
||||
* 3. Return a list of all art objects from inventory
|
||||
*/
|
||||
System.out.println( "============= Inventory List ===============");
|
||||
imgr.INVENTORY.forEach(System.out::println);
|
||||
System.out.println( "\n");
|
||||
|
||||
CustomerManager cmgr = CustomerManager.getInstance();
|
||||
Customer customer = cmgr.findByEmail("kate@museum.com");
|
||||
InventoryList customerCart = new InventoryList();
|
||||
@@ -68,7 +79,7 @@ public interface Api {
|
||||
/*
|
||||
* 3. Add a new transaction object to the list manager is handling
|
||||
*/
|
||||
Transaction tran = tmgr.TransactRequest(customer, customerCart, new Transaction());
|
||||
Transaction tran = tmgr.TransactRequest(customer, customerCart);
|
||||
/*
|
||||
* 4. Calculate and return transaction price
|
||||
* 5. Complete transaction
|
||||
@@ -80,13 +91,13 @@ public interface Api {
|
||||
/*
|
||||
* 7. Format and return transaction data in print format
|
||||
*/
|
||||
System.out.println( tran );
|
||||
System.out.println(tran);
|
||||
/*
|
||||
* 8. Retrieve and return transactions based on:
|
||||
* customer email
|
||||
*/
|
||||
TransactionList foundTrans = tmgr.findByCustomerEmail(customer.getEmail());
|
||||
/*
|
||||
/*
|
||||
* transaction date
|
||||
*/
|
||||
foundTrans = tmgr.findByTransactionDate(tran.getCompleted());
|
||||
@@ -99,7 +110,7 @@ public interface Api {
|
||||
*/
|
||||
foundTrans = tmgr.findByTransactionId(tran.getId());
|
||||
|
||||
/*
|
||||
/*
|
||||
* 9. Update inventory file(s) on local system
|
||||
*/
|
||||
InventoryManager.getInstance().save();
|
||||
@@ -118,7 +129,7 @@ public interface Api {
|
||||
}
|
||||
|
||||
static Painting make(Painting o) {
|
||||
o.setTitle("Windy Rowing");
|
||||
o.setTitle("Walking by the beach.");
|
||||
o.setDescription("East Market Square find. Local Author.");
|
||||
o.setAuthor("Dave Janson");
|
||||
o.setCreated(ZonedDateTime.now());
|
||||
@@ -126,7 +137,7 @@ public interface Api {
|
||||
}
|
||||
|
||||
static Print make(Print o) {
|
||||
o.setTitle("Windy Rowing");
|
||||
o.setTitle("Different day same thing");
|
||||
o.setDescription("East Market Square find. Local Author.");
|
||||
o.setAuthor("Dave Janson");
|
||||
|
||||
@@ -135,7 +146,7 @@ public interface Api {
|
||||
}
|
||||
|
||||
static Sculpture make(Sculpture o) {
|
||||
o.setTitle("Windy Rowing");
|
||||
o.setTitle("Jolly Romp");
|
||||
o.setDescription("East Market Square find. Local Author.");
|
||||
o.setAuthor("Dave Janson");
|
||||
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
[
|
||||
{
|
||||
"email": "kate@museum.com",
|
||||
"id": "1039445606",
|
||||
"id": "4659170390",
|
||||
"nameFirst": "Kate",
|
||||
"nameLast": "Demsey",
|
||||
"phone": "310-676-4844"
|
||||
},
|
||||
{
|
||||
"email": "jim@homedeco.com",
|
||||
"id": "4312148107",
|
||||
"id": "3722574478",
|
||||
"nameFirst": "Jim",
|
||||
"nameLast": "Gumbly",
|
||||
"phone": "203-676-4844"
|
||||
},
|
||||
{
|
||||
"email": "evan@homedeco.com",
|
||||
"id": "3611023109",
|
||||
"nameFirst": "Evan",
|
||||
"nameLast": "Hao",
|
||||
"phone": "203-676-8943"
|
||||
}
|
||||
]
|
||||
56
Api/src/resources/db/inventory.json
Normal file
56
Api/src/resources/db/inventory.json
Normal file
@@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"Author": "Dave Janson",
|
||||
"author": "Dave Janson",
|
||||
"created": "2025-10-30T10:47:09.3038539-04:00[America/New_York]",
|
||||
"description": "East Market Square find. Local Author.",
|
||||
"id": "4187213045",
|
||||
"price": 10.99,
|
||||
"title": "Windy Rowing",
|
||||
"type": "DRAWING"
|
||||
},
|
||||
{
|
||||
"Author": "Dave Janson",
|
||||
"author": "Dave Janson",
|
||||
"created": "2025-10-30T10:47:13.3647577-04:00[America/New_York]",
|
||||
"description": "East Market Square find. Local Author.",
|
||||
"id": "3284384487",
|
||||
"price": 10.99,
|
||||
"title": "Different day same thing",
|
||||
"type": "PRINT"
|
||||
},
|
||||
{
|
||||
"Author": "Dave Janson",
|
||||
"author": "Dave Janson",
|
||||
"created": "2025-10-30T10:47:14.3174866-04:00[America/New_York]",
|
||||
"description": "East Market Square find. Local Author.",
|
||||
"id": "3420570978",
|
||||
"price": 10.99,
|
||||
"title": "Walking by the beach.",
|
||||
"type": "PAINTING",
|
||||
"height": 0,
|
||||
"width": 0
|
||||
},
|
||||
{
|
||||
"Author": "Dave Janson",
|
||||
"author": "Dave Janson",
|
||||
"created": "2025-10-30T10:47:14.9196999-04:00[America/New_York]",
|
||||
"description": "East Market Square find. Local Author.",
|
||||
"id": "4652544628",
|
||||
"price": 10.99,
|
||||
"title": "Jolly Romp",
|
||||
"type": "SCULPTURE",
|
||||
"weight": 1.0
|
||||
},
|
||||
{
|
||||
"Author": "Dave Janson",
|
||||
"author": "Dave Janson",
|
||||
"created": "2025-10-30T10:47:15.4510495-04:00[America/New_York]",
|
||||
"description": "East Market Square find. Local Author.",
|
||||
"id": "3160354998",
|
||||
"price": 10.99,
|
||||
"title": "Jolly Romp",
|
||||
"type": "SCULPTURE",
|
||||
"weight": 1.0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user