-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
938 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/bigquery/interfaces/bq-get-week-transacao-by.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface IBqGetWeekTransacao { | ||
cpfCnpj: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Injectable, Logger } from '@nestjs/common'; | ||
import { nextFriday } from 'date-fns'; | ||
import { getPaymentWeek } from 'src/utils/payment-date-utils'; | ||
import { BigqueryTransacao } from '../entities/transacao.bigquery-entity'; | ||
import { BigqueryTransacaoRepository } from '../repositories/bigquery-transacao.repository'; | ||
|
||
@Injectable() | ||
export class BigqueryTransacaoService { | ||
private logger: Logger = new Logger('BigqueryTransacaoService', { | ||
timestamp: true, | ||
}); | ||
|
||
constructor( | ||
private readonly bigqueryTransacaoRepository: BigqueryTransacaoRepository, | ||
) {} | ||
|
||
/** | ||
* Get data from current payment week (from thu to wed) | ||
*/ | ||
public async getTransacaoOfCurrentWeek(): Promise<BigqueryTransacao[]> { | ||
const paymentWeek = getPaymentWeek(nextFriday(new Date())); | ||
return this.bigqueryTransacaoRepository.findTransacaoBy({ | ||
startDate: paymentWeek.startDate, | ||
endDate: paymentWeek.endDate, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { IsNotEmpty, ValidateIf } from 'class-validator'; | ||
|
||
function isCreate(object: SaveClienteFavorecidoDto): boolean { | ||
return object.id_cliente_favorecido === undefined; | ||
} | ||
|
||
export class SaveClienteFavorecidoDto { | ||
id_cliente_favorecido?: number; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
nome?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
cpf_cnpj?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
cod_banco?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
agencia?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
dv_agencia?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
conta_corrente?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
dv_conta_corrente?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
logradouro?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
numero?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
complemento?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
bairro?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
cidade?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
cep?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
complemento_cep?: string; | ||
|
||
@ValidateIf(isCreate) | ||
@IsNotEmpty() | ||
uf?: string; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.