-
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
2c9e645
commit d99145b
Showing
4 changed files
with
90 additions
and
42 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
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,24 @@ | ||
import { OfficeDto, OfficeReadDto } from '../../cnpja/cnpja.dto'; | ||
import { HttpService } from '../../http/http.service'; | ||
|
||
export class OpenOfficeService { | ||
|
||
public constructor( | ||
private httpService: HttpService, | ||
) { } | ||
|
||
/** | ||
* ### Consulta CNPJ | ||
* Adquire de forma centralizada múltiplas informações de um estabelecimento, incluindo Receita Federal, | ||
* Simples Nacional, Cadastro de Contribuintes e SUFRAMA. | ||
* @param params | ||
*/ | ||
public read(params: Pick<OfficeReadDto, 'taxId'>): Promise<OfficeDto> { | ||
const { taxId } = params; | ||
|
||
return this.httpService.get('office/:taxId', { | ||
replacements: { taxId }, | ||
}); | ||
} | ||
|
||
} |
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,24 @@ | ||
import { HttpService } from '../http/http.service'; | ||
import { OpenOfficeService } from './office/open.office.service'; | ||
|
||
export class CnpjaOpen { | ||
|
||
/** Operações relacionadas a API de Estabelecimentos. */ | ||
public office: OpenOfficeService; | ||
|
||
public constructor() { | ||
this.setup(); | ||
} | ||
|
||
/** | ||
* Resolve dependency tree and inject providers. | ||
*/ | ||
private setup(): void { | ||
const httpService = new HttpService({ | ||
baseUrl: 'https://open.cnpja.com', | ||
}); | ||
|
||
this.office = new OpenOfficeService(httpService); | ||
} | ||
|
||
} |