Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from 7SOATSquad30/refactor/folder-structure-cl…
Browse files Browse the repository at this point in the history
…ean-architecture

refactor: switch the folder structure to clean architecture
  • Loading branch information
MuriloKakazu authored Jul 27, 2024
2 parents 3ce5a11 + 7133801 commit 500fd21
Show file tree
Hide file tree
Showing 104 changed files with 669 additions and 523 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package br.com.fiap.grupo30.fastfood.adapters.out.mercadopago;

import br.com.fiap.grupo30.fastfood.application.dto.OrderDTO;
import br.com.fiap.grupo30.fastfood.application.dto.mercadopago.MercadoPagoPaymentDTO;
import br.com.fiap.grupo30.fastfood.application.dto.mercadopago.MercadoPagoQrCodeDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.OrderDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.mercadopago.MercadoPagoPaymentDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.mercadopago.MercadoPagoQrCodeDTO;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.net.http.HttpClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package br.com.fiap.grupo30.fastfood.adapters.out.mercadopago;

import br.com.fiap.grupo30.fastfood.application.dto.OrderDTO;
import br.com.fiap.grupo30.fastfood.application.dto.mercadopago.MercadoPagoCashOutDTO;
import br.com.fiap.grupo30.fastfood.application.dto.mercadopago.MercadoPagoCreateQrCodeForPaymentCollectionRequestDTO;
import br.com.fiap.grupo30.fastfood.application.dto.mercadopago.MercadoPagoOrderItemDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.OrderDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.mercadopago.MercadoPagoCashOutDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.mercadopago.MercadoPagoCreateQrCodeForPaymentCollectionRequestDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.mercadopago.MercadoPagoOrderItemDTO;
import java.time.Instant;
import java.util.Date;
import java.util.stream.Stream;
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/br/com/fiap/grupo30/fastfood/domain/Category.java

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/java/br/com/fiap/grupo30/fastfood/domain/Customer.java

This file was deleted.

20 changes: 0 additions & 20 deletions src/main/java/br/com/fiap/grupo30/fastfood/domain/Product.java

This file was deleted.

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);
}
}
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);
}
}
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);
}
}
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();
}
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);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package br.com.fiap.grupo30.fastfood.domain.services;
package br.com.fiap.grupo30.fastfood.domain.repositories;

import br.com.fiap.grupo30.fastfood.application.dto.ProductDTO;
import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.ProductDTO;
import java.util.List;

public interface ProductService {
public interface ProductRepository {

List<ProductDTO> findProductsByCategoryId(Long categoryId);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 500fd21

Please sign in to comment.