@wrcb/cb-common 1.0.864 → 1.0.865

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.
Files changed (38) hide show
  1. package/build/config/notasBrBilling.d.ts +6 -0
  2. package/build/config/notasBrBilling.js +72 -0
  3. package/build/events/notas-br/certificateExpiringEvent.d.ts +14 -0
  4. package/build/events/notas-br/certificateExpiringEvent.js +2 -0
  5. package/build/events/notas-br/certificateExpiringPublisher.d.ts +6 -0
  6. package/build/events/notas-br/certificateExpiringPublisher.js +12 -0
  7. package/build/events/notas-br/creditsGrantedEvent.d.ts +15 -0
  8. package/build/events/notas-br/creditsGrantedEvent.js +2 -0
  9. package/build/events/notas-br/creditsGrantedPublisher.d.ts +6 -0
  10. package/build/events/notas-br/creditsGrantedPublisher.js +12 -0
  11. package/build/events/notas-br/index.d.ts +10 -0
  12. package/build/events/notas-br/index.js +26 -0
  13. package/build/events/notas-br/invoiceAuthorizedEvent.d.ts +22 -0
  14. package/build/events/notas-br/invoiceAuthorizedEvent.js +2 -0
  15. package/build/events/notas-br/invoiceAuthorizedPublisher.d.ts +6 -0
  16. package/build/events/notas-br/invoiceAuthorizedPublisher.js +12 -0
  17. package/build/events/notas-br/invoiceCancelledEvent.d.ts +19 -0
  18. package/build/events/notas-br/invoiceCancelledEvent.js +2 -0
  19. package/build/events/notas-br/invoiceCancelledPublisher.d.ts +6 -0
  20. package/build/events/notas-br/invoiceCancelledPublisher.js +12 -0
  21. package/build/events/notas-br/invoiceRejectedEvent.d.ts +18 -0
  22. package/build/events/notas-br/invoiceRejectedEvent.js +2 -0
  23. package/build/events/notas-br/invoiceRejectedPublisher.d.ts +6 -0
  24. package/build/events/notas-br/invoiceRejectedPublisher.js +12 -0
  25. package/build/events/subjects.d.ts +6 -1
  26. package/build/events/subjects.js +6 -0
  27. package/build/index.d.ts +4 -0
  28. package/build/index.js +7 -0
  29. package/build/server.d.ts +1 -0
  30. package/build/server.js +2 -0
  31. package/build/services/TenantDataService.js +46 -0
  32. package/build/types/dmAutomator.d.ts +54 -0
  33. package/build/types/dmAutomator.js +6 -0
  34. package/build/types/notasBr.d.ts +264 -0
  35. package/build/types/notasBr.js +174 -0
  36. package/build/types/tenant.d.ts +2 -1
  37. package/build/types/tenant.js +1 -0
  38. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import { NbBillingTable, NbCreditPackage, NotasBrPlanTier } from '../types/notasBr';
2
+ export declare const CURRENT_BILLING_VERSION = "2026-08";
3
+ export declare const getBillingTable: (version?: string) => NbBillingTable;
4
+ export declare const getPlanConfig: (tier: NotasBrPlanTier, version?: string) => import("../types/notasBr").NbPlanConfig;
5
+ export declare const getCreditPackageConfig: (creditPackage: NbCreditPackage, version?: string) => import("../types/notasBr").NbCreditPackageConfig;
6
+ export declare const getTrialConfig: (version?: string) => import("../types/notasBr").NbTrialConfig;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // Configuração de billing do notas_br — fonte única de preços, franquias e limites.
3
+ //
4
+ // Mora no cb-common porque DOIS serviços precisam dos mesmos números: o
5
+ // gn-business decide se pode emitir, e o cb-payments cobra o pacote de crédito.
6
+ // Uma cópia em cada lado sairia do ar na primeira mudança de preço.
7
+ //
8
+ // Nenhum outro arquivo pode conter esses números. A tabela é versionada porque o
9
+ // preço muda com o tempo e o cliente que já assinou mantém o que contratou: a
10
+ // conta guarda `billingVersion` e todo cálculo passa por getBillingTable(versão).
11
+ //
12
+ // Ao mudar preço ou franquia: crie uma NOVA versão, não edite a existente.
13
+ // Editar uma versão publicada reescreve retroativamente o contrato de quem assinou.
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.getTrialConfig = exports.getCreditPackageConfig = exports.getPlanConfig = exports.getBillingTable = exports.CURRENT_BILLING_VERSION = void 0;
16
+ const notasBr_1 = require("../types/notasBr");
17
+ exports.CURRENT_BILLING_VERSION = '2026-08';
18
+ const BILLING_TABLES = {
19
+ '2026-08': {
20
+ version: '2026-08',
21
+ plans: {
22
+ [notasBr_1.NotasBrPlanTier.Essential]: {
23
+ tier: notasBr_1.NotasBrPlanTier.Essential,
24
+ monthlyPriceCents: 5900,
25
+ annualPriceCents: 59000, // 2 meses grátis
26
+ monthlyInvoiceAllowance: 50,
27
+ maxCompanies: 1,
28
+ maxUsers: 2
29
+ },
30
+ [notasBr_1.NotasBrPlanTier.Professional]: {
31
+ tier: notasBr_1.NotasBrPlanTier.Professional,
32
+ monthlyPriceCents: 11900,
33
+ annualPriceCents: 119000,
34
+ monthlyInvoiceAllowance: 200,
35
+ maxCompanies: null,
36
+ maxUsers: null
37
+ }
38
+ },
39
+ creditPackages: {
40
+ [notasBr_1.NbCreditPackage.Small]: {
41
+ creditPackage: notasBr_1.NbCreditPackage.Small,
42
+ priceCents: 1000,
43
+ quantity: 10
44
+ },
45
+ [notasBr_1.NbCreditPackage.Medium]: {
46
+ creditPackage: notasBr_1.NbCreditPackage.Medium,
47
+ priceCents: 5000,
48
+ quantity: 60
49
+ },
50
+ [notasBr_1.NbCreditPackage.Large]: {
51
+ creditPackage: notasBr_1.NbCreditPackage.Large,
52
+ priceCents: 15000,
53
+ quantity: 200
54
+ }
55
+ },
56
+ trial: {
57
+ durationDays: 7,
58
+ invoicesPerDay: 1
59
+ }
60
+ }
61
+ };
62
+ // Conta antiga com versão que não existe mais cai na atual em vez de quebrar a
63
+ // emissão. Só acontece se uma versão for removida do arquivo — o que não deve
64
+ // ser feito, mas falhar aberto aqui é melhor que bloquear quem paga.
65
+ const getBillingTable = (version) => (version && BILLING_TABLES[version]) || BILLING_TABLES[exports.CURRENT_BILLING_VERSION];
66
+ exports.getBillingTable = getBillingTable;
67
+ const getPlanConfig = (tier, version) => (0, exports.getBillingTable)(version).plans[tier];
68
+ exports.getPlanConfig = getPlanConfig;
69
+ const getCreditPackageConfig = (creditPackage, version) => (0, exports.getBillingTable)(version).creditPackages[creditPackage];
70
+ exports.getCreditPackageConfig = getCreditPackageConfig;
71
+ const getTrialConfig = (version) => (0, exports.getBillingTable)(version).trial;
72
+ exports.getTrialConfig = getTrialConfig;
@@ -0,0 +1,14 @@
1
+ import { Subjects } from '../subjects';
2
+ export interface NotasBrCertificateExpiringEvent {
3
+ subject: Subjects.NotasBrCertificateExpiring;
4
+ data: {
5
+ accountId: string;
6
+ companyId: string;
7
+ companyName: string;
8
+ cnpj: string;
9
+ ownerEmail: string;
10
+ expiresAt: string;
11
+ daysUntilExpiration: number;
12
+ timestamp: string;
13
+ };
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Publisher } from '../basePublisher';
2
+ import { NotasBrCertificateExpiringEvent } from './certificateExpiringEvent';
3
+ import { Subjects } from '../subjects';
4
+ export declare class NotasBrCertificateExpiringPublisher extends Publisher<NotasBrCertificateExpiringEvent> {
5
+ subject: Subjects.NotasBrCertificateExpiring;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotasBrCertificateExpiringPublisher = void 0;
4
+ const basePublisher_1 = require("../basePublisher");
5
+ const subjects_1 = require("../subjects");
6
+ class NotasBrCertificateExpiringPublisher extends basePublisher_1.Publisher {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.subject = subjects_1.Subjects.NotasBrCertificateExpiring;
10
+ }
11
+ }
12
+ exports.NotasBrCertificateExpiringPublisher = NotasBrCertificateExpiringPublisher;
@@ -0,0 +1,15 @@
1
+ import { Subjects } from '../subjects';
2
+ import { NbCreditPackage } from '../../types/notasBr';
3
+ export interface NotasBrCreditsGrantedEvent {
4
+ subject: Subjects.NotasBrCreditsGranted;
5
+ data: {
6
+ accountId: string;
7
+ purchasedByUserId: string;
8
+ creditPackage: NbCreditPackage;
9
+ quantity: number;
10
+ amount: number;
11
+ currency: string;
12
+ externalPaymentId: string;
13
+ timestamp: string;
14
+ };
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Publisher } from '../basePublisher';
2
+ import { NotasBrCreditsGrantedEvent } from './creditsGrantedEvent';
3
+ import { Subjects } from '../subjects';
4
+ export declare class NotasBrCreditsGrantedPublisher extends Publisher<NotasBrCreditsGrantedEvent> {
5
+ subject: Subjects.NotasBrCreditsGranted;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotasBrCreditsGrantedPublisher = void 0;
4
+ const basePublisher_1 = require("../basePublisher");
5
+ const subjects_1 = require("../subjects");
6
+ class NotasBrCreditsGrantedPublisher extends basePublisher_1.Publisher {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.subject = subjects_1.Subjects.NotasBrCreditsGranted;
10
+ }
11
+ }
12
+ exports.NotasBrCreditsGrantedPublisher = NotasBrCreditsGrantedPublisher;
@@ -0,0 +1,10 @@
1
+ export * from './invoiceAuthorizedEvent';
2
+ export * from './invoiceAuthorizedPublisher';
3
+ export * from './invoiceRejectedEvent';
4
+ export * from './invoiceRejectedPublisher';
5
+ export * from './invoiceCancelledEvent';
6
+ export * from './invoiceCancelledPublisher';
7
+ export * from './certificateExpiringEvent';
8
+ export * from './certificateExpiringPublisher';
9
+ export * from './creditsGrantedEvent';
10
+ export * from './creditsGrantedPublisher';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./invoiceAuthorizedEvent"), exports);
18
+ __exportStar(require("./invoiceAuthorizedPublisher"), exports);
19
+ __exportStar(require("./invoiceRejectedEvent"), exports);
20
+ __exportStar(require("./invoiceRejectedPublisher"), exports);
21
+ __exportStar(require("./invoiceCancelledEvent"), exports);
22
+ __exportStar(require("./invoiceCancelledPublisher"), exports);
23
+ __exportStar(require("./certificateExpiringEvent"), exports);
24
+ __exportStar(require("./certificateExpiringPublisher"), exports);
25
+ __exportStar(require("./creditsGrantedEvent"), exports);
26
+ __exportStar(require("./creditsGrantedPublisher"), exports);
@@ -0,0 +1,22 @@
1
+ import { Subjects } from '../subjects';
2
+ import { NbInvoiceType } from '../../types/notasBr';
3
+ export interface NotasBrInvoiceAuthorizedEvent {
4
+ subject: Subjects.NotasBrInvoiceAuthorized;
5
+ data: {
6
+ accountId: string;
7
+ companyId: string;
8
+ invoiceId: string;
9
+ invoiceType: NbInvoiceType;
10
+ number: string;
11
+ series?: string;
12
+ accessKey?: string;
13
+ issuerName: string;
14
+ recipientName: string;
15
+ recipientEmails: string[];
16
+ totalAmount: number;
17
+ pdfUrl: string;
18
+ xmlUrl: string;
19
+ authorizedAt: string;
20
+ timestamp: string;
21
+ };
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Publisher } from '../basePublisher';
2
+ import { NotasBrInvoiceAuthorizedEvent } from './invoiceAuthorizedEvent';
3
+ import { Subjects } from '../subjects';
4
+ export declare class NotasBrInvoiceAuthorizedPublisher extends Publisher<NotasBrInvoiceAuthorizedEvent> {
5
+ subject: Subjects.NotasBrInvoiceAuthorized;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotasBrInvoiceAuthorizedPublisher = void 0;
4
+ const basePublisher_1 = require("../basePublisher");
5
+ const subjects_1 = require("../subjects");
6
+ class NotasBrInvoiceAuthorizedPublisher extends basePublisher_1.Publisher {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.subject = subjects_1.Subjects.NotasBrInvoiceAuthorized;
10
+ }
11
+ }
12
+ exports.NotasBrInvoiceAuthorizedPublisher = NotasBrInvoiceAuthorizedPublisher;
@@ -0,0 +1,19 @@
1
+ import { Subjects } from '../subjects';
2
+ import { NbInvoiceType } from '../../types/notasBr';
3
+ export interface NotasBrInvoiceCancelledEvent {
4
+ subject: Subjects.NotasBrInvoiceCancelled;
5
+ data: {
6
+ accountId: string;
7
+ companyId: string;
8
+ invoiceId: string;
9
+ invoiceType: NbInvoiceType;
10
+ number: string;
11
+ accessKey?: string;
12
+ issuerName: string;
13
+ recipientName: string;
14
+ recipientEmails: string[];
15
+ reason: string;
16
+ cancelledAt: string;
17
+ timestamp: string;
18
+ };
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Publisher } from '../basePublisher';
2
+ import { NotasBrInvoiceCancelledEvent } from './invoiceCancelledEvent';
3
+ import { Subjects } from '../subjects';
4
+ export declare class NotasBrInvoiceCancelledPublisher extends Publisher<NotasBrInvoiceCancelledEvent> {
5
+ subject: Subjects.NotasBrInvoiceCancelled;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotasBrInvoiceCancelledPublisher = void 0;
4
+ const basePublisher_1 = require("../basePublisher");
5
+ const subjects_1 = require("../subjects");
6
+ class NotasBrInvoiceCancelledPublisher extends basePublisher_1.Publisher {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.subject = subjects_1.Subjects.NotasBrInvoiceCancelled;
10
+ }
11
+ }
12
+ exports.NotasBrInvoiceCancelledPublisher = NotasBrInvoiceCancelledPublisher;
@@ -0,0 +1,18 @@
1
+ import { Subjects } from '../subjects';
2
+ import { NbInvoiceType } from '../../types/notasBr';
3
+ export interface NotasBrInvoiceRejectedEvent {
4
+ subject: Subjects.NotasBrInvoiceRejected;
5
+ data: {
6
+ accountId: string;
7
+ companyId: string;
8
+ invoiceId: string;
9
+ invoiceType: NbInvoiceType;
10
+ issuerName: string;
11
+ ownerEmail: string;
12
+ rejectionCode: string;
13
+ rejectionMessage: string;
14
+ friendlyMessage: string;
15
+ rejectedAt: string;
16
+ timestamp: string;
17
+ };
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Publisher } from '../basePublisher';
2
+ import { NotasBrInvoiceRejectedEvent } from './invoiceRejectedEvent';
3
+ import { Subjects } from '../subjects';
4
+ export declare class NotasBrInvoiceRejectedPublisher extends Publisher<NotasBrInvoiceRejectedEvent> {
5
+ subject: Subjects.NotasBrInvoiceRejected;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotasBrInvoiceRejectedPublisher = void 0;
4
+ const basePublisher_1 = require("../basePublisher");
5
+ const subjects_1 = require("../subjects");
6
+ class NotasBrInvoiceRejectedPublisher extends basePublisher_1.Publisher {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.subject = subjects_1.Subjects.NotasBrInvoiceRejected;
10
+ }
11
+ }
12
+ exports.NotasBrInvoiceRejectedPublisher = NotasBrInvoiceRejectedPublisher;
@@ -64,5 +64,10 @@ export declare enum Subjects {
64
64
  SMAPostFailed = "sma:post:failed",
65
65
  AIRequestMade = "ai:request:made",
66
66
  LinkedinPostGenerated = "linkedin:post:generated",
67
- LinkedinPostPublished = "linkedin:post:published"
67
+ LinkedinPostPublished = "linkedin:post:published",
68
+ NotasBrInvoiceAuthorized = "notasbr:invoice:authorized",
69
+ NotasBrInvoiceRejected = "notasbr:invoice:rejected",
70
+ NotasBrInvoiceCancelled = "notasbr:invoice:cancelled",
71
+ NotasBrCertificateExpiring = "notasbr:certificate:expiring",
72
+ NotasBrCreditsGranted = "notasbr:credits:granted"
68
73
  }
@@ -78,4 +78,10 @@ var Subjects;
78
78
  // linkedin-automator
79
79
  Subjects["LinkedinPostGenerated"] = "linkedin:post:generated";
80
80
  Subjects["LinkedinPostPublished"] = "linkedin:post:published";
81
+ // notas-br
82
+ Subjects["NotasBrInvoiceAuthorized"] = "notasbr:invoice:authorized";
83
+ Subjects["NotasBrInvoiceRejected"] = "notasbr:invoice:rejected";
84
+ Subjects["NotasBrInvoiceCancelled"] = "notasbr:invoice:cancelled";
85
+ Subjects["NotasBrCertificateExpiring"] = "notasbr:certificate:expiring";
86
+ Subjects["NotasBrCreditsGranted"] = "notasbr:credits:granted";
81
87
  })(Subjects || (exports.Subjects = Subjects = {}));
package/build/index.d.ts CHANGED
@@ -38,12 +38,14 @@ export * from './types/addressType';
38
38
  export * from './types/imageProcessingStatus';
39
39
  export * from './types/whatsapp';
40
40
  export * from './types/leadAutomator';
41
+ export * from './types/dmAutomator';
41
42
  export * from './types/socialMediaAutomator';
42
43
  export * from './types/smaSubscriptionPlan';
43
44
  export * from './types/smaSubscriptionStatus';
44
45
  export * from './types/calNutri';
45
46
  export * from './types/linkedinAutomator';
46
47
  export * from './types/babelia';
48
+ export * from './types/notasBr';
47
49
  export * from './types/socialCredential';
48
50
  export * from './types/darkChannel';
49
51
  export * from './types/politicaBetCategory';
@@ -59,6 +61,8 @@ export * from './events/basePublisher';
59
61
  export * from './events/youtube-dark';
60
62
  export * from './events/social-media-automator';
61
63
  export * from './events/ai';
64
+ export * from './events/notas-br';
62
65
  export * from './services/TenantDataService';
63
66
  export * from './services/CurrencyService';
67
+ export * from './config/notasBrBilling';
64
68
  export * from './helpers/calculateBonus';
package/build/index.js CHANGED
@@ -55,6 +55,8 @@ __exportStar(require("./types/imageProcessingStatus"), exports);
55
55
  __exportStar(require("./types/whatsapp"), exports);
56
56
  // leadautomator
57
57
  __exportStar(require("./types/leadAutomator"), exports);
58
+ // dm-automator (comentário → DM)
59
+ __exportStar(require("./types/dmAutomator"), exports);
58
60
  // social-media-automator
59
61
  __exportStar(require("./types/socialMediaAutomator"), exports);
60
62
  __exportStar(require("./types/smaSubscriptionPlan"), exports);
@@ -65,6 +67,8 @@ __exportStar(require("./types/calNutri"), exports);
65
67
  __exportStar(require("./types/linkedinAutomator"), exports);
66
68
  // babelia
67
69
  __exportStar(require("./types/babelia"), exports);
70
+ // notas-br
71
+ __exportStar(require("./types/notasBr"), exports);
68
72
  // social credentials (multi-tenant, multi-platform)
69
73
  __exportStar(require("./types/socialCredential"), exports);
70
74
  // dark channel (n8n + Remotion render pipeline)
@@ -83,6 +87,9 @@ __exportStar(require("./events/basePublisher"), exports);
83
87
  __exportStar(require("./events/youtube-dark"), exports);
84
88
  __exportStar(require("./events/social-media-automator"), exports);
85
89
  __exportStar(require("./events/ai"), exports);
90
+ __exportStar(require("./events/notas-br"), exports);
86
91
  __exportStar(require("./services/TenantDataService"), exports);
87
92
  __exportStar(require("./services/CurrencyService"), exports);
93
+ // notas-br — tabela de billing compartilhada entre gn-business e cb-payments
94
+ __exportStar(require("./config/notasBrBilling"), exports);
88
95
  __exportStar(require("./helpers/calculateBonus"), exports);
package/build/server.d.ts CHANGED
@@ -88,6 +88,7 @@ export * from './events/compranomia/sellerProductDeletedEvent';
88
88
  export * from './events/apps/imageCreatedEvent';
89
89
  export * from './events/apps/creativeVideoReadyEvent';
90
90
  export * from './events/realstate/realStateVideoCreatedEvent';
91
+ export * from './events/notas-br';
91
92
  export * from './events/linkedin-automator/linkedinPostGeneratedEvent';
92
93
  export * from './events/linkedin-automator/linkedinPostGeneratedPublisher';
93
94
  export * from './events/linkedin-automator/linkedinPostPublishedEvent';
package/build/server.js CHANGED
@@ -104,6 +104,8 @@ __exportStar(require("./events/compranomia/sellerProductDeletedEvent"), exports)
104
104
  __exportStar(require("./events/apps/imageCreatedEvent"), exports);
105
105
  __exportStar(require("./events/apps/creativeVideoReadyEvent"), exports);
106
106
  __exportStar(require("./events/realstate/realStateVideoCreatedEvent"), exports);
107
+ // notas-br
108
+ __exportStar(require("./events/notas-br"), exports);
107
109
  // linkedin-automator
108
110
  __exportStar(require("./events/linkedin-automator/linkedinPostGeneratedEvent"), exports);
109
111
  __exportStar(require("./events/linkedin-automator/linkedinPostGeneratedPublisher"), exports);
@@ -1096,5 +1096,51 @@ TenantDataService.tenantDataMap = {
1096
1096
  }
1097
1097
  },
1098
1098
  RATING_CRITERIA: undefined
1099
+ },
1100
+ // TODO(notas-br): nome comercial e domínio ainda não definidos — SITE_NAME,
1101
+ // SITE_URL, SITE_DESCRIPTION e as redes sociais estão com placeholder.
1102
+ [tenant_1.Tenant.NotasBr]: {
1103
+ TENANT: tenant_1.Tenant.NotasBr,
1104
+ BACKEND_API_VERSION: '1',
1105
+ SITE_NAME: 'NotasBr',
1106
+ SITE_URL: 'https://notasbr.com.br',
1107
+ SITE_WHATSAPP_SUPPORT: '37988083717',
1108
+ SITE_WHATSAPP_BOT: '',
1109
+ WHATSAPP_BOT_NUMBER_ID: '',
1110
+ WHATSAPP_TOKEN: '',
1111
+ WHATSAPP_API_URL: '',
1112
+ WHATSAPP_API_VERSION: '',
1113
+ IOS_APP_DOWNLOAD_LINK: '',
1114
+ ANDROID_APP_DOWNLOAD_LINK: '',
1115
+ SITE_DESCRIPTION: 'Emissão de notas fiscais de serviço e de produto para microempresários, direto do celular',
1116
+ KEYWORDS: ['nota fiscal', 'nfse', 'nfe', 'nfce', 'mei', 'emissor'],
1117
+ SOCIAL_X: '',
1118
+ SOCIAL_YOUTUBE: '',
1119
+ SOCIAL_INSTAGRAM: '',
1120
+ SOCIAL_FACEBOOK: '',
1121
+ USER_CATEGORIES_CONFIG: {},
1122
+ COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_SELLER: [],
1123
+ COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_ADMIN: [],
1124
+ EMAIL_HOST: 'smtp.gmail.com',
1125
+ EMAIL_PORT: '587',
1126
+ EMAIL_USER: 'wrsolucoesdig@gmail.com',
1127
+ EMAIL_PASS: 'lwegguaqrzauawsg',
1128
+ AUTH_FACEBOOK_APP_ID: '',
1129
+ AUTH_GOOGLE_ID: '',
1130
+ AUTH_GOOGLE_SECRET: '',
1131
+ GOOGLE_ANALYTICS_MEASUREMENT_ID: '',
1132
+ GOOGLE_VERIFICATION: '',
1133
+ MEDIA_CONFIG: {
1134
+ maxPhotoSizeMB: 5,
1135
+ maxVideoSizeMB: 20,
1136
+ allowedImageFormats: ['jpg', 'jpeg', 'png', 'webp'],
1137
+ allowedVideoFormats: ['mp4', 'webm'],
1138
+ imageQualities: {
1139
+ thumbnail: { width: 150, height: 150, quality: 80 },
1140
+ medium: { width: 800, height: 800, quality: 85 },
1141
+ large: { width: 1200, height: 1200, quality: 90 }
1142
+ }
1143
+ },
1144
+ RATING_CRITERIA: undefined
1099
1145
  }
1100
1146
  };
@@ -0,0 +1,54 @@
1
+ export type DmChannel = 'instagram' | 'facebook' | 'tiktok' | 'youtube';
2
+ /** O que dispara a automação. */
3
+ export type DmTriggerType = 'comment' | 'direct_message';
4
+ /** Em quais publicações a automação vale. */
5
+ export type DmTriggerScope = 'all_posts' | 'specific_posts';
6
+ /** Templates prontos que o dono da conta escolhe. */
7
+ export type DmTemplateKind = 'link_only' | 'email_then_link' | 'name_email_then_link' | 'qualify_then_link';
8
+ export type DmStepType = 'send_text' | 'ask' | 'buttons';
9
+ /** Campo coletado por um passo `ask`. Alimenta DmContact/DmFlowRun.collected. */
10
+ export type DmAskField = 'name' | 'email' | 'phone' | 'custom';
11
+ export type DmValidation = 'none' | 'email' | 'phone';
12
+ export interface DmSendTextStep {
13
+ type: 'send_text';
14
+ /** Aceita {{link}}, {{name}}, {{email}}, {{phone}}, {{username}}. */
15
+ text: string;
16
+ }
17
+ export interface DmAskStep {
18
+ type: 'ask';
19
+ field: DmAskField;
20
+ /** Obrigatório quando field === 'custom'; é a chave em collected. */
21
+ fieldKey?: string;
22
+ prompt: string;
23
+ validate: DmValidation;
24
+ /** Mensagem quando a resposta não passa na validação. */
25
+ retryPrompt?: string;
26
+ /**
27
+ * Usa o quick reply nativo (`user_email` / `user_phone_number`), que chega
28
+ * preenchido com o dado do perfil — um toque, sem digitação. Só o Messenger
29
+ * suporta; no Instagram o adapter cai automaticamente para texto livre.
30
+ */
31
+ useNativeQuickReply?: boolean;
32
+ }
33
+ export interface DmButtonOption {
34
+ label: string;
35
+ value: string;
36
+ /** Quando presente, sobrescreve {{link}} nos passos seguintes. */
37
+ link?: string;
38
+ }
39
+ export interface DmButtonsStep {
40
+ type: 'buttons';
41
+ prompt: string;
42
+ /** Chave em collected onde o valor escolhido é gravado. */
43
+ fieldKey: string;
44
+ options: DmButtonOption[];
45
+ }
46
+ export type DmStep = DmSendTextStep | DmAskStep | DmButtonsStep;
47
+ export type DmMessageDirection = 'incoming' | 'outgoing';
48
+ export type DmMessageSentBy = 'bot' | 'human' | 'contact';
49
+ export type DmMessageType = 'text' | 'image' | 'video' | 'audio' | 'story_reply';
50
+ /** Estado da execução do fluxo para um contato. */
51
+ export type DmFlowRunStatus = 'active' | 'completed' | 'abandoned' | 'opted_out' | 'failed';
52
+ export type DmConversationStatus = 'open' | 'closed';
53
+ /** Origem do evento que criou o contato — usado no funil. */
54
+ export type DmContactSource = 'comment' | 'direct_message' | 'manual';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Automação de DM ("comentou → recebe no direct") para Instagram, Facebook,
3
+ // TikTok e YouTube. O fluxo é um documento de dados (DmStep[]), nunca um if no
4
+ // código: os templates são só sementes desse documento, então um construtor
5
+ // visual no futuro é uma tela que escreve o mesmo JSON.
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,264 @@
1
+ export declare enum NotasBrPlanTier {
2
+ Essential = "Essential",
3
+ Professional = "Professional"
4
+ }
5
+ export declare enum NbInvoiceType {
6
+ NFSe = "NFSe",// serviço — prefeitura / plataforma nacional
7
+ NFe = "NFe",// modelo 55 — produto com entrega/transporte
8
+ NFCe = "NFCe"
9
+ }
10
+ export declare enum NbInvoiceModel {
11
+ Model55 = "55",
12
+ Model65 = "65"
13
+ }
14
+ export declare enum NbInvoiceStatus {
15
+ Pending = "Pending",// salva no sistema, não enviada
16
+ WaitingData = "WaitingData",// falta informação obrigatória
17
+ WaitingAuthorization = "WaitingAuthorization",// enviada, aguardando o órgão
18
+ Authorized = "Authorized",
19
+ Rejected = "Rejected",// recusada por erro nos dados — corrigir e retransmitir
20
+ Denied = "Denied",// irregularidade cadastral — consome o número, não reaproveita
21
+ WaitingCancellation = "WaitingCancellation",
22
+ Cancelled = "Cancelled"
23
+ }
24
+ export declare enum NbInvoicePurpose {
25
+ Normal = "Normal",
26
+ Complementary = "Complementary",
27
+ Adjustment = "Adjustment",
28
+ Return = "Return"
29
+ }
30
+ export declare enum NbOperationType {
31
+ Outgoing = "Outgoing",// saída (padrão)
32
+ Incoming = "Incoming"
33
+ }
34
+ export declare enum NbFreightModality {
35
+ EmitterPaid = "EmitterPaid",// CIF
36
+ RecipientPaid = "RecipientPaid",// FOB
37
+ ThirdPartyPaid = "ThirdPartyPaid",
38
+ OwnSender = "OwnSender",
39
+ OwnRecipient = "OwnRecipient",
40
+ NoFreight = "NoFreight"
41
+ }
42
+ export declare enum NbPaymentMethod {
43
+ Cash = "Cash",
44
+ Pix = "Pix",
45
+ CreditCard = "CreditCard",
46
+ DebitCard = "DebitCard",
47
+ BankSlip = "BankSlip",
48
+ Check = "Check",
49
+ Voucher = "Voucher",
50
+ NoPayment = "NoPayment"
51
+ }
52
+ export declare enum NbPaymentTerm {
53
+ Immediate = "Immediate",// à vista (padrão)
54
+ Deferred = "Deferred"
55
+ }
56
+ export declare enum NbGoodsOrigin {
57
+ National = "0",
58
+ ForeignDirectImport = "1",
59
+ ForeignDomesticMarket = "2",
60
+ NationalImportContentOver40 = "3",
61
+ NationalBasicProductiveProcess = "4",
62
+ NationalImportContentUnder40 = "5",
63
+ ForeignDirectImportNoSimilar = "6",
64
+ ForeignDomesticMarketNoSimilar = "7",
65
+ NationalImportContentOver70 = "8"
66
+ }
67
+ export declare enum NbTaxRegime {
68
+ Mei = "Mei",
69
+ SimplesNacional = "SimplesNacional",
70
+ PresumedProfit = "PresumedProfit",// Lucro Presumido
71
+ RealProfit = "RealProfit"
72
+ }
73
+ export declare enum NbIcmsTaxpayerType {
74
+ Taxpayer = "Taxpayer",// 1 — contribuinte com IE
75
+ ExemptTaxpayer = "ExemptTaxpayer",// 2 — isento de inscrição
76
+ NonTaxpayer = "NonTaxpayer"
77
+ }
78
+ export declare enum NbTaxSituationKind {
79
+ Cst = "Cst",
80
+ Csosn = "Csosn"
81
+ }
82
+ export declare enum NbPersonType {
83
+ Individual = "Individual",// PF
84
+ Company = "Company"
85
+ }
86
+ export declare enum NbEnvironment {
87
+ Production = "Production",
88
+ Homologation = "Homologation"
89
+ }
90
+ export declare enum NbCertificateStatus {
91
+ Missing = "Missing",// nunca enviado — bloqueia a emissão
92
+ Valid = "Valid",
93
+ Expiring = "Expiring",// dentro da janela de alerta
94
+ Expired = "Expired",
95
+ Invalid = "Invalid"
96
+ }
97
+ export declare enum NbCreditPackage {
98
+ Small = "Small",
99
+ Medium = "Medium",
100
+ Large = "Large"
101
+ }
102
+ export declare enum NbCreditEntryType {
103
+ Purchase = "Purchase",
104
+ Consumption = "Consumption",
105
+ Refund = "Refund",// nota rejeitada/cancelada devolve o crédito
106
+ Adjustment = "Adjustment"
107
+ }
108
+ export declare enum NbQuotaSource {
109
+ Trial = "Trial",
110
+ PlanAllowance = "PlanAllowance",
111
+ Credit = "Credit"
112
+ }
113
+ export declare enum NbInvoiceEventType {
114
+ Created = "Created",
115
+ Updated = "Updated",
116
+ TransmissionRequested = "TransmissionRequested",
117
+ Authorized = "Authorized",
118
+ Rejected = "Rejected",
119
+ Denied = "Denied",
120
+ CancellationRequested = "CancellationRequested",
121
+ Cancelled = "Cancelled",
122
+ CorrectionLetterIssued = "CorrectionLetterIssued",
123
+ EmailSent = "EmailSent",
124
+ Deleted = "Deleted"
125
+ }
126
+ export declare enum NbMemberStatus {
127
+ Active = "Active",
128
+ Invited = "Invited",
129
+ Removed = "Removed"
130
+ }
131
+ export interface NbAddress {
132
+ zipCode: string;
133
+ street: string;
134
+ number: string;
135
+ complement?: string;
136
+ district: string;
137
+ city: string;
138
+ cityIbgeCode: string;
139
+ state: string;
140
+ }
141
+ export interface NbCnae {
142
+ code: string;
143
+ description: string;
144
+ isPrimary: boolean;
145
+ }
146
+ export interface NbInvoiceRecipient {
147
+ personId?: string;
148
+ personType?: NbPersonType;
149
+ document?: string;
150
+ name: string;
151
+ tradeName?: string;
152
+ stateRegistration?: string;
153
+ municipalRegistration?: string;
154
+ icmsTaxpayerType?: NbIcmsTaxpayerType;
155
+ address?: NbAddress;
156
+ emails: string[];
157
+ }
158
+ export interface NbInvoiceItem {
159
+ productId?: string;
160
+ code: string;
161
+ description: string;
162
+ unit: string;
163
+ quantity: number;
164
+ unitPriceCents: number;
165
+ discountCents: number;
166
+ totalCents: number;
167
+ ncm: string;
168
+ cfop: string;
169
+ taxSituationCode: string;
170
+ goodsOrigin: NbGoodsOrigin;
171
+ cest?: string;
172
+ gtin?: string;
173
+ ibptPercent?: number;
174
+ }
175
+ export interface NbInvoiceTotals {
176
+ itemsTotalCents: number;
177
+ discountCents: number;
178
+ freightCents: number;
179
+ totalCents: number;
180
+ approximateTaxesCents?: number;
181
+ }
182
+ export interface NbInvoiceFreight {
183
+ modality: NbFreightModality;
184
+ carrierName?: string;
185
+ carrierDocument?: string;
186
+ freightCents?: number;
187
+ vehiclePlate?: string;
188
+ vehicleState?: string;
189
+ volumeQuantity?: number;
190
+ volumeKind?: string;
191
+ volumeBrand?: string;
192
+ grossWeight?: number;
193
+ netWeight?: number;
194
+ }
195
+ export interface NbInvoiceBilling {
196
+ number: string;
197
+ amountCents: number;
198
+ dueDate: string;
199
+ sequence: number;
200
+ }
201
+ export interface NbInvoiceWithholdings {
202
+ pisCents: number;
203
+ cofinsCents: number;
204
+ csllCents: number;
205
+ inssCents: number;
206
+ irCents: number;
207
+ }
208
+ export interface NbInvoiceServiceInfo {
209
+ serviceId?: string;
210
+ cnaeCode: string;
211
+ lc116Item: string;
212
+ nationalTaxCode?: string;
213
+ municipalServiceCode?: string;
214
+ nbsCode?: string;
215
+ description: string;
216
+ competence: string;
217
+ provisionState: string;
218
+ provisionCityIbgeCode: string;
219
+ issRate: number;
220
+ issWithheld: boolean;
221
+ issCents: number;
222
+ withholdings: NbInvoiceWithholdings;
223
+ }
224
+ export interface NbInvoiceRejection {
225
+ code: string;
226
+ message: string;
227
+ friendlyMessage: string;
228
+ field?: string;
229
+ }
230
+ export interface NbCorrectionLetter {
231
+ sequence: number;
232
+ text: string;
233
+ protocol?: string;
234
+ createdAt: string;
235
+ }
236
+ export interface NbInvoiceEventLog {
237
+ type: NbInvoiceEventType;
238
+ at: string;
239
+ message?: string;
240
+ userId?: string;
241
+ }
242
+ export interface NbPlanConfig {
243
+ tier: NotasBrPlanTier;
244
+ monthlyPriceCents: number;
245
+ annualPriceCents: number;
246
+ monthlyInvoiceAllowance: number;
247
+ maxCompanies: number | null;
248
+ maxUsers: number | null;
249
+ }
250
+ export interface NbCreditPackageConfig {
251
+ creditPackage: NbCreditPackage;
252
+ priceCents: number;
253
+ quantity: number;
254
+ }
255
+ export interface NbTrialConfig {
256
+ durationDays: number;
257
+ invoicesPerDay: number;
258
+ }
259
+ export interface NbBillingTable {
260
+ version: string;
261
+ plans: Record<NotasBrPlanTier, NbPlanConfig>;
262
+ creditPackages: Record<NbCreditPackage, NbCreditPackageConfig>;
263
+ trial: NbTrialConfig;
264
+ }
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ // notas-br — emissão de notas fiscais (NFS-e, NF-e modelo 55 e NFC-e modelo 65)
3
+ //
4
+ // Convenção: prefixo Nb nos enums de domínio, para não colidir com os enums
5
+ // genéricos do cb-common (PaymentMethod, MeasurementUnit, etc.), que já são
6
+ // usados por outros tenants com semântica diferente.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.NbMemberStatus = exports.NbInvoiceEventType = exports.NbQuotaSource = exports.NbCreditEntryType = exports.NbCreditPackage = exports.NbCertificateStatus = exports.NbEnvironment = exports.NbPersonType = exports.NbTaxSituationKind = exports.NbIcmsTaxpayerType = exports.NbTaxRegime = exports.NbGoodsOrigin = exports.NbPaymentTerm = exports.NbPaymentMethod = exports.NbFreightModality = exports.NbOperationType = exports.NbInvoicePurpose = exports.NbInvoiceStatus = exports.NbInvoiceModel = exports.NbInvoiceType = exports.NotasBrPlanTier = void 0;
9
+ // Tier do plano. Fica separado de SubscriptionPlan porque aquele enum representa
10
+ // periodicidade (Monthly/Annual), não o que o cliente contratou.
11
+ var NotasBrPlanTier;
12
+ (function (NotasBrPlanTier) {
13
+ NotasBrPlanTier["Essential"] = "Essential";
14
+ NotasBrPlanTier["Professional"] = "Professional";
15
+ })(NotasBrPlanTier || (exports.NotasBrPlanTier = NotasBrPlanTier = {}));
16
+ var NbInvoiceType;
17
+ (function (NbInvoiceType) {
18
+ NbInvoiceType["NFSe"] = "NFSe";
19
+ NbInvoiceType["NFe"] = "NFe";
20
+ NbInvoiceType["NFCe"] = "NFCe"; // modelo 65 — venda presencial a consumidor final
21
+ })(NbInvoiceType || (exports.NbInvoiceType = NbInvoiceType = {}));
22
+ // Modelo numérico exigido pela SEFAZ. NFS-e não tem modelo — é controlada pelo município.
23
+ var NbInvoiceModel;
24
+ (function (NbInvoiceModel) {
25
+ NbInvoiceModel["Model55"] = "55";
26
+ NbInvoiceModel["Model65"] = "65";
27
+ })(NbInvoiceModel || (exports.NbInvoiceModel = NbInvoiceModel = {}));
28
+ var NbInvoiceStatus;
29
+ (function (NbInvoiceStatus) {
30
+ NbInvoiceStatus["Pending"] = "Pending";
31
+ NbInvoiceStatus["WaitingData"] = "WaitingData";
32
+ NbInvoiceStatus["WaitingAuthorization"] = "WaitingAuthorization";
33
+ NbInvoiceStatus["Authorized"] = "Authorized";
34
+ NbInvoiceStatus["Rejected"] = "Rejected";
35
+ NbInvoiceStatus["Denied"] = "Denied";
36
+ NbInvoiceStatus["WaitingCancellation"] = "WaitingCancellation";
37
+ NbInvoiceStatus["Cancelled"] = "Cancelled";
38
+ })(NbInvoiceStatus || (exports.NbInvoiceStatus = NbInvoiceStatus = {}));
39
+ // Finalidade da NF-e. Complementar, Ajuste e Devolução exigem chave referenciada.
40
+ var NbInvoicePurpose;
41
+ (function (NbInvoicePurpose) {
42
+ NbInvoicePurpose["Normal"] = "Normal";
43
+ NbInvoicePurpose["Complementary"] = "Complementary";
44
+ NbInvoicePurpose["Adjustment"] = "Adjustment";
45
+ NbInvoicePurpose["Return"] = "Return";
46
+ })(NbInvoicePurpose || (exports.NbInvoicePurpose = NbInvoicePurpose = {}));
47
+ var NbOperationType;
48
+ (function (NbOperationType) {
49
+ NbOperationType["Outgoing"] = "Outgoing";
50
+ NbOperationType["Incoming"] = "Incoming"; // entrada
51
+ })(NbOperationType || (exports.NbOperationType = NbOperationType = {}));
52
+ var NbFreightModality;
53
+ (function (NbFreightModality) {
54
+ NbFreightModality["EmitterPaid"] = "EmitterPaid";
55
+ NbFreightModality["RecipientPaid"] = "RecipientPaid";
56
+ NbFreightModality["ThirdPartyPaid"] = "ThirdPartyPaid";
57
+ NbFreightModality["OwnSender"] = "OwnSender";
58
+ NbFreightModality["OwnRecipient"] = "OwnRecipient";
59
+ NbFreightModality["NoFreight"] = "NoFreight"; // padrão
60
+ })(NbFreightModality || (exports.NbFreightModality = NbFreightModality = {}));
61
+ var NbPaymentMethod;
62
+ (function (NbPaymentMethod) {
63
+ NbPaymentMethod["Cash"] = "Cash";
64
+ NbPaymentMethod["Pix"] = "Pix";
65
+ NbPaymentMethod["CreditCard"] = "CreditCard";
66
+ NbPaymentMethod["DebitCard"] = "DebitCard";
67
+ NbPaymentMethod["BankSlip"] = "BankSlip";
68
+ NbPaymentMethod["Check"] = "Check";
69
+ NbPaymentMethod["Voucher"] = "Voucher";
70
+ NbPaymentMethod["NoPayment"] = "NoPayment";
71
+ })(NbPaymentMethod || (exports.NbPaymentMethod = NbPaymentMethod = {}));
72
+ var NbPaymentTerm;
73
+ (function (NbPaymentTerm) {
74
+ NbPaymentTerm["Immediate"] = "Immediate";
75
+ NbPaymentTerm["Deferred"] = "Deferred"; // a prazo
76
+ })(NbPaymentTerm || (exports.NbPaymentTerm = NbPaymentTerm = {}));
77
+ // Origem da mercadoria — tabela fechada da SEFAZ. O valor é o código do XML.
78
+ var NbGoodsOrigin;
79
+ (function (NbGoodsOrigin) {
80
+ NbGoodsOrigin["National"] = "0";
81
+ NbGoodsOrigin["ForeignDirectImport"] = "1";
82
+ NbGoodsOrigin["ForeignDomesticMarket"] = "2";
83
+ NbGoodsOrigin["NationalImportContentOver40"] = "3";
84
+ NbGoodsOrigin["NationalBasicProductiveProcess"] = "4";
85
+ NbGoodsOrigin["NationalImportContentUnder40"] = "5";
86
+ NbGoodsOrigin["ForeignDirectImportNoSimilar"] = "6";
87
+ NbGoodsOrigin["ForeignDomesticMarketNoSimilar"] = "7";
88
+ NbGoodsOrigin["NationalImportContentOver70"] = "8";
89
+ })(NbGoodsOrigin || (exports.NbGoodsOrigin = NbGoodsOrigin = {}));
90
+ var NbTaxRegime;
91
+ (function (NbTaxRegime) {
92
+ NbTaxRegime["Mei"] = "Mei";
93
+ NbTaxRegime["SimplesNacional"] = "SimplesNacional";
94
+ NbTaxRegime["PresumedProfit"] = "PresumedProfit";
95
+ NbTaxRegime["RealProfit"] = "RealProfit"; // Lucro Real
96
+ })(NbTaxRegime || (exports.NbTaxRegime = NbTaxRegime = {}));
97
+ // Indicador de contribuinte de ICMS do destinatário. Determina se a Inscrição
98
+ // Estadual é obrigatória — origem comum de rejeição.
99
+ var NbIcmsTaxpayerType;
100
+ (function (NbIcmsTaxpayerType) {
101
+ NbIcmsTaxpayerType["Taxpayer"] = "Taxpayer";
102
+ NbIcmsTaxpayerType["ExemptTaxpayer"] = "ExemptTaxpayer";
103
+ NbIcmsTaxpayerType["NonTaxpayer"] = "NonTaxpayer"; // 9 — não contribuinte
104
+ })(NbIcmsTaxpayerType || (exports.NbIcmsTaxpayerType = NbIcmsTaxpayerType = {}));
105
+ // Qual tabela de situação tributária vale para a empresa. Quem é do Simples usa
106
+ // CSOSN; os demais regimes usam CST. Não são intercambiáveis.
107
+ var NbTaxSituationKind;
108
+ (function (NbTaxSituationKind) {
109
+ NbTaxSituationKind["Cst"] = "Cst";
110
+ NbTaxSituationKind["Csosn"] = "Csosn";
111
+ })(NbTaxSituationKind || (exports.NbTaxSituationKind = NbTaxSituationKind = {}));
112
+ var NbPersonType;
113
+ (function (NbPersonType) {
114
+ NbPersonType["Individual"] = "Individual";
115
+ NbPersonType["Company"] = "Company"; // PJ
116
+ })(NbPersonType || (exports.NbPersonType = NbPersonType = {}));
117
+ var NbEnvironment;
118
+ (function (NbEnvironment) {
119
+ NbEnvironment["Production"] = "Production";
120
+ NbEnvironment["Homologation"] = "Homologation";
121
+ })(NbEnvironment || (exports.NbEnvironment = NbEnvironment = {}));
122
+ var NbCertificateStatus;
123
+ (function (NbCertificateStatus) {
124
+ NbCertificateStatus["Missing"] = "Missing";
125
+ NbCertificateStatus["Valid"] = "Valid";
126
+ NbCertificateStatus["Expiring"] = "Expiring";
127
+ NbCertificateStatus["Expired"] = "Expired";
128
+ NbCertificateStatus["Invalid"] = "Invalid"; // rejeitado pela Focus ou CNPJ divergente
129
+ })(NbCertificateStatus || (exports.NbCertificateStatus = NbCertificateStatus = {}));
130
+ var NbCreditPackage;
131
+ (function (NbCreditPackage) {
132
+ NbCreditPackage["Small"] = "Small";
133
+ NbCreditPackage["Medium"] = "Medium";
134
+ NbCreditPackage["Large"] = "Large";
135
+ })(NbCreditPackage || (exports.NbCreditPackage = NbCreditPackage = {}));
136
+ // Movimentos do ledger de créditos. Ledger em vez de saldo mutável porque o
137
+ // débito precisa ser auditável e idempotente pela chave da emissão.
138
+ var NbCreditEntryType;
139
+ (function (NbCreditEntryType) {
140
+ NbCreditEntryType["Purchase"] = "Purchase";
141
+ NbCreditEntryType["Consumption"] = "Consumption";
142
+ NbCreditEntryType["Refund"] = "Refund";
143
+ NbCreditEntryType["Adjustment"] = "Adjustment"; // correção manual do suporte
144
+ })(NbCreditEntryType || (exports.NbCreditEntryType = NbCreditEntryType = {}));
145
+ // De onde saiu o direito de emitir aquela nota. Fica registrado na própria nota
146
+ // para o relatório de consumo não precisar reconstruir a decisão depois.
147
+ var NbQuotaSource;
148
+ (function (NbQuotaSource) {
149
+ NbQuotaSource["Trial"] = "Trial";
150
+ NbQuotaSource["PlanAllowance"] = "PlanAllowance";
151
+ NbQuotaSource["Credit"] = "Credit";
152
+ })(NbQuotaSource || (exports.NbQuotaSource = NbQuotaSource = {}));
153
+ var NbInvoiceEventType;
154
+ (function (NbInvoiceEventType) {
155
+ NbInvoiceEventType["Created"] = "Created";
156
+ NbInvoiceEventType["Updated"] = "Updated";
157
+ NbInvoiceEventType["TransmissionRequested"] = "TransmissionRequested";
158
+ NbInvoiceEventType["Authorized"] = "Authorized";
159
+ NbInvoiceEventType["Rejected"] = "Rejected";
160
+ NbInvoiceEventType["Denied"] = "Denied";
161
+ NbInvoiceEventType["CancellationRequested"] = "CancellationRequested";
162
+ NbInvoiceEventType["Cancelled"] = "Cancelled";
163
+ NbInvoiceEventType["CorrectionLetterIssued"] = "CorrectionLetterIssued";
164
+ NbInvoiceEventType["EmailSent"] = "EmailSent";
165
+ NbInvoiceEventType["Deleted"] = "Deleted";
166
+ })(NbInvoiceEventType || (exports.NbInvoiceEventType = NbInvoiceEventType = {}));
167
+ // Vínculo entre usuário e conta. Invited existe para o convite entrar depois sem
168
+ // migração; nesta fase só Active é usado.
169
+ var NbMemberStatus;
170
+ (function (NbMemberStatus) {
171
+ NbMemberStatus["Active"] = "Active";
172
+ NbMemberStatus["Invited"] = "Invited";
173
+ NbMemberStatus["Removed"] = "Removed";
174
+ })(NbMemberStatus || (exports.NbMemberStatus = NbMemberStatus = {}));
@@ -12,5 +12,6 @@ export declare enum Tenant {
12
12
  LeadAutomator = "LeadAutomator",
13
13
  SocialMediaAutomator = "SocialMediaAutomator",
14
14
  BreadOfLife = "BreadOfLife",
15
- LinkedinAutomator = "LinkedinAutomator"
15
+ LinkedinAutomator = "LinkedinAutomator",
16
+ NotasBr = "NotasBr"
16
17
  }
@@ -17,4 +17,5 @@ var Tenant;
17
17
  Tenant["SocialMediaAutomator"] = "SocialMediaAutomator";
18
18
  Tenant["BreadOfLife"] = "BreadOfLife";
19
19
  Tenant["LinkedinAutomator"] = "LinkedinAutomator";
20
+ Tenant["NotasBr"] = "NotasBr";
20
21
  })(Tenant || (exports.Tenant = Tenant = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.864",
3
+ "version": "1.0.865",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",