Skip to content

Commit

Permalink
Merge pull request #1 from lucasmoraes804/main
Browse files Browse the repository at this point in the history
Aceitar SandBox nas APIs de cobrança
  • Loading branch information
RafaelEstevamReis authored Oct 3, 2024
2 parents e588503 + 42cd1e8 commit b2250cc
Show file tree
Hide file tree
Showing 34 changed files with 1,029 additions and 115 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

.idea/
17 changes: 17 additions & 0 deletions Sicoob.Cobranca/DataAnotation/CustomDateTimeWithZoneConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Newtonsoft.Json.Converters;

public class CustomDateTimeWithZoneConverter : IsoDateTimeConverter
{
public CustomDateTimeWithZoneConverter()
{
DateTimeFormat = "yyyy-MM-ddTHH:mm:sszzz";
}
}

public class CustomDateTimeConverter : IsoDateTimeConverter
{
public CustomDateTimeConverter()
{
DateTimeFormat = "yyyy-MM-dd";
}
}
5 changes: 3 additions & 2 deletions Sicoob.Cobranca/Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Sicoob.Cobranca;
using Sicoob.Cobranca.Models.v2;

namespace Sicoob.Cobranca;

using Sicoob.Cobranca.Models;
using System;
using System.Collections.Generic;
using System.IO.Compression;
Expand Down
7 changes: 7 additions & 0 deletions Sicoob.Cobranca/Models/Shared/Beneficiariofinal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Sicoob.Cobranca.Models.Shared;

public class Beneficiariofinal
{
public string? numeroCpfCnpj { get; set; }
public string? nome { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Sicoob.Cobranca.Models;
namespace Sicoob.Cobranca.Models.Shared;

public class DadosPagador
{
Expand Down
93 changes: 93 additions & 0 deletions Sicoob.Cobranca/Models/Shared/Enum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
namespace Sicoob.Cobranca.Models.Shared;


public enum IdentificacaoEmissaoBoleto: int
{
BancoEmite = 1,
ClienteEmite = 2
}

public enum IdentificacaoDistribuicaoBoleto : int
{
BancoDistribui = 1,
ClienteDistribui = 2
}

public enum TipoDesconto : int
{
SemDesconto = 0,
ValorFixoAteDataInformada = 1,
PercentualAteDataInformada = 2,
ValorPorAntecipacaoDiaCorrido = 3,
ValorPorAntecipacaoDiaUtil = 4,
PercentualPorAntecipacaoDiaCorrido = 5,
PercentualPorAntecipacaoDiaUtil = 6
}

public enum TipoJurosMora : int
{
ValorPorDia = 1,
TaxaMensal = 2,
Isento = 3
}

public enum TipoMulta : int
{
Isento = 0,
ValorFixo = 1,
Percentual = 2
}

public enum CodigoNegativacao : int
{
NegativarDiasUteis = 2,
NaoNegativar = 3
}

public enum CodigoProtesto : int
{
ProtestarDiasCorridos = 1,
ProtestarDiasUteis = 2,
NaoProtestar = 3,
}

public enum CodigoCadastrarPIX : int
{
Padrao = 0,
ComPIX = 1,
SemPIX = 1
}

public enum Modalidade : int
{
SimplesComRegistro = 1,
CarneDePagamentos = 5,
Indexada = 6,
CartaoDeCredito = 14
}
public struct SituacaoBoleto
{
public const string Liquidado = "Liquidado";
public const string EmAberto = "Em Aberto";
public const string Baixado = "Baixado";
}

public enum TipoHistorico : int
{
Entrada = 1,
Alteracao = 2,
Prorrogacao = 3,
Terifas = 4,
Protesto = 5,
LiquidacaoBaixa = 6
}

public enum Tipo
{
Entrada = 1,
Prorrogacao = 2,
A_Vencer = 3,
Vencido = 4,
Liquidacao = 5,
Baixa = 6,
}
10 changes: 10 additions & 0 deletions Sicoob.Cobranca/Models/Shared/Listahistorico.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace Sicoob.Cobranca.Models.Shared;

public class Listahistorico
{
public DateTime? dataHistorico { get; set; }
public int? tipoHistorico { get; set; }
public string? descricaoHistorico { get; set; }
}
18 changes: 18 additions & 0 deletions Sicoob.Cobranca/Models/Shared/Rateiocredito.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Sicoob.Cobranca.Models.Shared;

public class Rateiocredito
{
public int numeroBanco { get; set; }
public int numeroAgencia { get; set; }
public int numeroContaCorrente { get; set; }
public bool contaPrincipal { get; set; }
public int codigoTipoValorRateio { get; set; }
public decimal valorRateio { get; set; }
public int codigoTipoCalculoRateio { get; set; }
public string? numeroCpfCnpjTitular { get; set; }
public string? nomeTitular { get; set; }
public int codigoFinalidadeTed { get; set; }
public string? codigoTipoContaDestinoTed { get; set; }
public int quantidadeDiasFloat { get; set; }
public string? dataFloatCredito { get; set; }
}
7 changes: 7 additions & 0 deletions Sicoob.Cobranca/Models/Shared/RetornoArquivoMovimentacao.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Sicoob.Cobranca.Models.Shared;

public class RetornoArquivoMovimentacao
{
public string arquivo { get; set; }

Check warning on line 5 in Sicoob.Cobranca/Models/Shared/RetornoArquivoMovimentacao.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'arquivo' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public string nomeArquivo { get; set; }

Check warning on line 6 in Sicoob.Cobranca/Models/Shared/RetornoArquivoMovimentacao.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'nomeArquivo' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}
9 changes: 9 additions & 0 deletions Sicoob.Cobranca/Models/Shared/RetornoConsultaMovimentacoes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Sicoob.Cobranca.Models.Shared;

public class RetornoConsultaMovimentacoes
{
public string quantidadeTotalRegistros { get; set; }

Check warning on line 5 in Sicoob.Cobranca/Models/Shared/RetornoConsultaMovimentacoes.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'quantidadeTotalRegistros' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public int quantidadeRegistrosArquivo { get; set; }
public int quantidadeArquivo { get; set; }
public int[] idArquivos { get; set; }

Check warning on line 8 in Sicoob.Cobranca/Models/Shared/RetornoConsultaMovimentacoes.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'idArquivos' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Sicoob.Cobranca.Models.Shared;

public class RetornoSolicitacaoMovimentacoesCarteira
{
public string mensagem { get; set; }

Check warning on line 5 in Sicoob.Cobranca/Models/Shared/RetornoSolicitacaoMovimentacoesCarteira.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'mensagem' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public int codigoSolicitacao { get; set; }
}
21 changes: 21 additions & 0 deletions Sicoob.Cobranca/Models/v2/AlterarDataVencimento.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using Newtonsoft.Json;

namespace Sicoob.Cobranca.Models.v2;

public class AlterarDataVencimentoRequest : BoletoBase
{
[JsonConverter(typeof(CustomDateTimeWithZoneConverter))]
public DateTime dataVencimento { get; set; }
}

public class AlterarDataVencimentoResponse
{
public DadosDataVencimento[]? resultado { get; set; }
public ResultadoInfo?[] mensagens { get; set; }
}
public class DadosDataVencimento
{
public ResultadoInfo? status { get; set; }
public AlterarDataVencimentoRequest? boleto { get; set; }
}
17 changes: 17 additions & 0 deletions Sicoob.Cobranca/Models/v2/BaixarBoleto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Sicoob.Cobranca.Models.v2;

public class BaixarBoletoRequest : BoletoBase
{
public string seuNumero { get; set; }
}

public class BaixarBoletoResponse
{
public DadosBaixa[]? resultado { get; set; }
public ResultadoInfo? mensagens { get; set; }
}
public class DadosBaixa
{
public ResultadoInfo? status { get; set; }
public BaixarBoletoRequest? boleto { get; set; }
}
11 changes: 11 additions & 0 deletions Sicoob.Cobranca/Models/v2/BoletoBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Newtonsoft.Json;

namespace Sicoob.Cobranca.Models.v2;

public abstract class BoletoBase
{
public int numeroContrato { get; set; }
public int modalidade { get; set; } = 1; // Simples com Registro
[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
public int? nossoNumero { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Sicoob.Cobranca.Models;
using System;
using Sicoob.Cobranca.Models.Shared;

using System;
namespace Sicoob.Cobranca.Models.v2;

public class ConsultaBoletoRequest
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public class DadosBoleto
public DateTime dataVencimento { get; set; }
public DateTime dataLimitePagamento { get; set; }
public decimal valorAbatimento { get; set; }
public int tipoDesconto { get; set; }
public string tipoDesconto { get; set; }
public DateTime dataPrimeiroDesconto { get; set; }
public decimal valorPrimeiroDesconto { get; set; }
public DateTime dataSegundoDesconto { get; set; }
Expand Down Expand Up @@ -81,38 +82,8 @@ public class DadosBoleto
public string? qrCode { get; set; }
}

public class Beneficiariofinal
{
public string? numeroCpfCnpj { get; set; }
public string? nome { get; set; }
}

public class Mensagensinstrucao
{
public int tipoInstrucao { get; set; }
public string[] mensagens { get; set; }
}

public class Listahistorico
{
public DateTime dataHistorico { get; set; }
public string? tipoHistorico { get; set; }
public string? descricaoHistorico { get; set; }
}

public class Rateiocredito
{
public int numeroBanco { get; set; }
public int numeroAgencia { get; set; }
public int numeroContaCorrente { get; set; }
public bool contaPrincipal { get; set; }
public int codigoTipoValorRateio { get; set; }
public decimal valorRateio { get; set; }
public int codigoTipoCalculoRateio { get; set; }
public string? numeroCpfCnpjTitular { get; set; }
public string? nomeTitular { get; set; }
public int codigoFinalidadeTed { get; set; }
public string? codigoTipoContaDestinoTed { get; set; }
public int quantidadeDiasFloat { get; set; }
public string? dataFloatCredito { get; set; }
}
}
Loading

0 comments on commit b2250cc

Please sign in to comment.