This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from 7SOATSquad30/refactor/folder-structure-cl…
…ean-architecture refactor: switch the folder structure to clean architecture
- Loading branch information
Showing
104 changed files
with
669 additions
and
523 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/main/java/br/com/fiap/grupo30/fastfood/adapters/out/mercadopago/MercadoPagoAdapter.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
8 changes: 4 additions & 4 deletions
8
...java/br/com/fiap/grupo30/fastfood/adapters/out/mercadopago/MercadoPagoRequestBuilder.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
16 changes: 0 additions & 16 deletions
16
src/main/java/br/com/fiap/grupo30/fastfood/domain/Category.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/main/java/br/com/fiap/grupo30/fastfood/domain/Customer.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/main/java/br/com/fiap/grupo30/fastfood/domain/Product.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/main/java/br/com/fiap/grupo30/fastfood/domain/entities/Category.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.entities; | ||
|
||
import java.util.Objects; | ||
|
||
public class Category { | ||
|
||
private Long id; | ||
private String name; | ||
|
||
public Category() {} | ||
|
||
public Category(Long id, String name) { | ||
this.id = id; | ||
this.name = name; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Category category)) return false; | ||
return Objects.equals(id, category.id); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/main/java/br/com/fiap/grupo30/fastfood/domain/entities/Customer.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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.entities; | ||
|
||
import br.com.fiap.grupo30.fastfood.domain.valueobjects.CPF; | ||
import java.util.Objects; | ||
|
||
public class Customer { | ||
private Long id; | ||
private String name; | ||
private CPF cpf; | ||
private String email; | ||
|
||
public Customer() {} | ||
|
||
public Customer(Long id, String name, CPF cpf, String email) { | ||
this.id = id; | ||
this.name = name; | ||
this.cpf = cpf; | ||
this.email = email; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public CPF getCpf() { | ||
return cpf; | ||
} | ||
|
||
public void setCpf(CPF cpf) { | ||
this.cpf = cpf; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Customer customer)) return false; | ||
return Objects.equals(id, customer.id); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id); | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
src/main/java/br/com/fiap/grupo30/fastfood/domain/entities/Product.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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.entities; | ||
|
||
import java.util.Objects; | ||
|
||
public class Product { | ||
|
||
private Long id; | ||
private String name; | ||
private String description; | ||
private Double price; | ||
private String imgUrl; | ||
private Category category; | ||
|
||
public Product() {} | ||
|
||
public Product( | ||
Long id, | ||
String name, | ||
String description, | ||
Double price, | ||
String imgUrl, | ||
Category category) { | ||
this.id = id; | ||
this.name = name; | ||
this.description = description; | ||
this.price = price; | ||
this.imgUrl = imgUrl; | ||
this.category = category; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Double getPrice() { | ||
return price; | ||
} | ||
|
||
public void setPrice(Double price) { | ||
this.price = price; | ||
} | ||
|
||
public String getImgUrl() { | ||
return imgUrl; | ||
} | ||
|
||
public void setImgUrl(String imgUrl) { | ||
this.imgUrl = imgUrl; | ||
} | ||
|
||
public Category getCategory() { | ||
return category; | ||
} | ||
|
||
public void setCategory(Category category) { | ||
this.category = category; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Product product)) return false; | ||
return Objects.equals(id, product.id); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/br/com/fiap/grupo30/fastfood/domain/repositories/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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.repositories; | ||
|
||
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.CategoryDTO; | ||
import java.util.List; | ||
|
||
public interface CategoryRepository { | ||
List<CategoryDTO> findAll(); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/br/com/fiap/grupo30/fastfood/domain/repositories/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.repositories; | ||
|
||
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.CustomerDTO; | ||
|
||
public interface CustomerRepository { | ||
|
||
CustomerDTO findCustomerByCpf(String cpf); | ||
|
||
CustomerDTO insert(CustomerDTO dto); | ||
} |
6 changes: 3 additions & 3 deletions
6
...tfood/domain/services/ProductService.java → ...omain/repositories/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
8 changes: 0 additions & 8 deletions
8
src/main/java/br/com/fiap/grupo30/fastfood/domain/services/CategoryService.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/br/com/fiap/grupo30/fastfood/domain/services/CustomerService.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/main/java/br/com/fiap/grupo30/fastfood/domain/services/impl/CategoryServiceImpl.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.