@asumano/worklip-typeorm-db 1.1.14 → 1.1.16

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.
@@ -4,7 +4,7 @@ import { AssociateSession } from "./AssociateSession";
4
4
  import { Workshop } from "./Workshop";
5
5
  import { ServiceOrderHistory } from "./ServiceOrderHistory";
6
6
  import { Reminder } from "./Reminder";
7
- import { AssociatePermission } from "../entities.views.routes";
7
+ import { AssociatePasswordReset, AssociatePermission } from "../entities.views.routes";
8
8
  export declare class Associate {
9
9
  id: number;
10
10
  code: string;
@@ -28,4 +28,5 @@ export declare class Associate {
28
28
  service_order_history: ServiceOrderHistory[];
29
29
  reminders: Reminder[];
30
30
  permissions: AssociatePermission[];
31
+ passwordResets: AssociatePasswordReset[];
31
32
  }
@@ -207,6 +207,10 @@ __decorate([
207
207
  }),
208
208
  __metadata("design:type", Array)
209
209
  ], Associate.prototype, "permissions", void 0);
210
+ __decorate([
211
+ (0, typeorm_1.OneToMany)(() => entities_views_routes_1.AssociatePasswordReset, (passwordReset) => passwordReset.associate),
212
+ __metadata("design:type", Array)
213
+ ], Associate.prototype, "passwordResets", void 0);
210
214
  exports.Associate = Associate = __decorate([
211
215
  (0, typeorm_1.Entity)({
212
216
  comment: "Usuarios de los concesionarios/talleres de la plataforma.",
@@ -0,0 +1,10 @@
1
+ import { Associate } from "..";
2
+ export declare class AssociatePasswordReset {
3
+ id: number;
4
+ associate: Associate;
5
+ token: string;
6
+ expires_at: Date;
7
+ used: number;
8
+ created: Date;
9
+ updated: Date | null;
10
+ }
@@ -0,0 +1,77 @@
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.AssociatePasswordReset = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const __1 = require("..");
15
+ let AssociatePasswordReset = class AssociatePasswordReset {
16
+ };
17
+ exports.AssociatePasswordReset = AssociatePasswordReset;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ type: "int",
21
+ comment: "Número de identificación (ID) único de cada registro.",
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], AssociatePasswordReset.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => __1.Associate, (associate) => associate.passwordResets, {
27
+ onDelete: "CASCADE",
28
+ onUpdate: "NO ACTION",
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: "associate" }),
31
+ __metadata("design:type", __1.Associate)
32
+ ], AssociatePasswordReset.prototype, "associate", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({
35
+ length: 255,
36
+ type: "varchar",
37
+ comment: "Token generado para cambiar la contraseña.",
38
+ }),
39
+ __metadata("design:type", String)
40
+ ], AssociatePasswordReset.prototype, "token", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({
43
+ type: "datetime",
44
+ comment: "Cuando expira el token.",
45
+ }),
46
+ __metadata("design:type", Date)
47
+ ], AssociatePasswordReset.prototype, "expires_at", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({
50
+ default: 0,
51
+ type: "int",
52
+ width: 1,
53
+ comment: "Si ya se usó el token de cambio de contraseña.\n1: Ya se usó.\n0: No se ha usado.",
54
+ }),
55
+ __metadata("design:type", Number)
56
+ ], AssociatePasswordReset.prototype, "used", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({
59
+ type: "datetime",
60
+ comment: "Fecha de creación del registro.",
61
+ default: () => "CURRENT_TIMESTAMP",
62
+ }),
63
+ __metadata("design:type", Date)
64
+ ], AssociatePasswordReset.prototype, "created", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({
67
+ type: "datetime",
68
+ nullable: true,
69
+ default: null,
70
+ comment: "Fecha de actualización del registro.",
71
+ onUpdate: "CURRENT_TIMESTAMP",
72
+ }),
73
+ __metadata("design:type", Object)
74
+ ], AssociatePasswordReset.prototype, "updated", void 0);
75
+ exports.AssociatePasswordReset = AssociatePasswordReset = __decorate([
76
+ (0, typeorm_1.Entity)("associate_password_reset")
77
+ ], AssociatePasswordReset);
@@ -1,7 +1,9 @@
1
1
  import { GlobalTemplateSection } from "./GlobalTemplateSection";
2
+ import { VehicleType } from "./VehicleType";
2
3
  export declare class GlobalTemplate {
3
4
  id: number;
4
5
  code: string;
6
+ vehicle_type: VehicleType;
5
7
  name: string;
6
8
  created: Date;
7
9
  updated: Date | null;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GlobalTemplate = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const GlobalTemplateSection_1 = require("./GlobalTemplateSection");
15
+ const VehicleType_1 = require("./VehicleType");
15
16
  let GlobalTemplate = class GlobalTemplate {
16
17
  };
17
18
  exports.GlobalTemplate = GlobalTemplate;
@@ -31,6 +32,14 @@ __decorate([
31
32
  }),
32
33
  __metadata("design:type", String)
33
34
  ], GlobalTemplate.prototype, "code", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.ManyToOne)(() => VehicleType_1.VehicleType, (vehicleType) => vehicleType.vehicle_types_global_template, {
37
+ onDelete: "RESTRICT",
38
+ onUpdate: "NO ACTION",
39
+ }),
40
+ (0, typeorm_1.JoinColumn)({ name: "vehicle_type" }),
41
+ __metadata("design:type", VehicleType_1.VehicleType)
42
+ ], GlobalTemplate.prototype, "vehicle_type", void 0);
34
43
  __decorate([
35
44
  (0, typeorm_1.Column)({
36
45
  length: 100,
@@ -1,9 +1,11 @@
1
1
  import { Workshop } from "./Workshop";
2
2
  import { TemplateSection } from "./TemplateSection";
3
3
  import { ServiceOrder } from "./ServiceOrder";
4
+ import { VehicleType } from "./VehicleType";
4
5
  export declare class Template {
5
6
  id: number;
6
7
  code: string;
8
+ vehicle_type: VehicleType;
7
9
  workshop: Workshop;
8
10
  name: string;
9
11
  created: Date;
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const Workshop_1 = require("./Workshop");
15
15
  const TemplateSection_1 = require("./TemplateSection");
16
16
  const ServiceOrder_1 = require("./ServiceOrder");
17
+ const VehicleType_1 = require("./VehicleType");
17
18
  let Template = class Template {
18
19
  };
19
20
  exports.Template = Template;
@@ -33,6 +34,14 @@ __decorate([
33
34
  }),
34
35
  __metadata("design:type", String)
35
36
  ], Template.prototype, "code", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.ManyToOne)(() => VehicleType_1.VehicleType, (vehicleType) => vehicleType.vehicle_types_template, {
39
+ onDelete: "RESTRICT",
40
+ onUpdate: "NO ACTION",
41
+ }),
42
+ (0, typeorm_1.JoinColumn)({ name: "vehicle_type" }),
43
+ __metadata("design:type", VehicleType_1.VehicleType)
44
+ ], Template.prototype, "vehicle_type", void 0);
36
45
  __decorate([
37
46
  (0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, (workshop) => workshop.templates, {
38
47
  onDelete: "CASCADE",
@@ -2,9 +2,11 @@ import { Brand } from "./Brand";
2
2
  import { Company } from "./Company";
3
3
  import { ServiceOrder } from "./ServiceOrder";
4
4
  import { Reminder } from "./Reminder";
5
+ import { VehicleType } from "./VehicleType";
5
6
  export declare class Vehicle {
6
7
  id: number;
7
- name: string;
8
+ vehicle_type: VehicleType;
9
+ plate: string;
8
10
  brand: Brand;
9
11
  company: Company;
10
12
  mileage: number;
@@ -15,6 +15,7 @@ const Brand_1 = require("./Brand");
15
15
  const Company_1 = require("./Company");
16
16
  const ServiceOrder_1 = require("./ServiceOrder");
17
17
  const Reminder_1 = require("./Reminder");
18
+ const VehicleType_1 = require("./VehicleType");
18
19
  let Vehicle = class Vehicle {
19
20
  };
20
21
  exports.Vehicle = Vehicle;
@@ -25,10 +26,18 @@ __decorate([
25
26
  }),
26
27
  __metadata("design:type", Number)
27
28
  ], Vehicle.prototype, "id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.ManyToOne)(() => VehicleType_1.VehicleType, (vehicleType) => vehicleType.vehicle_types, {
31
+ onDelete: "RESTRICT",
32
+ onUpdate: "NO ACTION",
33
+ }),
34
+ (0, typeorm_1.JoinColumn)({ name: "vehicle_type" }),
35
+ __metadata("design:type", VehicleType_1.VehicleType)
36
+ ], Vehicle.prototype, "vehicle_type", void 0);
28
37
  __decorate([
29
38
  (0, typeorm_1.Column)({ length: 10, type: "varchar", comment: "Placa del vehículo." }),
30
39
  __metadata("design:type", String)
31
- ], Vehicle.prototype, "name", void 0);
40
+ ], Vehicle.prototype, "plate", void 0);
32
41
  __decorate([
33
42
  (0, typeorm_1.ManyToOne)(() => Brand_1.Brand, (brand) => brand.vehicles, {
34
43
  onDelete: "RESTRICT",
@@ -0,0 +1,12 @@
1
+ import { GlobalTemplate } from "./GlobalTemplate";
2
+ import { Template } from "./Template";
3
+ import { Vehicle } from "./Vehicle";
4
+ export declare class VehicleType {
5
+ id: number;
6
+ name: string;
7
+ details: any | null;
8
+ status: number;
9
+ vehicle_types: Vehicle[];
10
+ vehicle_types_template: Template[];
11
+ vehicle_types_global_template: GlobalTemplate[];
12
+ }
@@ -0,0 +1,69 @@
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.VehicleType = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const GlobalTemplate_1 = require("./GlobalTemplate");
15
+ const Template_1 = require("./Template");
16
+ const Vehicle_1 = require("./Vehicle");
17
+ let VehicleType = class VehicleType {
18
+ };
19
+ exports.VehicleType = VehicleType;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({
22
+ type: "int",
23
+ comment: "Número de identificación (ID) único de cada registro.",
24
+ }),
25
+ __metadata("design:type", Number)
26
+ ], VehicleType.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({
29
+ length: 50,
30
+ type: "varchar",
31
+ comment: "Nombre del tipo de vehículo.",
32
+ }),
33
+ __metadata("design:type", String)
34
+ ], VehicleType.prototype, "name", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({
37
+ type: "json",
38
+ nullable: true,
39
+ default: null,
40
+ comment: "Campo de tipo json para agregar estructura si se necesita.",
41
+ }),
42
+ __metadata("design:type", Object)
43
+ ], VehicleType.prototype, "details", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({
46
+ default: 1,
47
+ type: "int",
48
+ width: 1,
49
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
50
+ }),
51
+ __metadata("design:type", Number)
52
+ ], VehicleType.prototype, "status", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.OneToMany)(() => Vehicle_1.Vehicle, (vehicle) => vehicle.vehicle_type),
55
+ __metadata("design:type", Array)
56
+ ], VehicleType.prototype, "vehicle_types", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.OneToMany)(() => Template_1.Template, (template) => template.vehicle_type),
59
+ __metadata("design:type", Array)
60
+ ], VehicleType.prototype, "vehicle_types_template", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.OneToMany)(() => GlobalTemplate_1.GlobalTemplate, (globalTemplate) => globalTemplate.vehicle_type),
63
+ __metadata("design:type", Array)
64
+ ], VehicleType.prototype, "vehicle_types_global_template", void 0);
65
+ exports.VehicleType = VehicleType = __decorate([
66
+ (0, typeorm_1.Entity)({
67
+ comment: "Tabla creada para agregar los tipos de vehículos que va a manejar el concesionario/taller.",
68
+ })
69
+ ], VehicleType);
@@ -23,4 +23,6 @@ export { AssociatePlatform } from "./entities/AssociatePlatform";
23
23
  export { AssociateRole } from "./entities/AssociateRole";
24
24
  export { AssociatePermission } from "./entities/AssociatePermission";
25
25
  export { AssociateSection } from "./entities/AssociateSection";
26
+ export { AssociatePasswordReset } from "./entities/AssociatePasswordReset";
27
+ export { VehicleType } from "./entities/VehicleType";
26
28
  export { Associates } from "./views/Associates";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Associates = 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;
3
+ exports.Associates = 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
4
  var Country_1 = require("./entities/Country");
5
5
  Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
6
6
  var Region_1 = require("./entities/Region");
@@ -51,5 +51,9 @@ var AssociatePermission_1 = require("./entities/AssociatePermission");
51
51
  Object.defineProperty(exports, "AssociatePermission", { enumerable: true, get: function () { return AssociatePermission_1.AssociatePermission; } });
52
52
  var AssociateSection_1 = require("./entities/AssociateSection");
53
53
  Object.defineProperty(exports, "AssociateSection", { enumerable: true, get: function () { return AssociateSection_1.AssociateSection; } });
54
+ var AssociatePasswordReset_1 = require("./entities/AssociatePasswordReset");
55
+ Object.defineProperty(exports, "AssociatePasswordReset", { enumerable: true, get: function () { return AssociatePasswordReset_1.AssociatePasswordReset; } });
56
+ var VehicleType_1 = require("./entities/VehicleType");
57
+ Object.defineProperty(exports, "VehicleType", { enumerable: true, get: function () { return VehicleType_1.VehicleType; } });
54
58
  var Associates_1 = require("./views/Associates");
55
59
  Object.defineProperty(exports, "Associates", { enumerable: true, get: function () { return Associates_1.Associates; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asumano/worklip-typeorm-db",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "publishConfig": {
5
5
  "access": "restricted"
6
6
  },