7vsdk-pessoas 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { UfRequest, UfResponse } from "7vdomain";
2
- import { CrudClientBase } from "7vsdk-usuarios";
2
+ import { CrudClientBase } from "../base";
3
3
  export declare class UfClient extends CrudClientBase<UfRequest, UfResponse> {
4
4
  constructor(Url: string, tokenJwt: string);
5
5
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UfClient = void 0;
4
- const _7vsdk_usuarios_1 = require("7vsdk-usuarios");
5
- class UfClient extends _7vsdk_usuarios_1.CrudClientBase {
4
+ const base_1 = require("../base");
5
+ class UfClient extends base_1.CrudClientBase {
6
6
  constructor(Url, tokenJwt) {
7
7
  super(Url, "api/endereco/uf", tokenJwt);
8
8
  }
@@ -1,7 +1,6 @@
1
1
  import type { PessoaCnpjRequest, PessoaCnpjResponse } from "7vdomain";
2
2
  import { CrudClientBase } from "../base/CrudClientBase.js";
3
- export declare class PessoaCnpjClient extends CrudClientBase<PessoaCnpjResponse, PessoaCnpjRequest> {
4
- constructor(server: {
5
- Url: string;
6
- }, tokenJwt: string);
3
+ export declare class PessoaCnpjClient extends CrudClientBase<PessoaCnpjRequest, PessoaCnpjResponse> {
4
+ constructor(Url: string, tokenJwt: string);
5
+ postarPessoaCnpj(pessoaId: number, numero: string, ie: string, regimeTributario: number, lucroReal: boolean, industria: boolean): Promise<PessoaCnpjResponse>;
7
6
  }
@@ -3,8 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PessoaCnpjClient = void 0;
4
4
  const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
5
5
  class PessoaCnpjClient extends CrudClientBase_js_1.CrudClientBase {
6
- constructor(server, tokenJwt) {
7
- super(server.Url, "api/pessoa/cnpj", tokenJwt);
6
+ constructor(Url, tokenJwt) {
7
+ super(Url, "api/pessoa/cnpj", tokenJwt);
8
+ }
9
+ async postarPessoaCnpj(pessoaId, numero, ie, regimeTributario, lucroReal, industria) {
10
+ const request = {
11
+ Ie: ie,
12
+ Numero: numero,
13
+ PessoaId: pessoaId,
14
+ RegimeTributario: regimeTributario,
15
+ LucroReal: lucroReal,
16
+ Industria: industria
17
+ };
18
+ return await this.postAsync(request);
8
19
  }
9
20
  }
10
21
  exports.PessoaCnpjClient = PessoaCnpjClient;
@@ -1,16 +1,14 @@
1
- import { EmpresaRequest, EmpresaResponse } from "7vdomain";
1
+ import { EmpresaRequest, EmpresaResponse, EnderecoRequest, PessoaTelefoneRequest } from "7vdomain";
2
2
  import { CrudClientBase } from "../base";
3
- interface IEmpresaSdk {
4
- criarEmpresa(request: EmpresaRequest): Promise<EmpresaResponse>;
5
- pegarEmpresa(id: number): Promise<EmpresaResponse>;
6
- deletarEmpresa(id: number): Promise<void>;
7
- pegarEmpresaPaginacao(page: number, size: number): Promise<EmpresaResponse[]>;
8
- }
9
- export declare class EmpresaSdk extends CrudClientBase<EmpresaRequest, EmpresaResponse> implements IEmpresaSdk {
3
+ export declare class EmpresaSdk extends CrudClientBase<EmpresaRequest, EmpresaResponse> {
4
+ private pessoaSdk;
5
+ private enderecoSdk;
6
+ private pessoaCnpj;
10
7
  constructor(Url: string, tokenJwt: string);
11
- criarEmpresa(request: EmpresaRequest): Promise<EmpresaResponse>;
12
- pegarEmpresa(id: number): Promise<EmpresaResponse>;
13
- deletarEmpresa(id: number): Promise<void>;
14
- pegarEmpresaPaginacao(page: number, size: number): Promise<EmpresaResponse[]>;
8
+ criarEmpresaRoot(cnpj: string, ie: string, regimeTributario: number, razaoSocial: string, lucroReal: boolean, industria: boolean): Promise<void>;
9
+ incluirEmpresaRootCompleto(cnpj: string, razaoSocial: string, endereco: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): Promise<void>;
10
+ incluirClientePj(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string): Promise<void>;
11
+ incluirClientePjCompleto(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string, endereco: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): Promise<void>;
12
+ incluirClientePf(cnpjPai: string, cpfFilho: string, nomeCompletoFilho: string): Promise<void>;
13
+ incluirClientePfCompleto(cnpjPai: string, cpfFilho: string, nomeCompletoFilho: string, endereco: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): Promise<void>;
15
14
  }
16
- export {};
@@ -2,21 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmpresaSdk = void 0;
4
4
  const base_1 = require("../base");
5
+ const pessoas_1 = require("../pessoas");
6
+ const EnderecoCidadeClient_1 = require("../enderecos/EnderecoCidadeClient");
5
7
  class EmpresaSdk extends base_1.CrudClientBase {
6
8
  constructor(Url, tokenJwt) {
7
9
  super(Url, "portal-contador/empresa", tokenJwt);
10
+ this.pessoaSdk = new pessoas_1.PessoaClient(this.baseUrl, this.tokenJwt);
11
+ this.enderecoSdk = new EnderecoCidadeClient_1.EnderecoCidadeClient(this.baseUrl, this.tokenJwt);
12
+ this.pessoaCnpj = new pessoas_1.PessoaCnpjClient(this.baseUrl, this.tokenJwt);
8
13
  }
9
- async criarEmpresa(request) {
10
- return await this.postAsync(request);
14
+ async criarEmpresaRoot(cnpj, ie, regimeTributario, razaoSocial, lucroReal, industria) {
15
+ if (regimeTributario < 1 || regimeTributario > 3)
16
+ throw new Error("Regime tributário inválido. Use 1 para Simples Nacional, 2 para Lucro Presumido ou 3 para Lucro Real.");
17
+ const pessoaMandou = await this.pessoaSdk.postarPessoa(razaoSocial, "I");
18
+ await this.pessoaCnpj.postarPessoaCnpj(pessoaMandou.PessoaId, cnpj, ie, regimeTributario, lucroReal, industria);
11
19
  }
12
- async pegarEmpresa(id) {
13
- return await this.getAsync(id);
20
+ async incluirEmpresaRootCompleto(cnpj, razaoSocial, endereco, telefones) {
14
21
  }
15
- async deletarEmpresa(id) {
16
- return await this.deleteAsync(id);
22
+ async incluirClientePj(cnpjPai, cnpjFilho, razaoSocialFilho) {
17
23
  }
18
- async pegarEmpresaPaginacao(page, size) {
19
- return await this.getPagedAsync(page, size);
24
+ async incluirClientePjCompleto(cnpjPai, cnpjFilho, razaoSocialFilho, endereco, telefones) {
25
+ }
26
+ async incluirClientePf(cnpjPai, cpfFilho, nomeCompletoFilho) {
27
+ }
28
+ async incluirClientePfCompleto(cnpjPai, cpfFilho, nomeCompletoFilho, endereco, telefones) {
20
29
  }
21
30
  }
22
31
  exports.EmpresaSdk = EmpresaSdk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "7vsdk-pessoas",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  import { UfRequest, UfResponse } from "7vdomain";
2
- import { CrudClientBase } from "7vsdk-usuarios";
2
+ import { CrudClientBase } from "../base";
3
3
 
4
4
  export class UfClient extends CrudClientBase<UfRequest, UfResponse>
5
5
  {
@@ -1 +0,0 @@
1
- {"root":["../src/index.ts","../src/clients/index.ts","../src/clients/base/crudclientbase.ts","../src/clients/base/index.ts","../src/clients/enderecos/enderecobairroclient.ts","../src/clients/enderecos/enderecocidadeclient.ts","../src/clients/enderecos/enderecosdk.ts","../src/clients/enderecos/ufclient.ts","../src/clients/enderecos/index.ts","../src/clients/pessoas/pessoaclient.ts","../src/clients/pessoas/pessoacnpjclient.ts","../src/clients/pessoas/pessoacpfclient.ts","../src/clients/pessoas/pessoaemailclient.ts","../src/clients/pessoas/pessoaenderecoclient.ts","../src/clients/pessoas/pessoanascimentoclient.ts","../src/clients/pessoas/pessoanecessidadeespecial.ts","../src/clients/pessoas/pessoaprocedimentoclient.ts","../src/clients/pessoas/pessoarelacaoclient.ts","../src/clients/pessoas/pessoarelacaogrupoclient.ts","../src/clients/pessoas/pessoarelacaotipoclient.ts","../src/clients/pessoas/pessoatelefoneclient.ts","../src/clients/pessoas/pessoatipoclient.ts","../src/clients/pessoas/index.ts","../src/clients/portalcontador/empresasdk.ts","../src/clients/portalcontador/impostoestadualsdk.ts","../src/clients/portalcontador/impostofederalsdk.ts","../src/clients/portalcontador/index.ts"],"version":"5.9.3"}