-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat code, remove unused imports, and add comments.
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
1 parent
36a8b6a
commit bd1d4d4
Showing
25 changed files
with
312 additions
and
401 deletions.
There are no files selected for viewing
27 changes: 3 additions & 24 deletions
27
...kend/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/AddressRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
32 changes: 16 additions & 16 deletions
32
...end/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/CategoryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
8 changes: 3 additions & 5 deletions
8
...end/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/CustomerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
21 changes: 10 additions & 11 deletions
21
...end/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/EmployeeRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
17 changes: 8 additions & 9 deletions
17
...src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/GroceryOrderRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
32 changes: 7 additions & 25 deletions
32
...va/ca/mcgill/ecse321/GroceryApplicationBackend/dao/GroceryStoreApplicationRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
||
|
||
|
||
} |
20 changes: 9 additions & 11 deletions
20
.../src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/GroceryUserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
23 changes: 10 additions & 13 deletions
23
...kend/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/ManagerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
||
} |
20 changes: 10 additions & 10 deletions
20
...kend/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/PaymentRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
52 changes: 24 additions & 28 deletions
52
...kend/src/main/java/ca/mcgill/ecse321/GroceryApplicationBackend/dao/ProductRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
||
} |
Oops, something went wrong.