sgp-sdk 1.2.0 → 2.0.0-beta.2
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.
- package/CHANGELOG.md +234 -0
- package/COMPATIBILITY.md +231 -0
- package/MIGRATION.md +344 -0
- package/README.md +464 -265
- package/dist/address.d.ts +46 -0
- package/dist/annotation-selection.d.ts +32 -0
- package/dist/budget.d.ts +29 -0
- package/dist/classify.d.ts +15 -0
- package/dist/client.d.ts +938 -165
- package/dist/config.d.ts +115 -0
- package/dist/constants.d.ts +85 -0
- package/dist/document.d.ts +11 -0
- package/dist/effect.d.ts +22 -0
- package/dist/executor.d.ts +9 -0
- package/dist/exposure.d.ts +21 -0
- package/dist/guards.d.ts +2 -0
- package/dist/hooks.d.ts +16 -0
- package/dist/ids.d.ts +19 -0
- package/dist/index.d.ts +55 -49
- package/dist/index.js +3750 -1293
- package/dist/normalize.d.ts +9 -0
- package/dist/operation-sensitivity.d.ts +729 -0
- package/dist/operation.d.ts +145 -0
- package/dist/operations/catalogs-list-billing-profiles.d.ts +16 -0
- package/dist/operations/catalogs-list-nas.d.ts +25 -0
- package/dist/operations/catalogs-list-pops.d.ts +14 -0
- package/dist/operations/contracts-check-connection.d.ts +56 -0
- package/dist/operations/contracts-list-services.d.ts +103 -0
- package/dist/operations/contracts-list-status-reasons.d.ts +15 -0
- package/dist/operations/contracts-list.d.ts +52 -0
- package/dist/operations/contracts-update-status.d.ts +41 -0
- package/dist/operations/contracts-update.d.ts +39 -0
- package/dist/operations/coverage-check-address.d.ts +46 -0
- package/dist/operations/coverage-check.d.ts +43 -0
- package/dist/operations/coverage-list-gateways.d.ts +16 -0
- package/dist/operations/crm-contracts-create-by-cpf-cnpj.d.ts +97 -0
- package/dist/operations/crm-contracts-create.d.ts +221 -0
- package/dist/operations/crm-contracts-list.d.ts +50 -0
- package/dist/operations/crm-customers-create.d.ts +165 -0
- package/dist/operations/crm-customers-update-status.d.ts +41 -0
- package/dist/operations/customers-list.d.ts +104 -0
- package/dist/{endpoints/ura/lookup-customer.d.ts → operations/customers-search.d.ts} +56 -46
- package/dist/operations/documents-add.d.ts +29 -0
- package/dist/operations/documents-list.d.ts +31 -0
- package/dist/operations/experimental-annotations-list.d.ts +67 -0
- package/dist/operations/invoices-list.d.ts +148 -0
- package/dist/operations/maintenance-list.d.ts +35 -0
- package/dist/operations/occurrences-create.d.ts +125 -0
- package/dist/operations/occurrences-list-methods.d.ts +14 -0
- package/dist/operations/occurrences-list-types.d.ts +20 -0
- package/dist/operations/occurrences-list.d.ts +127 -0
- package/dist/{endpoints/ura/list-plans.d.ts → operations/plans-list.d.ts} +33 -23
- package/dist/operations/pre-registrations-create.d.ts +276 -0
- package/dist/operations/pre-registrations-list-due-days.d.ts +15 -0
- package/dist/operations/pre-registrations-list-plans.d.ts +24 -0
- package/dist/operations/pre-registrations-list-sellers.d.ts +16 -0
- package/dist/operations/services-add-generic.d.ts +52 -0
- package/dist/operations/services-add-tv.d.ts +47 -0
- package/dist/operations/services-change-plan.d.ts +40 -0
- package/dist/operations/services-remove-generic.d.ts +28 -0
- package/dist/operations/services-remove-tv.d.ts +29 -0
- package/dist/operations/work-orders-get.d.ts +99 -0
- package/dist/operations/work-orders-list-comments.d.ts +34 -0
- package/dist/operations/work-orders-list-reasons.d.ts +20 -0
- package/dist/operations/work-orders-list.d.ts +81 -0
- package/dist/path.d.ts +13 -0
- package/dist/raw-request.d.ts +26 -0
- package/dist/request.d.ts +28 -0
- package/dist/result.d.ts +113 -41
- package/dist/retry.d.ts +34 -0
- package/dist/sensitivity.d.ts +89 -4
- package/dist/tolerant.d.ts +21 -0
- package/dist/validation.d.ts +3 -0
- package/package.json +6 -3
- package/dist/endpoint.d.ts +0 -66
- package/dist/endpoints/crm/address.d.ts +0 -20
- package/dist/endpoints/crm/create-contract.d.ts +0 -109
- package/dist/endpoints/crm/create-customer.d.ts +0 -65
- package/dist/endpoints/crm/update-customer-status.d.ts +0 -43
- package/dist/endpoints/os/list-occurrence-reasons.d.ts +0 -24
- package/dist/endpoints/os/list-occurrence-types.d.ts +0 -25
- package/dist/endpoints/precadastro/list-due-days.d.ts +0 -19
- package/dist/endpoints/precadastro/list-sellers.d.ts +0 -21
- package/dist/endpoints/suporte/add-customer-document.d.ts +0 -24
- package/dist/endpoints/suporte/list-customer-documents.d.ts +0 -25
- package/dist/endpoints/ura/check-coverage.d.ts +0 -46
- package/dist/endpoints/ura/list-annotations.d.ts +0 -32
- package/dist/endpoints/ura/list-clients.d.ts +0 -58
- package/dist/endpoints/ura/list-contracts.d.ts +0 -45
- package/dist/endpoints/ura/list-invoices.d.ts +0 -107
- package/dist/endpoints/ura/list-nas.d.ts +0 -29
- package/dist/endpoints/ura/list-occurrence-methods.d.ts +0 -19
- package/dist/endpoints/ura/list-payment-carriers.d.ts +0 -20
- package/dist/endpoints/ura/list-pops.d.ts +0 -19
- package/dist/endpoints/ura/list-service-orders.d.ts +0 -64
- package/dist/endpoints/ura/open-ticket.d.ts +0 -81
- package/dist/errors.d.ts +0 -59
- package/dist/schema/parse.d.ts +0 -19
- package/dist/schema/paths.d.ts +0 -38
- package/dist/transport.d.ts +0 -65
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { OperationDefinition } from "../operation.js";
|
|
2
|
+
import { type CrmContractCreateData, type CrmContractCreateInput } from "./crm-contracts-create.js";
|
|
3
|
+
/**
|
|
4
|
+
* Input of `crm.contracts.createByCpfCnpj`: the contract of `crm.contracts.create`
|
|
5
|
+
* (see `CrmContractCreateInput` for every field and whether it was exercised) addressed by the
|
|
6
|
+
* customer's document instead of the customer id, so there is no `cliente_id`. The "Exercised"
|
|
7
|
+
* markers of those fields come from the by-id route: NO field of this input ever reached a success
|
|
8
|
+
* on this route (its only live call was refused).
|
|
9
|
+
*/
|
|
10
|
+
export interface CrmContractCreateByCpfCnpjInput extends Omit<CrmContractCreateInput, "cliente_id"> {
|
|
11
|
+
/**
|
|
12
|
+
* Exercised (live, with a CPF in digits only). Required. The document of the CRM customer, sent
|
|
13
|
+
* in the query string of the POST as `cpfcnpj`, SGP's own name for a field that takes either
|
|
14
|
+
* kind: the API decides whether it is a CPF or a CNPJ. Only a CPF was ever sent; a CNPJ is
|
|
15
|
+
* accepted by the field's name and was never exercised. Sent as given: digits or formatted
|
|
16
|
+
* (`123.456.789-00`). Personal data: never log it.
|
|
17
|
+
*/
|
|
18
|
+
cpfcnpj: string;
|
|
19
|
+
}
|
|
20
|
+
/** INTERNAL. Validation of the input, exported so a test can check it against the public type. */
|
|
21
|
+
export declare const crmContractsCreateByCpfCnpjInputSchema: import("zod").ZodObject<{
|
|
22
|
+
pop_id: import("zod").ZodNumber;
|
|
23
|
+
plano_id: import("zod/v4/core").$ZodBranded<import("zod").ZodNumber, "PlanId", "out">;
|
|
24
|
+
portador_id: import("zod").ZodNumber;
|
|
25
|
+
forma_cobranca_codigo: import("zod").ZodNumber;
|
|
26
|
+
vencimento_dia: import("zod").ZodNumber;
|
|
27
|
+
endereco_instalacao: import("zod").ZodObject<{
|
|
28
|
+
numero: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
29
|
+
complemento: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
pais: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
pontoreferencia: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
map_ll: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
condominio: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
34
|
+
logradouro: import("zod").ZodString;
|
|
35
|
+
bairro: import("zod").ZodString;
|
|
36
|
+
cidade: import("zod").ZodString;
|
|
37
|
+
cep: import("zod").ZodString;
|
|
38
|
+
uf: import("zod").ZodString;
|
|
39
|
+
}, import("zod/v4/core").$strict>;
|
|
40
|
+
endereco_cobranca: import("zod").ZodObject<{
|
|
41
|
+
numero: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
42
|
+
complemento: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
pais: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
|
+
pontoreferencia: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
map_ll: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
|
+
condominio: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
47
|
+
logradouro: import("zod").ZodString;
|
|
48
|
+
bairro: import("zod").ZodString;
|
|
49
|
+
cidade: import("zod").ZodString;
|
|
50
|
+
cep: import("zod").ZodString;
|
|
51
|
+
uf: import("zod").ZodString;
|
|
52
|
+
}, import("zod/v4/core").$strict>;
|
|
53
|
+
login: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
senha: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
|
+
modoaquisicao: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<0>, import("zod").ZodLiteral<1>]>>;
|
|
56
|
+
nas: import("zod").ZodOptional<import("zod").ZodString>;
|
|
57
|
+
isento: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
58
|
+
autocobranca: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
59
|
+
servicodesc: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
observacao: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
vendedor_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
62
|
+
comissao_tipo: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<1>, import("zod").ZodLiteral<2>]>>;
|
|
63
|
+
comissao: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
64
|
+
contrato_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
65
|
+
fidelidade_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
66
|
+
midia_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
67
|
+
central_login: import("zod").ZodOptional<import("zod").ZodString>;
|
|
68
|
+
central_senha: import("zod").ZodOptional<import("zod").ZodString>;
|
|
69
|
+
ip: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
+
ippool_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
71
|
+
mac_dhcp: import("zod").ZodOptional<import("zod").ZodString>;
|
|
72
|
+
mac: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
logins_simult: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
+
splitter_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
75
|
+
splitter_port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
76
|
+
tipo_equipamento: import("zod").ZodOptional<import("zod").ZodString>;
|
|
77
|
+
usuarioalt_id: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
78
|
+
os_instalacao: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
79
|
+
conteudo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
instalacao_quantidade_parcelas: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
81
|
+
instalacao_preco: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
82
|
+
instalacao_desconto: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
83
|
+
instalacao_entrada: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
84
|
+
instalacao_entrada_forma: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
85
|
+
instalacao_parcela_forma: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
86
|
+
instalacao_portador: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
87
|
+
cpfcnpj: import("zod").ZodString;
|
|
88
|
+
}, import("zod/v4/core").$strict>;
|
|
89
|
+
/**
|
|
90
|
+
* Response of `crm.contracts.createByCpfCnpj`. DOCUMENTED, NOT OBSERVED: the only call ever made to
|
|
91
|
+
* this route was refused (400), so a success was never seen. It is assumed to answer like
|
|
92
|
+
* `crm.contracts.create` (`{ message, clientecontrato, cliente }`), which is what the vendor's
|
|
93
|
+
* route family does; a 2xx without a numeric `clientecontrato` is `INVALID_RESPONSE`.
|
|
94
|
+
*/
|
|
95
|
+
export type CrmContractCreateByCpfCnpjData = CrmContractCreateData;
|
|
96
|
+
/** INTERNAL definition of `crm.contracts.createByCpfCnpj`. */
|
|
97
|
+
export declare const crmContractsCreateByCpfCnpj: OperationDefinition<CrmContractCreateByCpfCnpjData, "crm.contracts.createByCpfCnpj">;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type SgpAddress } from "../address.js";
|
|
3
|
+
import type { AcquisitionMode } from "../constants.js";
|
|
4
|
+
import { type CustomerId } from "../ids.js";
|
|
5
|
+
import type { OperationDefinition } from "../operation.js";
|
|
6
|
+
import type { OperationSensitivity } from "../sensitivity.js";
|
|
7
|
+
import type { PlanId } from "./plans-list.js";
|
|
8
|
+
/** The address of a CRM contract: the vendor requires these five keys, for both addresses. */
|
|
9
|
+
interface CrmContractAddress extends SgpAddress {
|
|
10
|
+
logradouro: string;
|
|
11
|
+
bairro: string;
|
|
12
|
+
cidade: string;
|
|
13
|
+
cep: string;
|
|
14
|
+
uf: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Input of `crm.contracts.create`, named as SGP names the fields. Only the fields the vendor's
|
|
18
|
+
* documentation marks as required are required here; the rest is optional. Each field says
|
|
19
|
+
* "Exercised" when a live call sent it (a live contract call and the 1.x live-tested contract) or
|
|
20
|
+
* "Documented" when only the vendor's documentation lists it and it was never sent.
|
|
21
|
+
*/
|
|
22
|
+
export interface CrmContractCreateInput {
|
|
23
|
+
/** ID of the CRM customer (the `cliente_id` of `crm.customers.create`). Goes in the path. */
|
|
24
|
+
cliente_id: CustomerId;
|
|
25
|
+
/** Exercised. Required. POP ID. */
|
|
26
|
+
pop_id: number;
|
|
27
|
+
/** Exercised. Required. Plan ID of the URA catalog (`plans.list`), a `PlanId`. */
|
|
28
|
+
plano_id: PlanId;
|
|
29
|
+
/** Exercised. Required. Payer or financial responsible (billing profile, `portador`) ID. */
|
|
30
|
+
portador_id: number;
|
|
31
|
+
/**
|
|
32
|
+
* Exercised with 1. Required. Billing-method code (`BILLING_METHOD`: 1 boleto, 2 automatic debit, 3 booklet, 4
|
|
33
|
+
* recurring charge, 6 PIX); any number is sent as given.
|
|
34
|
+
*/
|
|
35
|
+
forma_cobranca_codigo: number;
|
|
36
|
+
/** Exercised. Required. Due day of the month (a day, not an ID). */
|
|
37
|
+
vencimento_dia: number;
|
|
38
|
+
/** Exercised. Required. Sent nested (`endereco_instalacao`) and also as loose fields, as SGP reads both. */
|
|
39
|
+
endereco_instalacao: CrmContractAddress;
|
|
40
|
+
/** Exercised. Required. Sent nested (`endereco_cobranca`) only. */
|
|
41
|
+
endereco_cobranca: CrmContractAddress;
|
|
42
|
+
/**
|
|
43
|
+
* Exercised. PPPoE login. The vendor requires it, with `senha` and `modoaquisicao`, for an
|
|
44
|
+
* Internet service; the SDK cannot tell a plan's type, so it leaves them optional (the refusal
|
|
45
|
+
* for their absence was never observed). Secret: never log it.
|
|
46
|
+
*/
|
|
47
|
+
login?: string;
|
|
48
|
+
/** Exercised. PPPoE password; see `login`. Secret: never log it. */
|
|
49
|
+
senha?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Exercised with 1. Equipment situation: `ACQUISITION_MODE` (0 owned, 1 loan), the constant shared with
|
|
52
|
+
* `preRegistrations.create`. The vendor's CRM documentation lists 1 and 2, but SGP refused 2 on
|
|
53
|
+
* this route (live, 31/10: `{ errors: { modoaquisicao: "Modo de aquisição inválido." } }`); no
|
|
54
|
+
* other value is known to be valid, so the SDK accepts only 0 and 1.
|
|
55
|
+
*/
|
|
56
|
+
modoaquisicao?: AcquisitionMode;
|
|
57
|
+
/**
|
|
58
|
+
* Exercised. NAS name (text, not `nas_id`). SGP requires it for an Internet service (live: 400
|
|
59
|
+
* `{ errors: { nas: "O campo 'nas' é obrigatório para serviço de Internet." } }`).
|
|
60
|
+
*/
|
|
61
|
+
nas?: string;
|
|
62
|
+
/** Exercised with 100. Exempt percentage. */
|
|
63
|
+
isento?: number;
|
|
64
|
+
/** Exercised with `false`. Whether SGP charges the contract automatically. */
|
|
65
|
+
autocobranca?: boolean;
|
|
66
|
+
/** Documented. Details of the requested service. Free text: personal data. */
|
|
67
|
+
servicodesc?: string;
|
|
68
|
+
/** Documented. Free-text note. Personal data. */
|
|
69
|
+
observacao?: string;
|
|
70
|
+
/** Documented. Seller ID. */
|
|
71
|
+
vendedor_id?: number;
|
|
72
|
+
/** Documented. `1` percentage, `2` fixed amount. */
|
|
73
|
+
comissao_tipo?: 1 | 2;
|
|
74
|
+
/** Documented. Commission, in the unit of `comissao_tipo`. */
|
|
75
|
+
comissao?: number;
|
|
76
|
+
/** Documented. Contract group for printing. */
|
|
77
|
+
contrato_id?: number;
|
|
78
|
+
/** Documented. Loyalty (fidelidade) ID. */
|
|
79
|
+
fidelidade_id?: number;
|
|
80
|
+
/** Documented. "How did you hear about us" ID. */
|
|
81
|
+
midia_id?: number;
|
|
82
|
+
/** Documented. Login of the customer's central. Secret: never log it. */
|
|
83
|
+
central_login?: string;
|
|
84
|
+
/** Documented. Password of the customer's central. Secret: never log it. */
|
|
85
|
+
central_senha?: string;
|
|
86
|
+
/** Documented. Fixed IP of the contract. Network identifier: secret. */
|
|
87
|
+
ip?: string;
|
|
88
|
+
/** Documented. IP pool ID. */
|
|
89
|
+
ippool_id?: number;
|
|
90
|
+
/** Documented. MAC address for DHCP. Network identifier: secret. */
|
|
91
|
+
mac_dhcp?: string;
|
|
92
|
+
/** Documented. MAC address of the equipment. Network identifier: secret. */
|
|
93
|
+
mac?: string;
|
|
94
|
+
/** Documented. Number of simultaneous logins. */
|
|
95
|
+
logins_simult?: number;
|
|
96
|
+
/** Documented. Splitter ID. */
|
|
97
|
+
splitter_id?: number;
|
|
98
|
+
/** Documented. Splitter port. */
|
|
99
|
+
splitter_port?: number;
|
|
100
|
+
/** Documented. Equipment type. */
|
|
101
|
+
tipo_equipamento?: string;
|
|
102
|
+
/** Documented. ID of the user responsible for the change. */
|
|
103
|
+
usuarioalt_id?: number;
|
|
104
|
+
/** Exercised with `true`. Opens the installation work order, without a date. */
|
|
105
|
+
os_instalacao?: boolean;
|
|
106
|
+
/** Exercised. Text of the installation occurrence. */
|
|
107
|
+
conteudo?: string;
|
|
108
|
+
/** Exercised with 0. Number of installments of the installation. */
|
|
109
|
+
instalacao_quantidade_parcelas?: number;
|
|
110
|
+
/** Exercised with 0. Installation price, in reais. */
|
|
111
|
+
instalacao_preco?: number;
|
|
112
|
+
/** Documented. Discount over the installation price. */
|
|
113
|
+
instalacao_desconto?: number;
|
|
114
|
+
/** Documented. Down payment of the installation. */
|
|
115
|
+
instalacao_entrada?: number;
|
|
116
|
+
/** Documented. Payment form of the down payment. */
|
|
117
|
+
instalacao_entrada_forma?: number;
|
|
118
|
+
/** Documented. Payment form of the installments. */
|
|
119
|
+
instalacao_parcela_forma?: number;
|
|
120
|
+
/** Documented. Billing profile (portador) ID of the installation. */
|
|
121
|
+
instalacao_portador?: number;
|
|
122
|
+
}
|
|
123
|
+
/** INTERNAL. Validation of the input, exported so a test can check it against the public type. */
|
|
124
|
+
export declare const crmContractsCreateInputSchema: z.ZodObject<{
|
|
125
|
+
cliente_id: z.core.$ZodBranded<z.ZodNumber, "CustomerId", "out">;
|
|
126
|
+
pop_id: z.ZodNumber;
|
|
127
|
+
plano_id: z.core.$ZodBranded<z.ZodNumber, "PlanId", "out">;
|
|
128
|
+
portador_id: z.ZodNumber;
|
|
129
|
+
forma_cobranca_codigo: z.ZodNumber;
|
|
130
|
+
vencimento_dia: z.ZodNumber;
|
|
131
|
+
endereco_instalacao: z.ZodObject<{
|
|
132
|
+
numero: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
133
|
+
complemento: z.ZodOptional<z.ZodString>;
|
|
134
|
+
pais: z.ZodOptional<z.ZodString>;
|
|
135
|
+
pontoreferencia: z.ZodOptional<z.ZodString>;
|
|
136
|
+
map_ll: z.ZodOptional<z.ZodString>;
|
|
137
|
+
condominio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
138
|
+
logradouro: z.ZodString;
|
|
139
|
+
bairro: z.ZodString;
|
|
140
|
+
cidade: z.ZodString;
|
|
141
|
+
cep: z.ZodString;
|
|
142
|
+
uf: z.ZodString;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
endereco_cobranca: z.ZodObject<{
|
|
145
|
+
numero: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
146
|
+
complemento: z.ZodOptional<z.ZodString>;
|
|
147
|
+
pais: z.ZodOptional<z.ZodString>;
|
|
148
|
+
pontoreferencia: z.ZodOptional<z.ZodString>;
|
|
149
|
+
map_ll: z.ZodOptional<z.ZodString>;
|
|
150
|
+
condominio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
151
|
+
logradouro: z.ZodString;
|
|
152
|
+
bairro: z.ZodString;
|
|
153
|
+
cidade: z.ZodString;
|
|
154
|
+
cep: z.ZodString;
|
|
155
|
+
uf: z.ZodString;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
login: z.ZodOptional<z.ZodString>;
|
|
158
|
+
senha: z.ZodOptional<z.ZodString>;
|
|
159
|
+
modoaquisicao: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
|
|
160
|
+
nas: z.ZodOptional<z.ZodString>;
|
|
161
|
+
isento: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
autocobranca: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
servicodesc: z.ZodOptional<z.ZodString>;
|
|
164
|
+
observacao: z.ZodOptional<z.ZodString>;
|
|
165
|
+
vendedor_id: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
comissao_tipo: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
167
|
+
comissao: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
contrato_id: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
fidelidade_id: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
midia_id: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
central_login: z.ZodOptional<z.ZodString>;
|
|
172
|
+
central_senha: z.ZodOptional<z.ZodString>;
|
|
173
|
+
ip: z.ZodOptional<z.ZodString>;
|
|
174
|
+
ippool_id: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
mac_dhcp: z.ZodOptional<z.ZodString>;
|
|
176
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
177
|
+
logins_simult: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
splitter_id: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
splitter_port: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
tipo_equipamento: z.ZodOptional<z.ZodString>;
|
|
181
|
+
usuarioalt_id: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
os_instalacao: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
conteudo: z.ZodOptional<z.ZodString>;
|
|
184
|
+
instalacao_quantidade_parcelas: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
instalacao_preco: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
instalacao_desconto: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
instalacao_entrada: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
instalacao_entrada_forma: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
instalacao_parcela_forma: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
instalacao_portador: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
/**
|
|
193
|
+
* INTERNAL. The JSON body of a CRM contract, shared by the two routes that take it: both addresses
|
|
194
|
+
* nested, the installation one also as loose fields beside them (as 1.x). `fields` is the validated
|
|
195
|
+
* input without the customer reference (the path id of this route, the query document of the other).
|
|
196
|
+
*/
|
|
197
|
+
export declare const crmContractBody: ({ endereco_instalacao, endereco_cobranca, ...fields }: Omit<z.output<typeof crmContractsCreateInputSchema>, "cliente_id">) => Record<string, unknown>;
|
|
198
|
+
/**
|
|
199
|
+
* Success body of `POST /api/crm/cliente/{cliente_id}/contratos/`: SGP's `message`, the new
|
|
200
|
+
* contract's id (`clientecontrato`) and the customer's name. Other keys SGP may add are kept.
|
|
201
|
+
* INTERNAL: `crm.contracts.createByCpfCnpj` takes the same shape (documented, never observed there).
|
|
202
|
+
*/
|
|
203
|
+
export declare const crmContractCreatedSchema: z.ZodObject<{
|
|
204
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
205
|
+
clientecontrato: z.ZodNumber;
|
|
206
|
+
cliente: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
207
|
+
}, z.core.$loose>;
|
|
208
|
+
/** The one key a 200 must have to be taken as the creation answer. */
|
|
209
|
+
export declare const crmContractCreatedInvariants: readonly ["clientecontrato"];
|
|
210
|
+
/** Response of `crm.contracts.create`. */
|
|
211
|
+
export type CrmContractCreateData = z.output<typeof crmContractCreatedSchema>;
|
|
212
|
+
/**
|
|
213
|
+
* PPPoE and Central logins and passwords and the network identifiers (IP, MAC) are secrets; the
|
|
214
|
+
* addresses, the free texts and the customer's name in the 200 are personal. The rest are ids,
|
|
215
|
+
* codes, flags and money. INTERNAL: shared with `crm.contracts.createByCpfCnpj`, which sends the
|
|
216
|
+
* same body.
|
|
217
|
+
*/
|
|
218
|
+
export declare const crmContractsCreateSensitivity: OperationSensitivity;
|
|
219
|
+
/** INTERNAL definition of `crm.contracts.create`. */
|
|
220
|
+
export declare const crmContractsCreate: OperationDefinition<CrmContractCreateData, "crm.contracts.create">;
|
|
221
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { OperationDefinition } from "../operation.js";
|
|
3
|
+
/** Input of `crm.contracts.list`, named as SGP names the field. */
|
|
4
|
+
export interface CrmContractsListInput {
|
|
5
|
+
/**
|
|
6
|
+
* Exercised (live, with a CPF in digits only). Required. The document of the CRM customer, sent as
|
|
7
|
+
* `cpfcnpj`, SGP's own name for a field that takes either kind: the API decides whether it is a
|
|
8
|
+
* CPF or a CNPJ. Only a CPF was ever sent; a CNPJ is accepted by the field's name and was never
|
|
9
|
+
* exercised. Sent as given: digits or formatted (`123.456.789-00`). Personal data: never log it.
|
|
10
|
+
*/
|
|
11
|
+
cpfcnpj: string;
|
|
12
|
+
}
|
|
13
|
+
/** INTERNAL. Validation of the input, exported so a test can check it against the public type. */
|
|
14
|
+
export declare const crmContractsListInputSchema: z.ZodObject<{
|
|
15
|
+
cpfcnpj: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
declare const contractsSchema: z.ZodObject<{
|
|
18
|
+
cliente: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
cpf_cnpj: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
contratos: z.ZodArray<z.ZodObject<{
|
|
21
|
+
cliente_contrato_id: z.ZodNumber;
|
|
22
|
+
data_cadastro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
vencimento_dia: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
24
|
+
pop: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
endereco: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
forma_cobranca: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
data_status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
modo_status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
30
|
+
motivo_status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
vendedor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
servicos: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
plano: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
login: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
contrato_tipo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
36
|
+
situacao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
aquisicao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
}, z.core.$loose>>>>;
|
|
39
|
+
}, z.core.$loose>>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
/**
|
|
42
|
+
* Response of `GET /api/crm/cliente/contratos/`, in SGP's own shape: the customer's `cliente` and
|
|
43
|
+
* `cpf_cnpj` (personal data) and `contratos`, one summary per contract, empty when the CRM customer
|
|
44
|
+
* has none. `data_cadastro` and `data_status` are `DD/MM/AAAA` strings, kept as SGP writes them.
|
|
45
|
+
* Unknown keys reach `data` as received.
|
|
46
|
+
*/
|
|
47
|
+
export type CrmContractsListData = z.output<typeof contractsSchema>;
|
|
48
|
+
/** INTERNAL definition of `crm.contracts.list`. */
|
|
49
|
+
export declare const crmContractsList: OperationDefinition<CrmContractsListData, "crm.contracts.list">;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type SgpAddress } from "../address.js";
|
|
3
|
+
import type { OperationDefinition } from "../operation.js";
|
|
4
|
+
/** The address of a CRM customer: the vendor requires these five keys. */
|
|
5
|
+
interface CrmCustomerAddress extends SgpAddress {
|
|
6
|
+
logradouro: string;
|
|
7
|
+
bairro: string;
|
|
8
|
+
cidade: string;
|
|
9
|
+
cep: string;
|
|
10
|
+
uf: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fields common to both person types. All of them are personal data. Each field says "Exercised"
|
|
14
|
+
* when a live call sent it or "Documented" when only the vendor's documentation lists it.
|
|
15
|
+
*/
|
|
16
|
+
interface CrmCustomerCreateCommon {
|
|
17
|
+
/** Exercised. Customer name; for a company, its corporate name. Required. SGP refuses digits in it (400). */
|
|
18
|
+
nome: string;
|
|
19
|
+
/**
|
|
20
|
+
* Exercised. Required. A CPF on `personType: "F"`, a CNPJ on `"J"`. The SDK sends it in the
|
|
21
|
+
* canonical mask the base holds (the CRM already stores it that way). After removing `.`, `-`,
|
|
22
|
+
* `/` and spaces: exactly 11 digits go as `999.999.999-99` (`F`); exactly 14 alphanumerics, the
|
|
23
|
+
* last 2 digits, go as `AA.AAA.AAA/AAAA-99`, letters uppercased as the Receita writes them
|
|
24
|
+
* (`J`). An input already in the mask goes unchanged. Anything else is refused locally:
|
|
25
|
+
* `INVALID_INPUT`, `error.issues` is `["cpfcnpj: expected ..."]`, `attempts` 0, nothing sent,
|
|
26
|
+
* `effect` `"none"`. That covers a wrong length, other characters, letters in a CPF or in the
|
|
27
|
+
* last 2 positions of a CNPJ, and the wrong kind for the route (a CNPJ on `F`, a CPF on `J`).
|
|
28
|
+
* Format only: the check digits are not verified.
|
|
29
|
+
*/
|
|
30
|
+
cpfcnpj: string;
|
|
31
|
+
/** Exercised. Required. Sent nested (`endereco`) and also as loose fields beside it, the two formats the route reads. */
|
|
32
|
+
endereco: CrmCustomerAddress;
|
|
33
|
+
/** Documented. Contact e-mail. */
|
|
34
|
+
email?: string;
|
|
35
|
+
/** Documented. Contact phone. */
|
|
36
|
+
celular?: string;
|
|
37
|
+
/** Documented. Free-text note. */
|
|
38
|
+
observacao?: string;
|
|
39
|
+
}
|
|
40
|
+
/** `POST /api/crm/cliente/F`: a natural person. */
|
|
41
|
+
export interface CrmCustomerCreateIndividualInput extends CrmCustomerCreateCommon {
|
|
42
|
+
/** Selects the route `/F`; not sent as a field. */
|
|
43
|
+
personType: "F";
|
|
44
|
+
/** Documented. Birth date, `DD/MM/AAAA`. */
|
|
45
|
+
datanasc?: string;
|
|
46
|
+
/** Documented. Identity document number. */
|
|
47
|
+
rg?: string;
|
|
48
|
+
/** Documented. Issuer of the identity document. */
|
|
49
|
+
rg_emissor?: string;
|
|
50
|
+
/** Documented. `M` male, `F` female. */
|
|
51
|
+
sexo?: "M" | "F";
|
|
52
|
+
/** Documented. `C` married, `S` single, `V` widowed, `D` divorced. */
|
|
53
|
+
estadocivil?: "C" | "S" | "V" | "D";
|
|
54
|
+
/** Documented. Mother's name. */
|
|
55
|
+
nomemae?: string;
|
|
56
|
+
/** Documented. Father's name. */
|
|
57
|
+
nomepai?: string;
|
|
58
|
+
/** Documented. Occupation. */
|
|
59
|
+
profissao?: string;
|
|
60
|
+
/** Documented. Nationality. */
|
|
61
|
+
nacionalidade?: string;
|
|
62
|
+
/** Documented. Place of birth. */
|
|
63
|
+
naturalidade?: string;
|
|
64
|
+
}
|
|
65
|
+
/** `POST /api/crm/cliente/J`: a company. Documented only: never exercised against SGP. */
|
|
66
|
+
export interface CrmCustomerCreateCompanyInput extends CrmCustomerCreateCommon {
|
|
67
|
+
/** Selects the route `/J`; not sent as a field. */
|
|
68
|
+
personType: "J";
|
|
69
|
+
/** Documented. Trade name. */
|
|
70
|
+
nomefantasia?: string;
|
|
71
|
+
/** Documented. Name of the person responsible for the company. */
|
|
72
|
+
respempresa?: string;
|
|
73
|
+
/** Documented. CPF of the person responsible for the company. */
|
|
74
|
+
respcpf?: string;
|
|
75
|
+
/** Documented. State registration. */
|
|
76
|
+
insc_estadual?: string;
|
|
77
|
+
/** Documented. Municipal registration. */
|
|
78
|
+
insc_municipal?: string;
|
|
79
|
+
/** Documented. Foundation date, `DD/MM/AAAA`. */
|
|
80
|
+
datafundacao?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Input of `crm.customers.create`. `personType` picks the route (`F` or `J`) and is not sent as a
|
|
84
|
+
* field; every other key is sent under its own name, absent ones omitted. Unknown keys are refused.
|
|
85
|
+
*/
|
|
86
|
+
export type CrmCustomerCreateInput = CrmCustomerCreateIndividualInput | CrmCustomerCreateCompanyInput;
|
|
87
|
+
/** INTERNAL. Validation of the input, exported so a test can check it against the public types. */
|
|
88
|
+
export declare const crmCustomersCreateInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
89
|
+
nome: z.ZodString;
|
|
90
|
+
cpfcnpj: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
91
|
+
endereco: z.ZodObject<{
|
|
92
|
+
numero: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
93
|
+
complemento: z.ZodOptional<z.ZodString>;
|
|
94
|
+
pais: z.ZodOptional<z.ZodString>;
|
|
95
|
+
pontoreferencia: z.ZodOptional<z.ZodString>;
|
|
96
|
+
map_ll: z.ZodOptional<z.ZodString>;
|
|
97
|
+
condominio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
98
|
+
logradouro: z.ZodString;
|
|
99
|
+
bairro: z.ZodString;
|
|
100
|
+
cidade: z.ZodString;
|
|
101
|
+
cep: z.ZodString;
|
|
102
|
+
uf: z.ZodString;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
email: z.ZodOptional<z.ZodString>;
|
|
105
|
+
celular: z.ZodOptional<z.ZodString>;
|
|
106
|
+
observacao: z.ZodOptional<z.ZodString>;
|
|
107
|
+
personType: z.ZodLiteral<"F">;
|
|
108
|
+
datanasc: z.ZodOptional<z.ZodString>;
|
|
109
|
+
rg: z.ZodOptional<z.ZodString>;
|
|
110
|
+
rg_emissor: z.ZodOptional<z.ZodString>;
|
|
111
|
+
sexo: z.ZodOptional<z.ZodEnum<{
|
|
112
|
+
F: "F";
|
|
113
|
+
M: "M";
|
|
114
|
+
}>>;
|
|
115
|
+
estadocivil: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
C: "C";
|
|
117
|
+
D: "D";
|
|
118
|
+
S: "S";
|
|
119
|
+
V: "V";
|
|
120
|
+
}>>;
|
|
121
|
+
nomemae: z.ZodOptional<z.ZodString>;
|
|
122
|
+
nomepai: z.ZodOptional<z.ZodString>;
|
|
123
|
+
profissao: z.ZodOptional<z.ZodString>;
|
|
124
|
+
nacionalidade: z.ZodOptional<z.ZodString>;
|
|
125
|
+
naturalidade: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
127
|
+
nome: z.ZodString;
|
|
128
|
+
cpfcnpj: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
129
|
+
endereco: z.ZodObject<{
|
|
130
|
+
numero: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
131
|
+
complemento: z.ZodOptional<z.ZodString>;
|
|
132
|
+
pais: z.ZodOptional<z.ZodString>;
|
|
133
|
+
pontoreferencia: z.ZodOptional<z.ZodString>;
|
|
134
|
+
map_ll: z.ZodOptional<z.ZodString>;
|
|
135
|
+
condominio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
136
|
+
logradouro: z.ZodString;
|
|
137
|
+
bairro: z.ZodString;
|
|
138
|
+
cidade: z.ZodString;
|
|
139
|
+
cep: z.ZodString;
|
|
140
|
+
uf: z.ZodString;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
email: z.ZodOptional<z.ZodString>;
|
|
143
|
+
celular: z.ZodOptional<z.ZodString>;
|
|
144
|
+
observacao: z.ZodOptional<z.ZodString>;
|
|
145
|
+
personType: z.ZodLiteral<"J">;
|
|
146
|
+
nomefantasia: z.ZodOptional<z.ZodString>;
|
|
147
|
+
respempresa: z.ZodOptional<z.ZodString>;
|
|
148
|
+
respcpf: z.ZodOptional<z.ZodString>;
|
|
149
|
+
insc_estadual: z.ZodOptional<z.ZodString>;
|
|
150
|
+
insc_municipal: z.ZodOptional<z.ZodString>;
|
|
151
|
+
datafundacao: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strict>], "personType">;
|
|
153
|
+
/**
|
|
154
|
+
* Success body of `POST /api/crm/cliente/{F|J}`: the new customer's `cliente_id` and SGP's
|
|
155
|
+
* `message`, which echoes the customer's name and document. Other keys SGP may add are kept.
|
|
156
|
+
*/
|
|
157
|
+
declare const createdSchema: z.ZodObject<{
|
|
158
|
+
cliente_id: z.core.$ZodBranded<z.ZodNumber, "CustomerId", "out">;
|
|
159
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
160
|
+
}, z.core.$loose>;
|
|
161
|
+
/** Response of `crm.customers.create`. */
|
|
162
|
+
export type CrmCustomerCreateData = z.output<typeof createdSchema>;
|
|
163
|
+
/** INTERNAL definition of `crm.customers.create`. */
|
|
164
|
+
export declare const crmCustomersCreate: OperationDefinition<CrmCustomerCreateData, "crm.customers.create">;
|
|
165
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CustomerId } from "../ids.js";
|
|
3
|
+
import type { OperationDefinition } from "../operation.js";
|
|
4
|
+
/**
|
|
5
|
+
* Input of `crm.customers.updateStatus`, named as SGP names the fields. The status code is sent as
|
|
6
|
+
* given: SGP decides what it takes and which transitions it allows.
|
|
7
|
+
*/
|
|
8
|
+
export interface CrmCustomerUpdateStatusInput {
|
|
9
|
+
/** ID of the CRM customer: the `cliente_id` of `crm.customers.create`. Goes in the path. */
|
|
10
|
+
cliente_id: CustomerId;
|
|
11
|
+
/**
|
|
12
|
+
* Exercised with 6. Status code to move to (`CRM_STATUS`: 6 is "Contrato realizado no SGP"); any
|
|
13
|
+
* number is sent.
|
|
14
|
+
*/
|
|
15
|
+
status_id: number;
|
|
16
|
+
/** Documented, never sent. Free-text reason of the change. Personal data when it names the customer. */
|
|
17
|
+
motivo?: string;
|
|
18
|
+
}
|
|
19
|
+
/** INTERNAL. Validation of the input, exported so a test can check it against the public type. */
|
|
20
|
+
export declare const crmCustomersUpdateStatusInputSchema: z.ZodObject<{
|
|
21
|
+
cliente_id: z.core.$ZodBranded<z.ZodNumber, "CustomerId", "out">;
|
|
22
|
+
status_id: z.ZodNumber;
|
|
23
|
+
motivo: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
/**
|
|
26
|
+
* Success body of `POST /api/crm/cliente/{cliente_id}/status/`: the customer, SGP's `message`
|
|
27
|
+
* (which echoes the customer's name) and the status now set. Other keys SGP may add are kept.
|
|
28
|
+
*/
|
|
29
|
+
declare const statusUpdatedSchema: z.ZodObject<{
|
|
30
|
+
cliente_id: z.core.$ZodBranded<z.ZodNumber, "CustomerId", "out">;
|
|
31
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
novo_status: z.ZodObject<{
|
|
33
|
+
codigo: z.ZodNumber;
|
|
34
|
+
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
/** Response of `crm.customers.updateStatus`. */
|
|
38
|
+
export type CrmCustomerUpdateStatusData = z.output<typeof statusUpdatedSchema>;
|
|
39
|
+
/** INTERNAL definition of `crm.customers.updateStatus`. */
|
|
40
|
+
export declare const crmCustomersUpdateStatus: OperationDefinition<CrmCustomerUpdateStatusData, "crm.customers.updateStatus">;
|
|
41
|
+
export {};
|