Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBellas committed Feb 18, 2024
2 parents fcf079c + 6fb939f commit 08eaf8e
Show file tree
Hide file tree
Showing 8 changed files with 768 additions and 543 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Pacote de integração com a [API v3 do ERP Bling](https://developer.bling.com.br)
para Javascript/TypeScript. O mais completo existente.

Atualizado com a versão `v292` da API ([veja o registro de alterações](https://developer.bling.com.br/changelogs#2024-01-31)).
Atualizado com a versão `v294` da API ([veja o registro de alterações](https://developer.bling.com.br/changelogs#2024-02-15)).

**Atenção**: a versão 5.0.0+ do `bling-erp-api` para Javascript/TypeScript
utiliza a API v3 do Bling. Caso deseja utilizar a API v2 do Bling,
Expand Down
1,267 changes: 730 additions & 537 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bling-erp-api",
"version": "5.3.0",
"version": "5.4.0",
"description": "Pacote de integração com a API do Bling ERP",
"main": "lib/bling.js",
"directories": {
Expand Down Expand Up @@ -67,4 +67,4 @@
"publishConfig": {
"access": "public"
}
}
}
14 changes: 13 additions & 1 deletion src/entities/contasContabeis/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Chance } from 'chance'
import { ContasContabeis } from '..'
import { InMemoryBlingRepository } from '../../../repositories/bling-in-memory.repository'
import { IFindResponse } from '../interfaces/find.interface'
import { IGetResponse } from '../interfaces/get.interface'
import findResponse from './find-response'
import getResponse from './get-response'

Expand Down Expand Up @@ -29,10 +31,17 @@ describe('Contas contábeis entity', () => {
endpoint: 'contas-contabeis',
params: {
limite: undefined,
pagina: undefined
pagina: undefined,
ocultarInvisiveis: undefined,
ocultarContasIntegracaoPagamento: undefined,
ocultarTipoContaBancaria: undefined,
situacoes: undefined
}
})
expect(response).toBe(getResponse)

const typingResponseTest: IGetResponse = getResponse
expect(typingResponseTest).toBe(getResponse)
})

it('should find successfully', async () => {
Expand All @@ -47,5 +56,8 @@ describe('Contas contábeis entity', () => {
id: String(idContaContabil)
})
expect(response).toBe(findResponse)

const typingResponseTest: IFindResponse = findResponse
expect(typingResponseTest).toBe(findResponse)
})
})
7 changes: 6 additions & 1 deletion src/entities/contasContabeis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export class ContasContabeis extends Entity {
endpoint: 'contas-contabeis',
params: {
pagina: params?.pagina,
limite: params?.limite
limite: params?.limite,
ocultarInvisiveis: params?.ocultarInvisiveis,
ocultarContasIntegracaoPagamento:
params?.ocultarContasIntegracaoPagamento,
ocultarTipoContaBancaria: params?.ocultarTipoContaBancaria,
situacoes: params?.situacoes
}
})
}
Expand Down
6 changes: 6 additions & 0 deletions src/entities/contasContabeis/interfaces/get.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { ISituacao } from '../types/situacao.type'

export interface IGetParams {
pagina?: number
limite?: number
ocultarInvisiveis?: boolean
ocultarContasIntegracaoPagamento?: boolean
ocultarTipoContaBancaria?: boolean
situacoes?: ISituacao[]
}

export interface IGetResponse {
Expand Down
9 changes: 9 additions & 0 deletions src/entities/contasContabeis/types/situacao.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Tipagem representativa da situação da conta contábil.
*
* `1`: Ativo
* `2`: Inativo
* `3`: Pendente
* `4`: Cancelada
*/
export type ISituacao = 1 | 2 | 3 | 4
2 changes: 1 addition & 1 deletion src/repositories/bling.repository.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
export type IDefaultParams = Record<
string,
number | number[] | string | string[] | Date | undefined
number | number[] | string | string[] | boolean | Date | undefined
>

/**
Expand Down

0 comments on commit 08eaf8e

Please sign in to comment.