Skip to content

Commit

Permalink
Reformat code, remove unused imports, and add comments.
Browse files Browse the repository at this point in the history
Co-authored-by: michexylee <michelle.lee6@mail.mcgill.ca>
Co-authored-by:  DannyTu2  <danny.tu@mail.mcgill.ca>
Co-authored-by: NoahYe123 <jian.ye@mail.mcgill.ca>
Co-authored-by: hiArturo <arturo.moryramirez@mail.mcgill.ca>
Co-authored-by: yoahqiu <yoah.qiu@gmail.com>
  • Loading branch information
6 people committed Feb 23, 2022
1 parent 36a8b6a commit bd1d4d4
Show file tree
Hide file tree
Showing 25 changed files with 312 additions and 401 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;


import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Address;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Customer;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Store;

public interface AddressRepository extends CrudRepository<Address, Integer>{
import org.springframework.data.repository.CrudRepository;

/**
* Find address via address id
* @param id
* @return address (Address)
*
*
* */

public interface AddressRepository extends CrudRepository<Address, Integer> {
Address findAddressById(int id);

/**
* Find address via the city
* @param city
* @return address (Address)
*
* */




Address findAddressByCity(String city);

}
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;
import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Category;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Product;
import org.springframework.data.repository.CrudRepository;

public interface CategoryRepository extends CrudRepository<Category, Integer> {


/**
* Find category by id
* @param id
* @return category(Category)
*
*
* */

/**
* Find category by id
*
* @param id
* @return category(Category)
*/
Category findCategoryById(int id);

/**
* Find category by the name
*
* @param name
* @return category(Category)
*
* */
*/

Category findCategoryByname(String name);

/**
* Find category by the product
*
* @param product
* @return category(Category)
* */
*/


Category findCategoryByProduct(Product product);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Address;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Customer;
import org.springframework.data.repository.CrudRepository;


public interface CustomerRepository extends CrudRepository<Customer, String> {


Customer findCustomberById(int id);

Customer findCustomerById(int id);

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;
import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Employee;
import org.springframework.data.repository.CrudRepository;

public interface EmployeeRepository extends CrudRepository<Employee, String>{
public interface EmployeeRepository extends CrudRepository<Employee, String> {


/**
* Find an employee via id
* @param id
* @return employee(Employee)
*
*
* */

/**
* Find an employee via id
*
* @param id
* @return employee(Employee)
*/
Employee findEmployeeById(int id);

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;
import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryOrder;
import org.springframework.data.repository.CrudRepository;


public interface GroceryOrderRepository extends CrudRepository<GroceryOrder, String> {

/**
* Find grocery order via id
* @param id
* @param groceryOrder (GroceryOrder)
*
*
* */

/**
* Find grocery order via id
*
* @param id
* @param groceryOrder (GroceryOrder)
*/

GroceryOrder findGroceryOrderById(int id);
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Category;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryOrder;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryStoreApplication;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryUser;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Product;
import org.springframework.data.repository.CrudRepository;

public interface GroceryStoreApplicationRepository extends CrudRepository<GroceryStoreApplication, String> {

/**
* Find GroceryStore Application via id
* @param id
* @return groceryStoreApplication(GroceryStoreApplication)
*
*
* */

/**
* Find GroceryStore Application via id
*
* @param id
* @return groceryStoreApplication(GroceryStoreApplication)
*/
GroceryStoreApplication findGroceryStoreApplicationById(int id);
// GroceryStoreApplication finGroceryOrderByGroceryUser(GroceryUser user);
// GroceryStoreApplication finGroceryOrderByProducet(Product product);
// GroceryStoreApplication finGroceryOrderCategoryd(Category category);
// GroceryStoreApplication finGroceryOrderByGroceryOrder(GroceryOrder order);
// boolean existsByGroceryUserAndProduct(GroceryUser user, Product product);
// boolean existsByGroceryUserAndGroceryOrder(GroceryUser user, GroceryOrder order);
// boolean existsByCategroyAndGroceryOrder(Category category, GroceryOrder order);




}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryUser;
import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryUser;

public interface GroceryUserRepository extends CrudRepository<GroceryUser, Integer> {


public interface GroceryUserRepository extends CrudRepository<GroceryUser, Integer> {


/**
* Find grocery user via email
* @param email
* @return groceryUser(GroceryUser)
*
* */
GroceryUser findGroceryUserByEmail(String email);
/**
* Find grocery user via email
*
* @param email
* @return groceryUser(GroceryUser)
*/
GroceryUser findGroceryUserByEmail(String email);

}
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Manager;
import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Manager;

public interface ManagerRepository extends CrudRepository<Manager, Integer> {


public interface ManagerRepository extends CrudRepository<Manager, Integer> {


/**
* Find manager via Id
* @param id
* @return manager(Manager)
*
* */
Manager findManagerById(int Id);


/**
* Find manager via Id
*
* @param id
* @return manager(Manager)
*/
Manager findManagerById(int Id);


}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.Payment;
import org.springframework.data.repository.CrudRepository;

public interface PaymentRepository extends CrudRepository<Payment, Integer> {


/**
* Find payment via id
* @param id
* @return payment (Payment)
* */
Payment findPaymentById(int id);


/**
* Find payment via id
*
* @param id
* @return payment (Payment)
*/
Payment findPaymentById(int id);
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
package ca.mcgill.ecse321.GroceryApplicationBackend.dao;
// package ca.mcgill.ecse321.GroceryApplicationBackend.dao;

import org.springframework.data.repository.CrudRepository;
// import org.springframework.data.repository.CrudRepository;

import ca.mcgill.ecse321.GroceryApplicationBackend.model.GroceryOrder;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Product;
import ca.mcgill.ecse321.GroceryApplicationBackend.model.Product.Availability;
import org.springframework.data.repository.CrudRepository;


public interface ProductRepository extends CrudRepository<Product, Integer> {

public interface ProductRepository extends CrudRepository<Product,Integer> {
/**
* Find product via their name
*
* @param name
* @return product(Product)
*/
Product findProductByName(String name);

/**
* Find product via their name
* @param name
* @return product(Product)
*
* */
Product findProductByName(String name);

/**
* Find product via their barcode
* @param barcode
* @return product (Product)
*
* */
/**
* Find product via their barcode
*
* @param barcode
* @return product (Product)
*/


Product findProductByBarcode(int barcode);

/**
* Find product via availability
* @param availability
* @return product (Product)
* */
Product findProductByBarcode(int barcode);

/**
* Find product via availability
*
* @param availability
* @return product (Product)
*/

Product findProductByAvailability (Availability availability);

Product findProductByAvailability(Availability availability);


}
Loading

0 comments on commit bd1d4d4

Please sign in to comment.