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,220 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { MinLength } from "class-validator";
3
+ import { User } from "../user.entity";
4
+ import { Column, Entity, ManyToOne } from "typeorm";
5
+ import { Contact } from "./contact.entity";
6
+
7
+ @Entity()
8
+ export class Poliza extends BaseEntity {
9
+ @Column({ name: "id_bitrix", nullable: true })
10
+ idBitrix: number;
11
+
12
+ @MinLength(3)
13
+ @Column({ length: 15, nullable: true, name: "no_poliza" })
14
+ noPoliza: string;
15
+
16
+ @MinLength(3)
17
+ @Column({ length: 255, nullable: true })
18
+ title: string;
19
+
20
+ @MinLength(3)
21
+ @Column({ length: 5, nullable: true })
22
+ version: string;
23
+
24
+ @Column({ nullable: true, name: "vigencia_desde" })
25
+ vigenciaDesde: Date;
26
+
27
+ @Column({ nullable: true, name: "vigencia_hasta" })
28
+ vigenciaHasta: Date;
29
+
30
+ @Column({ nullable: true, name: "begin_date" })
31
+ beginDate: Date;
32
+
33
+ @Column({ nullable: true, name: "close_date" })
34
+ closeDate: Date;
35
+
36
+ @Column({ default: false })
37
+ opened?: boolean;
38
+
39
+ @Column({ name: "stage_semantic_id", nullable: true })
40
+ stageSemantic?: string;
41
+
42
+ @Column({ nullable: true, name: "stage_id" })
43
+ stage: string;
44
+
45
+ @Column({ name: "is_new", nullable: true })
46
+ isNew: boolean;
47
+
48
+ @Column({ type: "float", name: "prima_neta", default: 0 })
49
+ primaNeta?: number;
50
+
51
+ @Column({ type: "float", name: "recargo_fraccionado", default: 0 })
52
+ recargoFraccionado?: number;
53
+
54
+ @Column({ type: "float", name: "derecho_poliza", default: 0 })
55
+ derechoPoliza?: number;
56
+
57
+ @Column({ type: "float", default: 0 })
58
+ iva?: number;
59
+
60
+ @Column({ type: "float", name: "importe_pagar", nullable: true })
61
+ importePagar?: number;
62
+
63
+ @Column({ default: false, name: "is_recurring" })
64
+ isRecurring?: boolean;
65
+
66
+ @Column({ default: false, name: "is_return_customer" })
67
+ isReturnCustomer?: boolean;
68
+
69
+ @Column({ default: false, name: "is_repeated_approach" })
70
+ isRepeatedApproach?: boolean;
71
+
72
+ @Column({ default: false })
73
+ closed?: boolean;
74
+
75
+ @Column({ length: 50, nullable: true, name: "type_id" })
76
+ typeId?: string;
77
+
78
+ @Column({ type: "float", nullable: true })
79
+ opportunity?: number;
80
+
81
+ @Column({ default: false, name: "is_manual_opportunity" })
82
+ isManualOpportunity?: boolean;
83
+
84
+ @Column({ name: "currency_id", nullable: true })
85
+ currencyId?: string;
86
+
87
+ @Column({ name: "tax_value", type: "float", nullable: true })
88
+ taxValue?: number;
89
+
90
+ @Column({ type: "float", default: 0, name: "opportunity_account" })
91
+ opportunityAccount?: number;
92
+
93
+ @Column({ type: "float", default: 0, name: "tax_value_account" })
94
+ taxValueAccount?: number;
95
+
96
+ @Column({ name: "account_currency_id", nullable: true })
97
+ accountCurrencyId?: string;
98
+
99
+ @Column({ nullable: true })
100
+ probability?: number;
101
+
102
+ @Column({ type: "text", nullable: true })
103
+ comments?: string;
104
+
105
+ @Column({ name: "event_date", nullable: true })
106
+ eventDate?: Date;
107
+
108
+ @Column({ type: "varchar", length: 50, nullable: true, name: "event_id" })
109
+ eventId?: string;
110
+
111
+ @Column({ type: "text", nullable: true, name: "event_description" })
112
+ eventDescription?: string;
113
+
114
+ @Column({
115
+ type: "decimal",
116
+ precision: 20,
117
+ scale: 4,
118
+ default: 1.0,
119
+ name: "exch_rate",
120
+ })
121
+ exchRate?: number;
122
+
123
+ @Column({ nullable: true })
124
+ product?: string;
125
+
126
+ @Column({ nullable: true, name: "source_id" })
127
+ sourceId: string;
128
+
129
+ @Column({ nullable: true, name: "source_description" })
130
+ sourceDescription: string;
131
+
132
+ @ManyToOne(() => User, {
133
+ onDelete: "SET NULL",
134
+ onUpdate: "CASCADE",
135
+ nullable: true,
136
+ })
137
+ contact: Contact;
138
+
139
+ @ManyToOne(() => User, {
140
+ onDelete: "SET NULL",
141
+ onUpdate: "CASCADE",
142
+ nullable: true,
143
+ })
144
+ assignedBy?: User;
145
+
146
+ @ManyToOne(() => User, {
147
+ onDelete: "SET NULL",
148
+ onUpdate: "CASCADE",
149
+ nullable: true,
150
+ })
151
+ createdBy?: User;
152
+
153
+ @Column({ length: 255, nullable: true, name: "descripcion_movimiento" })
154
+ descripcionMovimiento?: string;
155
+
156
+ @Column({ length: 255, nullable: true })
157
+ especificacionesPlan: string;
158
+
159
+ @ManyToOne(() => User, {
160
+ onDelete: "SET NULL",
161
+ onUpdate: "CASCADE",
162
+ nullable: true,
163
+ })
164
+ agenteReclamo?: User;
165
+
166
+ @ManyToOne(() => User, {
167
+ onDelete: "SET NULL",
168
+ onUpdate: "CASCADE",
169
+ nullable: true,
170
+ })
171
+ agenteReembolso?: User;
172
+
173
+ @ManyToOne(() => User, {
174
+ onDelete: "SET NULL",
175
+ onUpdate: "CASCADE",
176
+ nullable: true,
177
+ })
178
+ agenteProgramaciones?: User;
179
+
180
+ @ManyToOne(() => User, {
181
+ onDelete: "SET NULL",
182
+ onUpdate: "CASCADE",
183
+ nullable: true,
184
+ })
185
+ agenteReembolsoSubsecuente?: User;
186
+
187
+ @ManyToOne(() => User, {
188
+ onDelete: "SET NULL",
189
+ onUpdate: "CASCADE",
190
+ nullable: true,
191
+ })
192
+ agenteRescateFondos?: User;
193
+
194
+ @ManyToOne(() => User, {
195
+ onDelete: "SET NULL",
196
+ onUpdate: "CASCADE",
197
+ nullable: true,
198
+ })
199
+ agenteSaludGMM?: User;
200
+
201
+ @ManyToOne(() => User, {
202
+ onDelete: "SET NULL",
203
+ onUpdate: "CASCADE",
204
+ nullable: true,
205
+ })
206
+ agenteVida?: User;
207
+
208
+ @ManyToOne(() => User, {
209
+ onDelete: "SET NULL",
210
+ onUpdate: "CASCADE",
211
+ nullable: true,
212
+ })
213
+ agenteAutos?: User;
214
+
215
+ @Column({ name: "fecha_referida_pago", nullable: true })
216
+ fechaReferidaPago?: Date;
217
+
218
+ @ManyToOne(() => User, (user) => user.id, { nullable: true })
219
+ modifyBy?: User;
220
+ }
package/tsconfig.json CHANGED
@@ -7,10 +7,11 @@
7
7
  "emitDecoratorMetadata": true,
8
8
  "experimentalDecorators": true,
9
9
  "allowSyntheticDefaultImports": true,
10
- "target": "ES2021",
10
+ "target": "ES2022",
11
11
  "sourceMap": true,
12
12
  "outDir": "./dist",
13
- "baseUrl": ".",
13
+ "rootDir": "./src",
14
+ "baseUrl": "./src",
14
15
  "incremental": true,
15
16
  "strict": true,
16
17
  "skipLibCheck": true,
@@ -24,6 +25,6 @@
24
25
  },
25
26
  "noFallthroughCasesInSwitch": false
26
27
  },
27
- "include": ["test/**/*", "src/**/*", "./**/*", "eslint.config.js"],
28
+ "include": ["test/**/*", "src/**/*", "eslint.config.js"],
28
29
  "typeRoots": ["./src/common/@types/typings"]
29
30
  }
package/webpack-hmr.js ADDED
@@ -0,0 +1,26 @@
1
+ const nodeExternals = require('webpack-node-externals');
2
+ const {RunScriptWebpackPlugin} = require('run-script-webpack-plugin');
3
+
4
+ module.exports = function (options, {HotModuleReplacementPlugin, WatchIgnorePlugin}) {
5
+ return {
6
+ ...options,
7
+ entry: ['webpack/hot/poll?100', options.entry],
8
+ externals: [
9
+ nodeExternals({
10
+ allowlist: ['webpack/hot/poll?100'],
11
+ }),
12
+ ],
13
+ node: {
14
+ __dirname: true,
15
+ __filename: true,
16
+ },
17
+ plugins: [
18
+ ...options.plugins,
19
+ new HotModuleReplacementPlugin(),
20
+ new WatchIgnorePlugin({
21
+ paths: [/\.js$/, /\.d\.ts$/],
22
+ }),
23
+ new RunScriptWebpackPlugin({name: options.output.filename, autoRestart: false}),
24
+ ],
25
+ };
26
+ };
@@ -0,0 +1,27 @@
1
+ const path = require("path");
2
+
3
+ module.exports = {
4
+ mode: "production", // Puedes cambiar a 'development' para mejor depuración
5
+ entry: "./src/index.ts", // Punto de entrada de tu librería
6
+ output: {
7
+ path: path.resolve(__dirname, "dist"),
8
+ filename: "index.js", // Nombre del archivo de salida
9
+ libraryTarget: "commonjs2", // Formato del módulo de salida
10
+ },
11
+ resolve: {
12
+ extensions: [".ts", ".js"],
13
+ alias: {
14
+ "@common": path.resolve(__dirname, "src/common"), // Ajusta según tus necesidades de alias
15
+ },
16
+ },
17
+ module: {
18
+ rules: [
19
+ {
20
+ test: /\.ts$/,
21
+ use: "ts-loader",
22
+ exclude: /node_modules/,
23
+ },
24
+ ],
25
+ },
26
+ target: "node", // Asegura que Webpack compila para un entorno Node.js
27
+ };
package/entities/index.ts DELETED
@@ -1,7 +0,0 @@
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";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes