@asumano/worklip-typeorm-db 1.1.51 → 1.1.52
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/ServiceOrder.d.ts +2 -0
- package/dist/entities/ServiceOrder.js +5 -0
- package/dist/entities/ServiceOrderApproval.d.ts +20 -0
- package/dist/entities/ServiceOrderApproval.js +159 -0
- package/dist/entities/Workshop.d.ts +2 -0
- package/dist/entities/Workshop.js +5 -0
- package/dist/entities.index.d.ts +1 -0
- package/dist/entities.index.js +4 -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, Country, EmailLog, MediaFile, PaymentMethod, UsageAlert, WhatsappLog } from "..";
|
|
5
|
+
import { BillingInvoice, BillingUsageSnapshot, CompanyBrand, CompanySubscription, Country, EmailLog, MediaFile, PaymentMethod, ServiceOrderApproval, UsageAlert, WhatsappLog } from "..";
|
|
6
6
|
export declare class Company {
|
|
7
7
|
id: number;
|
|
8
8
|
country: Country;
|
|
@@ -18,6 +18,7 @@ export declare class Company {
|
|
|
18
18
|
payment_methods: PaymentMethod[];
|
|
19
19
|
billing_usage_snapshots: BillingUsageSnapshot[];
|
|
20
20
|
media_files: MediaFile[];
|
|
21
|
+
service_order_approvals: ServiceOrderApproval[];
|
|
21
22
|
whatsapp_logs: WhatsappLog[];
|
|
22
23
|
email_logs: EmailLog[];
|
|
23
24
|
billing_invoices: BillingInvoice[];
|
package/dist/entities/Company.js
CHANGED
|
@@ -97,6 +97,10 @@ __decorate([
|
|
|
97
97
|
(0, typeorm_1.OneToMany)(() => __1.MediaFile, (mediaFile) => mediaFile.company),
|
|
98
98
|
__metadata("design:type", Array)
|
|
99
99
|
], Company.prototype, "media_files", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.OneToMany)(() => __1.ServiceOrderApproval, (serviceOrderApproval) => serviceOrderApproval.company),
|
|
102
|
+
__metadata("design:type", Array)
|
|
103
|
+
], Company.prototype, "service_order_approvals", void 0);
|
|
100
104
|
__decorate([
|
|
101
105
|
(0, typeorm_1.OneToMany)(() => __1.WhatsappLog, (whatsappLog) => whatsappLog.company),
|
|
102
106
|
__metadata("design:type", Array)
|
|
@@ -5,6 +5,7 @@ import { Workshop } from "./Workshop";
|
|
|
5
5
|
import { ServiceOrderHistory } from "./ServiceOrderHistory";
|
|
6
6
|
import { MediaFile } from "./MediaFile";
|
|
7
7
|
import { Reminder } from "./Reminder";
|
|
8
|
+
import { ServiceOrderApproval } from "./ServiceOrderApproval";
|
|
8
9
|
export declare class ServiceOrder {
|
|
9
10
|
id: number;
|
|
10
11
|
code: string;
|
|
@@ -22,4 +23,5 @@ export declare class ServiceOrder {
|
|
|
22
23
|
service_order_history: ServiceOrderHistory[];
|
|
23
24
|
media_files: MediaFile[];
|
|
24
25
|
reminders: Reminder[];
|
|
26
|
+
service_order_approvals: ServiceOrderApproval[];
|
|
25
27
|
}
|
|
@@ -18,6 +18,7 @@ const Workshop_1 = require("./Workshop");
|
|
|
18
18
|
const ServiceOrderHistory_1 = require("./ServiceOrderHistory");
|
|
19
19
|
const MediaFile_1 = require("./MediaFile");
|
|
20
20
|
const Reminder_1 = require("./Reminder");
|
|
21
|
+
const ServiceOrderApproval_1 = require("./ServiceOrderApproval");
|
|
21
22
|
let ServiceOrder = class ServiceOrder {
|
|
22
23
|
};
|
|
23
24
|
exports.ServiceOrder = ServiceOrder;
|
|
@@ -144,6 +145,10 @@ __decorate([
|
|
|
144
145
|
(0, typeorm_1.OneToMany)(() => Reminder_1.Reminder, (reminder) => reminder.service_order),
|
|
145
146
|
__metadata("design:type", Array)
|
|
146
147
|
], ServiceOrder.prototype, "reminders", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.OneToMany)(() => ServiceOrderApproval_1.ServiceOrderApproval, (serviceOrderApproval) => serviceOrderApproval.service_order),
|
|
150
|
+
__metadata("design:type", Array)
|
|
151
|
+
], ServiceOrder.prototype, "service_order_approvals", void 0);
|
|
147
152
|
exports.ServiceOrder = ServiceOrder = __decorate([
|
|
148
153
|
(0, typeorm_1.Entity)({
|
|
149
154
|
comment: "Órdenes de servicio del concesionario/taller.",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Company } from "./Company";
|
|
2
|
+
import { ServiceOrder } from "./ServiceOrder";
|
|
3
|
+
import { Workshop } from "./Workshop";
|
|
4
|
+
export declare class ServiceOrderApproval {
|
|
5
|
+
id: number;
|
|
6
|
+
company: Company;
|
|
7
|
+
workshop: Workshop;
|
|
8
|
+
service_order: ServiceOrder;
|
|
9
|
+
item_id: string;
|
|
10
|
+
item_name: string;
|
|
11
|
+
approval: number;
|
|
12
|
+
labor_cost: number;
|
|
13
|
+
replacement_cost: number;
|
|
14
|
+
total: number;
|
|
15
|
+
tax_percentage: number;
|
|
16
|
+
responded_by: string | null;
|
|
17
|
+
ip: string | null;
|
|
18
|
+
user_agent: string | null;
|
|
19
|
+
created: Date;
|
|
20
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
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.ServiceOrderApproval = 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 ServiceOrderApproval = class ServiceOrderApproval {
|
|
18
|
+
};
|
|
19
|
+
exports.ServiceOrderApproval = ServiceOrderApproval;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
22
|
+
type: "int",
|
|
23
|
+
comment: "ID único de cada registro.",
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], ServiceOrderApproval.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.service_order_approvals, {
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
31
|
+
}),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
33
|
+
__metadata("design:type", Company_1.Company)
|
|
34
|
+
], ServiceOrderApproval.prototype, "company", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, (workshop) => workshop.service_order_approvals, {
|
|
37
|
+
onDelete: "CASCADE",
|
|
38
|
+
onUpdate: "NO ACTION",
|
|
39
|
+
}),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
41
|
+
__metadata("design:type", Workshop_1.Workshop)
|
|
42
|
+
], ServiceOrderApproval.prototype, "workshop", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => ServiceOrder_1.ServiceOrder, (serviceOrder) => serviceOrder.service_order_approvals, {
|
|
45
|
+
onDelete: "CASCADE",
|
|
46
|
+
onUpdate: "NO ACTION",
|
|
47
|
+
}),
|
|
48
|
+
(0, typeorm_1.JoinColumn)({ name: "service_order" }),
|
|
49
|
+
__metadata("design:type", ServiceOrder_1.ServiceOrder)
|
|
50
|
+
], ServiceOrderApproval.prototype, "service_order", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
length: 50,
|
|
54
|
+
type: "varchar",
|
|
55
|
+
comment: "ID del ítem dentro del JSON de la visita (ej: 14_50_39).",
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], ServiceOrderApproval.prototype, "item_id", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({
|
|
61
|
+
length: 100,
|
|
62
|
+
type: "varchar",
|
|
63
|
+
comment: "Nombre del ítem al momento de responder. Se guarda como foto: el nombre puede cambiar después.",
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], ServiceOrderApproval.prototype, "item_name", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({
|
|
69
|
+
type: "int",
|
|
70
|
+
width: 1,
|
|
71
|
+
comment: "Respuesta del cliente:\n1: Aprobada.\n0: Rechazada.",
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], ServiceOrderApproval.prototype, "approval", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({
|
|
77
|
+
type: "decimal",
|
|
78
|
+
precision: 12,
|
|
79
|
+
scale: 2,
|
|
80
|
+
default: 0,
|
|
81
|
+
comment: "Mano de obra al momento de responder.",
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], ServiceOrderApproval.prototype, "labor_cost", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({
|
|
87
|
+
type: "decimal",
|
|
88
|
+
precision: 12,
|
|
89
|
+
scale: 2,
|
|
90
|
+
default: 0,
|
|
91
|
+
comment: "Valor del repuesto al momento de responder.",
|
|
92
|
+
}),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], ServiceOrderApproval.prototype, "replacement_cost", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({
|
|
97
|
+
type: "decimal",
|
|
98
|
+
precision: 12,
|
|
99
|
+
scale: 2,
|
|
100
|
+
default: 0,
|
|
101
|
+
comment: "Valor total que el cliente aprobó o rechazó. Es el dato que da validez a la bitácora: si el taller cambia el costo después, acá queda lo que realmente se respondió.",
|
|
102
|
+
}),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], ServiceOrderApproval.prototype, "total", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({
|
|
107
|
+
type: "decimal",
|
|
108
|
+
precision: 5,
|
|
109
|
+
scale: 2,
|
|
110
|
+
default: 0,
|
|
111
|
+
comment: "Porcentaje de impuesto vigente al momento de responder.",
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], ServiceOrderApproval.prototype, "tax_percentage", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({
|
|
117
|
+
length: 150,
|
|
118
|
+
type: "varchar",
|
|
119
|
+
default: null,
|
|
120
|
+
nullable: true,
|
|
121
|
+
comment: "Nombre que digitó el cliente al responder, si lo digitó.",
|
|
122
|
+
}),
|
|
123
|
+
__metadata("design:type", Object)
|
|
124
|
+
], ServiceOrderApproval.prototype, "responded_by", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({
|
|
127
|
+
length: 45,
|
|
128
|
+
type: "varchar",
|
|
129
|
+
default: null,
|
|
130
|
+
nullable: true,
|
|
131
|
+
comment: "IP desde la que se respondió.",
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Object)
|
|
134
|
+
], ServiceOrderApproval.prototype, "ip", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({
|
|
137
|
+
length: 255,
|
|
138
|
+
type: "varchar",
|
|
139
|
+
default: null,
|
|
140
|
+
nullable: true,
|
|
141
|
+
comment: "Navegador/dispositivo desde el que se respondió.",
|
|
142
|
+
}),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], ServiceOrderApproval.prototype, "user_agent", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.Column)({
|
|
147
|
+
type: "datetime",
|
|
148
|
+
comment: "Fecha de creación del registro.",
|
|
149
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
150
|
+
}),
|
|
151
|
+
__metadata("design:type", Date)
|
|
152
|
+
], ServiceOrderApproval.prototype, "created", void 0);
|
|
153
|
+
exports.ServiceOrderApproval = ServiceOrderApproval = __decorate([
|
|
154
|
+
(0, typeorm_1.Entity)({
|
|
155
|
+
comment: "Bitácora de las respuestas del cliente a las operaciones cotizadas de una visita. Es solo de inserción: si el cliente cambia de opinión se agrega otra fila, nunca se actualiza la anterior.",
|
|
156
|
+
name: "service_order_approval",
|
|
157
|
+
}),
|
|
158
|
+
(0, typeorm_1.Index)("IDX_service_order_approval_order", ["service_order", "created"])
|
|
159
|
+
], ServiceOrderApproval);
|
|
@@ -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 { ServiceOrderApproval } from "./ServiceOrderApproval";
|
|
11
12
|
export declare class Workshop {
|
|
12
13
|
id: number;
|
|
13
14
|
code: string;
|
|
@@ -28,6 +29,7 @@ export declare class Workshop {
|
|
|
28
29
|
service_orders: ServiceOrder[];
|
|
29
30
|
reminders: Reminder[];
|
|
30
31
|
media_files: MediaFile[];
|
|
32
|
+
service_order_approvals: ServiceOrderApproval[];
|
|
31
33
|
whatsapp_logs: WhatsappLog[];
|
|
32
34
|
email_logs: EmailLog[];
|
|
33
35
|
}
|
|
@@ -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 ServiceOrderApproval_1 = require("./ServiceOrderApproval");
|
|
24
25
|
let Workshop = class Workshop {
|
|
25
26
|
};
|
|
26
27
|
exports.Workshop = Workshop;
|
|
@@ -163,6 +164,10 @@ __decorate([
|
|
|
163
164
|
(0, typeorm_1.OneToMany)(() => MediaFile_1.MediaFile, (mediaFile) => mediaFile.workshop),
|
|
164
165
|
__metadata("design:type", Array)
|
|
165
166
|
], Workshop.prototype, "media_files", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, typeorm_1.OneToMany)(() => ServiceOrderApproval_1.ServiceOrderApproval, (serviceOrderApproval) => serviceOrderApproval.workshop),
|
|
169
|
+
__metadata("design:type", Array)
|
|
170
|
+
], Workshop.prototype, "service_order_approvals", void 0);
|
|
166
171
|
__decorate([
|
|
167
172
|
(0, typeorm_1.OneToMany)(() => WhatsappLog_1.WhatsappLog, (whatsappLog) => whatsappLog.workshop),
|
|
168
173
|
__metadata("design:type", Array)
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { SubscriptionAddon } from "./entities/SubscriptionAddon";
|
|
|
33
33
|
export { PaymentMethod } from "./entities/PaymentMethod";
|
|
34
34
|
export { BillingUsageSnapshot } from "./entities/BillingUsageSnapshot";
|
|
35
35
|
export { MediaFile } from "./entities/MediaFile";
|
|
36
|
+
export { ServiceOrderApproval } from "./entities/ServiceOrderApproval";
|
|
36
37
|
export { WhatsappLog } from "./entities/WhatsappLog";
|
|
37
38
|
export { EmailLog } from "./entities/EmailLog";
|
|
38
39
|
export { BillingInvoice } from "./entities/BillingInvoice";
|
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.WorkshopsByAssociate = void 0;
|
|
3
|
+
exports.TemplateSectionItems = exports.TemplateSections = exports.Templates = exports.Reminders = exports.Vehicles = exports.Clients = exports.ServicesOrder = exports.Associates = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = exports.BillingInvoice = exports.EmailLog = exports.WhatsappLog = exports.ServiceOrderApproval = exports.MediaFile = exports.BillingUsageSnapshot = exports.PaymentMethod = exports.SubscriptionAddon = exports.CompanySubscription = exports.SubscriptionPlan = exports.CountryHoliday = exports.CompanyBrand = exports.VehicleType = 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.WorkshopsByAssociate = exports.Workshops = 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");
|
|
@@ -72,6 +72,8 @@ var BillingUsageSnapshot_1 = require("./entities/BillingUsageSnapshot");
|
|
|
72
72
|
Object.defineProperty(exports, "BillingUsageSnapshot", { enumerable: true, get: function () { return BillingUsageSnapshot_1.BillingUsageSnapshot; } });
|
|
73
73
|
var MediaFile_1 = require("./entities/MediaFile");
|
|
74
74
|
Object.defineProperty(exports, "MediaFile", { enumerable: true, get: function () { return MediaFile_1.MediaFile; } });
|
|
75
|
+
var ServiceOrderApproval_1 = require("./entities/ServiceOrderApproval");
|
|
76
|
+
Object.defineProperty(exports, "ServiceOrderApproval", { enumerable: true, get: function () { return ServiceOrderApproval_1.ServiceOrderApproval; } });
|
|
75
77
|
var WhatsappLog_1 = require("./entities/WhatsappLog");
|
|
76
78
|
Object.defineProperty(exports, "WhatsappLog", { enumerable: true, get: function () { return WhatsappLog_1.WhatsappLog; } });
|
|
77
79
|
var EmailLog_1 = require("./entities/EmailLog");
|