easywork-common-lib 1.0.305 → 1.0.308

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 (58) hide show
  1. package/dist/common/functions/cripto.d.ts +1 -0
  2. package/dist/common/functions/cripto.js +9 -0
  3. package/dist/common/functions/cripto.js.map +1 -0
  4. package/dist/common/functions/image.d.ts +3 -0
  5. package/dist/common/functions/image.js +15 -0
  6. package/dist/common/functions/image.js.map +1 -0
  7. package/dist/common/functions/index.d.ts +2 -0
  8. package/dist/common/functions/index.js +19 -0
  9. package/dist/common/functions/index.js.map +1 -0
  10. package/dist/common/index.d.ts +1 -0
  11. package/dist/common/index.js +1 -0
  12. package/dist/common/index.js.map +1 -1
  13. package/dist/entities/helpers/sales/lead/index.d.ts +1 -0
  14. package/dist/entities/helpers/sales/lead/index.js +1 -0
  15. package/dist/entities/helpers/sales/lead/index.js.map +1 -1
  16. package/dist/entities/helpers/sales/lead/lead_cancel_reazon.entity.d.ts +4 -0
  17. package/dist/entities/helpers/sales/lead/lead_cancel_reazon.entity.js +28 -0
  18. package/dist/entities/helpers/sales/lead/lead_cancel_reazon.entity.js.map +1 -0
  19. package/dist/entities/index.d.ts +1 -2
  20. package/dist/entities/index.js +1 -2
  21. package/dist/entities/index.js.map +1 -1
  22. package/dist/entities/sales/contact.entity.js +1 -0
  23. package/dist/entities/sales/contact.entity.js.map +1 -1
  24. package/dist/entities/sales/index.d.ts +2 -0
  25. package/dist/entities/sales/index.js +2 -0
  26. package/dist/entities/sales/index.js.map +1 -1
  27. package/dist/entities/sales/lead.entity.d.ts +34 -44
  28. package/dist/entities/sales/lead.entity.js +143 -197
  29. package/dist/entities/sales/lead.entity.js.map +1 -1
  30. package/dist/entities/sales/poliza.entity.d.ts +15 -0
  31. package/dist/entities/sales/poliza.entity.js +103 -1
  32. package/dist/entities/sales/poliza.entity.js.map +1 -1
  33. package/dist/entities/sales/receipt-sub-agente.entity.d.ts +5 -0
  34. package/dist/entities/sales/receipt-sub-agente.entity.js +35 -0
  35. package/dist/entities/sales/receipt-sub-agente.entity.js.map +1 -0
  36. package/dist/entities/sales/receipt.entity.d.ts +5 -0
  37. package/dist/entities/sales/receipt.entity.js +31 -1
  38. package/dist/entities/sales/receipt.entity.js.map +1 -1
  39. package/dist/entities/thirdparty/email-config.d.ts +1 -0
  40. package/dist/entities/thirdparty/email-config.js +3 -0
  41. package/dist/entities/thirdparty/email-config.js.map +1 -0
  42. package/dist/entities/thirdparty/email.entity.d.ts +3 -2
  43. package/dist/entities/thirdparty/email.entity.js +7 -2
  44. package/dist/entities/thirdparty/email.entity.js.map +1 -1
  45. package/dist/entities/thirdparty/oauth.entity.d.ts +17 -0
  46. package/dist/entities/thirdparty/oauth.entity.js +88 -0
  47. package/dist/entities/thirdparty/oauth.entity.js.map +1 -0
  48. package/dist/modules/queue/notifier.service.d.ts +2 -1
  49. package/dist/modules/queue/notifier.service.js +2 -0
  50. package/dist/modules/queue/notifier.service.js.map +1 -1
  51. package/dist/modules/queue/notifiers/index.d.ts +1 -0
  52. package/dist/modules/queue/notifiers/index.js +1 -0
  53. package/dist/modules/queue/notifiers/index.js.map +1 -1
  54. package/dist/modules/queue/notifiers/lead.notifier.d.ts +7 -0
  55. package/dist/modules/queue/notifiers/lead.notifier.js +49 -0
  56. package/dist/modules/queue/notifiers/lead.notifier.js.map +1 -0
  57. package/package.json +1 -1
  58. package/tsconfig.tsbuildinfo +1 -1
@@ -1,12 +1,13 @@
1
1
  import { AmqpConnection } from "@golevelup/nestjs-rabbitmq";
2
2
  import { SendNotificationDto } from "../../common";
3
- import { ContactNotifier, TaskNotifier } from "./notifiers";
3
+ import { ContactNotifier, LeadNotifier, TaskNotifier } from "./notifiers";
4
4
  export declare class EasyNotifierService {
5
5
  private readonly amqpConnection;
6
6
  private readonly exchangeName;
7
7
  private readonly routingKey;
8
8
  readonly task: TaskNotifier;
9
9
  readonly contact: ContactNotifier;
10
+ readonly lead: LeadNotifier;
10
11
  constructor(amqpConnection: AmqpConnection, exchangeName: string, routingKey: string);
11
12
  sendNotification(data: SendNotificationDto): Promise<void>;
12
13
  sendOTPPhone(code: string, recipientsId: string[]): Promise<void>;
@@ -24,12 +24,14 @@ let EasyNotifierService = class EasyNotifierService {
24
24
  routingKey;
25
25
  task;
26
26
  contact;
27
+ lead;
27
28
  constructor(amqpConnection, exchangeName, routingKey) {
28
29
  this.amqpConnection = amqpConnection;
29
30
  this.exchangeName = exchangeName;
30
31
  this.routingKey = routingKey;
31
32
  this.task = new notifiers_1.TaskNotifier(this);
32
33
  this.contact = new notifiers_1.ContactNotifier(this);
34
+ this.lead = new notifiers_1.LeadNotifier(this);
33
35
  }
34
36
  async sendNotification(data) {
35
37
  logger.debug(`Sending notification: ${JSON.stringify(data)}`);
@@ -1 +1 @@
1
- {"version":3,"file":"notifier.service.js","sourceRoot":"","sources":["../../../src/modules/queue/notifier.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA4D;AAC5D,2CAA4D;AAC5D,yCAAuH;AACvH,2CAA4D;AAE5D,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,qBAAqB,CAAC,CAAC;AAG1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAKP;IACyB;IACO;IANrC,IAAI,CAAe;IACnB,OAAO,CAAkB;IAEzC,YACqB,cAA8B,EACL,YAAoB,EACb,UAAkB;QAFlD,mBAAc,GAAd,cAAc,CAAgB;QACL,iBAAY,GAAZ,YAAY,CAAQ;QACb,eAAU,GAAV,UAAU,CAAQ;QAEnE,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,IAAyB;QAC5C,MAAM,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAA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;YACjB,OAAO,EAAE,IAAI;YACb,YAAY;YACZ,QAAQ,EAAE,CAAC,4BAAmB,CAAC,KAAK,CAAC;YACrC,QAAQ,EAAE,6BAAoB,CAAC,GAAG;YAClC,WAAW,EAAE,gCAAuB,CAAC,GAAG;SAC3C,CAAC;QAEF,MAAM,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AA7CY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAQJ,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;IACvB,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;qCAFE,gCAAc;GAN1C,mBAAmB,CA6C/B"}
@@ -1,3 +1,4 @@
1
1
  export * from './task.notifier';
2
2
  export * from './calendar.notifier';
3
3
  export * from './contact.notifier';
4
+ export * from './lead.notifier';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./task.notifier"), exports);
18
18
  __exportStar(require("./calendar.notifier"), exports);
19
19
  __exportStar(require("./contact.notifier"), exports);
20
+ __exportStar(require("./lead.notifier"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/queue/notifiers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/queue/notifiers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC"}
@@ -0,0 +1,7 @@
1
+ import { EasyNotifierService } from '../notifier.service';
2
+ import { Lead, LeadComment } from '../../../entities';
3
+ export declare class LeadNotifier {
4
+ private readonly notifierService;
5
+ constructor(notifierService: EasyNotifierService);
6
+ notifyNewCommentLead(lead: Lead, comment: LeadComment, recipientsId: string[]): Promise<void>;
7
+ }
@@ -0,0 +1,49 @@
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.LeadNotifier = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const notifier_service_1 = require("../notifier.service");
15
+ const common_2 = require("../../../common");
16
+ let LeadNotifier = class LeadNotifier {
17
+ notifierService;
18
+ constructor(notifierService) {
19
+ this.notifierService = notifierService;
20
+ }
21
+ async notifyNewCommentLead(lead, comment, recipientsId) {
22
+ const commentText = comment.comment.slice(0, 20);
23
+ const content = `${comment.createdBy.name} comentó en el prospecto: <a href="/sales/leads/lead/${lead.id}?show=true" style="color:#170f6b">[${lead.name}]</a>. Texto del comentario: ${commentText}`;
24
+ const metadata = {
25
+ leadId: lead.id,
26
+ commentId: comment.id,
27
+ leadOwnerId: lead.createdBy?.id,
28
+ commentOwnerId: comment.createdBy?.id,
29
+ leadAssignedId: lead?.assignedBy?.id,
30
+ };
31
+ const notificationDto = {
32
+ title: "New Comment",
33
+ content,
34
+ recipientsId,
35
+ entityId: lead.id,
36
+ channels: [common_2.NotificationChannel.APP, common_2.NotificationChannel.SMS, common_2.NotificationChannel.PUSH],
37
+ category: common_2.NotificationCategory.CRM,
38
+ subCategory: common_2.NotificationSubcategory.CONTACT_NEW_COMMENT,
39
+ metadata,
40
+ };
41
+ await this.notifierService.sendNotification(notificationDto);
42
+ }
43
+ };
44
+ exports.LeadNotifier = LeadNotifier;
45
+ exports.LeadNotifier = LeadNotifier = __decorate([
46
+ (0, common_1.Injectable)(),
47
+ __metadata("design:paramtypes", [notifier_service_1.EasyNotifierService])
48
+ ], LeadNotifier);
49
+ //# sourceMappingURL=lead.notifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lead.notifier.js","sourceRoot":"","sources":["../../../../src/modules/queue/notifiers/lead.notifier.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,0DAA0D;AAE1D,4CAA0H;AAGnH,IAAM,YAAY,GAAlB,MAAM,YAAY;IACQ;IAA7B,YAA6B,eAAoC;QAApC,oBAAe,GAAf,eAAe,CAAqB;IAAI,CAAC;IAEtE,KAAK,CAAC,oBAAoB,CAAC,IAAU,EAAE,OAAoB,EAAE,YAAsB;QAC/E,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,wDAAwD,IAAI,CAAC,EAAE,sCAAsC,IAAI,CAAC,IAAI,gCAAgC,WAAW,EAAE,CAAC;QAErM,MAAM,QAAQ,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;YAC/B,cAAc,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE;YACrC,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;SACvC,CAAC;QAEF,MAAM,eAAe,GAAwB;YACzC,KAAK,EAAE,aAAa;YACpB,OAAO;YACP,YAAY;YACZ,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,QAAQ,EAAE,CAAC,4BAAmB,CAAC,GAAG,EAAE,4BAAmB,CAAC,GAAG,EAAE,4BAAmB,CAAC,IAAI,CAAC;YACtF,QAAQ,EAAE,6BAAoB,CAAC,GAAG;YAClC,WAAW,EAAE,gCAAuB,CAAC,mBAAmB;YACxD,QAAQ;SACX,CAAC;QAEF,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACjE,CAAC;CACJ,CAAA;AA5BY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAEqC,sCAAmB;GADxD,YAAY,CA4BxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.305",
3
+ "version": "1.0.308",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {