test-entity-library-asm 2.7.15 → 2.7.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.
@@ -1,5 +1,6 @@
1
1
  import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany';
2
2
  import { Master } from './Master';
3
+ import { ServicePlan } from './ServicePlan';
3
4
  export declare class DiscountCodeCompany {
4
5
  id: number;
5
6
  code: string;
@@ -15,4 +16,5 @@ export declare class DiscountCodeCompany {
15
16
  status: number;
16
17
  updated_by: Master;
17
18
  code_redemptions_history_company: CodeRedemptionHistoryCompany[];
19
+ servicePlans: ServicePlan[];
18
20
  }
@@ -15,6 +15,7 @@ var dateTransformer_1 = require("../transformers/dateTransformer");
15
15
  var jsonTransformer_1 = require("../transformers/jsonTransformer");
16
16
  var CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
17
17
  var Master_1 = require("./Master");
18
+ var ServicePlan_1 = require("./ServicePlan");
18
19
  var DiscountCodeCompany = /** @class */ (function () {
19
20
  function DiscountCodeCompany() {
20
21
  }
@@ -115,6 +116,10 @@ var DiscountCodeCompany = /** @class */ (function () {
115
116
  }),
116
117
  __metadata("design:type", Array)
117
118
  ], DiscountCodeCompany.prototype, "code_redemptions_history_company", void 0);
119
+ __decorate([
120
+ (0, typeorm_1.OneToMany)(function () { return ServicePlan_1.ServicePlan; }, function (servicePlan) { return servicePlan.discount; }),
121
+ __metadata("design:type", Array)
122
+ ], DiscountCodeCompany.prototype, "servicePlans", void 0);
118
123
  DiscountCodeCompany = __decorate([
119
124
  (0, typeorm_1.Entity)('discount_code_company', {
120
125
  comment: 'Códigos de descuento para las empresas.',
@@ -0,0 +1,13 @@
1
+ import { DiscountCodeCompany } from './DiscountCodeCompany';
2
+ export declare class ServicePlan {
3
+ id_service_plan: number;
4
+ code: string;
5
+ description: string | null;
6
+ price: number | null;
7
+ currency: string | null;
8
+ status: number;
9
+ type: number;
10
+ time_periods: string | null;
11
+ assigned_discount: number | null;
12
+ discount: DiscountCodeCompany | null;
13
+ }
@@ -0,0 +1,67 @@
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.ServicePlan = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var DiscountCodeCompany_1 = require("./DiscountCodeCompany"); // Asegúrate de ajustar el path al modelo correspondiente
15
+ var ServicePlan = /** @class */ (function () {
16
+ function ServicePlan() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({ name: 'id_service_plan' }),
20
+ __metadata("design:type", Number)
21
+ ], ServicePlan.prototype, "id_service_plan", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
24
+ __metadata("design:type", String)
25
+ ], ServicePlan.prototype, "code", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'varchar', length: 450, nullable: true }),
28
+ __metadata("design:type", Object)
29
+ ], ServicePlan.prototype, "description", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'float', nullable: true }),
32
+ __metadata("design:type", Object)
33
+ ], ServicePlan.prototype, "price", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
36
+ __metadata("design:type", Object)
37
+ ], ServicePlan.prototype, "currency", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'int', default: 1 }),
40
+ __metadata("design:type", Number)
41
+ ], ServicePlan.prototype, "status", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'int' }),
44
+ __metadata("design:type", Number)
45
+ ], ServicePlan.prototype, "type", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], ServicePlan.prototype, "time_periods", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], ServicePlan.prototype, "assigned_discount", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.ManyToOne)(function () { return DiscountCodeCompany_1.DiscountCodeCompany; }, function (discount) { return discount.servicePlans; }, {
56
+ onDelete: 'CASCADE',
57
+ onUpdate: 'CASCADE',
58
+ }),
59
+ __metadata("design:type", Object)
60
+ ], ServicePlan.prototype, "discount", void 0);
61
+ ServicePlan = __decorate([
62
+ (0, typeorm_1.Entity)('service_plan'),
63
+ (0, typeorm_1.Unique)(['code'])
64
+ ], ServicePlan);
65
+ return ServicePlan;
66
+ }());
67
+ exports.ServicePlan = ServicePlan;
@@ -46,6 +46,7 @@ export { ReassignReview } from './entities/ReassignReview';
46
46
  export { LocalPlan } from './entities/LocalPlan';
47
47
  export { PartnerPermissionSection } from './entities/PartnerPermissionSection';
48
48
  export { PartnerPlatform } from './entities/PartnerPlatform';
49
+ export { ServicePlan } from './entities/ServicePlan';
49
50
  export { LocalsCompany } from './views/LocalsCompany';
50
51
  export { VerifyLocals } from './views/VerifyLocals';
51
52
  export { MasterNotifications } from './views/MasterNotifications';
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.VerifyLocals = exports.LocalsCompany = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.ReassignReview = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
- exports.CustomRepository = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = void 0;
17
+ exports.LocalsCompany = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.ReassignReview = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
+ exports.CustomRepository = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = void 0;
19
19
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
20
20
  Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
21
21
  var Category_1 = require("./entities/Category");
@@ -112,6 +112,8 @@ var PartnerPermissionSection_1 = require("./entities/PartnerPermissionSection");
112
112
  Object.defineProperty(exports, "PartnerPermissionSection", { enumerable: true, get: function () { return PartnerPermissionSection_1.PartnerPermissionSection; } });
113
113
  var PartnerPlatform_1 = require("./entities/PartnerPlatform");
114
114
  Object.defineProperty(exports, "PartnerPlatform", { enumerable: true, get: function () { return PartnerPlatform_1.PartnerPlatform; } });
115
+ var ServicePlan_1 = require("./entities/ServicePlan");
116
+ Object.defineProperty(exports, "ServicePlan", { enumerable: true, get: function () { return ServicePlan_1.ServicePlan; } });
115
117
  var LocalsCompany_1 = require("./views/LocalsCompany");
116
118
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
117
119
  var VerifyLocals_1 = require("./views/VerifyLocals");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.7.15",
3
+ "version": "2.7.16",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,6 +10,7 @@ import { DateTransformer } from '../transformers/dateTransformer'
10
10
  import { jsonTransformer } from '../transformers/jsonTransformer'
11
11
  import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany'
12
12
  import { Master } from './Master'
13
+ import { ServicePlan } from './ServicePlan'
13
14
 
14
15
  @Entity('discount_code_company', {
15
16
  comment: 'Códigos de descuento para las empresas.',
@@ -104,4 +105,7 @@ export class DiscountCodeCompany {
104
105
  codeRedemptionHistoryCompany.discount_code_company
105
106
  )
106
107
  code_redemptions_history_company: CodeRedemptionHistoryCompany[]
108
+
109
+ @OneToMany(() => ServicePlan, (servicePlan) => servicePlan.discount)
110
+ servicePlans: ServicePlan[];
107
111
  }
@@ -0,0 +1,39 @@
1
+ import { Entity, PrimaryGeneratedColumn, Column, Unique, ManyToOne } from 'typeorm';
2
+ import { DiscountCodeCompany } from './DiscountCodeCompany'; // Asegúrate de ajustar el path al modelo correspondiente
3
+
4
+ @Entity('service_plan')
5
+ @Unique(['code'])
6
+ export class ServicePlan {
7
+ @PrimaryGeneratedColumn({ name: 'id_service_plan' })
8
+ id_service_plan: number;
9
+
10
+ @Column({ type: 'varchar', length: 100 })
11
+ code: string;
12
+
13
+ @Column({ type: 'varchar', length: 450, nullable: true })
14
+ description: string | null;
15
+
16
+ @Column({ type: 'float', nullable: true })
17
+ price: number | null;
18
+
19
+ @Column({ type: 'varchar', length: 10, nullable: true })
20
+ currency: string | null;
21
+
22
+ @Column({ type: 'int', default: 1 })
23
+ status: number;
24
+
25
+ @Column({ type: 'int' })
26
+ type: number;
27
+
28
+ @Column({ type: 'text', nullable: true })
29
+ time_periods: string | null;
30
+
31
+ @Column({ type: 'int', nullable: true })
32
+ assigned_discount: number | null;
33
+
34
+ @ManyToOne(() => DiscountCodeCompany, (discount) => discount.servicePlans, {
35
+ onDelete: 'CASCADE',
36
+ onUpdate: 'CASCADE',
37
+ })
38
+ discount: DiscountCodeCompany | null;
39
+ }
@@ -46,6 +46,7 @@ export { ReassignReview } from './entities/ReassignReview'
46
46
  export { LocalPlan } from './entities/LocalPlan'
47
47
  export { PartnerPermissionSection } from './entities/PartnerPermissionSection'
48
48
  export { PartnerPlatform } from './entities/PartnerPlatform'
49
+ export { ServicePlan } from './entities/ServicePlan'
49
50
 
50
51
  export { LocalsCompany } from './views/LocalsCompany'
51
52
  export { VerifyLocals } from './views/VerifyLocals'