easywork-common-lib 1.0.1352 → 1.0.1353

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 (34) hide show
  1. package/dist/common/enums/sales.enum.d.ts +2 -1
  2. package/dist/common/enums/sales.enum.js +1 -0
  3. package/dist/common/enums/sales.enum.js.map +1 -1
  4. package/dist/entities/subscriptions/payment-history.entity.d.ts +24 -0
  5. package/dist/entities/subscriptions/payment-history.entity.js +124 -0
  6. package/dist/entities/subscriptions/payment-history.entity.js.map +1 -0
  7. package/dist/entities/thirdparty/wati/index.d.ts +7 -0
  8. package/dist/entities/thirdparty/wati/index.js +24 -0
  9. package/dist/entities/thirdparty/wati/index.js.map +1 -0
  10. package/dist/entities/thirdparty/wati/wati-chat.entity.d.ts +27 -0
  11. package/dist/entities/thirdparty/wati/wati-chat.entity.js +207 -0
  12. package/dist/entities/thirdparty/wati/wati-chat.entity.js.map +1 -0
  13. package/dist/entities/thirdparty/wati/wati-configuration.entity.d.ts +22 -0
  14. package/dist/entities/thirdparty/wati/wati-configuration.entity.js +149 -0
  15. package/dist/entities/thirdparty/wati/wati-configuration.entity.js.map +1 -0
  16. package/dist/entities/thirdparty/wati/wati-events.entity.d.ts +9 -0
  17. package/dist/entities/thirdparty/wati/wati-events.entity.js +63 -0
  18. package/dist/entities/thirdparty/wati/wati-events.entity.js.map +1 -0
  19. package/dist/entities/thirdparty/wati/wati-message.entity.d.ts +30 -0
  20. package/dist/entities/thirdparty/wati/wati-message.entity.js +280 -0
  21. package/dist/entities/thirdparty/wati/wati-message.entity.js.map +1 -0
  22. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.d.ts +71 -0
  23. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js +216 -0
  24. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js.map +1 -0
  25. package/dist/entities/thirdparty/wati/wati-user-access.entity.d.ts +31 -0
  26. package/dist/entities/thirdparty/wati/wati-user-access.entity.js +193 -0
  27. package/dist/entities/thirdparty/wati/wati-user-access.entity.js.map +1 -0
  28. package/dist/entities/thirdparty/wati/wati.enum.d.ts +69 -0
  29. package/dist/entities/thirdparty/wati/wati.enum.js +83 -0
  30. package/dist/entities/thirdparty/wati/wati.enum.js.map +1 -0
  31. package/dist/grpc/drive/drive.proto +339 -339
  32. package/dist/grpc/drive/leads.proto +114 -114
  33. package/dist/modules/authorization/services/resource-access-filter.service.js +21 -21
  34. package/package.json +55 -55
@@ -157,7 +157,8 @@ export declare enum OriginCreationAgent {
157
157
  ACCOMPANIMENT = "accompaniment",
158
158
  RECRUITMENT = "recruitment",
159
159
  CONNECTION = "connection",
160
- CAPACITATION = "capacitation"
160
+ CAPACITATION = "capacitation",
161
+ CERTIFICATE = "certificate"
161
162
  }
162
163
  export declare enum ContractState {
163
164
  IN_PROGRESS = "in-progress",
@@ -189,6 +189,7 @@ var OriginCreationAgent;
189
189
  OriginCreationAgent["RECRUITMENT"] = "recruitment";
190
190
  OriginCreationAgent["CONNECTION"] = "connection";
191
191
  OriginCreationAgent["CAPACITATION"] = "capacitation";
192
+ OriginCreationAgent["CERTIFICATE"] = "certificate";
192
193
  })(OriginCreationAgent || (exports.OriginCreationAgent = OriginCreationAgent = {}));
193
194
  var ContractState;
194
195
  (function (ContractState) {
@@ -1 +1 @@
1
- {"version":3,"file":"sales.enum.js","sourceRoot":"","sources":["../../../src/common/enums/sales.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,wCAAwB,CAAA;AAC1B,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY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AAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,gCAAqB,CAAA;IACrB,oCAAyB,CAAA;AAC3B,CAAC,EAHW,OAAO,uBAAP,OAAO,QAGlB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;IACzB,6CAA6B,CAAA;IAC7B,qCAAqB,CAAA;AACvB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,sDAA+B,CAAA;IAC/B,kDAA2B,CAAA;IAC3B,gDAAyB,CAAA;IACzB,oDAA6B,CAAA;AAC/B,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,mCAAkB,CAAA;IAClB,iCAAgB,CAAA;IAChB,iDAAgC,CAAA;IAChC,gDAA+B,CAAA;IAC/B,sDAAqC,CAAA;AACvC,CAAC,EAPW,aAAa,6BAAb,aAAa,QAOxB;AAED,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;AACvB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB"}
1
+ {"version":3,"file":"sales.enum.js","sourceRoot":"","sources":["../../../src/common/enums/sales.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,wCAAwB,CAAA;AAC1B,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EALW,YAAY,4B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AC/B,uDAA2B,CAAA;AAC7B,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,gCAAqB,CAAA;IACrB,oCAAyB,CAAA;AAC3B,CAAC,EAHW,OAAO,uBAAP,OAAO,QAGlB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;IACzB,6CAA6B,CAAA;IAC7B,qCAAqB,CAAA;AACvB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,sDAA+B,CAAA;IAC/B,kDAA2B,CAAA;IAC3B,gDAAyB,CAAA;IACzB,oDAA6B,CAAA;IAC7B,kDAA2B,CAAA;AAC7B,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAED,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,mCAAkB,CAAA;IAClB,iCAAgB,CAAA;IAChB,iDAAgC,CAAA;IAChC,gDAA+B,CAAA;IAC/B,sDAAqC,CAAA;AACvC,CAAC,EAPW,aAAa,6BAAb,aAAa,QAOxB;AAED,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;AACvB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB"}
@@ -0,0 +1,24 @@
1
+ import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
2
+ import { Subscription } from './subscription.entity';
3
+ import { Group } from '../group.entity';
4
+ export declare enum PaymentStatus {
5
+ SUCCEEDED = "succeeded",
6
+ FAILED = "failed",
7
+ PENDING = "pending",
8
+ REFUNDED = "refunded",
9
+ DISPUTED = "disputed"
10
+ }
11
+ export declare class PaymentHistory extends BaseEntityOnlyEssential {
12
+ subscriptionId: number | null;
13
+ subscription: Subscription | null;
14
+ workspaceId: number;
15
+ group: Group;
16
+ amount: number;
17
+ currency: string;
18
+ paymentStatus: PaymentStatus;
19
+ transactionDate: Date;
20
+ paymentGatewayTransactionId: string | null;
21
+ paymentMethodInfo: Record<string, any> | null;
22
+ invoiceUrl: string | null;
23
+ notes: string | null;
24
+ }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PaymentHistory = exports.PaymentStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const base_entity_1 = require("../../common/database/base.entity");
16
+ const subscription_entity_1 = require("./subscription.entity");
17
+ const group_entity_1 = require("../group.entity");
18
+ var PaymentStatus;
19
+ (function (PaymentStatus) {
20
+ PaymentStatus["SUCCEEDED"] = "succeeded";
21
+ PaymentStatus["FAILED"] = "failed";
22
+ PaymentStatus["PENDING"] = "pending";
23
+ PaymentStatus["REFUNDED"] = "refunded";
24
+ PaymentStatus["DISPUTED"] = "disputed";
25
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
26
+ let PaymentHistory = class PaymentHistory extends base_entity_1.BaseEntityOnlyEssential {
27
+ subscriptionId;
28
+ subscription;
29
+ workspaceId;
30
+ group;
31
+ amount;
32
+ currency;
33
+ paymentStatus;
34
+ transactionDate;
35
+ paymentGatewayTransactionId;
36
+ paymentMethodInfo;
37
+ invoiceUrl;
38
+ notes;
39
+ };
40
+ exports.PaymentHistory = PaymentHistory;
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'ID of the associated workspace subscription (nullable for one-time payments)',
45
+ example: 10,
46
+ nullable: true,
47
+ }),
48
+ __metadata("design:type", Number)
49
+ ], PaymentHistory.prototype, "subscriptionId", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.ManyToOne)(() => subscription_entity_1.Subscription, subscription => subscription.paymentHistory, { onDelete: 'SET NULL' }),
52
+ (0, typeorm_1.JoinColumn)({ name: 'subscription_id' }),
53
+ __metadata("design:type", subscription_entity_1.Subscription)
54
+ ], PaymentHistory.prototype, "subscription", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
57
+ (0, swagger_1.ApiProperty)({ description: 'ID of the workspace associated with the payment', example: 101 }),
58
+ __metadata("design:type", Number)
59
+ ], PaymentHistory.prototype, "workspaceId", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.Group, group => group.paymentHistory, { onDelete: 'CASCADE' }),
62
+ (0, typeorm_1.JoinColumn)({ name: 'group_id' }),
63
+ __metadata("design:type", group_entity_1.Group)
64
+ ], PaymentHistory.prototype, "group", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2, nullable: false }),
67
+ (0, swagger_1.ApiProperty)({ description: 'Amount of the payment', example: 9.99 }),
68
+ __metadata("design:type", Number)
69
+ ], PaymentHistory.prototype, "amount", void 0);
70
+ __decorate([
71
+ (0, typeorm_1.Column)({ type: 'varchar', length: 3, nullable: false }),
72
+ (0, swagger_1.ApiProperty)({ description: 'Currency code (e.g., "USD", "EUR")', example: 'USD' }),
73
+ __metadata("design:type", String)
74
+ ], PaymentHistory.prototype, "currency", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)({ type: 'enum', enum: PaymentStatus, nullable: false }),
77
+ (0, swagger_1.ApiProperty)({ description: 'Status of the payment', enum: PaymentStatus, example: PaymentStatus.SUCCEEDED }),
78
+ __metadata("design:type", String)
79
+ ], PaymentHistory.prototype, "paymentStatus", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
82
+ (0, swagger_1.ApiProperty)({ description: 'Date and time of the transaction', example: '2024-06-05T11:00:00Z' }),
83
+ __metadata("design:type", Date)
84
+ ], PaymentHistory.prototype, "transactionDate", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true, nullable: true }),
87
+ (0, swagger_1.ApiProperty)({
88
+ description: 'Transaction ID from the payment processor (e.g., Stripe, PayPal)',
89
+ example: 'txn_abc123xyz',
90
+ nullable: true,
91
+ }),
92
+ __metadata("design:type", String)
93
+ ], PaymentHistory.prototype, "paymentGatewayTransactionId", void 0);
94
+ __decorate([
95
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
96
+ (0, swagger_1.ApiProperty)({
97
+ description: 'JSON containing payment method details (e.g., card type, last 4 digits)',
98
+ example: { cardType: 'Visa', last4: '4242' },
99
+ nullable: true,
100
+ }),
101
+ __metadata("design:type", Object)
102
+ ], PaymentHistory.prototype, "paymentMethodInfo", void 0);
103
+ __decorate([
104
+ (0, typeorm_1.Column)({ type: 'varchar', length: 512, nullable: true }),
105
+ (0, swagger_1.ApiProperty)({
106
+ description: 'URL to the invoice PDF or page',
107
+ example: 'https://example.com/invoices/12345',
108
+ nullable: true,
109
+ }),
110
+ __metadata("design:type", String)
111
+ ], PaymentHistory.prototype, "invoiceUrl", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
114
+ (0, swagger_1.ApiProperty)({
115
+ description: 'Internal notes about the payment',
116
+ example: 'Refund initiated due to double charge.',
117
+ nullable: true,
118
+ }),
119
+ __metadata("design:type", String)
120
+ ], PaymentHistory.prototype, "notes", void 0);
121
+ exports.PaymentHistory = PaymentHistory = __decorate([
122
+ (0, typeorm_1.Entity)('payment_history')
123
+ ], PaymentHistory);
124
+ //# sourceMappingURL=payment-history.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-history.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/payment-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkF;AAClF,6CAA8C;AAC9C,mEAA4E;AAC5E,+DAAqD;AACrD,kDAAwC;AAExC,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACvB,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,qCAAuB;IAOzD,cAAc,CAAgB;IAI9B,YAAY,CAAsB;IAIlC,WAAW,CAAS;IAIpB,KAAK,CAAQ;IAIb,MAAM,CAAS;IAIf,QAAQ,CAAS;IAIjB,aAAa,CAAgB;IAI7B,eAAe,CAAO;IAQtB,2BAA2B,CAAgB;IAQ3C,iBAAiB,CAA6B;IAQ9C,UAAU,CAAgB;IAQ1B,KAAK,CAAgB;CACtB,CAAA;AApEY,wCAAc;AAOzB;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8EAA8E;QAC3F,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;KACf,CAAC;;sDAC4B;AAI9B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,UAAU,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,gBAAM,EAAC,iBAAiB,CAAC;GACb,cAAc,CAoE1B"}
@@ -0,0 +1,7 @@
1
+ export * from "./wati-chat.entity";
2
+ export * from "./wati-configuration.entity";
3
+ export * from "./wati-events.entity";
4
+ export * from "./wati-message.entity";
5
+ export * from "./wati-user-access.entity";
6
+ export * from "./wati-user-access-log.entity";
7
+ export * from "./wati.enum";
@@ -0,0 +1,24 @@
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("./wati-chat.entity"), exports);
18
+ __exportStar(require("./wati-configuration.entity"), exports);
19
+ __exportStar(require("./wati-events.entity"), exports);
20
+ __exportStar(require("./wati-message.entity"), exports);
21
+ __exportStar(require("./wati-user-access.entity"), exports);
22
+ __exportStar(require("./wati-user-access-log.entity"), exports);
23
+ __exportStar(require("./wati.enum"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,gEAA8C;AAC9C,8CAA4B"}
@@ -0,0 +1,27 @@
1
+ import { Lead } from "../../sales/lead.entity";
2
+ import { Contact } from "../../sales/contact.entity";
3
+ import { BaseEntityOnlyEssential } from "../../../common";
4
+ import { WatiMessage } from "../wati/wati-message.entity";
5
+ import { WatiConfiguration } from "../wati/wati-configuration.entity";
6
+ import { User } from "../../user.entity";
7
+ import { WhatsAppConversationStatusEnum } from "../wati/wati.enum";
8
+ export declare class WatiChat extends BaseEntityOnlyEssential {
9
+ watiConfigurationId: string;
10
+ watiConfiguration: WatiConfiguration;
11
+ watiConversationId: string;
12
+ phoneNumber: string;
13
+ fullName?: string;
14
+ sessionActive: boolean;
15
+ sessionExpiresAt?: Date;
16
+ watiCustomAttributes?: object;
17
+ lastMessageTimestamp?: Date;
18
+ status: WhatsAppConversationStatusEnum;
19
+ unreadCountForAgent: number;
20
+ assignedToUserId?: string;
21
+ assignedToUser?: User;
22
+ crmLeadId?: string;
23
+ crmLead?: Lead;
24
+ crmContactId?: string;
25
+ crmContact?: Contact;
26
+ messages: WatiMessage[];
27
+ }
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WatiChat = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const class_validator_1 = require("class-validator");
16
+ const lead_entity_1 = require("../../sales/lead.entity");
17
+ const contact_entity_1 = require("../../sales/contact.entity");
18
+ const common_1 = require("../../../common");
19
+ const wati_message_entity_1 = require("../wati/wati-message.entity");
20
+ const wati_configuration_entity_1 = require("../wati/wati-configuration.entity");
21
+ const user_entity_1 = require("../../user.entity");
22
+ const wati_enum_1 = require("../wati/wati.enum");
23
+ let WatiChat = class WatiChat extends common_1.BaseEntityOnlyEssential {
24
+ watiConfigurationId;
25
+ watiConfiguration;
26
+ watiConversationId;
27
+ phoneNumber;
28
+ fullName;
29
+ sessionActive;
30
+ sessionExpiresAt;
31
+ watiCustomAttributes;
32
+ lastMessageTimestamp;
33
+ status;
34
+ unreadCountForAgent;
35
+ assignedToUserId;
36
+ assignedToUser;
37
+ crmLeadId;
38
+ crmLead;
39
+ crmContactId;
40
+ crmContact;
41
+ messages;
42
+ };
43
+ exports.WatiChat = WatiChat;
44
+ __decorate([
45
+ (0, swagger_1.ApiProperty)({ description: "ID de la WatiConfiguration asociada" }),
46
+ (0, class_validator_1.IsString)(),
47
+ (0, typeorm_1.Index)(),
48
+ (0, typeorm_1.Column)({ type: "uuid" }),
49
+ __metadata("design:type", String)
50
+ ], WatiChat.prototype, "watiConfigurationId", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => wati_configuration_entity_1.WatiConfiguration, (config) => config.chats),
53
+ (0, typeorm_1.JoinColumn)({ name: "watiConfigurationId" }),
54
+ __metadata("design:type", wati_configuration_entity_1.WatiConfiguration)
55
+ ], WatiChat.prototype, "watiConfiguration", void 0);
56
+ __decorate([
57
+ (0, swagger_1.ApiProperty)({
58
+ description: "ID único de la conversación en Wati (puede ser el número de teléfono del contacto)",
59
+ }),
60
+ (0, class_validator_1.IsString)(),
61
+ (0, class_validator_1.MaxLength)(255),
62
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
63
+ __metadata("design:type", String)
64
+ ], WatiChat.prototype, "watiConversationId", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiProperty)({
67
+ description: "Número de teléfono del contacto externo (cliente/prospecto)",
68
+ }),
69
+ (0, class_validator_1.IsString)(),
70
+ (0, class_validator_1.MaxLength)(50),
71
+ (0, typeorm_1.Index)(),
72
+ (0, typeorm_1.Column)({ type: "varchar", length: 50 }),
73
+ __metadata("design:type", String)
74
+ ], WatiChat.prototype, "phoneNumber", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiProperty)({
77
+ description: "Nombre del contacto tal como aparece en Wati",
78
+ required: false,
79
+ }),
80
+ (0, class_validator_1.IsString)(),
81
+ (0, class_validator_1.MaxLength)(255),
82
+ (0, class_validator_1.IsOptional)(),
83
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
84
+ __metadata("design:type", String)
85
+ ], WatiChat.prototype, "fullName", void 0);
86
+ __decorate([
87
+ (0, swagger_1.ApiProperty)({
88
+ description: "Indica si hay una sesión de WhatsApp activa con este contacto",
89
+ type: Boolean,
90
+ default: false,
91
+ }),
92
+ (0, class_validator_1.IsBoolean)(),
93
+ (0, typeorm_1.Column)({ type: "boolean", default: false }),
94
+ __metadata("design:type", Boolean)
95
+ ], WatiChat.prototype, "sessionActive", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({
98
+ description: "Fecha y hora de expiración de la sesión activa de WhatsApp",
99
+ required: false,
100
+ }),
101
+ (0, class_validator_1.IsDate)(),
102
+ (0, class_validator_1.IsOptional)(),
103
+ (0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
104
+ __metadata("design:type", Date)
105
+ ], WatiChat.prototype, "sessionExpiresAt", void 0);
106
+ __decorate([
107
+ (0, swagger_1.ApiProperty)({
108
+ description: "Atributos personalizados de Wati asociados al chat",
109
+ type: "object",
110
+ required: false,
111
+ }),
112
+ (0, class_validator_1.IsJSON)(),
113
+ (0, class_validator_1.IsOptional)(),
114
+ (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
115
+ __metadata("design:type", Object)
116
+ ], WatiChat.prototype, "watiCustomAttributes", void 0);
117
+ __decorate([
118
+ (0, swagger_1.ApiProperty)({
119
+ description: "Timestamp del último mensaje en esta conversación",
120
+ required: false,
121
+ }),
122
+ (0, class_validator_1.IsDate)(),
123
+ (0, class_validator_1.IsOptional)(),
124
+ (0, typeorm_1.Index)(),
125
+ (0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
126
+ __metadata("design:type", Date)
127
+ ], WatiChat.prototype, "lastMessageTimestamp", void 0);
128
+ __decorate([
129
+ (0, swagger_1.ApiProperty)({
130
+ enum: wati_enum_1.WhatsAppConversationStatusEnum,
131
+ description: "Estado de la conversación en Easywork",
132
+ }),
133
+ (0, class_validator_1.IsEnum)(wati_enum_1.WhatsAppConversationStatusEnum),
134
+ (0, typeorm_1.Column)({
135
+ type: "enum",
136
+ enum: wati_enum_1.WhatsAppConversationStatusEnum,
137
+ default: wati_enum_1.WhatsAppConversationStatusEnum.OPEN,
138
+ }),
139
+ __metadata("design:type", String)
140
+ ], WatiChat.prototype, "status", void 0);
141
+ __decorate([
142
+ (0, swagger_1.ApiProperty)({
143
+ description: "Número de mensajes no leídos para el agente",
144
+ default: 0,
145
+ }),
146
+ (0, class_validator_1.IsInt)(),
147
+ (0, class_validator_1.Min)(0),
148
+ (0, typeorm_1.Column)({ type: "integer", default: 0 }),
149
+ __metadata("design:type", Number)
150
+ ], WatiChat.prototype, "unreadCountForAgent", void 0);
151
+ __decorate([
152
+ (0, swagger_1.ApiProperty)({
153
+ description: "ID del usuario del CRM asignado a este chat",
154
+ required: false,
155
+ }),
156
+ (0, class_validator_1.IsString)(),
157
+ (0, class_validator_1.IsOptional)(),
158
+ (0, typeorm_1.Index)(),
159
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
160
+ __metadata("design:type", String)
161
+ ], WatiChat.prototype, "assignedToUserId", void 0);
162
+ __decorate([
163
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "SET NULL", nullable: true }),
164
+ (0, typeorm_1.JoinColumn)({ name: "assignedToUserId" }),
165
+ __metadata("design:type", user_entity_1.User)
166
+ ], WatiChat.prototype, "assignedToUser", void 0);
167
+ __decorate([
168
+ (0, swagger_1.ApiProperty)({
169
+ description: "ID del Lead en el CRM asociado a este chat",
170
+ required: false,
171
+ }),
172
+ (0, class_validator_1.IsString)(),
173
+ (0, class_validator_1.IsOptional)(),
174
+ (0, typeorm_1.Index)(),
175
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
176
+ __metadata("design:type", String)
177
+ ], WatiChat.prototype, "crmLeadId", void 0);
178
+ __decorate([
179
+ (0, typeorm_1.ManyToOne)(() => lead_entity_1.Lead, { onDelete: "SET NULL", nullable: true }),
180
+ (0, typeorm_1.JoinColumn)({ name: "crmLeadId" }),
181
+ __metadata("design:type", lead_entity_1.Lead)
182
+ ], WatiChat.prototype, "crmLead", void 0);
183
+ __decorate([
184
+ (0, swagger_1.ApiProperty)({
185
+ description: "ID del Contact en el CRM asociado a este chat",
186
+ required: false,
187
+ }),
188
+ (0, class_validator_1.IsString)(),
189
+ (0, class_validator_1.IsOptional)(),
190
+ (0, typeorm_1.Index)(),
191
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
192
+ __metadata("design:type", String)
193
+ ], WatiChat.prototype, "crmContactId", void 0);
194
+ __decorate([
195
+ (0, typeorm_1.ManyToOne)(() => contact_entity_1.Contact, { onDelete: "SET NULL", nullable: true }),
196
+ (0, typeorm_1.JoinColumn)({ name: "crmContactId" }),
197
+ __metadata("design:type", contact_entity_1.Contact)
198
+ ], WatiChat.prototype, "crmContact", void 0);
199
+ __decorate([
200
+ (0, typeorm_1.OneToMany)(() => wati_message_entity_1.WatiMessage, (message) => message.watiChat),
201
+ __metadata("design:type", Array)
202
+ ], WatiChat.prototype, "messages", void 0);
203
+ exports.WatiChat = WatiChat = __decorate([
204
+ (0, typeorm_1.Entity)("wati_chat"),
205
+ (0, typeorm_1.Index)(["watiConfigurationId", "watiConversationId"], { unique: true })
206
+ ], WatiChat);
207
+ //# sourceMappingURL=wati-chat.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wati-chat.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-chat.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkF;AAClF,6CAA8C;AAC9C,qDAAiH;AACjH,yDAA+C;AAC/C,+DAAqD;AACrD,4CAA0D;AAC1D,qEAA0D;AAC1D,iFAAsE;AACtE,mDAAyC;AACzC,iDAAmE;AAI5D,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,gCAAuB;IAKnD,mBAAmB,CAAS;IAI5B,iBAAiB,CAAoB;IAQrC,kBAAkB,CAAS;IAS3B,WAAW,CAAS;IAUpB,QAAQ,CAAU;IASlB,aAAa,CAAU;IASvB,gBAAgB,CAAQ;IAUxB,oBAAoB,CAAU;IAU9B,oBAAoB,CAAQ;IAY5B,MAAM,CAAiC;IASvC,mBAAmB,CAAS;IAU5B,gBAAgB,CAAU;IAI1B,cAAc,CAAQ;IAUtB,SAAS,CAAU;IAInB,OAAO,CAAQ;IAUf,YAAY,CAAU;IAItB,UAAU,CAAW;IAGrB,QAAQ,CAAgB;CACzB,CAAA;AA7IY,4BAAQ;AAKnB;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACnE,IAAA,0BAAQ,GAAE;IACV,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACG;AAI5B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;8BACzB,6CAAiB;mDAAC;AAQrC;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oFAAoF;KAClG,CAAC;IACD,IAAA,0BA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,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;;0CACpC;mBA5Ib,QAAQ;IAFpB,IAAA,gBAAM,EAAC,WAAW,CAAC;IACnB,IAAA,eAAK,EAAC,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC1D,QAAQ,CA6IpB"}
@@ -0,0 +1,22 @@
1
+ import { Group } from "../../group.entity";
2
+ import { EntityBase } from "../../../common";
3
+ import { WatiChat } from "./wati-chat.entity";
4
+ import { WatiIntegrationStatusEnum, WatiPlanType } from "./wati.enum";
5
+ export declare class WatiConfiguration extends EntityBase {
6
+ baseWebhookUrl: string;
7
+ generatedWebhookSecret: string;
8
+ apiEndpoint: string;
9
+ apiToken: string;
10
+ watiClientID: string;
11
+ associatedPhoneNumber: string;
12
+ status: WatiIntegrationStatusEnum;
13
+ lastErrorDetails?: string;
14
+ lastSuccessfulConnectionAt?: Date;
15
+ groupId: string;
16
+ group: Group;
17
+ watiSubscription?: {
18
+ planType: WatiPlanType;
19
+ features?: string[];
20
+ };
21
+ chats: WatiChat[];
22
+ }
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WatiConfiguration = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const class_validator_1 = require("class-validator");
16
+ const group_entity_1 = require("../../group.entity");
17
+ const common_1 = require("../../../common");
18
+ const wati_chat_entity_1 = require("./wati-chat.entity");
19
+ const wati_enum_1 = require("./wati.enum");
20
+ let WatiConfiguration = class WatiConfiguration extends common_1.EntityBase {
21
+ baseWebhookUrl;
22
+ generatedWebhookSecret;
23
+ apiEndpoint;
24
+ apiToken;
25
+ watiClientID;
26
+ associatedPhoneNumber;
27
+ status;
28
+ lastErrorDetails;
29
+ lastSuccessfulConnectionAt;
30
+ groupId;
31
+ group;
32
+ watiSubscription;
33
+ chats;
34
+ };
35
+ exports.WatiConfiguration = WatiConfiguration;
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({
38
+ description: "URL base del endpoint de webhooks de Easywork para esta integración. La URL completa se construye con identificadores y el secreto.",
39
+ }),
40
+ (0, class_validator_1.IsUrl)(),
41
+ (0, typeorm_1.Column)({ type: "varchar", length: 512 }),
42
+ __metadata("design:type", String)
43
+ ], WatiConfiguration.prototype, "baseWebhookUrl", void 0);
44
+ __decorate([
45
+ (0, swagger_1.ApiProperty)({
46
+ description: "Secreto generado por Easywork para validar los webhooks de Wati. Este secreto se añade a la URL que el usuario configura en Wati.",
47
+ }),
48
+ (0, class_validator_1.IsString)(),
49
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, select: false }),
50
+ __metadata("design:type", String)
51
+ ], WatiConfiguration.prototype, "generatedWebhookSecret", void 0);
52
+ __decorate([
53
+ (0, swagger_1.ApiProperty)({ description: "URL base de la API de Wati" }),
54
+ (0, class_validator_1.IsUrl)(),
55
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
56
+ __metadata("design:type", String)
57
+ ], WatiConfiguration.prototype, "apiEndpoint", void 0);
58
+ __decorate([
59
+ (0, swagger_1.ApiProperty)({ description: "Token de acceso para la API de Wati" }),
60
+ (0, class_validator_1.IsString)(),
61
+ (0, typeorm_1.Column)({ type: "text", select: false }),
62
+ __metadata("design:type", String)
63
+ ], WatiConfiguration.prototype, "apiToken", void 0);
64
+ __decorate([
65
+ (0, swagger_1.ApiProperty)({
66
+ description: "ID de cliente de Wati, identificador único de la cuenta de Wati",
67
+ example: "513892",
68
+ }),
69
+ (0, class_validator_1.IsString)(),
70
+ (0, typeorm_1.Index)(),
71
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
72
+ __metadata("design:type", String)
73
+ ], WatiConfiguration.prototype, "watiClientID", void 0);
74
+ __decorate([
75
+ (0, swagger_1.ApiProperty)({
76
+ description: "Número de WhatsApp asociado a esta configuración de Wati",
77
+ }),
78
+ (0, class_validator_1.IsString)(),
79
+ (0, typeorm_1.Index)(),
80
+ (0, typeorm_1.Column)({ type: "varchar", length: 50 }),
81
+ __metadata("design:type", String)
82
+ ], WatiConfiguration.prototype, "associatedPhoneNumber", void 0);
83
+ __decorate([
84
+ (0, swagger_1.ApiProperty)({
85
+ enum: wati_enum_1.WatiIntegrationStatusEnum,
86
+ description: "Estado actual de la integración con Wati",
87
+ default: wati_enum_1.WatiIntegrationStatusEnum.PENDING_SETUP,
88
+ }),
89
+ (0, class_validator_1.IsEnum)(wati_enum_1.WatiIntegrationStatusEnum),
90
+ (0, typeorm_1.Column)({
91
+ type: "enum",
92
+ enum: wati_enum_1.WatiIntegrationStatusEnum,
93
+ default: wati_enum_1.WatiIntegrationStatusEnum.PENDING_SETUP,
94
+ }),
95
+ __metadata("design:type", String)
96
+ ], WatiConfiguration.prototype, "status", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiProperty)({
99
+ description: "Detalles del último error de configuración/conexión",
100
+ required: false,
101
+ }),
102
+ (0, class_validator_1.IsString)(),
103
+ (0, class_validator_1.IsOptional)(),
104
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
105
+ __metadata("design:type", String)
106
+ ], WatiConfiguration.prototype, "lastErrorDetails", void 0);
107
+ __decorate([
108
+ (0, swagger_1.ApiProperty)({
109
+ description: "Fecha del último intento de conexión exitoso",
110
+ required: false,
111
+ }),
112
+ (0, class_validator_1.IsDate)(),
113
+ (0, class_validator_1.IsOptional)(),
114
+ (0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
115
+ __metadata("design:type", Date)
116
+ ], WatiConfiguration.prototype, "lastSuccessfulConnectionAt", void 0);
117
+ __decorate([
118
+ (0, swagger_1.ApiProperty)({
119
+ description: "ID del Group (tenant) al que pertenece esta configuración",
120
+ }),
121
+ (0, class_validator_1.IsString)(),
122
+ (0, typeorm_1.Index)(),
123
+ (0, typeorm_1.Column)({ type: "uuid", unique: true }),
124
+ __metadata("design:type", String)
125
+ ], WatiConfiguration.prototype, "groupId", void 0);
126
+ __decorate([
127
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.Group, { onDelete: "CASCADE" }),
128
+ (0, typeorm_1.JoinColumn)({ name: "groupId" }),
129
+ __metadata("design:type", group_entity_1.Group)
130
+ ], WatiConfiguration.prototype, "group", void 0);
131
+ __decorate([
132
+ (0, swagger_1.ApiProperty)({
133
+ description: "Información de la suscripción de Wati",
134
+ type: "object",
135
+ required: false,
136
+ }),
137
+ (0, class_validator_1.IsJSON)(),
138
+ (0, class_validator_1.IsOptional)(),
139
+ (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
140
+ __metadata("design:type", Object)
141
+ ], WatiConfiguration.prototype, "watiSubscription", void 0);
142
+ __decorate([
143
+ (0, typeorm_1.OneToMany)(() => wati_chat_entity_1.WatiChat, (chat) => chat.watiConfiguration),
144
+ __metadata("design:type", Array)
145
+ ], WatiConfiguration.prototype, "chats", void 0);
146
+ exports.WatiConfiguration = WatiConfiguration = __decorate([
147
+ (0, typeorm_1.Entity)("wati_configurations")
148
+ ], WatiConfiguration);
149
+ //# sourceMappingURL=wati-configuration.entity.js.map