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 #21 from 7SOATSquad30/refactor/use-cases
refactor: use cases
- Loading branch information
Showing
17 changed files
with
196 additions
and
146 deletions.
There are no files selected for viewing
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
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
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
9 changes: 0 additions & 9 deletions
9
src/main/java/br/com/fiap/grupo30/fastfood/application/useCases/CategoryUseCase.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/br/com/fiap/grupo30/fastfood/application/useCases/CustomerUseCase.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/main/java/br/com/fiap/grupo30/fastfood/application/useCases/ProductUseCase.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...main/java/br/com/fiap/grupo30/fastfood/application/useCases/impl/CategoryUseCaseImpl.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...main/java/br/com/fiap/grupo30/fastfood/application/useCases/impl/CustomerUseCaseImpl.java
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
src/main/java/br/com/fiap/grupo30/fastfood/application/useCases/impl/ProductUseCaseImpl.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
.../java/br/com/fiap/grupo30/fastfood/domain/usecases/customer/FindCustomerByCpfUseCase.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,19 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.usecases.customer; | ||
|
||
import br.com.fiap.grupo30.fastfood.application.dto.CustomerDTO; | ||
import br.com.fiap.grupo30.fastfood.application.services.CustomerService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class FindCustomerByCpfUseCase { | ||
|
||
private final CustomerService customerService; | ||
|
||
public FindCustomerByCpfUseCase(CustomerService customerService) { | ||
this.customerService = customerService; | ||
} | ||
|
||
public CustomerDTO execute(String cpf) { | ||
return customerService.findCustomerByCpf(cpf); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ava/br/com/fiap/grupo30/fastfood/domain/usecases/customer/RegisterNewCustomerUseCase.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,19 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.usecases.customer; | ||
|
||
import br.com.fiap.grupo30.fastfood.application.dto.CustomerDTO; | ||
import br.com.fiap.grupo30.fastfood.application.services.CustomerService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class RegisterNewCustomerUseCase { | ||
|
||
private final CustomerService customerService; | ||
|
||
public RegisterNewCustomerUseCase(CustomerService customerService) { | ||
this.customerService = customerService; | ||
} | ||
|
||
public CustomerDTO execute(CustomerDTO dto) { | ||
return customerService.insert(dto); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/product/CreateProductUseCase.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,19 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.usecases.product; | ||
|
||
import br.com.fiap.grupo30.fastfood.application.dto.ProductDTO; | ||
import br.com.fiap.grupo30.fastfood.application.services.ProductService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class CreateProductUseCase { | ||
|
||
private final ProductService productService; | ||
|
||
public CreateProductUseCase(ProductService productService) { | ||
this.productService = productService; | ||
} | ||
|
||
public ProductDTO execute(ProductDTO product) { | ||
return productService.insert(product); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/product/DeleteProductUseCase.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,18 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.usecases.product; | ||
|
||
import br.com.fiap.grupo30.fastfood.application.services.ProductService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class DeleteProductUseCase { | ||
|
||
private final ProductService productService; | ||
|
||
public DeleteProductUseCase(ProductService productService) { | ||
this.productService = productService; | ||
} | ||
|
||
public void execute(Long id) { | ||
productService.delete(id); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/product/GetProductUseCase.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,19 @@ | ||
package br.com.fiap.grupo30.fastfood.domain.usecases.product; | ||
|
||
import br.com.fiap.grupo30.fastfood.application.dto.ProductDTO; | ||
import br.com.fiap.grupo30.fastfood.application.services.ProductService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class GetProductUseCase { | ||
|
||
private final ProductService productService; | ||
|
||
public GetProductUseCase(ProductService productService) { | ||
this.productService = productService; | ||
} | ||
|
||
public ProductDTO execute(Long id) { | ||
return productService.findById(id); | ||
} | ||
} |
Oops, something went wrong.