evo360-types 1.3.662 → 1.3.664
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/dist/apps/evo-core/zod-schemas.d.ts +157 -8
- package/dist/apps/evo-core/zod-schemas.js +15 -2
- package/dist/apps/evo-core/zod-schemas.ts +15 -1
- package/dist/apps/evo-crm/lead/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-finops/zod-schemas.d.ts +67 -24
- package/dist/apps/evo-finops/zod-schemas.js +23 -1
- package/dist/apps/evo-finops/zod-schemas.ts +25 -0
- package/dist/apps/evo-med/insurance/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/people/zod-schemas.d.ts +12 -12
- package/dist/apps/shared/zod-schemas.d.ts +2 -2
- package/dist/types/evo-core/index.d.ts +14 -2
- package/dist/types/evo-core/index.ts +20 -2
- package/dist/types/evo-finops/common/contract.d.ts +2 -0
- package/dist/types/evo-finops/common/contract.ts +3 -0
- package/dist/types/evo-finops/common/nfse-fee-reimbursement.d.ts +105 -0
- package/dist/types/evo-finops/common/nfse-fee-reimbursement.js +34 -0
- package/dist/types/evo-finops/common/nfse-fee-reimbursement.ts +134 -0
- package/dist/types/evo-finops/index.d.ts +1 -0
- package/dist/types/evo-finops/index.js +1 -0
- package/dist/types/evo-finops/index.ts +1 -0
- package/package.json +1 -1
|
@@ -245,6 +245,29 @@ export declare const zNexusModuleChatPermissionsSchema: z.ZodObject<{
|
|
|
245
245
|
management?: boolean | undefined;
|
|
246
246
|
supervision?: boolean | undefined;
|
|
247
247
|
}>;
|
|
248
|
+
/**
|
|
249
|
+
* Schema for INexusModuleFinancePermissions
|
|
250
|
+
*/
|
|
251
|
+
export declare const zNexusModuleFinancePermissionsSchema: z.ZodObject<{
|
|
252
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
257
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
reports?: boolean | undefined;
|
|
260
|
+
customers?: boolean | undefined;
|
|
261
|
+
contracts?: boolean | undefined;
|
|
262
|
+
billing?: boolean | undefined;
|
|
263
|
+
reimbursements?: boolean | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
reports?: boolean | undefined;
|
|
266
|
+
customers?: boolean | undefined;
|
|
267
|
+
contracts?: boolean | undefined;
|
|
268
|
+
billing?: boolean | undefined;
|
|
269
|
+
reimbursements?: boolean | undefined;
|
|
270
|
+
}>;
|
|
248
271
|
/**
|
|
249
272
|
* Schema for INexusReports
|
|
250
273
|
*/
|
|
@@ -268,7 +291,26 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
268
291
|
supervision?: boolean | undefined;
|
|
269
292
|
}>, z.ZodBoolean]>>;
|
|
270
293
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
-
finance: z.ZodOptional<z.
|
|
294
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
295
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
297
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
298
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
299
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
300
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
301
|
+
}, "strip", z.ZodTypeAny, {
|
|
302
|
+
reports?: boolean | undefined;
|
|
303
|
+
customers?: boolean | undefined;
|
|
304
|
+
contracts?: boolean | undefined;
|
|
305
|
+
billing?: boolean | undefined;
|
|
306
|
+
reimbursements?: boolean | undefined;
|
|
307
|
+
}, {
|
|
308
|
+
reports?: boolean | undefined;
|
|
309
|
+
customers?: boolean | undefined;
|
|
310
|
+
contracts?: boolean | undefined;
|
|
311
|
+
billing?: boolean | undefined;
|
|
312
|
+
reimbursements?: boolean | undefined;
|
|
313
|
+
}>, z.ZodBoolean]>>;
|
|
272
314
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
273
315
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
274
316
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -288,7 +330,26 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
288
330
|
supervision?: boolean | undefined;
|
|
289
331
|
}>, z.ZodBoolean]>>;
|
|
290
332
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
-
finance: z.ZodOptional<z.
|
|
333
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
334
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
335
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
338
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
339
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
}, "strip", z.ZodTypeAny, {
|
|
341
|
+
reports?: boolean | undefined;
|
|
342
|
+
customers?: boolean | undefined;
|
|
343
|
+
contracts?: boolean | undefined;
|
|
344
|
+
billing?: boolean | undefined;
|
|
345
|
+
reimbursements?: boolean | undefined;
|
|
346
|
+
}, {
|
|
347
|
+
reports?: boolean | undefined;
|
|
348
|
+
customers?: boolean | undefined;
|
|
349
|
+
contracts?: boolean | undefined;
|
|
350
|
+
billing?: boolean | undefined;
|
|
351
|
+
reimbursements?: boolean | undefined;
|
|
352
|
+
}>, z.ZodBoolean]>>;
|
|
292
353
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
293
354
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
294
355
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -308,7 +369,26 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
308
369
|
supervision?: boolean | undefined;
|
|
309
370
|
}>, z.ZodBoolean]>>;
|
|
310
371
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
311
|
-
finance: z.ZodOptional<z.
|
|
372
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
373
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
374
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
376
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
377
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
378
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
380
|
+
reports?: boolean | undefined;
|
|
381
|
+
customers?: boolean | undefined;
|
|
382
|
+
contracts?: boolean | undefined;
|
|
383
|
+
billing?: boolean | undefined;
|
|
384
|
+
reimbursements?: boolean | undefined;
|
|
385
|
+
}, {
|
|
386
|
+
reports?: boolean | undefined;
|
|
387
|
+
customers?: boolean | undefined;
|
|
388
|
+
contracts?: boolean | undefined;
|
|
389
|
+
billing?: boolean | undefined;
|
|
390
|
+
reimbursements?: boolean | undefined;
|
|
391
|
+
}>, z.ZodBoolean]>>;
|
|
312
392
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
313
393
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
314
394
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -334,7 +414,26 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
334
414
|
supervision?: boolean | undefined;
|
|
335
415
|
}>, z.ZodBoolean]>>;
|
|
336
416
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
-
finance: z.ZodOptional<z.
|
|
417
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
418
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
419
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
422
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
423
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
424
|
+
}, "strip", z.ZodTypeAny, {
|
|
425
|
+
reports?: boolean | undefined;
|
|
426
|
+
customers?: boolean | undefined;
|
|
427
|
+
contracts?: boolean | undefined;
|
|
428
|
+
billing?: boolean | undefined;
|
|
429
|
+
reimbursements?: boolean | undefined;
|
|
430
|
+
}, {
|
|
431
|
+
reports?: boolean | undefined;
|
|
432
|
+
customers?: boolean | undefined;
|
|
433
|
+
contracts?: boolean | undefined;
|
|
434
|
+
billing?: boolean | undefined;
|
|
435
|
+
reimbursements?: boolean | undefined;
|
|
436
|
+
}>, z.ZodBoolean]>>;
|
|
338
437
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
339
438
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
340
439
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -354,7 +453,26 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
354
453
|
supervision?: boolean | undefined;
|
|
355
454
|
}>, z.ZodBoolean]>>;
|
|
356
455
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
-
finance: z.ZodOptional<z.
|
|
456
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
457
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
458
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
459
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
462
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
463
|
+
}, "strip", z.ZodTypeAny, {
|
|
464
|
+
reports?: boolean | undefined;
|
|
465
|
+
customers?: boolean | undefined;
|
|
466
|
+
contracts?: boolean | undefined;
|
|
467
|
+
billing?: boolean | undefined;
|
|
468
|
+
reimbursements?: boolean | undefined;
|
|
469
|
+
}, {
|
|
470
|
+
reports?: boolean | undefined;
|
|
471
|
+
customers?: boolean | undefined;
|
|
472
|
+
contracts?: boolean | undefined;
|
|
473
|
+
billing?: boolean | undefined;
|
|
474
|
+
reimbursements?: boolean | undefined;
|
|
475
|
+
}>, z.ZodBoolean]>>;
|
|
358
476
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
359
477
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
360
478
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -374,7 +492,26 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
374
492
|
supervision?: boolean | undefined;
|
|
375
493
|
}>, z.ZodBoolean]>>;
|
|
376
494
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
377
|
-
finance: z.ZodOptional<z.
|
|
495
|
+
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
496
|
+
customers: z.ZodOptional<z.ZodBoolean>;
|
|
497
|
+
contracts: z.ZodOptional<z.ZodBoolean>;
|
|
498
|
+
billing: z.ZodOptional<z.ZodBoolean>;
|
|
499
|
+
reports: z.ZodOptional<z.ZodBoolean>;
|
|
500
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
501
|
+
reimbursements: z.ZodOptional<z.ZodBoolean>;
|
|
502
|
+
}, "strip", z.ZodTypeAny, {
|
|
503
|
+
reports?: boolean | undefined;
|
|
504
|
+
customers?: boolean | undefined;
|
|
505
|
+
contracts?: boolean | undefined;
|
|
506
|
+
billing?: boolean | undefined;
|
|
507
|
+
reimbursements?: boolean | undefined;
|
|
508
|
+
}, {
|
|
509
|
+
reports?: boolean | undefined;
|
|
510
|
+
customers?: boolean | undefined;
|
|
511
|
+
contracts?: boolean | undefined;
|
|
512
|
+
billing?: boolean | undefined;
|
|
513
|
+
reimbursements?: boolean | undefined;
|
|
514
|
+
}>, z.ZodBoolean]>>;
|
|
378
515
|
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
379
516
|
waba: z.ZodOptional<z.ZodBoolean>;
|
|
380
517
|
reports: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
@@ -388,7 +525,13 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
388
525
|
management?: boolean | undefined;
|
|
389
526
|
supervision?: boolean | undefined;
|
|
390
527
|
} | undefined;
|
|
391
|
-
finance?: boolean |
|
|
528
|
+
finance?: boolean | {
|
|
529
|
+
reports?: boolean | undefined;
|
|
530
|
+
customers?: boolean | undefined;
|
|
531
|
+
contracts?: boolean | undefined;
|
|
532
|
+
billing?: boolean | undefined;
|
|
533
|
+
reimbursements?: boolean | undefined;
|
|
534
|
+
} | undefined;
|
|
392
535
|
notifications?: boolean | undefined;
|
|
393
536
|
waba?: boolean | undefined;
|
|
394
537
|
reports?: boolean | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -404,7 +547,13 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
404
547
|
management?: boolean | undefined;
|
|
405
548
|
supervision?: boolean | undefined;
|
|
406
549
|
} | undefined;
|
|
407
|
-
finance?: boolean |
|
|
550
|
+
finance?: boolean | {
|
|
551
|
+
reports?: boolean | undefined;
|
|
552
|
+
customers?: boolean | undefined;
|
|
553
|
+
contracts?: boolean | undefined;
|
|
554
|
+
billing?: boolean | undefined;
|
|
555
|
+
reimbursements?: boolean | undefined;
|
|
556
|
+
} | undefined;
|
|
408
557
|
notifications?: boolean | undefined;
|
|
409
558
|
waba?: boolean | undefined;
|
|
410
559
|
reports?: boolean | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zNexusClaimsSchema = exports.zNexusModulesSchema = exports.zNexusReportsSchema = exports.zNexusModuleChatPermissionsSchema = exports.zRbacGroupSchema = exports.zRbacPermissionMetadataSchema = exports.zRbacRoleSchema = exports.zRbacRolePermsSchema = exports.zUserTenantIndexSchema = exports.zTenantUserSchema = exports.zUserTenantIndexStatusSchema = exports.zTenantUserStatusSchema = exports.zRbacPermValueSchema = exports.zActionArgsSchema = void 0;
|
|
3
|
+
exports.zNexusClaimsSchema = exports.zNexusModulesSchema = exports.zNexusReportsSchema = exports.zNexusModuleFinancePermissionsSchema = exports.zNexusModuleChatPermissionsSchema = exports.zRbacGroupSchema = exports.zRbacPermissionMetadataSchema = exports.zRbacRoleSchema = exports.zRbacRolePermsSchema = exports.zUserTenantIndexSchema = exports.zTenantUserSchema = exports.zUserTenantIndexStatusSchema = exports.zTenantUserStatusSchema = exports.zRbacPermValueSchema = exports.zActionArgsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../shared/zod-schemas");
|
|
6
6
|
const zod_schemas_2 = require("../evo-tenant/zod-schemas");
|
|
@@ -101,6 +101,17 @@ exports.zNexusModuleChatPermissionsSchema = zod_1.z.object({
|
|
|
101
101
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
102
102
|
csq: zod_1.z.boolean().optional(),
|
|
103
103
|
});
|
|
104
|
+
/**
|
|
105
|
+
* Schema for INexusModuleFinancePermissions
|
|
106
|
+
*/
|
|
107
|
+
exports.zNexusModuleFinancePermissionsSchema = zod_1.z.object({
|
|
108
|
+
customers: zod_1.z.boolean().optional(),
|
|
109
|
+
contracts: zod_1.z.boolean().optional(),
|
|
110
|
+
billing: zod_1.z.boolean().optional(),
|
|
111
|
+
reports: zod_1.z.boolean().optional(),
|
|
112
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
113
|
+
reimbursements: zod_1.z.boolean().optional(),
|
|
114
|
+
});
|
|
104
115
|
/**
|
|
105
116
|
* Schema for INexusReports
|
|
106
117
|
*/
|
|
@@ -112,7 +123,9 @@ exports.zNexusModulesSchema = zod_1.z
|
|
|
112
123
|
.object({
|
|
113
124
|
chat: zod_1.z.union([exports.zNexusModuleChatPermissionsSchema, zod_1.z.boolean()]).optional(),
|
|
114
125
|
tenants: zod_1.z.boolean().optional(),
|
|
115
|
-
finance: zod_1.z
|
|
126
|
+
finance: zod_1.z
|
|
127
|
+
.union([exports.zNexusModuleFinancePermissionsSchema, zod_1.z.boolean()])
|
|
128
|
+
.optional(),
|
|
116
129
|
notifications: zod_1.z.boolean().optional(),
|
|
117
130
|
waba: zod_1.z.boolean().optional(),
|
|
118
131
|
reports: zod_1.z.union([exports.zNexusReportsSchema, zod_1.z.boolean()]).optional(),
|
|
@@ -112,6 +112,18 @@ export const zNexusModuleChatPermissionsSchema = z.object({
|
|
|
112
112
|
csq: z.boolean().optional(),
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Schema for INexusModuleFinancePermissions
|
|
117
|
+
*/
|
|
118
|
+
export const zNexusModuleFinancePermissionsSchema = z.object({
|
|
119
|
+
customers: z.boolean().optional(),
|
|
120
|
+
contracts: z.boolean().optional(),
|
|
121
|
+
billing: z.boolean().optional(),
|
|
122
|
+
reports: z.boolean().optional(),
|
|
123
|
+
/** feat-264 — reembolso da taxa de NFS-e. */
|
|
124
|
+
reimbursements: z.boolean().optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
115
127
|
/**
|
|
116
128
|
* Schema for INexusReports
|
|
117
129
|
*/
|
|
@@ -124,7 +136,9 @@ export const zNexusModulesSchema = z
|
|
|
124
136
|
.object({
|
|
125
137
|
chat: z.union([zNexusModuleChatPermissionsSchema, z.boolean()]).optional(),
|
|
126
138
|
tenants: z.boolean().optional(),
|
|
127
|
-
finance: z
|
|
139
|
+
finance: z
|
|
140
|
+
.union([zNexusModuleFinancePermissionsSchema, z.boolean()])
|
|
141
|
+
.optional(),
|
|
128
142
|
notifications: z.boolean().optional(),
|
|
129
143
|
waba: z.boolean().optional(),
|
|
130
144
|
reports: z.union([zNexusReportsSchema, z.boolean()]).optional(),
|
|
@@ -118,8 +118,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
118
118
|
name: string;
|
|
119
119
|
kind: string;
|
|
120
120
|
country: string;
|
|
121
|
-
city: string;
|
|
122
121
|
state: string;
|
|
122
|
+
city: string;
|
|
123
123
|
line1: string;
|
|
124
124
|
line2: string;
|
|
125
125
|
neighborhood: string;
|
|
@@ -129,8 +129,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
129
129
|
name?: string | undefined;
|
|
130
130
|
kind?: string | undefined;
|
|
131
131
|
country?: string | undefined;
|
|
132
|
-
city?: string | undefined;
|
|
133
132
|
state?: string | undefined;
|
|
133
|
+
city?: string | undefined;
|
|
134
134
|
line1?: string | undefined;
|
|
135
135
|
line2?: string | undefined;
|
|
136
136
|
neighborhood?: string | undefined;
|
|
@@ -374,8 +374,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
374
374
|
name: string;
|
|
375
375
|
kind: string;
|
|
376
376
|
country: string;
|
|
377
|
-
city: string;
|
|
378
377
|
state: string;
|
|
378
|
+
city: string;
|
|
379
379
|
line1: string;
|
|
380
380
|
line2: string;
|
|
381
381
|
neighborhood: string;
|
|
@@ -385,8 +385,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
385
385
|
name?: string | undefined;
|
|
386
386
|
kind?: string | undefined;
|
|
387
387
|
country?: string | undefined;
|
|
388
|
-
city?: string | undefined;
|
|
389
388
|
state?: string | undefined;
|
|
389
|
+
city?: string | undefined;
|
|
390
390
|
line1?: string | undefined;
|
|
391
391
|
line2?: string | undefined;
|
|
392
392
|
neighborhood?: string | undefined;
|
|
@@ -630,8 +630,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
630
630
|
name: string;
|
|
631
631
|
kind: string;
|
|
632
632
|
country: string;
|
|
633
|
-
city: string;
|
|
634
633
|
state: string;
|
|
634
|
+
city: string;
|
|
635
635
|
line1: string;
|
|
636
636
|
line2: string;
|
|
637
637
|
neighborhood: string;
|
|
@@ -641,8 +641,8 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
641
641
|
name?: string | undefined;
|
|
642
642
|
kind?: string | undefined;
|
|
643
643
|
country?: string | undefined;
|
|
644
|
-
city?: string | undefined;
|
|
645
644
|
state?: string | undefined;
|
|
645
|
+
city?: string | undefined;
|
|
646
646
|
line1?: string | undefined;
|
|
647
647
|
line2?: string | undefined;
|
|
648
648
|
neighborhood?: string | undefined;
|
|
@@ -8896,12 +8896,12 @@ export declare const zIssuerNfseConfigSchema: z.ZodObject<{
|
|
|
8896
8896
|
code: z.ZodOptional<z.ZodString>;
|
|
8897
8897
|
}, "strip", z.ZodTypeAny, {
|
|
8898
8898
|
code?: string | undefined;
|
|
8899
|
-
city?: string | undefined;
|
|
8900
8899
|
state?: string | undefined;
|
|
8900
|
+
city?: string | undefined;
|
|
8901
8901
|
}, {
|
|
8902
8902
|
code?: string | undefined;
|
|
8903
|
-
city?: string | undefined;
|
|
8904
8903
|
state?: string | undefined;
|
|
8904
|
+
city?: string | undefined;
|
|
8905
8905
|
}>>;
|
|
8906
8906
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
8907
8907
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -8929,12 +8929,12 @@ export declare const zIssuerNfseConfigSchema: z.ZodObject<{
|
|
|
8929
8929
|
code: z.ZodOptional<z.ZodString>;
|
|
8930
8930
|
}, "strip", z.ZodTypeAny, {
|
|
8931
8931
|
code?: string | undefined;
|
|
8932
|
-
city?: string | undefined;
|
|
8933
8932
|
state?: string | undefined;
|
|
8933
|
+
city?: string | undefined;
|
|
8934
8934
|
}, {
|
|
8935
8935
|
code?: string | undefined;
|
|
8936
|
-
city?: string | undefined;
|
|
8937
8936
|
state?: string | undefined;
|
|
8937
|
+
city?: string | undefined;
|
|
8938
8938
|
}>>;
|
|
8939
8939
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
8940
8940
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -8962,12 +8962,12 @@ export declare const zIssuerNfseConfigSchema: z.ZodObject<{
|
|
|
8962
8962
|
code: z.ZodOptional<z.ZodString>;
|
|
8963
8963
|
}, "strip", z.ZodTypeAny, {
|
|
8964
8964
|
code?: string | undefined;
|
|
8965
|
-
city?: string | undefined;
|
|
8966
8965
|
state?: string | undefined;
|
|
8966
|
+
city?: string | undefined;
|
|
8967
8967
|
}, {
|
|
8968
8968
|
code?: string | undefined;
|
|
8969
|
-
city?: string | undefined;
|
|
8970
8969
|
state?: string | undefined;
|
|
8970
|
+
city?: string | undefined;
|
|
8971
8971
|
}>>;
|
|
8972
8972
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
8973
8973
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9075,12 +9075,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9075
9075
|
code: z.ZodOptional<z.ZodString>;
|
|
9076
9076
|
}, "strip", z.ZodTypeAny, {
|
|
9077
9077
|
code?: string | undefined;
|
|
9078
|
-
city?: string | undefined;
|
|
9079
9078
|
state?: string | undefined;
|
|
9079
|
+
city?: string | undefined;
|
|
9080
9080
|
}, {
|
|
9081
9081
|
code?: string | undefined;
|
|
9082
|
-
city?: string | undefined;
|
|
9083
9082
|
state?: string | undefined;
|
|
9083
|
+
city?: string | undefined;
|
|
9084
9084
|
}>>;
|
|
9085
9085
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9086
9086
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9108,12 +9108,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9108
9108
|
code: z.ZodOptional<z.ZodString>;
|
|
9109
9109
|
}, "strip", z.ZodTypeAny, {
|
|
9110
9110
|
code?: string | undefined;
|
|
9111
|
-
city?: string | undefined;
|
|
9112
9111
|
state?: string | undefined;
|
|
9112
|
+
city?: string | undefined;
|
|
9113
9113
|
}, {
|
|
9114
9114
|
code?: string | undefined;
|
|
9115
|
-
city?: string | undefined;
|
|
9116
9115
|
state?: string | undefined;
|
|
9116
|
+
city?: string | undefined;
|
|
9117
9117
|
}>>;
|
|
9118
9118
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9119
9119
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9141,12 +9141,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9141
9141
|
code: z.ZodOptional<z.ZodString>;
|
|
9142
9142
|
}, "strip", z.ZodTypeAny, {
|
|
9143
9143
|
code?: string | undefined;
|
|
9144
|
-
city?: string | undefined;
|
|
9145
9144
|
state?: string | undefined;
|
|
9145
|
+
city?: string | undefined;
|
|
9146
9146
|
}, {
|
|
9147
9147
|
code?: string | undefined;
|
|
9148
|
-
city?: string | undefined;
|
|
9149
9148
|
state?: string | undefined;
|
|
9149
|
+
city?: string | undefined;
|
|
9150
9150
|
}>>;
|
|
9151
9151
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9152
9152
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9689,12 +9689,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9689
9689
|
code: z.ZodOptional<z.ZodString>;
|
|
9690
9690
|
}, "strip", z.ZodTypeAny, {
|
|
9691
9691
|
code?: string | undefined;
|
|
9692
|
-
city?: string | undefined;
|
|
9693
9692
|
state?: string | undefined;
|
|
9693
|
+
city?: string | undefined;
|
|
9694
9694
|
}, {
|
|
9695
9695
|
code?: string | undefined;
|
|
9696
|
-
city?: string | undefined;
|
|
9697
9696
|
state?: string | undefined;
|
|
9697
|
+
city?: string | undefined;
|
|
9698
9698
|
}>>;
|
|
9699
9699
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9700
9700
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9722,12 +9722,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9722
9722
|
code: z.ZodOptional<z.ZodString>;
|
|
9723
9723
|
}, "strip", z.ZodTypeAny, {
|
|
9724
9724
|
code?: string | undefined;
|
|
9725
|
-
city?: string | undefined;
|
|
9726
9725
|
state?: string | undefined;
|
|
9726
|
+
city?: string | undefined;
|
|
9727
9727
|
}, {
|
|
9728
9728
|
code?: string | undefined;
|
|
9729
|
-
city?: string | undefined;
|
|
9730
9729
|
state?: string | undefined;
|
|
9730
|
+
city?: string | undefined;
|
|
9731
9731
|
}>>;
|
|
9732
9732
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9733
9733
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -9755,12 +9755,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
9755
9755
|
code: z.ZodOptional<z.ZodString>;
|
|
9756
9756
|
}, "strip", z.ZodTypeAny, {
|
|
9757
9757
|
code?: string | undefined;
|
|
9758
|
-
city?: string | undefined;
|
|
9759
9758
|
state?: string | undefined;
|
|
9759
|
+
city?: string | undefined;
|
|
9760
9760
|
}, {
|
|
9761
9761
|
code?: string | undefined;
|
|
9762
|
-
city?: string | undefined;
|
|
9763
9762
|
state?: string | undefined;
|
|
9763
|
+
city?: string | undefined;
|
|
9764
9764
|
}>>;
|
|
9765
9765
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
9766
9766
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -10303,12 +10303,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
10303
10303
|
code: z.ZodOptional<z.ZodString>;
|
|
10304
10304
|
}, "strip", z.ZodTypeAny, {
|
|
10305
10305
|
code?: string | undefined;
|
|
10306
|
-
city?: string | undefined;
|
|
10307
10306
|
state?: string | undefined;
|
|
10307
|
+
city?: string | undefined;
|
|
10308
10308
|
}, {
|
|
10309
10309
|
code?: string | undefined;
|
|
10310
|
-
city?: string | undefined;
|
|
10311
10310
|
state?: string | undefined;
|
|
10311
|
+
city?: string | undefined;
|
|
10312
10312
|
}>>;
|
|
10313
10313
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
10314
10314
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -10336,12 +10336,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
10336
10336
|
code: z.ZodOptional<z.ZodString>;
|
|
10337
10337
|
}, "strip", z.ZodTypeAny, {
|
|
10338
10338
|
code?: string | undefined;
|
|
10339
|
-
city?: string | undefined;
|
|
10340
10339
|
state?: string | undefined;
|
|
10340
|
+
city?: string | undefined;
|
|
10341
10341
|
}, {
|
|
10342
10342
|
code?: string | undefined;
|
|
10343
|
-
city?: string | undefined;
|
|
10344
10343
|
state?: string | undefined;
|
|
10344
|
+
city?: string | undefined;
|
|
10345
10345
|
}>>;
|
|
10346
10346
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
10347
10347
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -10369,12 +10369,12 @@ export declare const zIssuerTaxProfileSchema: z.ZodObject<{
|
|
|
10369
10369
|
code: z.ZodOptional<z.ZodString>;
|
|
10370
10370
|
}, "strip", z.ZodTypeAny, {
|
|
10371
10371
|
code?: string | undefined;
|
|
10372
|
-
city?: string | undefined;
|
|
10373
10372
|
state?: string | undefined;
|
|
10373
|
+
city?: string | undefined;
|
|
10374
10374
|
}, {
|
|
10375
10375
|
code?: string | undefined;
|
|
10376
|
-
city?: string | undefined;
|
|
10377
10376
|
state?: string | undefined;
|
|
10377
|
+
city?: string | undefined;
|
|
10378
10378
|
}>>;
|
|
10379
10379
|
tax_regime: z.ZodOptional<z.ZodEnum<["simples_nacional", "lucro_presumido", "lucro_real", "mei", "unknown"]>>;
|
|
10380
10380
|
rps_series: z.ZodOptional<z.ZodString>;
|
|
@@ -14704,6 +14704,8 @@ export declare const zNexFinopsContractAllowancesWriteSchema: z.ZodObject<{
|
|
|
14704
14704
|
}>>>>;
|
|
14705
14705
|
alerts_enabled: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
14706
14706
|
alert_thresholds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
14707
|
+
/** feat-264 D4 — ausente/null = TRUE (reembolsa). */
|
|
14708
|
+
nfse_fee_reimbursement: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
14707
14709
|
}, "strip", z.ZodTypeAny, {
|
|
14708
14710
|
allowances?: Record<string, {
|
|
14709
14711
|
included: number;
|
|
@@ -14711,6 +14713,7 @@ export declare const zNexFinopsContractAllowancesWriteSchema: z.ZodObject<{
|
|
|
14711
14713
|
}> | null | undefined;
|
|
14712
14714
|
alerts_enabled?: boolean | null | undefined;
|
|
14713
14715
|
alert_thresholds?: number[] | null | undefined;
|
|
14716
|
+
nfse_fee_reimbursement?: boolean | null | undefined;
|
|
14714
14717
|
}, {
|
|
14715
14718
|
allowances?: Record<string, {
|
|
14716
14719
|
included: number;
|
|
@@ -14718,6 +14721,7 @@ export declare const zNexFinopsContractAllowancesWriteSchema: z.ZodObject<{
|
|
|
14718
14721
|
}> | null | undefined;
|
|
14719
14722
|
alerts_enabled?: boolean | null | undefined;
|
|
14720
14723
|
alert_thresholds?: number[] | null | undefined;
|
|
14724
|
+
nfse_fee_reimbursement?: boolean | null | undefined;
|
|
14721
14725
|
}>;
|
|
14722
14726
|
export declare const zNexFinopsPaymentMethodKindSchema: z.ZodEnum<["asaas_subscription", "asaas_card_token"]>;
|
|
14723
14727
|
export declare const zNexFinopsPaymentMethodStatusSchema: z.ZodEnum<["active", "failing", "inactive", "revoked"]>;
|
|
@@ -14821,3 +14825,42 @@ export declare const zNexFinopsPaymentMethodsDiscoverSchema: z.ZodObject<{
|
|
|
14821
14825
|
} | undefined;
|
|
14822
14826
|
customer_id?: string | undefined;
|
|
14823
14827
|
}>;
|
|
14828
|
+
/** Competência `"YYYY-MM"`. */
|
|
14829
|
+
export declare const zNfseFeeReimbursementCompetenciaSchema: z.ZodString;
|
|
14830
|
+
/**
|
|
14831
|
+
* `POST /nfse-fee-reimbursements/execute`. `expected` é o que o operador viu
|
|
14832
|
+
* na prévia; o backend recalcula e recusa se divergir.
|
|
14833
|
+
*/
|
|
14834
|
+
export declare const zNfseFeeReimbursementExecuteSchema: z.ZodObject<{
|
|
14835
|
+
tenant: z.ZodString;
|
|
14836
|
+
competencia: z.ZodString;
|
|
14837
|
+
expected: z.ZodObject<{
|
|
14838
|
+
invoice_count: z.ZodNumber;
|
|
14839
|
+
fee_value: z.ZodNumber;
|
|
14840
|
+
amount: z.ZodNumber;
|
|
14841
|
+
}, "strip", z.ZodTypeAny, {
|
|
14842
|
+
amount: number;
|
|
14843
|
+
invoice_count: number;
|
|
14844
|
+
fee_value: number;
|
|
14845
|
+
}, {
|
|
14846
|
+
amount: number;
|
|
14847
|
+
invoice_count: number;
|
|
14848
|
+
fee_value: number;
|
|
14849
|
+
}>;
|
|
14850
|
+
}, "strict", z.ZodTypeAny, {
|
|
14851
|
+
tenant: string;
|
|
14852
|
+
expected: {
|
|
14853
|
+
amount: number;
|
|
14854
|
+
invoice_count: number;
|
|
14855
|
+
fee_value: number;
|
|
14856
|
+
};
|
|
14857
|
+
competencia: string;
|
|
14858
|
+
}, {
|
|
14859
|
+
tenant: string;
|
|
14860
|
+
expected: {
|
|
14861
|
+
amount: number;
|
|
14862
|
+
invoice_count: number;
|
|
14863
|
+
fee_value: number;
|
|
14864
|
+
};
|
|
14865
|
+
competencia: string;
|
|
14866
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.zServiceTaxInfoSchema = exports.zServiceLineItemSchema = exports.zServiceInvoiceStateSchema = exports.zProviderServiceInvoiceStatusSchema = exports.zExternalLinkSchema = exports.zExternalObjectTypeSchema = exports.zInvoiceSourceRefSchema = exports.zInvoiceSourceTypeSchema = exports.zInvoiceTakerRefSchema = exports.zInvoiceTakerSnapshotSchema = exports.zInvoiceTakerSnapshotAddressSchema = exports.zTakerDocumentSchema = exports.zTakerTaxProfileSchema = exports.zTakerProviderRefsSchema = exports.zTakerAddressSchema = exports.zInvoiceTakerTypeSchema = exports.zServiceSchema = exports.zCustomerServiceTaxInfoSchema = exports.zIssuerTaxProfileSchema = exports.zIssuerNfseConfigSchema = exports.zIssuerMunicipalCredentialsRefSchema = exports.zIssuerTaxRegimeSchema = exports.zIssuerCompanyIdentitySchema = exports.zIssuerCompanyAddressSchema = exports.zTaxProfileSyncStateSchema = exports.zAsaasProviderSchema = exports.zAsaasProviderAsaasBlockSchema = exports.zAsaasProviderCapabilitiesSchema = exports.zAsaasPaymentsCapabilitiesSchema = exports.zAsaasEnvFlagSchema = exports.zAsaasNfseCapabilitiesSchema = exports.zAsaasEnvAuthConfigSchema = exports.zAsaasSubaccountInputSchema = exports.zAsaasAccountScopeSchema = exports.zAsaasWebhookConfigSchema = exports.zRetryPolicySchema = exports.zAsaasWebhookEventSchema = exports.zAsaasAccountScopeModeSchema = exports.zProviderRemoteRefsSchema = exports.zProviderFiscalInfoPayloadSchema = exports.zProviderCredentialsInputSchema = exports.zProviderCredentialsSecretRefsSchema = exports.zProviderMunicipalOptionsSnapshotSchema = exports.zProviderOptionItemSchema = exports.zProviderMunicipalAuthTypeSchema = exports.zFinopsProviderBaseSchema = exports.zProviderStatusSchema = exports.zFinopsActionSchema = exports.zFinopsProviderTypeSchema = exports.zProviderEnvSchema = void 0;
|
|
4
|
-
exports.zNexFinopsPaymentMethodsDiscoverSchema = exports.zEvoBillingPortalCardCaptureSchema = exports.zNexFinopsBillingCardChargeSchema = exports.zNexFinopsContractPaymentMethodsWriteSchema = exports.zNexFinopsPaymentMethodPatchSchema = exports.zNexFinopsPaymentMethodStatusSchema = exports.zNexFinopsPaymentMethodKindSchema = exports.zNexFinopsContractAllowancesWriteSchema = exports.zNexFinopsUsageAlertDefaultsSchema = exports.zNexFinopsAlertThresholdSchema = exports.zNexFinopsContractAllowancesSchema = exports.zNexFinopsContractAllowanceSchema = exports.zNexVendasJourneyPaymentSchema = exports.zNexVendasJourneyPaymentSupersededSchema = exports.zNexVendasJourneyPaymentWebhookEventSchema = exports.zNexVendasJourneyBoletoSchema = exports.zNexVendasJourneyPaymentChooseSchema = exports.zNexVendasJourneyPaymentStateSchema = exports.zNexVendasJourneyPaymentKindSchema = exports.zNexVendasJourneyPaymentMethodSchema = exports.zNexFinopsContractAsaasInfoSchema = exports.zNexFinopsAsaasSubscriptionStatusSchema = exports.zNexFinopsPaymentMethodSchema = exports.zNexFinopsProposalSchema = exports.zNexFinopsProposalWriteSchema = exports.zNexFinopsProposalPrefillSchema = exports.zNexFinopsProposalLoyaltyPeriodSchema = exports.zNexFinopsProposalPaymentMethodSchema = exports.zNexFinopsProposalStatusSchema = exports.zServiceInvoiceSchema = exports.zPaymentLinkSchema = exports.zPaymentLinkDocumentStateSchema = exports.zAsaasPaymentLinkSubscriptionCycleSchema = exports.zAsaasPaymentLinkChargeTypeSchema = exports.zAsaasPaymentLinkBillingTypeSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = exports.zProviderInvoiceLinksSchema = void 0;
|
|
4
|
+
exports.zNfseFeeReimbursementExecuteSchema = exports.zNfseFeeReimbursementCompetenciaSchema = exports.zNexFinopsPaymentMethodsDiscoverSchema = exports.zEvoBillingPortalCardCaptureSchema = exports.zNexFinopsBillingCardChargeSchema = exports.zNexFinopsContractPaymentMethodsWriteSchema = exports.zNexFinopsPaymentMethodPatchSchema = exports.zNexFinopsPaymentMethodStatusSchema = exports.zNexFinopsPaymentMethodKindSchema = exports.zNexFinopsContractAllowancesWriteSchema = exports.zNexFinopsUsageAlertDefaultsSchema = exports.zNexFinopsAlertThresholdSchema = exports.zNexFinopsContractAllowancesSchema = exports.zNexFinopsContractAllowanceSchema = exports.zNexVendasJourneyPaymentSchema = exports.zNexVendasJourneyPaymentSupersededSchema = exports.zNexVendasJourneyPaymentWebhookEventSchema = exports.zNexVendasJourneyBoletoSchema = exports.zNexVendasJourneyPaymentChooseSchema = exports.zNexVendasJourneyPaymentStateSchema = exports.zNexVendasJourneyPaymentKindSchema = exports.zNexVendasJourneyPaymentMethodSchema = exports.zNexFinopsContractAsaasInfoSchema = exports.zNexFinopsAsaasSubscriptionStatusSchema = exports.zNexFinopsPaymentMethodSchema = exports.zNexFinopsProposalSchema = exports.zNexFinopsProposalWriteSchema = exports.zNexFinopsProposalPrefillSchema = exports.zNexFinopsProposalLoyaltyPeriodSchema = exports.zNexFinopsProposalPaymentMethodSchema = exports.zNexFinopsProposalStatusSchema = exports.zServiceInvoiceSchema = exports.zPaymentLinkSchema = exports.zPaymentLinkDocumentStateSchema = exports.zAsaasPaymentLinkSubscriptionCycleSchema = exports.zAsaasPaymentLinkChargeTypeSchema = exports.zAsaasPaymentLinkBillingTypeSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = exports.zProviderInvoiceLinksSchema = void 0;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const zod_schemas_1 = require("../shared/zod-schemas");
|
|
7
7
|
// ---- Provider enums and base ----
|
|
@@ -932,6 +932,8 @@ exports.zNexFinopsContractAllowancesWriteSchema = zod_1.z
|
|
|
932
932
|
allowances: exports.zNexFinopsContractAllowancesSchema.optional().nullable(),
|
|
933
933
|
alerts_enabled: zod_1.z.boolean().optional().nullable(),
|
|
934
934
|
alert_thresholds: zod_1.z.array(exports.zNexFinopsAlertThresholdSchema).optional().nullable(),
|
|
935
|
+
/** feat-264 D4 — ausente/null = TRUE (reembolsa). */
|
|
936
|
+
nfse_fee_reimbursement: zod_1.z.boolean().optional().nullable(),
|
|
935
937
|
})
|
|
936
938
|
.strip();
|
|
937
939
|
// ---- Nexus FinOps — métodos de pagamento do cliente (feat-253) ----
|
|
@@ -1007,3 +1009,23 @@ exports.zNexFinopsPaymentMethodsDiscoverSchema = zod_1.z
|
|
|
1007
1009
|
.optional(),
|
|
1008
1010
|
})
|
|
1009
1011
|
.strip();
|
|
1012
|
+
// ---- Nexus FinOps — reembolso da taxa de NFS-e (feat-264) ----
|
|
1013
|
+
/** Competência `"YYYY-MM"`. */
|
|
1014
|
+
exports.zNfseFeeReimbursementCompetenciaSchema = zod_1.z
|
|
1015
|
+
.string()
|
|
1016
|
+
.regex(/^\d{4}-(0[1-9]|1[0-2])$/);
|
|
1017
|
+
/**
|
|
1018
|
+
* `POST /nfse-fee-reimbursements/execute`. `expected` é o que o operador viu
|
|
1019
|
+
* na prévia; o backend recalcula e recusa se divergir.
|
|
1020
|
+
*/
|
|
1021
|
+
exports.zNfseFeeReimbursementExecuteSchema = zod_1.z
|
|
1022
|
+
.object({
|
|
1023
|
+
tenant: zod_1.z.string().min(1),
|
|
1024
|
+
competencia: exports.zNfseFeeReimbursementCompetenciaSchema,
|
|
1025
|
+
expected: zod_1.z.object({
|
|
1026
|
+
invoice_count: zod_1.z.number().int().positive(),
|
|
1027
|
+
fee_value: zod_1.z.number().positive(),
|
|
1028
|
+
amount: zod_1.z.number().positive(),
|
|
1029
|
+
}),
|
|
1030
|
+
})
|
|
1031
|
+
.strict();
|
|
@@ -1021,6 +1021,8 @@ export const zNexFinopsContractAllowancesWriteSchema = z
|
|
|
1021
1021
|
allowances: zNexFinopsContractAllowancesSchema.optional().nullable(),
|
|
1022
1022
|
alerts_enabled: z.boolean().optional().nullable(),
|
|
1023
1023
|
alert_thresholds: z.array(zNexFinopsAlertThresholdSchema).optional().nullable(),
|
|
1024
|
+
/** feat-264 D4 — ausente/null = TRUE (reembolsa). */
|
|
1025
|
+
nfse_fee_reimbursement: z.boolean().optional().nullable(),
|
|
1024
1026
|
})
|
|
1025
1027
|
.strip();
|
|
1026
1028
|
|
|
@@ -1104,3 +1106,26 @@ export const zNexFinopsPaymentMethodsDiscoverSchema = z
|
|
|
1104
1106
|
.optional(),
|
|
1105
1107
|
})
|
|
1106
1108
|
.strip();
|
|
1109
|
+
|
|
1110
|
+
// ---- Nexus FinOps — reembolso da taxa de NFS-e (feat-264) ----
|
|
1111
|
+
|
|
1112
|
+
/** Competência `"YYYY-MM"`. */
|
|
1113
|
+
export const zNfseFeeReimbursementCompetenciaSchema = z
|
|
1114
|
+
.string()
|
|
1115
|
+
.regex(/^\d{4}-(0[1-9]|1[0-2])$/);
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* `POST /nfse-fee-reimbursements/execute`. `expected` é o que o operador viu
|
|
1119
|
+
* na prévia; o backend recalcula e recusa se divergir.
|
|
1120
|
+
*/
|
|
1121
|
+
export const zNfseFeeReimbursementExecuteSchema = z
|
|
1122
|
+
.object({
|
|
1123
|
+
tenant: z.string().min(1),
|
|
1124
|
+
competencia: zNfseFeeReimbursementCompetenciaSchema,
|
|
1125
|
+
expected: z.object({
|
|
1126
|
+
invoice_count: z.number().int().positive(),
|
|
1127
|
+
fee_value: z.number().positive(),
|
|
1128
|
+
amount: z.number().positive(),
|
|
1129
|
+
}),
|
|
1130
|
+
})
|
|
1131
|
+
.strict();
|
|
@@ -140,8 +140,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
140
140
|
name: string;
|
|
141
141
|
kind: string;
|
|
142
142
|
country: string;
|
|
143
|
-
city: string;
|
|
144
143
|
state: string;
|
|
144
|
+
city: string;
|
|
145
145
|
line1: string;
|
|
146
146
|
line2: string;
|
|
147
147
|
neighborhood: string;
|
|
@@ -151,8 +151,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
151
151
|
name?: string | undefined;
|
|
152
152
|
kind?: string | undefined;
|
|
153
153
|
country?: string | undefined;
|
|
154
|
-
city?: string | undefined;
|
|
155
154
|
state?: string | undefined;
|
|
155
|
+
city?: string | undefined;
|
|
156
156
|
line1?: string | undefined;
|
|
157
157
|
line2?: string | undefined;
|
|
158
158
|
neighborhood?: string | undefined;
|
|
@@ -279,8 +279,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
279
279
|
name: string;
|
|
280
280
|
kind: string;
|
|
281
281
|
country: string;
|
|
282
|
-
city: string;
|
|
283
282
|
state: string;
|
|
283
|
+
city: string;
|
|
284
284
|
line1: string;
|
|
285
285
|
line2: string;
|
|
286
286
|
neighborhood: string;
|
|
@@ -290,8 +290,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
290
290
|
name?: string | undefined;
|
|
291
291
|
kind?: string | undefined;
|
|
292
292
|
country?: string | undefined;
|
|
293
|
-
city?: string | undefined;
|
|
294
293
|
state?: string | undefined;
|
|
294
|
+
city?: string | undefined;
|
|
295
295
|
line1?: string | undefined;
|
|
296
296
|
line2?: string | undefined;
|
|
297
297
|
neighborhood?: string | undefined;
|
|
@@ -418,8 +418,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
418
418
|
name: string;
|
|
419
419
|
kind: string;
|
|
420
420
|
country: string;
|
|
421
|
-
city: string;
|
|
422
421
|
state: string;
|
|
422
|
+
city: string;
|
|
423
423
|
line1: string;
|
|
424
424
|
line2: string;
|
|
425
425
|
neighborhood: string;
|
|
@@ -429,8 +429,8 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
429
429
|
name?: string | undefined;
|
|
430
430
|
kind?: string | undefined;
|
|
431
431
|
country?: string | undefined;
|
|
432
|
-
city?: string | undefined;
|
|
433
432
|
state?: string | undefined;
|
|
433
|
+
city?: string | undefined;
|
|
434
434
|
line1?: string | undefined;
|
|
435
435
|
line2?: string | undefined;
|
|
436
436
|
neighborhood?: string | undefined;
|
|
@@ -135,8 +135,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
135
135
|
name: string;
|
|
136
136
|
kind: string;
|
|
137
137
|
country: string;
|
|
138
|
-
city: string;
|
|
139
138
|
state: string;
|
|
139
|
+
city: string;
|
|
140
140
|
line1: string;
|
|
141
141
|
line2: string;
|
|
142
142
|
neighborhood: string;
|
|
@@ -146,8 +146,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
146
146
|
name?: string | undefined;
|
|
147
147
|
kind?: string | undefined;
|
|
148
148
|
country?: string | undefined;
|
|
149
|
-
city?: string | undefined;
|
|
150
149
|
state?: string | undefined;
|
|
150
|
+
city?: string | undefined;
|
|
151
151
|
line1?: string | undefined;
|
|
152
152
|
line2?: string | undefined;
|
|
153
153
|
neighborhood?: string | undefined;
|
|
@@ -289,8 +289,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
289
289
|
name: string;
|
|
290
290
|
kind: string;
|
|
291
291
|
country: string;
|
|
292
|
-
city: string;
|
|
293
292
|
state: string;
|
|
293
|
+
city: string;
|
|
294
294
|
line1: string;
|
|
295
295
|
line2: string;
|
|
296
296
|
neighborhood: string;
|
|
@@ -300,8 +300,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
300
300
|
name?: string | undefined;
|
|
301
301
|
kind?: string | undefined;
|
|
302
302
|
country?: string | undefined;
|
|
303
|
-
city?: string | undefined;
|
|
304
303
|
state?: string | undefined;
|
|
304
|
+
city?: string | undefined;
|
|
305
305
|
line1?: string | undefined;
|
|
306
306
|
line2?: string | undefined;
|
|
307
307
|
neighborhood?: string | undefined;
|
|
@@ -443,8 +443,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
443
443
|
name: string;
|
|
444
444
|
kind: string;
|
|
445
445
|
country: string;
|
|
446
|
-
city: string;
|
|
447
446
|
state: string;
|
|
447
|
+
city: string;
|
|
448
448
|
line1: string;
|
|
449
449
|
line2: string;
|
|
450
450
|
neighborhood: string;
|
|
@@ -454,8 +454,8 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
454
454
|
name?: string | undefined;
|
|
455
455
|
kind?: string | undefined;
|
|
456
456
|
country?: string | undefined;
|
|
457
|
-
city?: string | undefined;
|
|
458
457
|
state?: string | undefined;
|
|
458
|
+
city?: string | undefined;
|
|
459
459
|
line1?: string | undefined;
|
|
460
460
|
line2?: string | undefined;
|
|
461
461
|
neighborhood?: string | undefined;
|
|
@@ -984,8 +984,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
984
984
|
name: string;
|
|
985
985
|
kind: string;
|
|
986
986
|
country: string;
|
|
987
|
-
city: string;
|
|
988
987
|
state: string;
|
|
988
|
+
city: string;
|
|
989
989
|
line1: string;
|
|
990
990
|
line2: string;
|
|
991
991
|
neighborhood: string;
|
|
@@ -995,8 +995,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
995
995
|
name?: string | undefined;
|
|
996
996
|
kind?: string | undefined;
|
|
997
997
|
country?: string | undefined;
|
|
998
|
-
city?: string | undefined;
|
|
999
998
|
state?: string | undefined;
|
|
999
|
+
city?: string | undefined;
|
|
1000
1000
|
line1?: string | undefined;
|
|
1001
1001
|
line2?: string | undefined;
|
|
1002
1002
|
neighborhood?: string | undefined;
|
|
@@ -1632,8 +1632,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
1632
1632
|
name: string;
|
|
1633
1633
|
kind: string;
|
|
1634
1634
|
country: string;
|
|
1635
|
-
city: string;
|
|
1636
1635
|
state: string;
|
|
1636
|
+
city: string;
|
|
1637
1637
|
line1: string;
|
|
1638
1638
|
line2: string;
|
|
1639
1639
|
neighborhood: string;
|
|
@@ -1643,8 +1643,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
1643
1643
|
name?: string | undefined;
|
|
1644
1644
|
kind?: string | undefined;
|
|
1645
1645
|
country?: string | undefined;
|
|
1646
|
-
city?: string | undefined;
|
|
1647
1646
|
state?: string | undefined;
|
|
1647
|
+
city?: string | undefined;
|
|
1648
1648
|
line1?: string | undefined;
|
|
1649
1649
|
line2?: string | undefined;
|
|
1650
1650
|
neighborhood?: string | undefined;
|
|
@@ -2280,8 +2280,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
2280
2280
|
name: string;
|
|
2281
2281
|
kind: string;
|
|
2282
2282
|
country: string;
|
|
2283
|
-
city: string;
|
|
2284
2283
|
state: string;
|
|
2284
|
+
city: string;
|
|
2285
2285
|
line1: string;
|
|
2286
2286
|
line2: string;
|
|
2287
2287
|
neighborhood: string;
|
|
@@ -2291,8 +2291,8 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
2291
2291
|
name?: string | undefined;
|
|
2292
2292
|
kind?: string | undefined;
|
|
2293
2293
|
country?: string | undefined;
|
|
2294
|
-
city?: string | undefined;
|
|
2295
2294
|
state?: string | undefined;
|
|
2295
|
+
city?: string | undefined;
|
|
2296
2296
|
line1?: string | undefined;
|
|
2297
2297
|
line2?: string | undefined;
|
|
2298
2298
|
neighborhood?: string | undefined;
|
|
@@ -64,8 +64,8 @@ export declare const zAddressSchema: z.ZodObject<{
|
|
|
64
64
|
name: string;
|
|
65
65
|
kind: string;
|
|
66
66
|
country: string;
|
|
67
|
-
city: string;
|
|
68
67
|
state: string;
|
|
68
|
+
city: string;
|
|
69
69
|
line1: string;
|
|
70
70
|
line2: string;
|
|
71
71
|
neighborhood: string;
|
|
@@ -75,8 +75,8 @@ export declare const zAddressSchema: z.ZodObject<{
|
|
|
75
75
|
name?: string | undefined;
|
|
76
76
|
kind?: string | undefined;
|
|
77
77
|
country?: string | undefined;
|
|
78
|
-
city?: string | undefined;
|
|
79
78
|
state?: string | undefined;
|
|
79
|
+
city?: string | undefined;
|
|
80
80
|
line1?: string | undefined;
|
|
81
81
|
line2?: string | undefined;
|
|
82
82
|
neighborhood?: string | undefined;
|
|
@@ -54,14 +54,26 @@ export interface INexusModuleChatPermissions {
|
|
|
54
54
|
}
|
|
55
55
|
export interface INexusReports {
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Sub-claims do módulo financeiro do Nexus. `finance === true` é o formato
|
|
59
|
+
* legado; não herda `reimbursements` (feat-264: movimenta dinheiro, exige TOTP).
|
|
60
|
+
*/
|
|
61
|
+
export interface INexusModuleFinancePermissions {
|
|
62
|
+
customers?: boolean;
|
|
63
|
+
contracts?: boolean;
|
|
64
|
+
billing?: boolean;
|
|
65
|
+
reports?: boolean;
|
|
66
|
+
/** feat-264 — reembolso da taxa de NFS-e. Sem bypass de admin. */
|
|
67
|
+
reimbursements?: boolean;
|
|
68
|
+
}
|
|
57
69
|
export interface INexusModules {
|
|
58
70
|
chat?: INexusModuleChatPermissions | boolean;
|
|
59
71
|
tenants?: boolean;
|
|
60
|
-
finance?: boolean;
|
|
72
|
+
finance?: INexusModuleFinancePermissions | boolean;
|
|
61
73
|
notifications?: boolean;
|
|
62
74
|
waba?: boolean;
|
|
63
75
|
reports?: INexusReports | boolean;
|
|
64
|
-
[key: string]: INexusModuleChatPermissions | INexusReports | boolean | undefined;
|
|
76
|
+
[key: string]: INexusModuleChatPermissions | INexusModuleFinancePermissions | INexusReports | boolean | undefined;
|
|
65
77
|
}
|
|
66
78
|
export interface INexusClaims {
|
|
67
79
|
nexus_access: boolean;
|
|
@@ -66,14 +66,32 @@ export interface INexusModuleChatPermissions {
|
|
|
66
66
|
|
|
67
67
|
export interface INexusReports {}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Sub-claims do módulo financeiro do Nexus. `finance === true` é o formato
|
|
71
|
+
* legado; não herda `reimbursements` (feat-264: movimenta dinheiro, exige TOTP).
|
|
72
|
+
*/
|
|
73
|
+
export interface INexusModuleFinancePermissions {
|
|
74
|
+
customers?: boolean;
|
|
75
|
+
contracts?: boolean;
|
|
76
|
+
billing?: boolean;
|
|
77
|
+
reports?: boolean;
|
|
78
|
+
/** feat-264 — reembolso da taxa de NFS-e. Sem bypass de admin. */
|
|
79
|
+
reimbursements?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
69
82
|
export interface INexusModules {
|
|
70
83
|
chat?: INexusModuleChatPermissions | boolean;
|
|
71
84
|
tenants?: boolean;
|
|
72
|
-
finance?: boolean;
|
|
85
|
+
finance?: INexusModuleFinancePermissions | boolean;
|
|
73
86
|
notifications?: boolean;
|
|
74
87
|
waba?: boolean;
|
|
75
88
|
reports?: INexusReports | boolean;
|
|
76
|
-
[key: string]:
|
|
89
|
+
[key: string]:
|
|
90
|
+
| INexusModuleChatPermissions
|
|
91
|
+
| INexusModuleFinancePermissions
|
|
92
|
+
| INexusReports
|
|
93
|
+
| boolean
|
|
94
|
+
| undefined;
|
|
77
95
|
}
|
|
78
96
|
|
|
79
97
|
export interface INexusClaims {
|
|
@@ -179,6 +179,8 @@ export interface INexFinopsContract extends IFireGlobalDoc {
|
|
|
179
179
|
* `INexFinopsUsageAlertDefaults.thresholds`.
|
|
180
180
|
*/
|
|
181
181
|
alert_thresholds?: number[] | null;
|
|
182
|
+
/** feat-264 D4 — reembolsar a taxa de NFS-e ao cliente. ⚠️ Ausente/null = TRUE (reembolsa). */
|
|
183
|
+
nfse_fee_reimbursement?: boolean | null;
|
|
182
184
|
}
|
|
183
185
|
export declare const NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS: Record<NexFinopsContractStatus, NexFinopsContractStatus[]>;
|
|
184
186
|
/**
|
|
@@ -219,6 +219,9 @@ export interface INexFinopsContract extends IFireGlobalDoc {
|
|
|
219
219
|
* `INexFinopsUsageAlertDefaults.thresholds`.
|
|
220
220
|
*/
|
|
221
221
|
alert_thresholds?: number[] | null;
|
|
222
|
+
|
|
223
|
+
/** feat-264 D4 — reembolsar a taxa de NFS-e ao cliente. ⚠️ Ausente/null = TRUE (reembolsa). */
|
|
224
|
+
nfse_fee_reimbursement?: boolean | null;
|
|
222
225
|
}
|
|
223
226
|
|
|
224
227
|
// ── Status transitions ──
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** Coleção dos registros de reembolso. */
|
|
2
|
+
export declare const NEX_FINOPS_NFSE_FEE_REIMBURSEMENTS_COLLECTION = "nfse_fee_reimbursements";
|
|
3
|
+
/** `externalReference` da transferência Asaas = `"nexnfr:{id}"`. */
|
|
4
|
+
export declare const NFSE_FEE_REIMBURSEMENT_EXTERNAL_REF_PREFIX = "nexnfr:";
|
|
5
|
+
export type NfseFeeReimbursementState = 'awaiting_authorization' | 'pending' | 'done' | 'failed' | 'canceled' | 'refused';
|
|
6
|
+
/**
|
|
7
|
+
* `failed`/`canceled`/`refused` -> `done` existe só para a REALIDADE do Asaas: um
|
|
8
|
+
* `TRANSFER_DONE` do `transfer_id` vinculado significa que o dinheiro saiu; o
|
|
9
|
+
* registro vira `done` (as notas passam a ser consumidas e nunca são pagas duas
|
|
10
|
+
* vezes) e gera alerta CRITICAL. Nenhum fluxo nosso faz essa transição.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NFSE_FEE_REIMBURSEMENT_TRANSITIONS: Record<NfseFeeReimbursementState, NfseFeeReimbursementState[]>;
|
|
13
|
+
/** Estados que consomem as notas do snapshot (não podem ser reembolsadas de novo). */
|
|
14
|
+
export declare const NFSE_FEE_REIMBURSEMENT_CONSUMING_STATES: readonly string[];
|
|
15
|
+
/** Estados em voo: bloqueiam nova execução para o mesmo tenant/competência. */
|
|
16
|
+
export declare const NFSE_FEE_REIMBURSEMENT_IN_FLIGHT_STATES: readonly string[];
|
|
17
|
+
/** D1: plugável. Só `asaas_internal_transfer` é implementado; `pix` fica para depois. */
|
|
18
|
+
export type NfseFeeReimbursementPayoutMethod = 'asaas_internal_transfer';
|
|
19
|
+
export interface INfseFeeReimbursement {
|
|
20
|
+
/** `{tenant}_{YYYY-MM}[_{seq}]` */
|
|
21
|
+
id: string;
|
|
22
|
+
tenant: string;
|
|
23
|
+
/** `"YYYY-MM"` (mês de `authorized_at` em America/Sao_Paulo). */
|
|
24
|
+
competencia: string;
|
|
25
|
+
/** 1, 2, … */
|
|
26
|
+
seq: number;
|
|
27
|
+
state: NfseFeeReimbursementState;
|
|
28
|
+
state_reason?: string | null;
|
|
29
|
+
provider: {
|
|
30
|
+
id: string;
|
|
31
|
+
type: 'asaas_subaccount';
|
|
32
|
+
env: 'production';
|
|
33
|
+
asaas_account_id: string;
|
|
34
|
+
wallet_id: string;
|
|
35
|
+
};
|
|
36
|
+
/** Snapshot do que foi reembolsado. */
|
|
37
|
+
invoices: {
|
|
38
|
+
count: number;
|
|
39
|
+
ids: string[];
|
|
40
|
+
};
|
|
41
|
+
fee: {
|
|
42
|
+
value: number;
|
|
43
|
+
source: 'asaas_myaccount_fees';
|
|
44
|
+
fetched_at: string;
|
|
45
|
+
};
|
|
46
|
+
/** `round2(count * fee.value)` */
|
|
47
|
+
amount: number;
|
|
48
|
+
currency: 'BRL';
|
|
49
|
+
contract: {
|
|
50
|
+
customer_id: string | null;
|
|
51
|
+
contract_ids: string[];
|
|
52
|
+
};
|
|
53
|
+
payout: {
|
|
54
|
+
method: NfseFeeReimbursementPayoutMethod;
|
|
55
|
+
/** `"nexnfr:{id}"` */
|
|
56
|
+
external_reference: string;
|
|
57
|
+
/** Ex.: `"Reembolso taxa NFS-e 09/2026 - 10 notas"` */
|
|
58
|
+
description: string;
|
|
59
|
+
/** Id Asaas — vinculado SÓ pela resposta do nosso POST /v3/transfers/ (validação e eventos nunca vinculam). */
|
|
60
|
+
transfer_id?: string | null;
|
|
61
|
+
/** PENDING | BANK_PROCESSING | DONE | CANCELLED | FAILED | BLOCKED */
|
|
62
|
+
asaas_status?: string | null;
|
|
63
|
+
transfer_fee?: number | null;
|
|
64
|
+
effective_date?: string | null;
|
|
65
|
+
fail_reason?: string | null;
|
|
66
|
+
};
|
|
67
|
+
validation: {
|
|
68
|
+
decision: 'APPROVED' | 'REFUSED' | null;
|
|
69
|
+
decided_at?: string | null;
|
|
70
|
+
attempts: number;
|
|
71
|
+
last_reason?: string | null;
|
|
72
|
+
};
|
|
73
|
+
last_event?: string | null;
|
|
74
|
+
last_event_at?: string | null;
|
|
75
|
+
requested_by: {
|
|
76
|
+
login_id: string;
|
|
77
|
+
email?: string | null;
|
|
78
|
+
second_factor: 'totp';
|
|
79
|
+
auth_time: string;
|
|
80
|
+
};
|
|
81
|
+
created_at: string;
|
|
82
|
+
updated_at: string;
|
|
83
|
+
done_at?: string | null;
|
|
84
|
+
}
|
|
85
|
+
export type NfseFeeReimbursementEligibility = 'eligible' | 'nothing_to_reimburse' | 'in_flight' | 'open_competencia' | 'not_eligible_own_account' | 'not_eligible_contract_flag' | 'no_contract' | 'subaccount_not_ready' | 'fee_unavailable';
|
|
86
|
+
export interface INfseFeeReimbursementPreviewRow {
|
|
87
|
+
tenant: string;
|
|
88
|
+
tenant_name?: string | null;
|
|
89
|
+
competencia: string;
|
|
90
|
+
eligibility: NfseFeeReimbursementEligibility;
|
|
91
|
+
reason?: string | null;
|
|
92
|
+
provider_id?: string | null;
|
|
93
|
+
provider_type?: string | null;
|
|
94
|
+
wallet_id?: string | null;
|
|
95
|
+
/** Autorizadas na competência, do provider. */
|
|
96
|
+
invoice_count_total: number;
|
|
97
|
+
invoice_count_already_reimbursed: number;
|
|
98
|
+
invoice_count_to_reimburse: number;
|
|
99
|
+
fee_value: number | null;
|
|
100
|
+
amount: number | null;
|
|
101
|
+
next_record_id?: string | null;
|
|
102
|
+
records: Array<Pick<INfseFeeReimbursement, 'id' | 'state' | 'amount' | 'seq'> & {
|
|
103
|
+
invoice_count: number;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ── Nexus FinOps — reembolso da taxa de NFS-e (feat-264) ──
|
|
3
|
+
//
|
|
4
|
+
// A Asaas debita da subconta do cliente a taxa de cada NFS-e autorizada. O
|
|
5
|
+
// Nexus apura, por competência, quantas notas nossas foram autorizadas e
|
|
6
|
+
// devolve `count × fee` por transferência interna (walletId) a partir da conta
|
|
7
|
+
// master. Cada apuração vira um registro de controle do backend.
|
|
8
|
+
//
|
|
9
|
+
// Runtime `lib: es6`: as constantes abaixo são só dados.
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.NFSE_FEE_REIMBURSEMENT_IN_FLIGHT_STATES = exports.NFSE_FEE_REIMBURSEMENT_CONSUMING_STATES = exports.NFSE_FEE_REIMBURSEMENT_TRANSITIONS = exports.NFSE_FEE_REIMBURSEMENT_EXTERNAL_REF_PREFIX = exports.NEX_FINOPS_NFSE_FEE_REIMBURSEMENTS_COLLECTION = void 0;
|
|
12
|
+
/** Coleção dos registros de reembolso. */
|
|
13
|
+
exports.NEX_FINOPS_NFSE_FEE_REIMBURSEMENTS_COLLECTION = 'nfse_fee_reimbursements';
|
|
14
|
+
// path: core/nexus/apps/nex-finops/nfse_fee_reimbursements/{id}
|
|
15
|
+
/** `externalReference` da transferência Asaas = `"nexnfr:{id}"`. */
|
|
16
|
+
exports.NFSE_FEE_REIMBURSEMENT_EXTERNAL_REF_PREFIX = 'nexnfr:';
|
|
17
|
+
/**
|
|
18
|
+
* `failed`/`canceled`/`refused` -> `done` existe só para a REALIDADE do Asaas: um
|
|
19
|
+
* `TRANSFER_DONE` do `transfer_id` vinculado significa que o dinheiro saiu; o
|
|
20
|
+
* registro vira `done` (as notas passam a ser consumidas e nunca são pagas duas
|
|
21
|
+
* vezes) e gera alerta CRITICAL. Nenhum fluxo nosso faz essa transição.
|
|
22
|
+
*/
|
|
23
|
+
exports.NFSE_FEE_REIMBURSEMENT_TRANSITIONS = {
|
|
24
|
+
awaiting_authorization: ['pending', 'failed', 'refused', 'canceled', 'done'],
|
|
25
|
+
pending: ['done', 'failed', 'canceled'],
|
|
26
|
+
done: [],
|
|
27
|
+
failed: ['done'],
|
|
28
|
+
canceled: ['done'],
|
|
29
|
+
refused: ['done'],
|
|
30
|
+
};
|
|
31
|
+
/** Estados que consomem as notas do snapshot (não podem ser reembolsadas de novo). */
|
|
32
|
+
exports.NFSE_FEE_REIMBURSEMENT_CONSUMING_STATES = ['awaiting_authorization', 'pending', 'done'];
|
|
33
|
+
/** Estados em voo: bloqueiam nova execução para o mesmo tenant/competência. */
|
|
34
|
+
exports.NFSE_FEE_REIMBURSEMENT_IN_FLIGHT_STATES = ['awaiting_authorization', 'pending'];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// ── Nexus FinOps — reembolso da taxa de NFS-e (feat-264) ──
|
|
2
|
+
//
|
|
3
|
+
// A Asaas debita da subconta do cliente a taxa de cada NFS-e autorizada. O
|
|
4
|
+
// Nexus apura, por competência, quantas notas nossas foram autorizadas e
|
|
5
|
+
// devolve `count × fee` por transferência interna (walletId) a partir da conta
|
|
6
|
+
// master. Cada apuração vira um registro de controle do backend.
|
|
7
|
+
//
|
|
8
|
+
// Runtime `lib: es6`: as constantes abaixo são só dados.
|
|
9
|
+
|
|
10
|
+
/** Coleção dos registros de reembolso. */
|
|
11
|
+
export const NEX_FINOPS_NFSE_FEE_REIMBURSEMENTS_COLLECTION = 'nfse_fee_reimbursements';
|
|
12
|
+
// path: core/nexus/apps/nex-finops/nfse_fee_reimbursements/{id}
|
|
13
|
+
|
|
14
|
+
/** `externalReference` da transferência Asaas = `"nexnfr:{id}"`. */
|
|
15
|
+
export const NFSE_FEE_REIMBURSEMENT_EXTERNAL_REF_PREFIX = 'nexnfr:';
|
|
16
|
+
|
|
17
|
+
export type NfseFeeReimbursementState =
|
|
18
|
+
| 'awaiting_authorization' // intenção gravada; POST /v3/transfers chamado ou a chamar; aguarda validação
|
|
19
|
+
| 'pending' // validação APROVADA por nós (ou Asaas confirmou PENDING com id vinculado)
|
|
20
|
+
| 'done' // TRANSFER_DONE
|
|
21
|
+
| 'failed' // POST rejeitado/erro de rede, ou TRANSFER_FAILED
|
|
22
|
+
| 'canceled' // TRANSFER_CANCELLED (inclui 3 falhas da validação)
|
|
23
|
+
| 'refused'; // nosso webhook recusou (divergência) — terminal
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* `failed`/`canceled`/`refused` -> `done` existe só para a REALIDADE do Asaas: um
|
|
27
|
+
* `TRANSFER_DONE` do `transfer_id` vinculado significa que o dinheiro saiu; o
|
|
28
|
+
* registro vira `done` (as notas passam a ser consumidas e nunca são pagas duas
|
|
29
|
+
* vezes) e gera alerta CRITICAL. Nenhum fluxo nosso faz essa transição.
|
|
30
|
+
*/
|
|
31
|
+
export const NFSE_FEE_REIMBURSEMENT_TRANSITIONS: Record<NfseFeeReimbursementState, NfseFeeReimbursementState[]> = {
|
|
32
|
+
awaiting_authorization: ['pending', 'failed', 'refused', 'canceled', 'done'],
|
|
33
|
+
pending: ['done', 'failed', 'canceled'],
|
|
34
|
+
done: [],
|
|
35
|
+
failed: ['done'],
|
|
36
|
+
canceled: ['done'],
|
|
37
|
+
refused: ['done'],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Estados que consomem as notas do snapshot (não podem ser reembolsadas de novo). */
|
|
41
|
+
export const NFSE_FEE_REIMBURSEMENT_CONSUMING_STATES: readonly string[] = ['awaiting_authorization', 'pending', 'done'];
|
|
42
|
+
|
|
43
|
+
/** Estados em voo: bloqueiam nova execução para o mesmo tenant/competência. */
|
|
44
|
+
export const NFSE_FEE_REIMBURSEMENT_IN_FLIGHT_STATES: readonly string[] = ['awaiting_authorization', 'pending'];
|
|
45
|
+
|
|
46
|
+
/** D1: plugável. Só `asaas_internal_transfer` é implementado; `pix` fica para depois. */
|
|
47
|
+
export type NfseFeeReimbursementPayoutMethod = 'asaas_internal_transfer';
|
|
48
|
+
|
|
49
|
+
export interface INfseFeeReimbursement {
|
|
50
|
+
/** `{tenant}_{YYYY-MM}[_{seq}]` */
|
|
51
|
+
id: string;
|
|
52
|
+
tenant: string;
|
|
53
|
+
/** `"YYYY-MM"` (mês de `authorized_at` em America/Sao_Paulo). */
|
|
54
|
+
competencia: string;
|
|
55
|
+
/** 1, 2, … */
|
|
56
|
+
seq: number;
|
|
57
|
+
state: NfseFeeReimbursementState;
|
|
58
|
+
state_reason?: string | null;
|
|
59
|
+
provider: {
|
|
60
|
+
id: string;
|
|
61
|
+
type: 'asaas_subaccount';
|
|
62
|
+
env: 'production';
|
|
63
|
+
asaas_account_id: string;
|
|
64
|
+
wallet_id: string;
|
|
65
|
+
};
|
|
66
|
+
/** Snapshot do que foi reembolsado. */
|
|
67
|
+
invoices: { count: number; ids: string[] };
|
|
68
|
+
fee: { value: number; source: 'asaas_myaccount_fees'; fetched_at: string };
|
|
69
|
+
/** `round2(count * fee.value)` */
|
|
70
|
+
amount: number;
|
|
71
|
+
currency: 'BRL';
|
|
72
|
+
contract: { customer_id: string | null; contract_ids: string[] };
|
|
73
|
+
payout: {
|
|
74
|
+
method: NfseFeeReimbursementPayoutMethod;
|
|
75
|
+
/** `"nexnfr:{id}"` */
|
|
76
|
+
external_reference: string;
|
|
77
|
+
/** Ex.: `"Reembolso taxa NFS-e 09/2026 - 10 notas"` */
|
|
78
|
+
description: string;
|
|
79
|
+
/** Id Asaas — vinculado SÓ pela resposta do nosso POST /v3/transfers/ (validação e eventos nunca vinculam). */
|
|
80
|
+
transfer_id?: string | null;
|
|
81
|
+
/** PENDING | BANK_PROCESSING | DONE | CANCELLED | FAILED | BLOCKED */
|
|
82
|
+
asaas_status?: string | null;
|
|
83
|
+
transfer_fee?: number | null;
|
|
84
|
+
effective_date?: string | null;
|
|
85
|
+
fail_reason?: string | null;
|
|
86
|
+
};
|
|
87
|
+
validation: {
|
|
88
|
+
decision: 'APPROVED' | 'REFUSED' | null;
|
|
89
|
+
decided_at?: string | null;
|
|
90
|
+
attempts: number;
|
|
91
|
+
last_reason?: string | null;
|
|
92
|
+
};
|
|
93
|
+
last_event?: string | null;
|
|
94
|
+
last_event_at?: string | null;
|
|
95
|
+
requested_by: {
|
|
96
|
+
login_id: string;
|
|
97
|
+
email?: string | null;
|
|
98
|
+
second_factor: 'totp';
|
|
99
|
+
auth_time: string;
|
|
100
|
+
};
|
|
101
|
+
created_at: string;
|
|
102
|
+
updated_at: string;
|
|
103
|
+
done_at?: string | null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type NfseFeeReimbursementEligibility =
|
|
107
|
+
| 'eligible'
|
|
108
|
+
| 'nothing_to_reimburse'
|
|
109
|
+
| 'in_flight'
|
|
110
|
+
| 'open_competencia'
|
|
111
|
+
| 'not_eligible_own_account' // provider type 'asaas' (conta própria) — D1
|
|
112
|
+
| 'not_eligible_contract_flag'
|
|
113
|
+
| 'no_contract'
|
|
114
|
+
| 'subaccount_not_ready' // subconta inativa/sem wallet_id/sem env production
|
|
115
|
+
| 'fee_unavailable'; // GET /v3/myAccount/fees falhou ou sem invoice.feeValue
|
|
116
|
+
|
|
117
|
+
export interface INfseFeeReimbursementPreviewRow {
|
|
118
|
+
tenant: string;
|
|
119
|
+
tenant_name?: string | null;
|
|
120
|
+
competencia: string;
|
|
121
|
+
eligibility: NfseFeeReimbursementEligibility;
|
|
122
|
+
reason?: string | null;
|
|
123
|
+
provider_id?: string | null;
|
|
124
|
+
provider_type?: string | null;
|
|
125
|
+
wallet_id?: string | null;
|
|
126
|
+
/** Autorizadas na competência, do provider. */
|
|
127
|
+
invoice_count_total: number;
|
|
128
|
+
invoice_count_already_reimbursed: number;
|
|
129
|
+
invoice_count_to_reimburse: number;
|
|
130
|
+
fee_value: number | null;
|
|
131
|
+
amount: number | null;
|
|
132
|
+
next_record_id?: string | null;
|
|
133
|
+
records: Array<Pick<INfseFeeReimbursement, 'id' | 'state' | 'amount' | 'seq'> & { invoice_count: number }>;
|
|
134
|
+
}
|
|
@@ -5,6 +5,7 @@ export * from "./common/contract";
|
|
|
5
5
|
export * from "./common/proposal";
|
|
6
6
|
export * from "./common/billing";
|
|
7
7
|
export * from "./common/payment-method";
|
|
8
|
+
export * from "./common/nfse-fee-reimbursement";
|
|
8
9
|
export * from "./providers";
|
|
9
10
|
export * from "./providers/provider_fiscal_types";
|
|
10
11
|
export * from "./providers/asaas/asaas_provider";
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./common/contract"), exports);
|
|
|
22
22
|
__exportStar(require("./common/proposal"), exports);
|
|
23
23
|
__exportStar(require("./common/billing"), exports);
|
|
24
24
|
__exportStar(require("./common/payment-method"), exports);
|
|
25
|
+
__exportStar(require("./common/nfse-fee-reimbursement"), exports);
|
|
25
26
|
__exportStar(require("./providers"), exports);
|
|
26
27
|
__exportStar(require("./providers/provider_fiscal_types"), exports);
|
|
27
28
|
__exportStar(require("./providers/asaas/asaas_provider"), exports);
|
|
@@ -7,6 +7,7 @@ export * from "./common/contract";
|
|
|
7
7
|
export * from "./common/proposal";
|
|
8
8
|
export * from "./common/billing";
|
|
9
9
|
export * from "./common/payment-method";
|
|
10
|
+
export * from "./common/nfse-fee-reimbursement";
|
|
10
11
|
export * from "./providers";
|
|
11
12
|
export * from "./providers/provider_fiscal_types";
|
|
12
13
|
export * from "./providers/asaas/asaas_provider";
|