Skip to content

Commit

Permalink
task: corrige fachadas das features
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelodiasbr committed Jan 21, 2024
1 parent a08c924 commit 4ba2947
Show file tree
Hide file tree
Showing 25 changed files with 41 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public async Task GivenQueOTrabalhadorTemUmComprovanteDePontoGuardadoComAData(Da

var transaction = new TransactionContext(userId.ToString());

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

_gestaoContratos.Contrato.QualificaPonto(ponto);

ponto.DataHora = data;
ponto.MomentoId = MomentoEnum.Entrada;

var comprovante = BackupComprovantesService.CriaComprovante(transaction);
var comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

comprovante.ComprovaPonto(ponto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task GivenQueOTrabalhadorRegistrouAEntradaNoExpedienteAs(DateTime e

var contrato = _db.Contratos.FirstOrDefault();

var pontoEntrada = RegistroPontosService.CriaPonto(transaction);
var pontoEntrada = RegistroPontosFacade.CriaPonto(transaction);

contrato.QualificaPonto(pontoEntrada);

Expand All @@ -99,7 +99,7 @@ public async Task GivenQueOTrabalhadorRegistrouASaidaNoExpedienteAs(DateTime sai

var contrato = _db.Contratos.FirstOrDefault();

var pontoSaida = RegistroPontosService.CriaPonto(transaction);
var pontoSaida = RegistroPontosFacade.CriaPonto(transaction);

contrato.QualificaPonto(pontoSaida);

Expand Down Expand Up @@ -153,7 +153,7 @@ public async Task GivenQueOsPontosRegistradosForam(Table table)

var momento = (MomentoEnum)Enum.Parse(typeof(MomentoEnum), row["momento"]);

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

_gestaoContratos.Contrato.QualificaPonto(ponto);

Expand Down
8 changes: 4 additions & 4 deletions specs/MeuPonto.Specs/Support/SeedHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void SetupTestUsers(

var trabalhador = TrabalhadorFactory.CriaTrabalhador(transaction);

var contrato = GestaoContratosService.InciarAberturaContrato(transaction);
var contrato = GestaoContratosFacade.InciarAberturaContrato(transaction);

contrato.Nome = userName;
contrato.Ativo = true;
Expand Down Expand Up @@ -84,13 +84,13 @@ public void SetupTestUsers(

gestaoContratos.Inicia(contrato);

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

ponto.MomentoId = MomentoEnum.Entrada;

registroPontos.Inicia(ponto);

var comprovante = BackupComprovantesService.CriaComprovante(transaction);
var comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

backupComprovantes.Inicia(comprovante);

Expand All @@ -100,7 +100,7 @@ public void SetupTestUsers(

var competencia = new DateTime(hoje.Year, hoje.Month, 1);

var folha = GestaoFolhaService.IniciarAberturaFolha(transaction);
var folha = GestaoFolhaFacade.IniciarAberturaFolha(transaction);

folha.AssociarAo(contrato);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public async Task GivenQueOTrabalhadorTemUmComprovanteDePontoGuardadoComAData(Da

var transaction = new TransactionContext(userId.ToString());

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

_gestaoContratos.Contrato.QualificaPonto(ponto);

ponto.DataHora = data;
ponto.MomentoId = MomentoEnum.Entrada;

var comprovante = BackupComprovantesService.CriaComprovante(transaction);
var comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

comprovante.ComprovaPonto(ponto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task GivenQueOTrabalhadorRegistrouAEntradaNoExpedienteAs(DateTime e

var contrato = _db.Contratos.FirstOrDefault();

var pontoEntrada = RegistroPontosService.CriaPonto(transaction);
var pontoEntrada = RegistroPontosFacade.CriaPonto(transaction);

contrato.QualificaPonto(pontoEntrada);

Expand All @@ -99,7 +99,7 @@ public async Task GivenQueOTrabalhadorRegistrouASaidaNoExpedienteAs(DateTime sai

var contrato = _db.Contratos.FirstOrDefault();

var pontoSaida = RegistroPontosService.CriaPonto(transaction);
var pontoSaida = RegistroPontosFacade.CriaPonto(transaction);

contrato.QualificaPonto(pontoSaida);

Expand Down Expand Up @@ -153,7 +153,7 @@ public async Task GivenQueOsPontosRegistradosForam(Table table)

var momento = (MomentoEnum)Enum.Parse(typeof(MomentoEnum), row["momento"]);

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

_gestaoContratos.Contrato.QualificaPonto(ponto);

Expand Down
8 changes: 4 additions & 4 deletions specs/MeuPonto.UseCases/Support/SeedHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void SetupTestUsers(

var trabalhador = TrabalhadorFactory.CriaTrabalhador(transaction);

var contrato = GestaoContratosService.InciarAberturaContrato(transaction);
var contrato = GestaoContratosFacade.InciarAberturaContrato(transaction);

contrato.Nome = userName;
contrato.Ativo = true;
Expand Down Expand Up @@ -84,13 +84,13 @@ public void SetupTestUsers(

gestaoContratos.Inicia(contrato);

var ponto = RegistroPontosService.CriaPonto(transaction);
var ponto = RegistroPontosFacade.CriaPonto(transaction);

ponto.MomentoId = MomentoEnum.Entrada;

registroPontos.Inicia(ponto);

var comprovante = BackupComprovantesService.CriaComprovante(transaction);
var comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

backupComprovantes.Inicia(comprovante);

Expand All @@ -100,7 +100,7 @@ public void SetupTestUsers(

var competencia = new DateTime(hoje.Year, hoje.Month, 1);

var folha = GestaoFolhaService.IniciarAberturaFolha(transaction);
var folha = GestaoFolhaFacade.IniciarAberturaFolha(transaction);

folha.AssociarAo(contrato);

Expand Down
2 changes: 1 addition & 1 deletion src/MeuPonto.Web/Pages/Contratos/Criar.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public IActionResult OnGet()
{
var transaction = User.CreateTransaction();

AberturaContrato = GestaoContratosService.InciarAberturaContrato(transaction);
AberturaContrato = GestaoContratosFacade.InciarAberturaContrato(transaction);

ViewData["EmpregadorId"] = new SelectList(_db.Empregadores.Where(x => x.UserId == User.GetUserId()), "Id", "Nome").AddEmptyValue();

Expand Down
2 changes: 1 addition & 1 deletion src/MeuPonto.Web/Pages/Pontos/Comprovantes/Criar.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<IActionResult> OnGet()
{
var transaction = User.CreateTransaction();

Comprovante = BackupComprovantesService.CriaComprovante(transaction);
Comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

var ponto = await _db.Pontos
.Include(x => x.Contrato)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public IActionResult OnGet()
{
var transaction = User.CreateTransaction();

Comprovante = BackupComprovantesService.CriaComprovante(transaction);
Comprovante = BackupComprovantesFacade.CriaComprovante(transaction);

Comprovante.TipoImagemId = TipoImagemEnum.Original;

Expand Down
2 changes: 1 addition & 1 deletion src/MeuPonto.Web/Pages/Pontos/Marcar.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public IActionResult OnGet()
{
var transaction = User.CreateTransaction();

Ponto = RegistroPontosService.CriaPonto(transaction);
Ponto = RegistroPontosFacade.CriaPonto(transaction);

Ponto.DataHora = _dateTimeSnapshot.GetDateTimeUntilMinutes();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MeuPonto.Models;
using System.Transactions;

namespace MeuPonto.Services;
namespace MeuPonto.Features;

public static class BackupComprovantesService
public static class BackupComprovantesFacade
{
public static Comprovante CriaComprovante(TransactionContext transaction)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MeuPonto.Models;
using System.Transactions;

namespace MeuPonto.Services;
namespace MeuPonto.Features;

public static class CadastroEmpregadoresService
public static class CadastroEmpregadoresFacade
{
public static Empregador CriaEmpregador(TransactionContext transaction)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MeuPonto.Models;
using System.Transactions;

namespace MeuPonto.Services;
namespace MeuPonto.Features;

public static class GestaoContratosService
public static class GestaoContratosFacade
{
public static Contrato InciarAberturaContrato(TransactionContext transaction)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MeuPonto.Models;
using System.Transactions;

namespace MeuPonto.Services;
namespace MeuPonto.Features;

public static class GestaoFolhasService
public static class GestaoFolhaFacade
{
public static Folha CriaFolha(TransactionContext transaction)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MeuPonto.Models;
using System.Transactions;

namespace MeuPonto.Services;
namespace MeuPonto.Features;

public static class RegistroPontosService
public static class RegistroPontosFacade
{
public static Ponto CriaPonto(TransactionContext transaction)
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Timesheet.Features.CadastroEmpregadores;

public static class CadastroEmpregadoresService
public static class CadastroEmpregadoresFacade
{
public static Empregador CriaEmpregador(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Timesheet.Features.GestaoContratos;

public static class GestaoContratosService
public static class GestaoContratosFacade
{
public static Contrato InciarAberturaContrato(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Timesheet.Features.GestaoFolha;

public static class GestaoFolhaService
public static class GestaoFolhaFacade
{
public static Folha IniciarAberturaFolha(this TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Timesheet.Features.RegistroPontos;

public static class RegistroPontosService
public static class RegistroPontosFacade
{
public static Ponto CriaPonto(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Timesheet.Features.BackupComprovantes;

public static class BackupComprovantesService
public static class BackupComprovantesFacade
{
public static Comprovante CriaComprovante(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Timesheet.Features.CadastroEmpregadores;

public static class CadastroEmpregadores
public static class CadastroEmpregadoresFacade
{
public static Empregador CriaEmpregador(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Timesheet.Features.GestaoContratos;

public static class GestaoContratosService
public static class GestaoContratosFacade
{
public static Contrato InciarAberturaContrato(TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Timesheet.Features.GestaoFolha;

public static class GestaoFolhaService
public static class GestaoFolhaFacade
{
public static Folha IniciarAberturaFolha(this TransactionContext transaction, Guid? id = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Timesheet.Features.RegistroPontos;

public static class RegistroPontosService
public static class RegistroPontosFacade
{
public static Ponto CriaPonto(TransactionContext transaction, Guid? id = null)
{
Expand Down

0 comments on commit 4ba2947

Please sign in to comment.