@asumano/worklip-typeorm-db 1.1.70 → 1.1.72
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.
- package/dist/entities/Company.d.ts +2 -1
- package/dist/entities/Company.js +4 -0
- package/dist/entities/EmailLog.js +6 -1
- package/dist/entities/EmailSuppression.d.ts +11 -0
- package/dist/entities/EmailSuppression.js +104 -0
- package/dist/entities/ServiceOrder.d.ts +2 -0
- package/dist/entities/ServiceOrder.js +5 -0
- package/dist/entities/SubscriptionPlan.d.ts +13 -0
- package/dist/entities/SubscriptionPlan.js +8 -0
- package/dist/entities/VoiceNoteLog.d.ts +38 -0
- package/dist/entities/VoiceNoteLog.js +143 -0
- package/dist/entities/Workshop.d.ts +2 -0
- package/dist/entities/Workshop.js +5 -0
- package/dist/entities.index.d.ts +2 -0
- package/dist/entities.index.js +6 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Vehicle } from "./Vehicle";
|
|
|
2
2
|
import { Client } from "./Client";
|
|
3
3
|
import { Associate } from "./Associate";
|
|
4
4
|
import { Workshop } from "./Workshop";
|
|
5
|
-
import { BillingInvoice, BillingUsageSnapshot, CompanyBrand, CompanySubscription, CompanyVehicleType, Country, EmailLog, MediaFile, PaymentMethod, ServiceOrderApproval, UsageAlert, WhatsappLog } from "..";
|
|
5
|
+
import { BillingInvoice, BillingUsageSnapshot, CompanyBrand, CompanySubscription, CompanyVehicleType, Country, EmailLog, MediaFile, PaymentMethod, ServiceOrderApproval, UsageAlert, VoiceNoteLog, WhatsappLog } from "..";
|
|
6
6
|
export declare class Company {
|
|
7
7
|
id: number;
|
|
8
8
|
country: Country;
|
|
@@ -25,6 +25,7 @@ export declare class Company {
|
|
|
25
25
|
service_order_approvals: ServiceOrderApproval[];
|
|
26
26
|
whatsapp_logs: WhatsappLog[];
|
|
27
27
|
email_logs: EmailLog[];
|
|
28
|
+
voice_note_logs: VoiceNoteLog[];
|
|
28
29
|
billing_invoices: BillingInvoice[];
|
|
29
30
|
usage_alerts: UsageAlert[];
|
|
30
31
|
company_subscriptions: CompanySubscription[];
|
package/dist/entities/Company.js
CHANGED
|
@@ -140,6 +140,10 @@ __decorate([
|
|
|
140
140
|
(0, typeorm_1.OneToMany)(() => __1.EmailLog, (emailLog) => emailLog.company),
|
|
141
141
|
__metadata("design:type", Array)
|
|
142
142
|
], Company.prototype, "email_logs", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.OneToMany)(() => __1.VoiceNoteLog, (voiceNoteLog) => voiceNoteLog.company),
|
|
145
|
+
__metadata("design:type", Array)
|
|
146
|
+
], Company.prototype, "voice_note_logs", void 0);
|
|
143
147
|
__decorate([
|
|
144
148
|
(0, typeorm_1.OneToMany)(() => __1.BillingInvoice, (billingInvoice) => billingInvoice.company),
|
|
145
149
|
__metadata("design:type", Array)
|
|
@@ -86,7 +86,7 @@ __decorate([
|
|
|
86
86
|
default: 1,
|
|
87
87
|
type: "int",
|
|
88
88
|
width: 1,
|
|
89
|
-
comment: "Estado en el que se queda el log:\r\n1: Enviado.\r\n2: Entregado.\r\n3: Abierto.\r\n4: Error.",
|
|
89
|
+
comment: "Estado en el que se queda el log:\r\n1: Enviado.\r\n2: Entregado.\r\n3: Abierto.\r\n4: Error.\r\n5: Rebotado.\r\n6: Queja.",
|
|
90
90
|
}),
|
|
91
91
|
__metadata("design:type", Number)
|
|
92
92
|
], EmailLog.prototype, "status", void 0);
|
|
@@ -113,4 +113,9 @@ exports.EmailLog = EmailLog = __decorate([
|
|
|
113
113
|
name: "email_log",
|
|
114
114
|
}),
|
|
115
115
|
(0, typeorm_1.Index)("IDX_email_log_company_created", ["company", "created"])
|
|
116
|
+
// DOC: Cada evento de SES llega identificado solo por el MessageId, así que casarlo con su
|
|
117
|
+
// fila es una búsqueda por esta columna. Sin índice sería un recorrido completo de la tabla,
|
|
118
|
+
// que crece ~60.000 filas al mes.
|
|
119
|
+
,
|
|
120
|
+
(0, typeorm_1.Index)("IDX_email_log_provider_message_id", ["provider_message_id"])
|
|
116
121
|
], EmailLog);
|
|
@@ -0,0 +1,104 @@
|
|
|
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.EmailSuppression = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
// DOC: Direcciones a las que NO se les puede volver a escribir, alimentada por los eventos
|
|
15
|
+
// de rebote y queja que SES publica en SNS. Espejo local de la lista de supresión de la
|
|
16
|
+
// cuenta de SES: la de AWS es la autoritativa, esta permite el chequeo antes de enviar y
|
|
17
|
+
// poder decirle al taller "este correo está mal, corríjalo".
|
|
18
|
+
//
|
|
19
|
+
// A propósito NO tiene `company` ni `client`: el evento de SES solo trae la DIRECCIÓN, y la
|
|
20
|
+
// misma puede estar en varios clientes de varias empresas (o no ser de ningún cliente, como
|
|
21
|
+
// las que el asesor escribe a mano al compartir el informe). Es global por diseño.
|
|
22
|
+
let EmailSuppression = class EmailSuppression {
|
|
23
|
+
};
|
|
24
|
+
exports.EmailSuppression = EmailSuppression;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
27
|
+
type: "int",
|
|
28
|
+
comment: "ID único de cada registro.",
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], EmailSuppression.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Index)("UQ_email_suppression_email", { unique: true }),
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
length: 255,
|
|
36
|
+
type: "varchar",
|
|
37
|
+
comment: "Dirección suprimida, en minúsculas.",
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], EmailSuppression.prototype, "email", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
type: "int",
|
|
44
|
+
comment: "Motivo por el que se suprimió:\r\n1: Rebote permanente.\r\n2: Queja (marcada como spam).",
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], EmailSuppression.prototype, "event_type", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
type: "text",
|
|
51
|
+
nullable: true,
|
|
52
|
+
default: null,
|
|
53
|
+
comment: "Diagnóstico que devolvió SES (subtipo, código SMTP y texto del servidor).",
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], EmailSuppression.prototype, "reason", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({
|
|
59
|
+
length: 255,
|
|
60
|
+
type: "varchar",
|
|
61
|
+
nullable: true,
|
|
62
|
+
default: null,
|
|
63
|
+
comment: "MessageId de SES del correo que provocó la supresión.",
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], EmailSuppression.prototype, "provider_message_id", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({
|
|
69
|
+
type: "datetime",
|
|
70
|
+
comment: "Primera vez que se recibió un evento para esta dirección.",
|
|
71
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Date)
|
|
74
|
+
], EmailSuppression.prototype, "first_seen", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({
|
|
77
|
+
type: "datetime",
|
|
78
|
+
comment: "Última vez que se recibió un evento para esta dirección.",
|
|
79
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Date)
|
|
82
|
+
], EmailSuppression.prototype, "last_seen", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
type: "int",
|
|
86
|
+
default: 1,
|
|
87
|
+
comment: "Cuántos eventos se han recibido para esta dirección.",
|
|
88
|
+
}),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], EmailSuppression.prototype, "event_count", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({
|
|
93
|
+
type: "datetime",
|
|
94
|
+
comment: "Fecha de creación del registro.",
|
|
95
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Date)
|
|
98
|
+
], EmailSuppression.prototype, "created", void 0);
|
|
99
|
+
exports.EmailSuppression = EmailSuppression = __decorate([
|
|
100
|
+
(0, typeorm_1.Entity)({
|
|
101
|
+
comment: "Direcciones de correo suprimidas por rebote permanente o queja, según los eventos de Amazon SES.",
|
|
102
|
+
name: "email_suppression",
|
|
103
|
+
})
|
|
104
|
+
], EmailSuppression);
|
|
@@ -8,6 +8,7 @@ import { Reminder } from "./Reminder";
|
|
|
8
8
|
import { ServiceOrderApproval } from "./ServiceOrderApproval";
|
|
9
9
|
import { WhatsappLog } from "./WhatsappLog";
|
|
10
10
|
import { EmailLog } from "./EmailLog";
|
|
11
|
+
import { VoiceNoteLog } from "./VoiceNoteLog";
|
|
11
12
|
export declare class ServiceOrder {
|
|
12
13
|
id: number;
|
|
13
14
|
code: string;
|
|
@@ -31,4 +32,5 @@ export declare class ServiceOrder {
|
|
|
31
32
|
service_order_approvals: ServiceOrderApproval[];
|
|
32
33
|
whatsapp_logs: WhatsappLog[];
|
|
33
34
|
email_logs: EmailLog[];
|
|
35
|
+
voice_note_logs: VoiceNoteLog[];
|
|
34
36
|
}
|
|
@@ -21,6 +21,7 @@ const Reminder_1 = require("./Reminder");
|
|
|
21
21
|
const ServiceOrderApproval_1 = require("./ServiceOrderApproval");
|
|
22
22
|
const WhatsappLog_1 = require("./WhatsappLog");
|
|
23
23
|
const EmailLog_1 = require("./EmailLog");
|
|
24
|
+
const VoiceNoteLog_1 = require("./VoiceNoteLog");
|
|
24
25
|
// DOC: El consecutivo es único por taller y año. Es la garantía de que dos visitas
|
|
25
26
|
// del mismo taller nunca compartan número, incluso si se crean a la vez.
|
|
26
27
|
let ServiceOrder = class ServiceOrder {
|
|
@@ -189,6 +190,10 @@ __decorate([
|
|
|
189
190
|
(0, typeorm_1.OneToMany)(() => EmailLog_1.EmailLog, (emailLog) => emailLog.service_order),
|
|
190
191
|
__metadata("design:type", Array)
|
|
191
192
|
], ServiceOrder.prototype, "email_logs", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, typeorm_1.OneToMany)(() => VoiceNoteLog_1.VoiceNoteLog, (voiceNoteLog) => voiceNoteLog.service_order),
|
|
195
|
+
__metadata("design:type", Array)
|
|
196
|
+
], ServiceOrder.prototype, "voice_note_logs", void 0);
|
|
192
197
|
exports.ServiceOrder = ServiceOrder = __decorate([
|
|
193
198
|
(0, typeorm_1.Index)("UQ_service_order_visit_sequence", ["workshop", "visit_year", "visit_sequence"], { unique: true })
|
|
194
199
|
// DOC: Para buscar/ordenar por el número dentro de un taller sin escanear la tabla.
|
|
@@ -9,6 +9,19 @@ export declare class SubscriptionPlan {
|
|
|
9
9
|
included_storage_gb: number;
|
|
10
10
|
included_whatsapp_messages: number;
|
|
11
11
|
included_emails: number;
|
|
12
|
+
/**
|
|
13
|
+
* DOC: Minutos de audio al mes que el plan incluye para transcribir notas de voz.
|
|
14
|
+
*
|
|
15
|
+
* Se crea junto con `voice_note_log` para no gastar una versión entera de la librería
|
|
16
|
+
* después por una sola columna, pero de momento NO se valida ni se ofrece en el panel de
|
|
17
|
+
* planes: hasta que exista `RESOURCE.VOICE_NOTE` en `limitFor()`, un campo en pantalla
|
|
18
|
+
* donde escribir 500 minutos que nadie respeta es peor que no tenerlo.
|
|
19
|
+
*
|
|
20
|
+
* El día que se active: se expone en el formulario y se agrega su caso en los límites, sin
|
|
21
|
+
* volver a tocar la base. Para dimensionarlo, una nota de ~10 segundos se cobra como 1/6 de
|
|
22
|
+
* minuto, así que 1 minuto son ~6 notas.
|
|
23
|
+
*/
|
|
24
|
+
included_voice_note_minutes: number;
|
|
12
25
|
max_workshops: number;
|
|
13
26
|
max_users: number;
|
|
14
27
|
retention_days: number | null;
|
|
@@ -78,6 +78,14 @@ __decorate([
|
|
|
78
78
|
}),
|
|
79
79
|
__metadata("design:type", Number)
|
|
80
80
|
], SubscriptionPlan.prototype, "included_emails", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({
|
|
83
|
+
default: 0,
|
|
84
|
+
type: "int",
|
|
85
|
+
comment: "Minutos de audio incluidos en el plan para transcribir notas de voz a texto.",
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], SubscriptionPlan.prototype, "included_voice_note_minutes", void 0);
|
|
81
89
|
__decorate([
|
|
82
90
|
(0, typeorm_1.Column)({
|
|
83
91
|
default: 1,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Company } from "./Company";
|
|
2
|
+
import { ServiceOrder } from "./ServiceOrder";
|
|
3
|
+
import { Workshop } from "./Workshop";
|
|
4
|
+
export declare class VoiceNoteLog {
|
|
5
|
+
id: number;
|
|
6
|
+
company: Company;
|
|
7
|
+
workshop: Workshop | null;
|
|
8
|
+
service_order: ServiceOrder | null;
|
|
9
|
+
/**
|
|
10
|
+
* DOC: Ítem de la visita en el que se dictó. Es un TEXTO y no una llave foránea porque los
|
|
11
|
+
* ítems de una visita NO son filas: viven dentro del JSON de `service_order.data`
|
|
12
|
+
* (`sections[].items[]`), y este es el `id` que cada ítem tiene ahí dentro.
|
|
13
|
+
*
|
|
14
|
+
* Es la razón por la que existe `item_name` justo debajo: sin integridad referencial, nadie
|
|
15
|
+
* garantiza que ese ítem siga existiendo mañana.
|
|
16
|
+
*/
|
|
17
|
+
visit_item_id: string | null;
|
|
18
|
+
item_name: string | null;
|
|
19
|
+
duration_seconds: number;
|
|
20
|
+
/**
|
|
21
|
+
* DOC: Duración que COBRA el proveedor, que no es la misma. Groq factura un mínimo de 10
|
|
22
|
+
* segundos por petición, así que una nota de 4 segundos se cobra como 10.
|
|
23
|
+
*
|
|
24
|
+
* Existen las dos columnas porque son dos preguntas distintas: al taller se le muestra lo
|
|
25
|
+
* que dictó (`duration_seconds`) y contra su cuota se cuenta lo que costó
|
|
26
|
+
* (`billed_seconds`). Es la misma lección de los rebotes de correo: lo que cobra el
|
|
27
|
+
* proveedor no es lo que se entregó.
|
|
28
|
+
*
|
|
29
|
+
* Se guarda desde el primer día aunque todavía no haya cuota que validar: agregarlo
|
|
30
|
+
* después dejaría los meses anteriores sin el único dato que sirve para poner precio.
|
|
31
|
+
*/
|
|
32
|
+
billed_seconds: number;
|
|
33
|
+
transcription: string | null;
|
|
34
|
+
provider_model: string | null;
|
|
35
|
+
status: number;
|
|
36
|
+
error_message: string | null;
|
|
37
|
+
created: Date;
|
|
38
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
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.VoiceNoteLog = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Company_1 = require("./Company");
|
|
15
|
+
const ServiceOrder_1 = require("./ServiceOrder");
|
|
16
|
+
const Workshop_1 = require("./Workshop");
|
|
17
|
+
let VoiceNoteLog = class VoiceNoteLog {
|
|
18
|
+
};
|
|
19
|
+
exports.VoiceNoteLog = VoiceNoteLog;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
22
|
+
type: "int",
|
|
23
|
+
comment: "ID único de cada registro.",
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], VoiceNoteLog.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.voice_note_logs, {
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
31
|
+
}),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
33
|
+
__metadata("design:type", Company_1.Company)
|
|
34
|
+
], VoiceNoteLog.prototype, "company", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, (workshop) => workshop.voice_note_logs, {
|
|
37
|
+
onDelete: "SET NULL",
|
|
38
|
+
onUpdate: "NO ACTION",
|
|
39
|
+
nullable: true,
|
|
40
|
+
}),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], VoiceNoteLog.prototype, "workshop", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => ServiceOrder_1.ServiceOrder, (serviceOrder) => serviceOrder.voice_note_logs, {
|
|
46
|
+
onDelete: "SET NULL",
|
|
47
|
+
onUpdate: "NO ACTION",
|
|
48
|
+
nullable: true,
|
|
49
|
+
}),
|
|
50
|
+
(0, typeorm_1.JoinColumn)({ name: "service_order" }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], VoiceNoteLog.prototype, "service_order", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
length: 64,
|
|
56
|
+
type: "varchar",
|
|
57
|
+
default: null,
|
|
58
|
+
nullable: true,
|
|
59
|
+
comment: "ID del ítem DENTRO del JSON de la visita (no es una llave foránea: los ítems no son filas).",
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], VoiceNoteLog.prototype, "visit_item_id", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
length: 100,
|
|
66
|
+
type: "varchar",
|
|
67
|
+
default: null,
|
|
68
|
+
nullable: true,
|
|
69
|
+
comment: "Nombre que tenía el ítem cuando se dictó la nota.",
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], VoiceNoteLog.prototype, "item_name", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({
|
|
75
|
+
type: "int",
|
|
76
|
+
default: 0,
|
|
77
|
+
comment: "Duración real del audio, en segundos.",
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], VoiceNoteLog.prototype, "duration_seconds", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({
|
|
83
|
+
type: "int",
|
|
84
|
+
default: 0,
|
|
85
|
+
comment: "Segundos que cobra el proveedor (mínimo facturable, puede ser mayor que la duración real).",
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], VoiceNoteLog.prototype, "billed_seconds", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({
|
|
91
|
+
type: "text",
|
|
92
|
+
default: null,
|
|
93
|
+
nullable: true,
|
|
94
|
+
comment: "Texto transcrito del audio.",
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], VoiceNoteLog.prototype, "transcription", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
length: 100,
|
|
101
|
+
type: "varchar",
|
|
102
|
+
default: null,
|
|
103
|
+
nullable: true,
|
|
104
|
+
comment: "Modelo del proveedor que hizo la transcripción.",
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], VoiceNoteLog.prototype, "provider_model", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({
|
|
110
|
+
default: 1,
|
|
111
|
+
type: "int",
|
|
112
|
+
width: 1,
|
|
113
|
+
comment: "Estado del registro:\r\n1: Transcrita.\r\n2: Error (el audio se procesó y se cobró, pero no se obtuvo texto).",
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], VoiceNoteLog.prototype, "status", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)({
|
|
119
|
+
type: "text",
|
|
120
|
+
nullable: true,
|
|
121
|
+
default: null,
|
|
122
|
+
comment: "Error retornado por el proveedor.",
|
|
123
|
+
}),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], VoiceNoteLog.prototype, "error_message", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.Column)({
|
|
128
|
+
type: "datetime",
|
|
129
|
+
comment: "Fecha de creación del registro.",
|
|
130
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
131
|
+
}),
|
|
132
|
+
__metadata("design:type", Date)
|
|
133
|
+
], VoiceNoteLog.prototype, "created", void 0);
|
|
134
|
+
exports.VoiceNoteLog = VoiceNoteLog = __decorate([
|
|
135
|
+
(0, typeorm_1.Entity)({
|
|
136
|
+
comment: "Logs de las notas de voz que se transcriben a texto por cada concesionario/taller.",
|
|
137
|
+
name: "voice_note_log",
|
|
138
|
+
})
|
|
139
|
+
// DOC: Mismo índice que sus hermanas `whatsapp_log` y `email_log`, y por lo mismo: el
|
|
140
|
+
// consumo del ciclo se calcula SUMANDO esta tabla por empresa y rango de fechas.
|
|
141
|
+
,
|
|
142
|
+
(0, typeorm_1.Index)("IDX_voice_note_log_company_created", ["company", "created"])
|
|
143
|
+
], VoiceNoteLog);
|
|
@@ -8,6 +8,7 @@ import { Region } from "./Region";
|
|
|
8
8
|
import { MediaFile } from "./MediaFile";
|
|
9
9
|
import { WhatsappLog } from "./WhatsappLog";
|
|
10
10
|
import { EmailLog } from "./EmailLog";
|
|
11
|
+
import { VoiceNoteLog } from "./VoiceNoteLog";
|
|
11
12
|
import { ServiceOrderApproval } from "./ServiceOrderApproval";
|
|
12
13
|
export declare class Workshop {
|
|
13
14
|
id: number;
|
|
@@ -32,4 +33,5 @@ export declare class Workshop {
|
|
|
32
33
|
service_order_approvals: ServiceOrderApproval[];
|
|
33
34
|
whatsapp_logs: WhatsappLog[];
|
|
34
35
|
email_logs: EmailLog[];
|
|
36
|
+
voice_note_logs: VoiceNoteLog[];
|
|
35
37
|
}
|
|
@@ -21,6 +21,7 @@ const Region_1 = require("./Region");
|
|
|
21
21
|
const MediaFile_1 = require("./MediaFile");
|
|
22
22
|
const WhatsappLog_1 = require("./WhatsappLog");
|
|
23
23
|
const EmailLog_1 = require("./EmailLog");
|
|
24
|
+
const VoiceNoteLog_1 = require("./VoiceNoteLog");
|
|
24
25
|
const ServiceOrderApproval_1 = require("./ServiceOrderApproval");
|
|
25
26
|
let Workshop = class Workshop {
|
|
26
27
|
};
|
|
@@ -176,6 +177,10 @@ __decorate([
|
|
|
176
177
|
(0, typeorm_1.OneToMany)(() => EmailLog_1.EmailLog, (emailLog) => emailLog.workshop),
|
|
177
178
|
__metadata("design:type", Array)
|
|
178
179
|
], Workshop.prototype, "email_logs", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, typeorm_1.OneToMany)(() => VoiceNoteLog_1.VoiceNoteLog, (voiceNoteLog) => voiceNoteLog.workshop),
|
|
182
|
+
__metadata("design:type", Array)
|
|
183
|
+
], Workshop.prototype, "voice_note_logs", void 0);
|
|
179
184
|
exports.Workshop = Workshop = __decorate([
|
|
180
185
|
(0, typeorm_1.Entity)({
|
|
181
186
|
comment: "concesionarios/talleres de la plataforma.",
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export { MediaFile } from "./entities/MediaFile";
|
|
|
43
43
|
export { ServiceOrderApproval } from "./entities/ServiceOrderApproval";
|
|
44
44
|
export { WhatsappLog } from "./entities/WhatsappLog";
|
|
45
45
|
export { EmailLog } from "./entities/EmailLog";
|
|
46
|
+
export { VoiceNoteLog } from "./entities/VoiceNoteLog";
|
|
47
|
+
export { EmailSuppression } from "./entities/EmailSuppression";
|
|
46
48
|
export { BillingInvoice } from "./entities/BillingInvoice";
|
|
47
49
|
export { PaymentTransaction } from "./entities/PaymentTransaction";
|
|
48
50
|
export { SubscriptionAddonTemplate } from "./entities/SubscriptionAddonTemplate";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.GlobalTemplateSectionItems = exports.GlobalTemplateSections = exports.GlobalTemplates = exports.SubscriptionAddonTemplates = exports.SubscriptionPlans = exports.Masters = exports.Companies = exports.WorkshopsByAssociate = exports.Workshops = exports.TemplateSectionItems = exports.TemplateSections = exports.Templates = exports.Reminders = exports.Vehicles = exports.Clients = exports.ServicesOrder = void 0;
|
|
3
|
+
exports.SubscriptionAddonTemplate = exports.PaymentTransaction = exports.BillingInvoice = exports.EmailSuppression = exports.VoiceNoteLog = exports.EmailLog = exports.WhatsappLog = exports.ServiceOrderApproval = exports.MediaFile = exports.BillingUsageSnapshot = exports.PaymentMethod = exports.SubscriptionAddon = exports.CompanySubscription = exports.SubscriptionPlan = exports.CountryHoliday = exports.CompanyVehicleType = exports.BrandVehicleType = exports.CompanyBrand = exports.VehicleType = exports.MasterSection = exports.MasterPermission = exports.MasterRole = exports.MasterPlatform = exports.MasterPasswordReset = exports.AssociatePasswordReset = exports.AssociateSection = exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSectionItem = exports.TemplateSection = exports.Template = exports.Workshop = exports.GlobalTemplateSectionItem = exports.GlobalTemplateSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.Country = void 0;
|
|
4
|
+
exports.GlobalTemplateSectionItems = exports.GlobalTemplateSections = exports.GlobalTemplates = exports.SubscriptionAddonTemplates = exports.SubscriptionPlans = exports.Masters = exports.Companies = exports.WorkshopsByAssociate = exports.Workshops = exports.TemplateSectionItems = exports.TemplateSections = exports.Templates = exports.Reminders = exports.Vehicles = exports.Clients = exports.ServicesOrder = exports.Associates = exports.UsageAlert = void 0;
|
|
5
5
|
var Country_1 = require("./entities/Country");
|
|
6
6
|
Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
|
|
7
7
|
var Region_1 = require("./entities/Region");
|
|
@@ -92,6 +92,10 @@ var WhatsappLog_1 = require("./entities/WhatsappLog");
|
|
|
92
92
|
Object.defineProperty(exports, "WhatsappLog", { enumerable: true, get: function () { return WhatsappLog_1.WhatsappLog; } });
|
|
93
93
|
var EmailLog_1 = require("./entities/EmailLog");
|
|
94
94
|
Object.defineProperty(exports, "EmailLog", { enumerable: true, get: function () { return EmailLog_1.EmailLog; } });
|
|
95
|
+
var VoiceNoteLog_1 = require("./entities/VoiceNoteLog");
|
|
96
|
+
Object.defineProperty(exports, "VoiceNoteLog", { enumerable: true, get: function () { return VoiceNoteLog_1.VoiceNoteLog; } });
|
|
97
|
+
var EmailSuppression_1 = require("./entities/EmailSuppression");
|
|
98
|
+
Object.defineProperty(exports, "EmailSuppression", { enumerable: true, get: function () { return EmailSuppression_1.EmailSuppression; } });
|
|
95
99
|
var BillingInvoice_1 = require("./entities/BillingInvoice");
|
|
96
100
|
Object.defineProperty(exports, "BillingInvoice", { enumerable: true, get: function () { return BillingInvoice_1.BillingInvoice; } });
|
|
97
101
|
var PaymentTransaction_1 = require("./entities/PaymentTransaction");
|