customerNames = new HashSet<>();
+ for (int i = 0; i < 100; i++) {
+ customerNames.add(dataFaker.name().fullName());
+ }
+
+ int randomAgent = random.nextInt(10);
+
+ for (String theName : customerNames){
+
+ String custcity = dataFaker.address()
+ .city();
+ String tempWorkingarea = dataFaker.address()
+ .cityName();
+ String tempCustcountry = dataFaker.address()
+ .country();
+ String tempGrade = dataFaker.country()
+ .countryCode2();
+ double tempOpeningamt = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ double tempReceiveamt = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ double tempPaymentamt = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ double tempOutstandingamt = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ String tempPhone = dataFaker.phoneNumber()
+ .phoneNumber();
+
+ Customer fakeCustomer = new Customer(theName,
+ custcity,
+ tempWorkingarea,
+ tempCustcountry,
+ tempGrade,
+ tempOpeningamt,
+ tempReceiveamt,
+ tempPaymentamt,
+ tempOutstandingamt,
+ tempPhone,
+ a10);
+
+ int randomNumber = random.nextInt(10); // random number 0 through 9
+ for (int i = 0; i < randomNumber; i++)
+ {
+ double tempGetOrdamount = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ double tempGetAdvanceamount = dataFaker.number()
+ .randomDouble(2,
+ 0,
+ 10000);
+ String tempGetOrderdescription = dataFaker.lorem()
+ .characters();
+
+ Order newOrder = new Order(tempGetOrdamount,
+ tempGetAdvanceamount,
+ fakeCustomer,
+ tempGetOrderdescription);
+
+ newOrder.getPayments().add(pay1);
+ fakeCustomer.getOrders()
+ .add(newOrder);
+
+
+ }
+
+ // this actually saves the faker data.
+ custrepos.save(fakeCustomer);
+ }
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/config/H2ServerConfiguration.java b/modelorders/src/main/java/com/lambdaschool/modelorders/config/H2ServerConfiguration.java
new file mode 100644
index 000000000..6929e23be
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/config/H2ServerConfiguration.java
@@ -0,0 +1,72 @@
+package com.lambdaschool.modelorders.config;
+
+import org.h2.tools.Server;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.sql.SQLException;
+
+/**
+ * Configures H2 access through the JetBrains IntelliJ IDEA IDE.
+ *
+ * Adapted from https://techdev.io/en/developer-blog/querying-the-embedded-h2-database-of-a-spring-boot-application
+ * necessary for using the database tool built into intellij
+ */
+@Configuration
+public class H2ServerConfiguration
+{
+
+ /**
+ * TCP port for remote connections, default 9092.
+ */
+ @Value("${h2.tcp.port:9092}")
+ private String h2TcpPort;
+
+ /**
+ * Web port, default 8082.
+ */
+ @Value("${h2.web.port:8082}")
+ private String h2WebPort;
+
+ /**
+ * TCP connection to connect with SQL clients to the embedded h2 database.
+ *
+ * Connect to "jdbc:h2:tcp://localhost:9092/mem:testdb", username "sa", password empty.
+ *
+ * @return The created TcpServer needed to access H2.
+ * @throws SQLException If the server cannot be created.
+ */
+ @Bean
+ @ConditionalOnExpression("${h2.tcp.enabled:true}")
+ public Server h2TcpServer() throws
+ SQLException
+ {
+ return Server.createTcpServer("-tcp",
+ "-tcpAllowOthers",
+ "-tcpPort",
+ h2TcpPort)
+ .start();
+ }
+
+ /**
+ * Web console for the embedded h2 database.
+ *
+ * Go to http://localhost:8082 and connect to the database "jdbc:h2:mem:testdb", username "sa", password empty.
+ *
+ * @return The created web server needed to access H2.
+ * @throws SQLException If the server cannot be created.
+ */
+ @Bean
+ @ConditionalOnExpression("${h2.web.enabled:true}")
+ public Server h2WebServer() throws
+ SQLException
+ {
+ return Server.createWebServer("-web",
+ "-webAllowOthers",
+ "-webPort",
+ h2WebPort)
+ .start();
+ }
+}
\ No newline at end of file
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/controller/AgentController.java b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/AgentController.java
new file mode 100644
index 000000000..c64e55db3
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/AgentController.java
@@ -0,0 +1,9 @@
+//package com.lambdaschool.modelorders.controller;
+//
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@RestController
+//@RequestMapping("/agents")
+//public class AgentController {
+//}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/controller/CustomerController.java b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/CustomerController.java
new file mode 100644
index 000000000..43bdb353a
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/CustomerController.java
@@ -0,0 +1,27 @@
+//package com.lambdaschool.modelorders.controller;
+//
+//import com.lambdaschool.modelorders.models.Customer;
+//import com.lambdaschool.modelorders.services.CustomerServicesImpl;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.http.HttpStatus;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.web.bind.annotation.*;
+//
+//import java.util.List;
+//
+//@RestController
+//@RequestMapping("/customers")
+//public class CustomerController {
+//
+// @Autowired
+// private CustomerServicesImpl customerServicesImpl;
+//
+// @GetMapping(value = "/customers",
+// produces = "application/json")
+// public ResponseEntity> listAllCustomers() {
+// List myCustomers = customerServicesImpl.findAllCustomers();
+// return new ResponseEntity<>(myCustomers,
+// HttpStatus.OK);
+// }
+//
+//}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/controller/OrderController.java b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/OrderController.java
new file mode 100644
index 000000000..2b8e5af15
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/controller/OrderController.java
@@ -0,0 +1,10 @@
+//package com.lambdaschool.modelorders.controller;
+//
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@RestController
+//@RequestMapping("/orders")
+//public class OrderController {
+//
+//}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/models/Agent.java b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Agent.java
new file mode 100644
index 000000000..f5a8b1f7b
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Agent.java
@@ -0,0 +1,82 @@
+package com.lambdaschool.modelorders.models;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name="agents")
+public class Agent {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private long agentcode;
+
+ private String agentname;
+ private String workingarea;
+ private double commission;
+ private String phone;
+ private String country;
+
+ public Agent() {
+ }
+
+ public Agent(
+ String agentname,
+ String workingarea,
+ double commission,
+ String phone,
+ String country) {
+ this.agentname = agentname;
+ this.workingarea = workingarea;
+ this.commission = commission;
+ this.phone = phone;
+ this.country = country;
+ }
+
+ public long getAgentcode() {
+ return agentcode;
+ }
+
+ public void setAgentcode(long agentcode) {
+ this.agentcode = agentcode;
+ }
+
+ public String getAgentname() {
+ return agentname;
+ }
+
+ public void setAgentname(String agentname) {
+ this.agentname = agentname;
+ }
+
+ public String getWorkingarea() {
+ return workingarea;
+ }
+
+ public void setWorkingarea(String workingarea) {
+ this.workingarea = workingarea;
+ }
+
+ public double getCommission() {
+ return commission;
+ }
+
+ public void setCommission(double commission) {
+ this.commission = commission;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/models/Customer.java b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Customer.java
new file mode 100644
index 000000000..b3ae527e7
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Customer.java
@@ -0,0 +1,167 @@
+package com.lambdaschool.modelorders.models;
+
+import javax.persistence.*;
+import java.util.*;
+
+@Entity
+@Table(name ="customers")
+public class Customer {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private long custcode;
+
+ @Column(nullable = false)
+ private String custname;
+ private String custcity;
+ private String workingarea;
+ private String custcountry;
+ private String grade;
+ private double openingamt;
+ private double receiveamt;
+ private double paymentamt;
+ private double outstandingamt;
+ private String phone;
+
+ @ManyToOne
+ @JoinColumn(name="agentcode",
+ nullable = false)
+ private Agent agentcode;
+
+ @OneToMany(mappedBy = "customer",
+ cascade = CascadeType.ALL,
+ orphanRemoval = true)
+ List orders = new ArrayList<>();
+
+ public Customer() {
+ }
+
+ public Customer(
+ String custname,
+ String custcity,
+ String workingarea,
+ String custcountry,
+ String grade,
+ double openingamt,
+ double receiveamt,
+ double paymentamt,
+ double outstandingamt,
+ String phone,
+ Agent agentcode) {
+ this.custname = custname;
+ this.custcity = custcity;
+ this.workingarea = workingarea;
+ this.custcountry = custcountry;
+ this.grade = grade;
+ this.openingamt = openingamt;
+ this.receiveamt = receiveamt;
+ this.paymentamt = paymentamt;
+ this.outstandingamt = outstandingamt;
+ this.phone = phone;
+ this.agentcode = agentcode;
+ }
+
+ public long getCustcode() {
+ return custcode;
+ }
+
+ public void setCustcode(long custcode) {
+ this.custcode = custcode;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCustcity() {
+ return custcity;
+ }
+
+ public void setCustcity(String custcity) {
+ this.custcity = custcity;
+ }
+
+ public String getWorkingarea() {
+ return workingarea;
+ }
+
+ public void setWorkingarea(String workingarea) {
+ this.workingarea = workingarea;
+ }
+
+ public String getCustcountry() {
+ return custcountry;
+ }
+
+ public void setCustcountry(String custcountry) {
+ this.custcountry = custcountry;
+ }
+
+ public String getGrade() {
+ return grade;
+ }
+
+ public void setGrade(String grade) {
+ this.grade = grade;
+ }
+
+ public double getOpeningamt() {
+ return openingamt;
+ }
+
+ public void setOpeningamt(double openingamt) {
+ this.openingamt = openingamt;
+ }
+
+ public double getReceiveamt() {
+ return receiveamt;
+ }
+
+ public void setReceiveamt(double receiveamt) {
+ this.receiveamt = receiveamt;
+ }
+
+ public double getPaymentamt() {
+ return paymentamt;
+ }
+
+ public void setPaymentamt(double paymentamt) {
+ this.paymentamt = paymentamt;
+ }
+
+ public double getOutstandingamt() {
+ return outstandingamt;
+ }
+
+ public void setOutstandingamt(double outstandingamt) {
+ this.outstandingamt = outstandingamt;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Agent getAgentcode() {
+ return agentcode;
+ }
+
+ public void setAgentcode(Agent agentcode) {
+ this.agentcode = agentcode;
+ }
+
+ public List getOrders() {
+ return orders;
+ }
+
+ public void setOrders(List orders) {
+ this.orders = orders;
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/models/Order.java b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Order.java
new file mode 100644
index 000000000..309a84377
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Order.java
@@ -0,0 +1,85 @@
+package com.lambdaschool.modelorders.models;
+
+import javax.persistence.*;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name = "orders")
+public class Order {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private long ordnum;
+
+ private double ordamount;
+ private double advanceamount;
+
+ @ManyToMany()
+ @JoinTable(name="orderspayments",
+ joinColumns = @JoinColumn(name="ordnum"),
+ inverseJoinColumns = @JoinColumn(name="paymentid"))
+ Set payments = new HashSet<>();
+
+ private String orderdescription;
+
+ @ManyToOne
+ @JoinColumn(name ="custcode", nullable = false)
+ private Customer customer;
+
+ public Order() {
+ }
+
+ public Order(
+ double ordamount,
+ double advanceamount,
+ Customer customers,
+ String orderdescription)
+ {
+ this.ordamount = ordamount;
+ this.advanceamount = advanceamount;
+ this.orderdescription = orderdescription;
+ this.payments = payments;
+ this.customer = customers;
+ }
+
+ public long getOrdnum() {
+ return ordnum;
+ }
+
+ public void setOrdnum(long ordnum) {
+ this.ordnum = ordnum;
+ }
+
+ public double getOrdamount() {
+ return ordamount;
+ }
+
+ public void setOrdamount(double ordamount) {
+ this.ordamount = ordamount;
+ }
+
+ public double getAdvanceamount() {
+ return advanceamount;
+ }
+
+ public void setAdvanceamount(double advanceamount) {
+ this.advanceamount = advanceamount;
+ }
+
+ public Set getPayments() {
+ return payments;
+ }
+
+ public void setPayments(Set payments) {
+ this.payments = payments;
+ }
+
+ public Customer getCustomers() {
+ return customer;
+ }
+
+ public void setCustomers(Customer customers) {
+ this.customer = customers;
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/models/Payment.java b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Payment.java
new file mode 100644
index 000000000..870788914
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/models/Payment.java
@@ -0,0 +1,54 @@
+package com.lambdaschool.modelorders.models;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import javax.persistence.*;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name="payments")
+public class Payment {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private long paymentid;
+
+ @Column(nullable = false)
+ private String type;
+
+ @ManyToMany(mappedBy = "payments")
+ @JsonIgnoreProperties(value = "payments", allowSetters = true)
+ Set orders = new HashSet<>();
+
+ public Payment() {
+ }
+
+ public Payment(String type) {
+ this.type = type;
+ }
+
+ public long getPaymentid() {
+ return paymentid;
+ }
+
+ public void setPaymentid(long paymentid) {
+ this.paymentid = paymentid;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Set getOrders() {
+ return orders;
+ }
+
+ public void setOrders(Set orders) {
+ this.orders = orders;
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/AgentsRepository.java b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/AgentsRepository.java
new file mode 100644
index 000000000..8df5a9c1a
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/AgentsRepository.java
@@ -0,0 +1,7 @@
+package com.lambdaschool.modelorders.repositories;
+
+import com.lambdaschool.modelorders.models.Agent;
+import org.springframework.data.repository.CrudRepository;
+
+public interface AgentsRepository extends CrudRepository {
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/CustomersRepository.java b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/CustomersRepository.java
new file mode 100644
index 000000000..78fb3695e
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/CustomersRepository.java
@@ -0,0 +1,8 @@
+package com.lambdaschool.modelorders.repositories;
+
+import com.lambdaschool.modelorders.models.Customer;
+import org.springframework.data.repository.CrudRepository;
+
+public interface CustomersRepository extends CrudRepository {
+
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/OrdersRepository.java b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/OrdersRepository.java
new file mode 100644
index 000000000..c4f97a885
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/OrdersRepository.java
@@ -0,0 +1,7 @@
+package com.lambdaschool.modelorders.repositories;
+
+import com.lambdaschool.modelorders.models.Order;
+import org.springframework.data.repository.CrudRepository;
+
+public interface OrdersRepository extends CrudRepository {
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/PaymentRepository.java b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/PaymentRepository.java
new file mode 100644
index 000000000..7e3d25948
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/repositories/PaymentRepository.java
@@ -0,0 +1,7 @@
+package com.lambdaschool.modelorders.repositories;
+
+import com.lambdaschool.modelorders.models.Payment;
+import org.springframework.data.repository.CrudRepository;
+
+public interface PaymentRepository extends CrudRepository {
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServices.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServices.java
new file mode 100644
index 000000000..783917f3f
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServices.java
@@ -0,0 +1,9 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Agent;
+
+import java.util.List;
+
+public interface AgentServices {
+ Agent save(Agent agent);
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServicesImpl.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServicesImpl.java
new file mode 100644
index 000000000..014916613
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/AgentServicesImpl.java
@@ -0,0 +1,24 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Agent;
+import com.lambdaschool.modelorders.repositories.AgentsRepository;
+import com.lambdaschool.modelorders.repositories.OrdersRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class AgentServicesImpl implements AgentServices {
+
+ @Autowired
+ private AgentsRepository agentRepos;
+
+ @Transactional
+ @Override
+ public Agent save(Agent agent) {
+ return agentRepos.save(agent);
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServices.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServices.java
new file mode 100644
index 000000000..f67374c06
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServices.java
@@ -0,0 +1,11 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Customer;
+
+import java.util.List;
+
+public interface CustomerServices {
+
+ Customer save(Customer customer);
+
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServicesImpl.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServicesImpl.java
new file mode 100644
index 000000000..a4b3ff833
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/CustomerServicesImpl.java
@@ -0,0 +1,18 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Customer;
+import com.lambdaschool.modelorders.repositories.CustomersRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+public class CustomerServicesImpl implements CustomerServices {
+
+ @Autowired
+ CustomersRepository custrepos;
+
+ @Override
+ public Customer save(Customer customer) {
+ return custrepos.save(customer);
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServices.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServices.java
new file mode 100644
index 000000000..57390f04f
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServices.java
@@ -0,0 +1,8 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Payment;
+
+public interface PaymentServices {
+ Payment save(Payment payment);
+
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServicesImpl.java b/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServicesImpl.java
new file mode 100644
index 000000000..cf86023e2
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/services/PaymentServicesImpl.java
@@ -0,0 +1,21 @@
+package com.lambdaschool.modelorders.services;
+
+import com.lambdaschool.modelorders.models.Payment;
+import com.lambdaschool.modelorders.repositories.PaymentRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional
+@Service
+public class PaymentServicesImpl implements PaymentServices {
+
+ @Autowired
+ PaymentRepository paymentrepos;
+
+ @Transactional
+ @Override
+ public Payment save(Payment payment) {
+ return paymentrepos.save(payment);
+ }
+}
diff --git a/modelorders/src/main/java/com/lambdaschool/modelorders/views/AgentCounts.java b/modelorders/src/main/java/com/lambdaschool/modelorders/views/AgentCounts.java
new file mode 100644
index 000000000..458fcfb7a
--- /dev/null
+++ b/modelorders/src/main/java/com/lambdaschool/modelorders/views/AgentCounts.java
@@ -0,0 +1,21 @@
+package com.lambdaschool.modelorders.views;
+
+/**
+ * Used to format the JSON output for a custom query that gathers information on restaurants
+ * and the count of their menu items
+ */
+public interface AgentCounts{
+ /**
+ * The name of the restaurant. Must be called name
+ *
+ * @return the name (String) of restaurant
+ */
+ String getAgentname();
+
+ /**
+ * The count of the count of the menu items. Must be called countmenus
+ *
+ * @return the count (int) of the menu items
+ */
+ int getCountagent();
+}
diff --git a/modelorders/src/main/resources/application.properties b/modelorders/src/main/resources/application.properties
new file mode 100644
index 000000000..8947c9333
--- /dev/null
+++ b/modelorders/src/main/resources/application.properties
@@ -0,0 +1,26 @@
+
+# Configurations useful for working with H2
+spring.h2.console.enabled=true
+spring.h2.console.path=/h2-console
+#
+# We set a port that is not frequently used
+server.port=${PORT:2019}
+#
+# Feature that determines what happens when no accessors are found for a type
+# (and there are no annotations to indicate it is meant to be serialized).
+spring.jackson.serialization.fail-on-empty-beans=false
+#
+# keeps a transaction inside of the same entity manager
+# This property register an EntityManager to the current thread,
+# so you will have the same EntityManager until the web request is finished.
+spring.jpa.open-in-view=true
+#
+# What do with the schema
+# drop n create table again, good for testing
+spring.jpa.hibernate.ddl-auto=create
+spring.datasource.initialization-mode=never
+#debug=true
+#
+# Good for production!
+# spring.jpa.hibernate.ddl-auto=update
+# spring.datasource.initialization-mode=never
diff --git a/data.sql b/modelorders/src/main/resources/data.sql
similarity index 100%
rename from data.sql
rename to modelorders/src/main/resources/data.sql
diff --git a/modelorders/src/test/java/com/lambdaschool/modelorders/ModelordersApplicationTests.java b/modelorders/src/test/java/com/lambdaschool/modelorders/ModelordersApplicationTests.java
new file mode 100644
index 000000000..13c93faa7
--- /dev/null
+++ b/modelorders/src/test/java/com/lambdaschool/modelorders/ModelordersApplicationTests.java
@@ -0,0 +1,13 @@
+package com.lambdaschool.modelorders;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class ModelordersApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}