Skip to content

Commit

Permalink
Merge pull request #203 from RJ-SMTR/feature/#196-cnab-jae-2
Browse files Browse the repository at this point in the history
Feature/#196 cnab jae 2
  • Loading branch information
williamfl2007 committed Mar 5, 2024
2 parents 21f6668 + 117c36a commit 2bbffd9
Show file tree
Hide file tree
Showing 31 changed files with 716 additions and 241 deletions.
274 changes: 274 additions & 0 deletions src/bigquery/entities/ordem-pagamento.bigquery-entity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { HttpStatus } from "@nestjs/common";
import { CommonHttpException } from "src/utils/http-exception/common-http-exception";

export class BigqueryOrdemPagamento {
/** Data da ordem de pagamento (partição) */
data_ordem: string | null;
Expand Down Expand Up @@ -85,4 +88,275 @@ export class BigqueryOrdemPagamento {

/** Código de controle de versão do dado (SHA Github) */
versao: string | null;

/**
* Get field validated
* @throws `HttpException`
*/
getDataOrdem(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.data_ordem) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'data_ordem', args);
}
return this.data_ordem;
}

/**
* Get field validated
* @throws `HttpException`
*/
getDataPagamento(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.data_pagamento) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'data_pagamento', args);
}
return this.data_pagamento;
}

/**
* Get field validated
* @throws `HttpException`
*/
getConsorcio(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.consorcio) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'consorcio', args);
}
return this.consorcio;
}

/**
* Get field validated
* @throws `HttpException`
*/
getOperadora(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.operadora) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'operadora', args);
}
return this.operadora;
}

/**
* Get field validated
* @throws `HttpException`
*/
getServico(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.servico) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'servico', args);
}
return this.servico;
}

/**
* Get field validated
* @throws `HttpException`
*/
getIdOrdemRessarcimento(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): string {
if (!this.id_ordem_ressarcimento) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'id_ordem_ressarcimento', args);
}
return this.id_ordem_ressarcimento;
}

/**
* Get field validated
* @throws `HttpException`
*/
getQuantidadeTransacaoRateioCredito(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.quantidade_transacao_rateio_credito === null
|| this.quantidade_transacao_rateio_credito === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'quantidade_transacao_rateio_credito', args);
}
return this.quantidade_transacao_rateio_credito;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorRateioCredito(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_rateio_credito === null
|| this.valor_rateio_credito === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'valor_rateio_credito', args);
}
return this.valor_rateio_credito;
}

/**
* Get field validated
* @throws `HttpException`
*/
getQuantidadeTransacaoRateioDebito(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.quantidade_transacao_rateio_debito === null
|| this.quantidade_transacao_rateio_debito === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'quantidade_transacao_rateio_debito', args);
}
return this.quantidade_transacao_rateio_debito;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorRateioDebito(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_rateio_debito === null
|| this.valor_rateio_debito === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'valor_rateio_debito', args);
}
return this.valor_rateio_debito;
}

/**
* Get field validated
* @throws `HttpException`
*/
getQuantidadeTotalTransacao(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.quantidade_total_transacao === null
|| this.quantidade_total_transacao === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'quantidade_total_transacao', args);
}
return this.quantidade_total_transacao;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorTotalTransacaoBruto(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_total_transacao_bruto === null
|| this.valor_total_transacao_bruto === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'valor_total_transacao_bruto', args);
}
return this.valor_total_transacao_bruto;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorDescontoTaxa(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_desconto_taxa === null
|| this.valor_desconto_taxa === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'valor_desconto_taxa', args);
}
return this.valor_desconto_taxa;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorTotalTransacaoLiquido(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_total_transacao_liquido === null
|| this.valor_total_transacao_liquido === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento', 'valor_total_transacao_liquido', args);
}
return this.valor_total_transacao_liquido;
}

/**
* Get field validated
* @throws `HttpException`
*/
getQuantidadeTotalTransacaoCaptura(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.quantidade_total_transacao_captura === null
|| this.quantidade_total_transacao_captura === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento',
'quantidade_total_transacao_captura',
args);
}
return this.quantidade_total_transacao_captura;
}

/**
* Get field validated
* @throws `HttpException`
*/
getValorTotalTransacaoCaptura(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): number {
if (this.valor_total_transacao_captura === null
|| this.valor_total_transacao_captura === undefined) {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento',
'valor_total_transacao_captura',
args);
}
return this.valor_total_transacao_captura;
}

/**
* Get field validated
* @throws `HttpException`
*/
getIndicadorOrdemValida(args?: {
errorMessage?: string;
httpStatusCode?: HttpStatus;
}): boolean {
if (typeof this.indicador_ordem_valida !== 'boolean') {
throw CommonHttpException.invalidField(
'BigqueryOrdemPagamento',
'indicador_ordem_valida',
args);
}
return this.indicador_ordem_valida;
}
}
Empty file.
19 changes: 0 additions & 19 deletions src/cnab/cnab-caixa.service.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/cnab/cnab.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { CnabService } from './cnab.service';
import { CnabService } from './service/cnab.service';

@Module({
providers: [CnabService],
})
export class CnabModule {}
export class CnabModule { }
4 changes: 0 additions & 4 deletions src/cnab/cnab.service.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/cnab/dto/detalhe-a.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DetalheADTO {

@ValidateIf(isCreate)
@IsNotEmpty()
num_doc_lancamento?: string;
num_doc_lancamento?: number;

@ValidateIf(isCreate)
@IsNotEmpty()
Expand Down
3 changes: 2 additions & 1 deletion src/cnab/dto/detalhe-b.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export class DetalheBDTO {

@ValidateIf(isCreate)
@IsNotEmpty()
nsr?: string;
nsr?: number;

@ValidateIf(isCreate)
@IsNotEmpty()
data_vencimento?: Date;
}

39 changes: 33 additions & 6 deletions src/cnab/dto/item-transacao.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
import { IsNotEmpty, ValidateIf } from "class-validator";

function isCreate(object: ItemTransacaoDTO): boolean {
return object.id_item_transacao === undefined;
}

export class ItemTransacaoDTO {
id_item_transacao: number;
dt_transacao: Date;
dt_processamento;
dt_captura;
modo: string;
id_cliente_favorecido:number;
constructor(dto?: ItemTransacaoDTO) {
if (dto) {
Object.assign(this, dto);
}
}

id_item_transacao?: number;

@ValidateIf(isCreate)
@IsNotEmpty()
dt_transacao?: Date;

@ValidateIf(isCreate)
@IsNotEmpty()
dt_processamento?: Date;

@ValidateIf(isCreate)
@IsNotEmpty()
dt_captura?: Date;

@ValidateIf(isCreate)
@IsNotEmpty()
modo?: string;

@ValidateIf(isCreate)
@IsNotEmpty()
id_cliente_favorecido?: number;
}
Loading

0 comments on commit 2bbffd9

Please sign in to comment.