easywork-common-lib 1.0.4 → 1.0.6

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 (75) hide show
  1. package/dist/common/database/base.entity.js +6 -39
  2. package/dist/common/database/base.entity.js.map +1 -1
  3. package/dist/common/database/index.js +1 -18
  4. package/dist/common/database/index.js.map +1 -1
  5. package/dist/entities/app_config/app-config.entity.d.ts +5 -0
  6. package/dist/entities/drive/folder.entity.d.ts +5 -0
  7. package/dist/entities/email.entity.d.ts +5 -0
  8. package/dist/entities/group.entity.js +1 -9
  9. package/dist/entities/group.entity.js.map +1 -1
  10. package/dist/entities/helpers/contact_email.entity.d.ts +11 -0
  11. package/dist/entities/helpers/contact_phone.entity.d.ts +11 -0
  12. package/dist/entities/helpers/contact_sources.entity.d.ts +5 -0
  13. package/dist/entities/helpers/contact_types.entity.d.ts +5 -0
  14. package/dist/entities/helpers/lead_email.entity.d.ts +11 -0
  15. package/dist/entities/helpers/lead_phone.entity.d.ts +11 -0
  16. package/dist/entities/index.d.ts +10 -0
  17. package/dist/entities/index.js +1 -24
  18. package/dist/entities/index.js.map +1 -1
  19. package/dist/entities/otp-log.entity.js +4 -27
  20. package/dist/entities/otp-log.entity.js.map +1 -1
  21. package/dist/entities/permission.entity.js +3 -21
  22. package/dist/entities/permission.entity.js.map +1 -1
  23. package/dist/entities/phone.entity.d.ts +5 -0
  24. package/dist/entities/profile.entity.js +5 -33
  25. package/dist/entities/profile.entity.js.map +1 -1
  26. package/dist/entities/protocol.entity.js +4 -24
  27. package/dist/entities/protocol.entity.js.map +1 -1
  28. package/dist/entities/refresh-token.entity.js +3 -18
  29. package/dist/entities/refresh-token.entity.js.map +1 -1
  30. package/dist/entities/role.entity.js +2 -15
  31. package/dist/entities/role.entity.js.map +1 -1
  32. package/dist/entities/sales/contact.entity.d.ts +41 -0
  33. package/dist/entities/sales/lead.entity.d.ts +46 -0
  34. package/dist/entities/sales/poliza.entity.d.ts +58 -0
  35. package/dist/entities/user.entity.js +12 -75
  36. package/dist/entities/user.entity.js.map +1 -1
  37. package/dist/eslint.config.d.ts +1 -1
  38. package/dist/eslint.config.js +1 -47
  39. package/dist/eslint.config.js.map +1 -1
  40. package/dist/index.js +2 -18
  41. package/dist/index.js.LICENSE.txt +19 -0
  42. package/dist/index.js.map +1 -1
  43. package/package.json +41 -29
  44. package/package.old.json +32 -0
  45. package/src/entities/app_config/app-config.entity.ts +13 -0
  46. package/src/entities/drive/folder.entity.ts +13 -0
  47. package/src/entities/email.entity.ts +13 -0
  48. package/src/entities/helpers/contact_email.entity.ts +33 -0
  49. package/src/entities/helpers/contact_phone.entity.ts +33 -0
  50. package/src/entities/helpers/contact_sources.entity.ts +13 -0
  51. package/src/entities/helpers/contact_types.entity.ts +13 -0
  52. package/src/entities/helpers/lead_email.entity.ts +31 -0
  53. package/src/entities/helpers/lead_phone.entity.ts +31 -0
  54. package/src/entities/index.ts +17 -0
  55. package/src/entities/phone.entity.ts +13 -0
  56. package/{entities → src/entities}/profile.entity.ts +1 -1
  57. package/src/entities/sales/contact.entity.ts +140 -0
  58. package/src/entities/sales/lead.entity.ts +151 -0
  59. package/src/entities/sales/poliza.entity.ts +220 -0
  60. package/tsconfig.json +4 -3
  61. package/webpack-hmr.js +26 -0
  62. package/webpack.config.js +27 -0
  63. package/entities/index.ts +0 -7
  64. /package/{common → src/common}/@types/typings/globals.d.ts +0 -0
  65. /package/{common → src/common}/database/base.entity.ts +0 -0
  66. /package/{common → src/common}/database/index.ts +0 -0
  67. /package/{entities → src/entities}/group.entity.ts +0 -0
  68. /package/{entities → src/entities}/otp-log.entity.ts +0 -0
  69. /package/{entities → src/entities}/permission.entity.ts +0 -0
  70. /package/{entities → src/entities}/protocol.entity.ts +0 -0
  71. /package/{entities → src/entities}/refresh-token.entity.ts +0 -0
  72. /package/{entities → src/entities}/role.entity.ts +0 -0
  73. /package/{entities → src/entities}/user.entity.ts +0 -0
  74. /package/{eslint.config.js → src/eslint.config.js} +0 -0
  75. /package/{index.ts → src/index.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ /*!
2
+ */
3
+
4
+ /*! *****************************************************************************
5
+ Copyright (C) Microsoft. All rights reserved.
6
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
7
+ this file except in compliance with the License. You may obtain a copy of the
8
+ License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
12
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
13
+ MERCHANTABLITY OR NON-INFRINGEMENT.
14
+
15
+ See the Apache Version 2.0 License for specific language governing permissions
16
+ and limitations under the License.
17
+ ***************************************************************************** */
18
+
19
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
package/package.json CHANGED
@@ -1,29 +1,41 @@
1
- {
2
- "name": "easywork-common-lib",
3
- "version": "1.0.4",
4
- "description": "Paquete de librerías compartidas para EasyWork",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc"
9
- },
10
- "keywords": [
11
- "nestjs",
12
- "typeorm",
13
- "shared",
14
- "entities"
15
- ],
16
- "author": "Rosmer Campos",
17
- "license": "MIT",
18
- "dependencies": {
19
- "@nestjs/common": "^10.3.8",
20
- "@nestjs/typeorm": "^10.0.2",
21
- "@rubiin/tsconfig": "^1.1.2",
22
- "class-transformer": "^0.5.1",
23
- "class-validator": "^0.14.1",
24
- "typeorm": "^0.2.45"
25
- },
26
- "devDependencies": {
27
- "typescript": "^5.4.2"
28
- }
29
- }
1
+ {
2
+ "name": "easywork-common-lib",
3
+ "version": "1.0.6",
4
+ "description": "Librería común de Easywork",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "webpack",
8
+ "postbuild": "node -r tsconfig-paths/register dist/index.js",
9
+ "test": "echo \"Error: no test specified\" && exit 1"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/criptopreto/easywork-common-lib.git"
14
+ },
15
+ "keywords": [
16
+ "nodejs"
17
+ ],
18
+ "author": "Rosmer Campos",
19
+ "license": "MIT",
20
+ "bugs": {
21
+ "url": "https://github.com/criptopreto/easywork-common-lib/issues"
22
+ },
23
+ "homepage": "https://github.com/criptopreto/easywork-common-lib#readme",
24
+ "dependencies": {
25
+ "@nestjs/common": "^10.3.8",
26
+ "@nestjs/typeorm": "^10.0.2",
27
+ "class-transformer": "^0.5.1",
28
+ "class-validator": "^0.14.1",
29
+ "tspath": "^2.6.8",
30
+ "typeorm": "^0.3.20"
31
+ },
32
+ "devDependencies": {
33
+ "@antfu/eslint-config": "^2.15.0",
34
+ "@rubiin/tsconfig": "^1.1.2",
35
+ "ts-loader": "^9.5.1",
36
+ "tsconfig-paths": "^4.2.0",
37
+ "typescript": "^5.4.5",
38
+ "webpack": "^5.91.0",
39
+ "webpack-cli": "^5.1.4"
40
+ }
41
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "easywork-common-lib",
3
+ "version": "1.0.4",
4
+ "description": "Paquete de librerías compartidas para EasyWork",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc"
9
+ },
10
+ "keywords": [
11
+ "nestjs",
12
+ "typeorm",
13
+ "shared",
14
+ "entities"
15
+ ],
16
+ "author": "Rosmer Campos",
17
+ "license": "MIT",
18
+ "dependencies": {
19
+ "@nestjs/common": "^10.3.8",
20
+ "@nestjs/typeorm": "^10.0.2",
21
+ "class-transformer": "^0.5.1",
22
+ "class-validator": "^0.14.1",
23
+ "typeorm": "^0.3.20"
24
+ },
25
+ "devDependencies": {
26
+ "@antfu/eslint-config": "^2.15.0",
27
+ "@rubiin/tsconfig": "^1.1.2",
28
+ "typescript": "^5.4.5",
29
+ "webpack": "^5.91.0",
30
+ "webpack-node-externals": "^3.0.0"
31
+ }
32
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class AppConfig extends BaseEntity {
7
+ @MinLength(3)
8
+ @Column({ unique: true })
9
+ key: string;
10
+
11
+ @Column({ nullable: true })
12
+ value: string;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class Folder extends BaseEntity {
7
+ @MinLength(1)
8
+ @Column({ unique: true })
9
+ name: string;
10
+
11
+ @Column({ default: false })
12
+ isDefault: boolean;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class Email extends BaseEntity {
7
+ @MinLength(3)
8
+ @Column({ unique: true })
9
+ email: string;
10
+
11
+ @Column({ name: "is_default", default: false })
12
+ isDefault: boolean;
13
+ }
@@ -0,0 +1,33 @@
1
+ import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
2
+ import { Exclude } from "class-transformer";
3
+ import { Contact } from "../sales/contact.entity";
4
+ import { Email } from "../email.entity";
5
+
6
+ @Entity()
7
+ export class ContactEmail extends BaseEntity {
8
+ @PrimaryGeneratedColumn("uuid")
9
+ id?: string;
10
+
11
+ @Column()
12
+ contactId: string;
13
+
14
+ @Column()
15
+ emailId: string;
16
+
17
+ @Column({ nullable: true })
18
+ relation: string;
19
+
20
+ @Exclude()
21
+ @ManyToOne(() => Contact, contact => contact.emails, {
22
+ onDelete: "CASCADE",
23
+ onUpdate: "CASCADE",
24
+ })
25
+ public contact: Contact;
26
+
27
+ @ManyToOne(() => Email, {
28
+ onDelete: "CASCADE",
29
+ onUpdate: "CASCADE",
30
+ eager: true,
31
+ })
32
+ public email: Email; // s
33
+ }
@@ -0,0 +1,33 @@
1
+ import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
2
+ import { Exclude } from "class-transformer";
3
+ import { Contact } from "../sales/contact.entity";
4
+ import { Phone } from "../phone.entity";
5
+
6
+ @Entity()
7
+ export class ContactPhone extends BaseEntity {
8
+ @PrimaryGeneratedColumn("uuid")
9
+ id?: string;
10
+
11
+ @Column()
12
+ contactId: string;
13
+
14
+ @Column()
15
+ phoneId: string;
16
+
17
+ @Column({ nullable: true })
18
+ relation: string;
19
+
20
+ @Exclude()
21
+ @ManyToOne(() => Contact, contact => contact.phones, {
22
+ onDelete: "CASCADE",
23
+ onUpdate: "CASCADE",
24
+ })
25
+ public contact: Contact;
26
+
27
+ @ManyToOne(() => Phone, {
28
+ onDelete: "CASCADE",
29
+ onUpdate: "CASCADE",
30
+ eager: true,
31
+ })
32
+ public phone: Phone; // s
33
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class ContactSource extends BaseEntity {
7
+ @MinLength(3)
8
+ @Column({ unique: true })
9
+ name: string;
10
+
11
+ @Column({ default: false })
12
+ isDefault: boolean;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class ContactType extends BaseEntity {
7
+ @MinLength(3)
8
+ @Column({ unique: true })
9
+ name: string;
10
+
11
+ @Column({ default: false })
12
+ isDefault: boolean;
13
+ }
@@ -0,0 +1,31 @@
1
+ import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
2
+ import { Lead } from "../sales/lead.entity";
3
+ import { Email } from "../email.entity";
4
+
5
+ @Entity()
6
+ export class LeadEmail extends BaseEntity {
7
+ @PrimaryGeneratedColumn("uuid")
8
+ id?: string;
9
+
10
+ @Column()
11
+ leadId: string;
12
+
13
+ @Column()
14
+ emailId: string;
15
+
16
+ @Column({ nullable: true })
17
+ relation: string;
18
+
19
+ @ManyToOne(() => Lead, (lead) => lead.emails, {
20
+ onDelete: "CASCADE",
21
+ onUpdate: "CASCADE",
22
+ })
23
+ public lead: Lead;
24
+
25
+ @ManyToOne(() => Email, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "CASCADE",
28
+ eager: true,
29
+ })
30
+ public email: Email; // s
31
+ }
@@ -0,0 +1,31 @@
1
+ import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
2
+ import { Lead } from "../sales/lead.entity";
3
+ import { Phone } from "../phone.entity";
4
+
5
+ @Entity()
6
+ export class LeadPhone extends BaseEntity {
7
+ @PrimaryGeneratedColumn("uuid")
8
+ id?: string;
9
+
10
+ @Column()
11
+ leadId: string;
12
+
13
+ @Column()
14
+ phoneId: string;
15
+
16
+ @Column({ nullable: true })
17
+ relation: string;
18
+
19
+ @ManyToOne(() => Lead, (lead) => lead.phones, {
20
+ onDelete: "CASCADE",
21
+ onUpdate: "CASCADE",
22
+ })
23
+ public lead: Lead;
24
+
25
+ @ManyToOne(() => Phone, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "CASCADE",
28
+ eager: true,
29
+ })
30
+ public phone: Phone; // s
31
+ }
@@ -0,0 +1,17 @@
1
+ export * from "./user.entity";
2
+ export * from "./protocol.entity";
3
+ export * from "./otp-log.entity";
4
+ export * from "./refresh-token.entity";
5
+ export * from "./profile.entity";
6
+ export * from "./role.entity";
7
+ export * from "./permission.entity";
8
+ export * from "./sales/contact.entity";
9
+ export * from "./sales/lead.entity";
10
+ export * from "./sales/poliza.entity";
11
+ export * from "./phone.entity";
12
+ export * from "./email.entity";
13
+ export * from "./helpers/contact_phone.entity";
14
+ export * from "./helpers/contact_email.entity";
15
+ export * from "./helpers/contact_types.entity";
16
+ export * from "./helpers/contact_sources.entity";
17
+ export * from "./app_config/app-config.entity";
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { Column, Entity } from "typeorm";
4
+
5
+ @Entity()
6
+ export class Phone extends BaseEntity {
7
+ @MinLength(3)
8
+ @Column({ unique: true })
9
+ number: string;
10
+
11
+ @Column({ name: "is_default", default: false })
12
+ isDefault: boolean;
13
+ }
@@ -16,7 +16,7 @@ export class Profile extends BaseEntity {
16
16
  @Column({ nullable: true })
17
17
  birthday: Date;
18
18
 
19
- @OneToOne(() => User, (user) => user.profile, {
19
+ @OneToOne(() => User, user => user.profile, {
20
20
  onDelete: "CASCADE",
21
21
  onUpdate: "CASCADE",
22
22
  })
@@ -0,0 +1,140 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { ContactEmail } from "../helpers/contact_email.entity";
3
+ import { ContactPhone } from "../helpers/contact_phone.entity";
4
+ import { ContactSource } from "../helpers/contact_sources.entity";
5
+ import { ContactType } from "../helpers/contact_types.entity";
6
+ import { User } from "../user.entity";
7
+ import { Column, Entity, ManyToOne, OneToMany } from "typeorm";
8
+
9
+ @Entity()
10
+ export class Contact extends BaseEntity {
11
+ @Column({ name: "curp", length: 50, nullable: true })
12
+ curp: string;
13
+
14
+ @Column({ name: "id_bitrix", nullable: true })
15
+ idBitrix: number;
16
+
17
+ @Column({ name: "cua", length: 50, nullable: true })
18
+ cua: string;
19
+
20
+ @Column({ name: "cargo", length: 50, nullable: true })
21
+ cargo: string;
22
+
23
+ @Column({ name: "full_name", length: 100, nullable: true })
24
+ fullName: string;
25
+
26
+ @Column({ name: "name", length: 50, nullable: true })
27
+ name: string;
28
+
29
+ @Column({ name: "last_name", length: 50, nullable: true })
30
+ lastName: string;
31
+
32
+ @Column({ name: "second_name", length: 50, nullable: true })
33
+ secondName: string;
34
+
35
+ @Column({ name: "photo", length: 255, nullable: true })
36
+ photo: string;
37
+
38
+ @Column({ name: "post", type: "text", nullable: true })
39
+ post: string;
40
+
41
+ @Column({ name: "address", type: "text", nullable: true })
42
+ address: string;
43
+
44
+ @Column({ name: "comments", type: "text", nullable: true })
45
+ comments: string;
46
+
47
+ @Column({ name: "lead", nullable: true })
48
+ lead: string;
49
+
50
+ @Column({ name: "export", default: false })
51
+ export: boolean;
52
+
53
+ @Column({ name: "originator_id", length: 255, nullable: true })
54
+ originatorId: string;
55
+
56
+ @Column({ name: "origin_id", length: 255, nullable: true })
57
+ originId: string;
58
+
59
+ @Column({ name: "origin_version", length: 255, nullable: true })
60
+ originVersion: string;
61
+
62
+ @Column({ name: "birthdate", nullable: true })
63
+ birthdate: Date;
64
+
65
+ @Column({ name: "honorific", length: 128, nullable: true })
66
+ honorific: string;
67
+
68
+ @Column({ name: "has_phone", default: false })
69
+ hasPhone: boolean;
70
+
71
+ @Column({ name: "has_email", default: false })
72
+ hasEmail: boolean;
73
+
74
+ @Column({ name: "has_imol", default: false })
75
+ hasImol: boolean;
76
+
77
+ @Column({ name: "face_id", nullable: true })
78
+ faceId: string;
79
+
80
+ @Column({ name: "opened", default: false })
81
+ opened: boolean;
82
+
83
+ @Column({ name: "company", nullable: true })
84
+ company: string;
85
+
86
+ @Column({ name: "source_description", type: "text", nullable: true })
87
+ sourceDescription: string;
88
+
89
+ /* Metadata */
90
+ @ManyToOne(() => User, {
91
+ onDelete: "SET NULL",
92
+ onUpdate: "CASCADE",
93
+ nullable: true,
94
+ })
95
+ assignedBy: User;
96
+
97
+ @ManyToOne(() => User, {
98
+ onDelete: "SET NULL",
99
+ onUpdate: "CASCADE",
100
+ nullable: true,
101
+ })
102
+ createdBy: User;
103
+
104
+ @ManyToOne(() => User, {
105
+ onDelete: "SET NULL",
106
+ onUpdate: "CASCADE",
107
+ nullable: true,
108
+ })
109
+ observador: User;
110
+
111
+ @ManyToOne(() => ContactType, {
112
+ onDelete: "SET NULL",
113
+ onUpdate: "CASCADE",
114
+ nullable: true,
115
+ eager: true,
116
+ })
117
+ type: ContactType;
118
+
119
+ @ManyToOne(() => ContactSource, {
120
+ onDelete: "SET NULL",
121
+ onUpdate: "CASCADE",
122
+ nullable: true,
123
+ eager: true,
124
+ })
125
+ source: ContactSource;
126
+
127
+ @OneToMany(() => ContactPhone, (contactPhone) => contactPhone.contact, {
128
+ onDelete: "CASCADE",
129
+ onUpdate: "CASCADE",
130
+ eager: true,
131
+ })
132
+ phones?: ContactPhone[];
133
+
134
+ @OneToMany(() => ContactEmail, (contactEmail) => contactEmail.contact, {
135
+ onDelete: "CASCADE",
136
+ onUpdate: "CASCADE",
137
+ eager: true,
138
+ })
139
+ emails?: ContactEmail[];
140
+ }
@@ -0,0 +1,151 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { LeadEmail } from "../helpers/lead_email.entity";
3
+ import { LeadPhone } from "../helpers/lead_phone.entity";
4
+ import { User } from "../user.entity";
5
+ import { Column, Entity, ManyToOne, OneToMany, OneToOne } from "typeorm";
6
+ import { Contact } from "./contact.entity";
7
+
8
+ @Entity()
9
+ export class Lead extends BaseEntity {
10
+ @Column({ name: "curp", length: 50, nullable: true })
11
+ curp: string;
12
+
13
+ @Column({ name: "id_bitrix" })
14
+ idBitrix: number;
15
+
16
+ @Column({ name: "cua", length: 50, nullable: true })
17
+ cua: string;
18
+
19
+ @Column({ name: "full_name", length: 100, nullable: true })
20
+ fullName: string;
21
+
22
+ @Column({ name: "name", length: 50, nullable: true })
23
+ name: string;
24
+
25
+ @Column({ name: "last_name", length: 50, nullable: true })
26
+ lastName: string;
27
+
28
+ @Column({ name: "second_name", length: 50, nullable: true })
29
+ secondName: string;
30
+
31
+ @Column({ name: "photo", length: 255, nullable: true })
32
+ photo: string;
33
+
34
+ @Column({ type: "decimal" })
35
+ opportunity: number;
36
+
37
+ @Column({ name: "post", type: "text", nullable: true })
38
+ post: string;
39
+
40
+ @Column({ name: "address", type: "text", nullable: true })
41
+ address: string;
42
+
43
+ @Column({ name: "comments", type: "text", nullable: true })
44
+ comments: string;
45
+
46
+ @Column({ name: "lead", nullable: true })
47
+ lead: string;
48
+
49
+ @Column({ name: "export", default: false })
50
+ export: boolean;
51
+
52
+ @Column({ name: "originator_id", length: 255, nullable: true })
53
+ originatorId: string;
54
+
55
+ @Column({ name: "origin_id", length: 255, nullable: true })
56
+ originId: string;
57
+
58
+ @Column({ name: "origin_version", length: 255, nullable: true })
59
+ originVersion: string;
60
+
61
+ @Column({ name: "birthdate", nullable: true })
62
+ birthdate: Date;
63
+
64
+ @Column({ name: "honorific", length: 128, nullable: true })
65
+ honorific: string;
66
+
67
+ @Column({ name: "has_phone", default: false })
68
+ hasPhone: boolean;
69
+
70
+ @Column({ name: "has_email", default: false })
71
+ hasEmail: boolean;
72
+
73
+ @Column({ name: "has_imol", default: false })
74
+ hasImol: boolean;
75
+
76
+ @Column({ name: "face_id", nullable: true })
77
+ faceId: string;
78
+
79
+ @Column({ name: "opened", default: false })
80
+ opened: boolean;
81
+
82
+ @Column({ name: "company", nullable: true })
83
+ company: string;
84
+
85
+ @Column({ name: "status_id", nullable: true })
86
+ statusId: string;
87
+
88
+ @Column({ name: "company_title", length: 255, nullable: true })
89
+ companyTitle: string;
90
+
91
+ @Column({ name: "account_currency_id", nullable: true })
92
+ accountCurrencyId: string;
93
+
94
+ @Column({ nullable: true })
95
+ title: string;
96
+
97
+ @Column({ name: "source", length: 50, nullable: true })
98
+ source: string;
99
+
100
+ @Column({ name: "source_description", type: "text", nullable: true })
101
+ sourceDescription: string;
102
+
103
+ @Column({ name: "is_return_customer", nullable: true })
104
+ isReturnCustomer: boolean;
105
+
106
+ @Column({ name: "is_manual_opportunity", nullable: true })
107
+ isManualOpportunity: boolean;
108
+
109
+ /* Metadata */
110
+ @ManyToOne(() => User, {
111
+ onDelete: "SET NULL",
112
+ onUpdate: "CASCADE",
113
+ nullable: true,
114
+ })
115
+ assignedBy: User;
116
+
117
+ @ManyToOne(() => User, {
118
+ onDelete: "SET NULL",
119
+ onUpdate: "CASCADE",
120
+ nullable: true,
121
+ })
122
+ createdBy: User;
123
+
124
+ @ManyToOne(() => User, {
125
+ onDelete: "SET NULL",
126
+ onUpdate: "CASCADE",
127
+ nullable: true,
128
+ })
129
+ observador: User;
130
+
131
+ @OneToOne(() => Contact, {
132
+ onDelete: "SET NULL",
133
+ onUpdate: "CASCADE",
134
+ nullable: true,
135
+ })
136
+ contact: Contact;
137
+
138
+ @OneToMany(() => LeadPhone, (leadPhone) => leadPhone.lead, {
139
+ onDelete: "CASCADE",
140
+ onUpdate: "CASCADE",
141
+ eager: true,
142
+ })
143
+ phones?: LeadPhone[];
144
+
145
+ @OneToMany(() => LeadEmail, (leadEmail) => leadEmail.lead, {
146
+ onDelete: "CASCADE",
147
+ onUpdate: "CASCADE",
148
+ eager: true,
149
+ })
150
+ emails?: LeadEmail[];
151
+ }