@asumano/worklip-typeorm-db 1.1.16 → 1.1.17

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,7 +1,9 @@
1
1
  import { Vehicle } from "./Vehicle";
2
+ import { CompanyBrand } from "./CompanyBrand";
2
3
  export declare class Brand {
3
4
  id: number;
4
5
  name: string;
5
6
  details: any | null;
6
7
  vehicles: Vehicle[];
8
+ companyBrands: CompanyBrand[];
7
9
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Brand = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const Vehicle_1 = require("./Vehicle");
15
+ const CompanyBrand_1 = require("./CompanyBrand");
15
16
  let Brand = class Brand {
16
17
  };
17
18
  exports.Brand = Brand;
@@ -39,6 +40,10 @@ __decorate([
39
40
  (0, typeorm_1.OneToMany)(() => Vehicle_1.Vehicle, (vehicle) => vehicle.brand),
40
41
  __metadata("design:type", Array)
41
42
  ], Brand.prototype, "vehicles", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.OneToMany)(() => CompanyBrand_1.CompanyBrand, (companyBrand) => companyBrand.brand),
45
+ __metadata("design:type", Array)
46
+ ], Brand.prototype, "companyBrands", void 0);
42
47
  exports.Brand = Brand = __decorate([
43
48
  (0, typeorm_1.Entity)({
44
49
  comment: "Marcas de vehículos que estarán disponibles en la plataforma.",
@@ -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 { Country } from "..";
5
+ import { CompanyBrand, Country } from "..";
6
6
  export declare class Company {
7
7
  id: number;
8
8
  country: Country;
@@ -14,4 +14,5 @@ export declare class Company {
14
14
  clients: Client[];
15
15
  associates: Associate[];
16
16
  workshops: Workshop[];
17
+ companyBrands: CompanyBrand[];
17
18
  }
@@ -81,6 +81,10 @@ __decorate([
81
81
  (0, typeorm_1.OneToMany)(() => Workshop_1.Workshop, (workshop) => workshop.company),
82
82
  __metadata("design:type", Array)
83
83
  ], Company.prototype, "workshops", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.OneToMany)(() => __1.CompanyBrand, (companyBrand) => companyBrand.company),
86
+ __metadata("design:type", Array)
87
+ ], Company.prototype, "companyBrands", void 0);
84
88
  exports.Company = Company = __decorate([
85
89
  (0, typeorm_1.Entity)({ comment: "Empresas registradas en la plataforma." })
86
90
  ], Company);
@@ -0,0 +1,7 @@
1
+ import { Brand } from "./Brand";
2
+ import { Company } from "./Company";
3
+ export declare class CompanyBrand {
4
+ id: number;
5
+ company: Company;
6
+ brand: Brand;
7
+ }
@@ -0,0 +1,47 @@
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.CompanyBrand = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Brand_1 = require("./Brand");
15
+ const Company_1 = require("./Company");
16
+ let CompanyBrand = class CompanyBrand {
17
+ };
18
+ exports.CompanyBrand = CompanyBrand;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)({
21
+ type: "int",
22
+ comment: "ID único de cada registro.",
23
+ }),
24
+ __metadata("design:type", Number)
25
+ ], CompanyBrand.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.companyBrands, {
28
+ onDelete: "CASCADE",
29
+ onUpdate: "NO ACTION",
30
+ }),
31
+ (0, typeorm_1.JoinColumn)({ name: "company" }),
32
+ __metadata("design:type", Company_1.Company)
33
+ ], CompanyBrand.prototype, "company", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.ManyToOne)(() => Brand_1.Brand, (brand) => brand.companyBrands, {
36
+ onDelete: "RESTRICT",
37
+ onUpdate: "NO ACTION",
38
+ }),
39
+ (0, typeorm_1.JoinColumn)({ name: "brand" }),
40
+ __metadata("design:type", Brand_1.Brand)
41
+ ], CompanyBrand.prototype, "brand", void 0);
42
+ exports.CompanyBrand = CompanyBrand = __decorate([
43
+ (0, typeorm_1.Entity)({
44
+ name: "company_brand",
45
+ comment: "Relación entre las marcas de vehículos y las concesionarios/talleres, hay unos concesionarios/talleres que solo aceptan un tipo de marca de vehículos.",
46
+ })
47
+ ], CompanyBrand);
@@ -25,4 +25,5 @@ export { AssociatePermission } from "./entities/AssociatePermission";
25
25
  export { AssociateSection } from "./entities/AssociateSection";
26
26
  export { AssociatePasswordReset } from "./entities/AssociatePasswordReset";
27
27
  export { VehicleType } from "./entities/VehicleType";
28
+ export { CompanyBrand } from "./entities/CompanyBrand";
28
29
  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.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;
3
+ exports.Associates = 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
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");
@@ -55,5 +55,7 @@ var AssociatePasswordReset_1 = require("./entities/AssociatePasswordReset");
55
55
  Object.defineProperty(exports, "AssociatePasswordReset", { enumerable: true, get: function () { return AssociatePasswordReset_1.AssociatePasswordReset; } });
56
56
  var VehicleType_1 = require("./entities/VehicleType");
57
57
  Object.defineProperty(exports, "VehicleType", { enumerable: true, get: function () { return VehicleType_1.VehicleType; } });
58
+ var CompanyBrand_1 = require("./entities/CompanyBrand");
59
+ Object.defineProperty(exports, "CompanyBrand", { enumerable: true, get: function () { return CompanyBrand_1.CompanyBrand; } });
58
60
  var Associates_1 = require("./views/Associates");
59
61
  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.16",
3
+ "version": "1.1.17",
4
4
  "publishConfig": {
5
5
  "access": "restricted"
6
6
  },