Skip to content

Commit

Permalink
fix: resolve merge ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yxuo committed Mar 5, 2024
1 parent 15e69ce commit d5684da
Show file tree
Hide file tree
Showing 23 changed files with 605 additions and 160 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.
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;
}
6 changes: 3 additions & 3 deletions src/cnab/dto/transacao.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export class TransacaoDTO {

@ValidateIf(isCreate)
@IsNotEmpty()
dt_ordem?: string;
dt_ordem?: Date;

@ValidateIf(isCreate)
@IsNotEmpty()
dt_pagamento?: string;
dt_pagamento?: Date;

@ValidateIf(isCreate)
@IsNotEmpty()
Expand Down Expand Up @@ -72,7 +72,7 @@ export class TransacaoDTO {
vlr_total_transacao_captura?: number;

@ValidateIf(isCreate)
indicador_ordem_valida?: string;
indicador_ordem_valida?: boolean;

@ValidateIf(isCreate)
@IsNotEmpty()
Expand Down
Loading

0 comments on commit d5684da

Please sign in to comment.