-
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
1 parent
dabf084
commit 04534fa
Showing
21 changed files
with
112 additions
and
5 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/cnab/entitys/detalhe-a.entity.ts → src/cnab/entity/detalhe-a.entity.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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
import { EntityHelper } from '../../utils/entity-helper'; | ||
@Entity() | ||
class TransacaoClienteItem extends EntityHelper{ | ||
id_item_transacao:number; | ||
id_cliente_favorecido:number; | ||
} | ||
|
||
function Entity(): (target: typeof TransacaoClienteItem) => void | typeof TransacaoClienteItem { | ||
throw new Error('Function not implemented.'); | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Empty file.
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,10 @@ | ||
class TransacaoListener{ | ||
|
||
private transacaoService:TransacaoService; | ||
|
||
//rodar as 09:00 e as 14:00 | ||
function JobTransaction(){ | ||
transacaoService.insereTransacoes(); | ||
} | ||
|
||
} |
Empty file.
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 @@ | ||
//metodo de insert cliente favorecido |
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,9 @@ | ||
class Pagador { | ||
|
||
|
||
function getPagador(tipo:string):Pagador{//Saber se é fase 4 ou CCT pra pegar o pagador | ||
//Se o tipo for CCT pagador 2 | ||
//Senao 1 | ||
|
||
} | ||
} |
Empty file.
Empty file.
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,30 @@ | ||
import { UsersService } from 'src/users/users.service'; | ||
import { ClienteFavorecido } from './../entitys/cliente-favorecido.entity'; | ||
|
||
class ClienteFavorecidoService{ | ||
|
||
private clienteFavorecido: ClienteFavorecidoRepository; | ||
|
||
private userService: UsersService; | ||
|
||
function insertClienteFavorecido(){ | ||
|
||
// userService.get | ||
|
||
for{ | ||
//veirificar se o usuario já existe na base | ||
ClienteFavorecido.findByCpfCnj(cpf_cnpj); | ||
|
||
|
||
// de/para -> user / Cliente | ||
|
||
//se não existir | ||
|
||
clienteFavorecido.insere(); | ||
|
||
//Se exitir | ||
ClienteFavorecido.atualiza(); | ||
} | ||
} | ||
|
||
} |
Empty file.
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,47 @@ | ||
|
||
class TransacaoService{ | ||
|
||
|
||
private transacoesRepository: TransacoesRepository; | ||
|
||
private itemTransacaoRepository: ItemTransacoesRepository; | ||
|
||
private clienteFavorecidoService: ClienteFavorecidoService; | ||
|
||
private pagadorService: PagadorService; | ||
|
||
function insereTransacoes(){ | ||
//metodo de inserir cliente Favorecido | ||
var listaCliente = clienteFavorecidoService.insere(); | ||
//TransacoesFernanda buscar | ||
var transacoesFernanda = buscar; | ||
|
||
//percorrer todas a transações e inserir na tabela transacao | ||
for(transacaoFernada : transacoesFernanda) { | ||
|
||
//metodo de consultar o pagador | ||
var pagador = pagadorService.getPagador(2):Pagador; | ||
transacao.idPagador = idPagador; | ||
transacao.nome = transacaoFernanda.nome; | ||
//preencher o objeto transacao e inserir na base (id_pagador parte desse obj) | ||
|
||
var id_transacao = transacoesRepository.insert(transacao) | ||
|
||
//buscar todas as ordens de pagamento por idTransacaoFernanda | ||
var ordensPgto = buscarOrder(transacaoFernada.idTransacaoFernanda); | ||
for(ordemPgto:ordensPgto){ | ||
|
||
var id_cliente_favorecido = listaCliente.findByCPFCNPJ(ordemPgto.cpf_enpj); | ||
itemTransacao.id_cliente_favorecido = id_cliente_favorecido; | ||
//insere o item detalhamento | ||
itemTransacao.id_transacao = id_transacao; | ||
itemTransacao.idClientFavorecido = idClienteFavorecido; | ||
itemTransacao.dt_transacao = ordemPgto.dt_transacao; | ||
|
||
itemTransacaoRepository.insere(itemTransacao); | ||
} | ||
|
||
} | ||
|
||
} | ||
} |