-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Application.UseCases; | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Api.Controllers | ||
{ | ||
public class ClientesController : ControllerBase | ||
{ | ||
private readonly IClienteUseCase _clienteUseCase; | ||
|
||
public ClientesController(IClienteUseCase clienteUseCase) | ||
{ | ||
_clienteUseCase = clienteUseCase; | ||
} | ||
|
||
[HttpGet] | ||
public IActionResult Get(string cpf) | ||
{ | ||
return Ok(_clienteUseCase.GetByCpf(cpf)); | ||
} | ||
|
||
|
||
[HttpPost] | ||
public IActionResult Post([FromBody] Cliente cliente) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Application.UseCases | ||
{ | ||
public class ClienteUseCase : IClienteUseCase | ||
{ | ||
public void AddCliente(Cliente cliente) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Cliente GetByCpf(string cpf) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Application.UseCases | ||
{ | ||
public interface IClienteUseCase | ||
{ | ||
Cliente GetByCpf(string cpf); | ||
void AddCliente(Cliente cliente); | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Entities | ||
{ | ||
public class Cliente | ||
{ | ||
public int Id { get; set; } | ||
public string Nome { get; set; } | ||
public string Email { get; set; } | ||
public string Cpf { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Entities | ||
{ | ||
public class ItemPedido | ||
{ | ||
public int Id { get; set; } | ||
public Produto Produto { get; set; } | ||
public int Quantidade { get; set; } | ||
public double Subtotal { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Enums; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Entities | ||
{ | ||
public class Pedido | ||
{ | ||
public int Id { get; set; } | ||
public string Codigo { get; set; } | ||
public string Status { get; set; } | ||
public Cliente Cliente { get; set; } | ||
public double PrecoTotal { get; set; } | ||
public double ValorPago { get; set; } | ||
public DateTime DataPagamento { get; set; } | ||
public FormaPagamento FormaPagamento { get; set; } | ||
public List<ItemPedido> Produtos { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Enums; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Entities | ||
{ | ||
public class Produto | ||
{ | ||
public int Id { get; set; } | ||
public string Codigo { get; set; } | ||
public string Nome { get; set; } | ||
public CategoriaProduto Categoria { get; set; } | ||
public double Preco { get; set; } | ||
public string Descricao { get; set; } | ||
public List<string> Imagens { get; set; } // Lista de URLs das imagens | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Enums | ||
{ | ||
public enum CategoriaProduto | ||
{ | ||
Lanche, | ||
Acompanamento, | ||
Bebida, | ||
Sobremesa | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Enums | ||
{ | ||
public enum FormaPagamento | ||
{ | ||
MercadoPago | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Domain.Repositories | ||
{ | ||
public interface IClienteRepository | ||
{ | ||
Task<Cliente> GetByCpf(string cpf); | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
Check failure on line 2 in src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repositories/ByteMeBurgerDbContext.cs
|
||
using Microsoft.Identity.Client; | ||
Check failure on line 3 in src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repositories/ByteMeBurgerDbContext.cs
|
||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Infrastructure.Repositories | ||
{ | ||
public class ByteMeBurgerDbContext: DbContext | ||
Check failure on line 7 in src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repositories/ByteMeBurgerDbContext.cs
|
||
{ | ||
public ByteMeBurgerDbContext(DbContextOptions options) : base(options) | ||
Check failure on line 9 in src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repositories/ByteMeBurgerDbContext.cs
|
||
{ | ||
|
||
} | ||
public DbSet<Cliente> Clientes { get; set; } | ||
Check failure on line 13 in src/FIAP.TechChallenge.ByteMeBurger.Infrastructure/Repositories/ByteMeBurgerDbContext.cs
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Entities; | ||
using FIAP.TechChallenge.ByteMeBurger.Domain.Repositories; | ||
|
||
namespace FIAP.TechChallenge.ByteMeBurger.Infrastructure.Repositories | ||
{ | ||
public class ClienteRepository : IClienteRepository | ||
{ | ||
private readonly ByteMeBurgerDbContext _context; | ||
public ClienteRepository(ByteMeBurgerDbContext context) { | ||
_context = context; | ||
} | ||
public Task<Cliente> GetByCpf(string cpf) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |