@asumano/worklip-typeorm-db 1.1.67 → 1.1.69

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.
@@ -1,4 +1,5 @@
1
1
  import { City } from "./City";
2
+ import { MasterPasswordReset } from "./MasterPasswordReset";
2
3
  import { MasterPermission } from "./MasterPermission";
3
4
  import { MasterSession } from "./MasterSession";
4
5
  export declare class Master {
@@ -19,4 +20,5 @@ export declare class Master {
19
20
  visible: number;
20
21
  master_sessions: MasterSession[];
21
22
  permissions: MasterPermission[];
23
+ passwordResets: MasterPasswordReset[];
22
24
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Master = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const City_1 = require("./City");
15
+ const MasterPasswordReset_1 = require("./MasterPasswordReset");
15
16
  const MasterPermission_1 = require("./MasterPermission");
16
17
  const MasterSession_1 = require("./MasterSession");
17
18
  let Master = class Master {
@@ -163,6 +164,10 @@ __decorate([
163
164
  }),
164
165
  __metadata("design:type", Array)
165
166
  ], Master.prototype, "permissions", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.OneToMany)(() => MasterPasswordReset_1.MasterPasswordReset, (passwordReset) => passwordReset.master),
169
+ __metadata("design:type", Array)
170
+ ], Master.prototype, "passwordResets", void 0);
166
171
  exports.Master = Master = __decorate([
167
172
  (0, typeorm_1.Entity)({
168
173
  comment: "Usuarios tipo administrador de la plataforma.",
@@ -0,0 +1,10 @@
1
+ import { Master } from "..";
2
+ export declare class MasterPasswordReset {
3
+ id: number;
4
+ master: Master;
5
+ token: string;
6
+ expires_at: Date;
7
+ used: number;
8
+ created: Date;
9
+ updated: Date | null;
10
+ }
@@ -0,0 +1,80 @@
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.MasterPasswordReset = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const __1 = require("..");
15
+ // DOC: Espejo de `AssociatePasswordReset` para la plataforma administrativa. Va en
16
+ // una tabla aparte y no en una compartida porque `associate` y `master` son tablas
17
+ // distintas: una sola tabla obligaría a una llave foránea que apunte a dos sitios.
18
+ let MasterPasswordReset = class MasterPasswordReset {
19
+ };
20
+ exports.MasterPasswordReset = MasterPasswordReset;
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)({
23
+ type: "int",
24
+ comment: "Número de identificación (ID) único de cada registro.",
25
+ }),
26
+ __metadata("design:type", Number)
27
+ ], MasterPasswordReset.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.ManyToOne)(() => __1.Master, (master) => master.passwordResets, {
30
+ onDelete: "CASCADE",
31
+ onUpdate: "NO ACTION",
32
+ }),
33
+ (0, typeorm_1.JoinColumn)({ name: "master" }),
34
+ __metadata("design:type", __1.Master)
35
+ ], MasterPasswordReset.prototype, "master", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({
38
+ length: 255,
39
+ type: "varchar",
40
+ comment: "Token generado para cambiar la contraseña.",
41
+ }),
42
+ __metadata("design:type", String)
43
+ ], MasterPasswordReset.prototype, "token", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({
46
+ type: "datetime",
47
+ comment: "Cuando expira el token.",
48
+ }),
49
+ __metadata("design:type", Date)
50
+ ], MasterPasswordReset.prototype, "expires_at", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({
53
+ default: 0,
54
+ type: "int",
55
+ width: 1,
56
+ comment: "Si ya se usó el token de cambio de contraseña.\n1: Ya se usó.\n0: No se ha usado.",
57
+ }),
58
+ __metadata("design:type", Number)
59
+ ], MasterPasswordReset.prototype, "used", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ type: "datetime",
63
+ comment: "Fecha de creación del registro.",
64
+ default: () => "CURRENT_TIMESTAMP",
65
+ }),
66
+ __metadata("design:type", Date)
67
+ ], MasterPasswordReset.prototype, "created", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({
70
+ type: "datetime",
71
+ nullable: true,
72
+ default: null,
73
+ comment: "Fecha de actualización del registro.",
74
+ onUpdate: "CURRENT_TIMESTAMP",
75
+ }),
76
+ __metadata("design:type", Object)
77
+ ], MasterPasswordReset.prototype, "updated", void 0);
78
+ exports.MasterPasswordReset = MasterPasswordReset = __decorate([
79
+ (0, typeorm_1.Entity)("master_password_reset")
80
+ ], MasterPasswordReset);
@@ -1,3 +1,4 @@
1
+ import { Company } from "./Company";
1
2
  import { CompanySubscription } from "./CompanySubscription";
2
3
  export declare class SubscriptionPlan {
3
4
  id: number;
@@ -12,6 +13,7 @@ export declare class SubscriptionPlan {
12
13
  max_users: number;
13
14
  retention_days: number | null;
14
15
  is_custom: number;
16
+ company: Company | null;
15
17
  status: number;
16
18
  created: Date;
17
19
  updated: Date | null;
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SubscriptionPlan = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
+ const Company_1 = require("./Company");
14
15
  const CompanySubscription_1 = require("./CompanySubscription");
15
16
  let SubscriptionPlan = class SubscriptionPlan {
16
17
  };
@@ -110,6 +111,11 @@ __decorate([
110
111
  }),
111
112
  __metadata("design:type", Number)
112
113
  ], SubscriptionPlan.prototype, "is_custom", void 0);
114
+ __decorate([
115
+ (0, typeorm_1.ManyToOne)(() => Company_1.Company, { onDelete: "SET NULL", onUpdate: "NO ACTION" }),
116
+ (0, typeorm_1.JoinColumn)({ name: "company" }),
117
+ __metadata("design:type", Object)
118
+ ], SubscriptionPlan.prototype, "company", void 0);
113
119
  __decorate([
114
120
  (0, typeorm_1.Column)({
115
121
  default: 1,
@@ -24,6 +24,7 @@ export { AssociateRole } from "./entities/AssociateRole";
24
24
  export { AssociatePermission } from "./entities/AssociatePermission";
25
25
  export { AssociateSection } from "./entities/AssociateSection";
26
26
  export { AssociatePasswordReset } from "./entities/AssociatePasswordReset";
27
+ export { MasterPasswordReset } from "./entities/MasterPasswordReset";
27
28
  export { MasterPlatform } from "./entities/MasterPlatform";
28
29
  export { MasterRole } from "./entities/MasterRole";
29
30
  export { MasterPermission } from "./entities/MasterPermission";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.CompanyVehicleType = exports.CompanyBrand = exports.VehicleType = exports.MasterSection = exports.MasterPermission = exports.MasterRole = exports.MasterPlatform = 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 = void 0;
3
+ 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.CompanyVehicleType = 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 = 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");
@@ -54,6 +54,8 @@ var AssociateSection_1 = require("./entities/AssociateSection");
54
54
  Object.defineProperty(exports, "AssociateSection", { enumerable: true, get: function () { return AssociateSection_1.AssociateSection; } });
55
55
  var AssociatePasswordReset_1 = require("./entities/AssociatePasswordReset");
56
56
  Object.defineProperty(exports, "AssociatePasswordReset", { enumerable: true, get: function () { return AssociatePasswordReset_1.AssociatePasswordReset; } });
57
+ var MasterPasswordReset_1 = require("./entities/MasterPasswordReset");
58
+ Object.defineProperty(exports, "MasterPasswordReset", { enumerable: true, get: function () { return MasterPasswordReset_1.MasterPasswordReset; } });
57
59
  var MasterPlatform_1 = require("./entities/MasterPlatform");
58
60
  Object.defineProperty(exports, "MasterPlatform", { enumerable: true, get: function () { return MasterPlatform_1.MasterPlatform; } });
59
61
  var MasterRole_1 = require("./entities/MasterRole");
@@ -11,6 +11,8 @@ export declare class SubscriptionPlans {
11
11
  max_users: number;
12
12
  retention_days: number | null;
13
13
  is_custom: number;
14
+ company: number | null;
15
+ company_name: string | null;
14
16
  status: number;
15
17
  created: Date;
16
18
  updated: Date | null;
@@ -62,6 +62,14 @@ __decorate([
62
62
  (0, typeorm_1.ViewColumn)(),
63
63
  __metadata("design:type", Number)
64
64
  ], SubscriptionPlans.prototype, "is_custom", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.ViewColumn)(),
67
+ __metadata("design:type", Object)
68
+ ], SubscriptionPlans.prototype, "company", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.ViewColumn)(),
71
+ __metadata("design:type", Object)
72
+ ], SubscriptionPlans.prototype, "company_name", void 0);
65
73
  __decorate([
66
74
  (0, typeorm_1.ViewColumn)(),
67
75
  __metadata("design:type", Number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asumano/worklip-typeorm-db",
3
- "version": "1.1.67",
3
+ "version": "1.1.69",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },