test-entity-library-asm 2.0.9 → 2.1.0

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.
@@ -0,0 +1,8 @@
1
+ import { BusinessTypeProduct } from './BusinessTypeProduct';
2
+ export declare class BusinessType {
3
+ id: number;
4
+ name: string;
5
+ description: string;
6
+ status: number;
7
+ businessTypesProduct: BusinessTypeProduct[];
8
+ }
@@ -0,0 +1,55 @@
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.BusinessType = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var BusinessTypeProduct_1 = require("./BusinessTypeProduct");
15
+ var BusinessType = /** @class */ (function () {
16
+ function BusinessType() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ comment: 'Número de identificación (ID) único de cada registro.',
21
+ }),
22
+ __metadata("design:type", Number)
23
+ ], BusinessType.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del tipo de negocio.' }),
26
+ __metadata("design:type", String)
27
+ ], BusinessType.prototype, "name", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({
30
+ type: 'json',
31
+ nullable: true,
32
+ comment: 'Descripción del tipo de negocio.',
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], BusinessType.prototype, "description", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({
38
+ default: 1,
39
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
40
+ }),
41
+ __metadata("design:type", Number)
42
+ ], BusinessType.prototype, "status", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.OneToMany)(function () { return BusinessTypeProduct_1.BusinessTypeProduct; }, function (businessTypeProduct) { return businessTypeProduct.business_type; }),
45
+ __metadata("design:type", Array)
46
+ ], BusinessType.prototype, "businessTypesProduct", void 0);
47
+ BusinessType = __decorate([
48
+ (0, typeorm_1.Entity)({
49
+ name: 'business_type',
50
+ comment: 'Almacenar los tipos de negocio qué se van a poder agregar en asumano.',
51
+ })
52
+ ], BusinessType);
53
+ return BusinessType;
54
+ }());
55
+ exports.BusinessType = BusinessType;
@@ -0,0 +1,10 @@
1
+ import { Local } from '..';
2
+ import { BusinessType } from './BusinessType';
3
+ export declare class BusinessTypeProduct {
4
+ id: number;
5
+ business_type: BusinessType;
6
+ name: string;
7
+ photo: string;
8
+ status: number;
9
+ business_type_products: Local[];
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.BusinessTypeProduct = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
15
+ var BusinessType_1 = require("./BusinessType");
16
+ var BusinessTypeProduct = /** @class */ (function () {
17
+ function BusinessTypeProduct() {
18
+ }
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)({
21
+ comment: 'Número de identificación (ID) único de cada registro.',
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], BusinessTypeProduct.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(function () { return BusinessType_1.BusinessType; }, function (businessType) { return businessType.businessTypesProduct; }, {
27
+ onDelete: 'RESTRICT',
28
+ onUpdate: 'NO ACTION',
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: 'business_type' }),
31
+ __metadata("design:type", BusinessType_1.BusinessType)
32
+ ], BusinessTypeProduct.prototype, "business_type", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({
35
+ length: 40,
36
+ comment: 'ID de la variable que se encuentra en los archivos `locales` para el multilenguaje.',
37
+ }),
38
+ __metadata("design:type", String)
39
+ ], BusinessTypeProduct.prototype, "name", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({
42
+ length: 500,
43
+ nullable: true,
44
+ comment: 'Imagen para el tipo de comida.',
45
+ }),
46
+ __metadata("design:type", String)
47
+ ], BusinessTypeProduct.prototype, "photo", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({
50
+ default: 1,
51
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
52
+ }),
53
+ __metadata("design:type", Number)
54
+ ], BusinessTypeProduct.prototype, "status", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.ManyToMany)(function () { return __1.Local; }),
57
+ (0, typeorm_1.JoinTable)({
58
+ name: 'business_type_product_local',
59
+ joinColumn: {
60
+ name: 'local',
61
+ referencedColumnName: 'id',
62
+ },
63
+ inverseJoinColumn: {
64
+ name: 'business_type_product',
65
+ referencedColumnName: 'id',
66
+ },
67
+ }),
68
+ __metadata("design:type", Array)
69
+ ], BusinessTypeProduct.prototype, "business_type_products", void 0);
70
+ BusinessTypeProduct = __decorate([
71
+ (0, typeorm_1.Entity)('business_type_product', {
72
+ comment: 'Tabla para agregar los productos qué el local va tener por el tipo de negocio.',
73
+ })
74
+ ], BusinessTypeProduct);
75
+ return BusinessTypeProduct;
76
+ }());
77
+ exports.BusinessTypeProduct = BusinessTypeProduct;
@@ -2,11 +2,10 @@ import { City } from './City';
2
2
  import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany';
3
3
  import { DiscountCodeUser } from './DiscountCodeUser';
4
4
  import { Local } from './Local';
5
- import { Plan } from './Plan';
6
- import { ProductTopping } from './ProductTopping';
7
- import { TypeFood } from './TypeFood';
8
5
  import { Partner } from './Partner';
9
6
  import { PartnerRole } from './PartnerRole';
7
+ import { Plan } from './Plan';
8
+ import { ProductTopping } from './ProductTopping';
10
9
  export declare class Company {
11
10
  id: number;
12
11
  name: string;
@@ -22,7 +21,6 @@ export declare class Company {
22
21
  expiration: Date;
23
22
  updated: Date;
24
23
  status: number;
25
- types_food: TypeFood[];
26
24
  locals: Local[];
27
25
  code_redemption_history_company: CodeRedemptionHistoryCompany[];
28
26
  discount_code_users: DiscountCodeUser[];
@@ -15,11 +15,10 @@ var City_1 = require("./City");
15
15
  var CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
16
16
  var DiscountCodeUser_1 = require("./DiscountCodeUser");
17
17
  var Local_1 = require("./Local");
18
- var Plan_1 = require("./Plan");
19
- var ProductTopping_1 = require("./ProductTopping");
20
- var TypeFood_1 = require("./TypeFood");
21
18
  var Partner_1 = require("./Partner");
22
19
  var PartnerRole_1 = require("./PartnerRole");
20
+ var Plan_1 = require("./Plan");
21
+ var ProductTopping_1 = require("./ProductTopping");
23
22
  var Company = /** @class */ (function () {
24
23
  function Company() {
25
24
  }
@@ -121,13 +120,6 @@ var Company = /** @class */ (function () {
121
120
  }),
122
121
  __metadata("design:type", Number)
123
122
  ], Company.prototype, "status", void 0);
124
- __decorate([
125
- (0, typeorm_1.ManyToMany)(function () { return TypeFood_1.TypeFood; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
126
- (0, typeorm_1.JoinTable)({
127
- name: 'type_food_company',
128
- }),
129
- __metadata("design:type", Array)
130
- ], Company.prototype, "types_food", void 0);
131
123
  __decorate([
132
124
  (0, typeorm_1.OneToMany)(function () { return Local_1.Local; }, function (local) { return local.company; }),
133
125
  __metadata("design:type", Array)
@@ -9,6 +9,7 @@ import { Square } from './Square';
9
9
  import { Terminal } from './Terminal';
10
10
  import { User } from './User';
11
11
  import { Partner } from './Partner';
12
+ import { BusinessTypeProduct } from './BusinessTypeProduct';
12
13
  export declare class Local {
13
14
  id: number;
14
15
  company: Company;
@@ -31,4 +32,5 @@ export declare class Local {
31
32
  requests: Request[];
32
33
  terminals: Terminal[];
33
34
  users_favorite_local: User[];
35
+ business_type_products: BusinessTypeProduct[];
34
36
  }
@@ -22,6 +22,7 @@ var Square_1 = require("./Square");
22
22
  var Terminal_1 = require("./Terminal");
23
23
  var User_1 = require("./User");
24
24
  var Partner_1 = require("./Partner");
25
+ var BusinessTypeProduct_1 = require("./BusinessTypeProduct");
25
26
  var Local = /** @class */ (function () {
26
27
  function Local() {
27
28
  }
@@ -151,6 +152,21 @@ var Local = /** @class */ (function () {
151
152
  }),
152
153
  __metadata("design:type", Array)
153
154
  ], Local.prototype, "users_favorite_local", void 0);
155
+ __decorate([
156
+ (0, typeorm_1.ManyToMany)(function () { return BusinessTypeProduct_1.BusinessTypeProduct; }),
157
+ (0, typeorm_1.JoinTable)({
158
+ name: 'business_type_product_local',
159
+ joinColumn: {
160
+ name: 'business_type_product',
161
+ referencedColumnName: 'id',
162
+ },
163
+ inverseJoinColumn: {
164
+ name: 'local',
165
+ referencedColumnName: 'id',
166
+ },
167
+ }),
168
+ __metadata("design:type", Array)
169
+ ], Local.prototype, "business_type_products", void 0);
154
170
  Local = __decorate([
155
171
  (0, typeorm_1.Entity)({ comment: 'Locales disponibles de las empresas (company).' })
156
172
  ], Local);
@@ -1,40 +1,41 @@
1
+ export { BusinessTypeProduct } from './entities/BusinessTypeProduct';
1
2
  export { Category } from './entities/Category';
2
3
  export { ScheduleCategory } from './entities/CategorySchedule';
3
4
  export { City } from './entities/City';
4
- export { Company } from './entities/Company';
5
- export { Country } from './entities/Country';
6
5
  export { CodeRedemptionHistoryCompany } from './entities/CodeRedemptionHistoryCompany';
7
- export { DiscountCodeUser } from './entities/DiscountCodeUser';
8
- export { Local } from './entities/Local';
9
- export { Partner } from './entities/Partner';
10
- export { PartnerRole } from './entities/PartnerRole';
11
6
  export { CodeRedemptionHistoryUser } from './entities/CodeRedemptionHistoryUser';
7
+ export { Company } from './entities/Company';
12
8
  export { Configuration } from './entities/Configuration';
9
+ export { Country } from './entities/Country';
13
10
  export { Day } from './entities/Day';
14
11
  export { DiscountCodeCompany } from './entities/DiscountCodeCompany';
12
+ export { DiscountCodeUser } from './entities/DiscountCodeUser';
13
+ export { Local } from './entities/Local';
15
14
  export { LocalQualification } from './entities/LocalQualification';
16
- export { Plan } from './entities/Plan';
17
- export { Product } from './entities/Product';
18
- export { ProductTopping } from './entities/ProductTopping';
19
- export { Region } from './entities/Region';
20
15
  export { Master } from './entities/Master';
21
- export { TypeFood } from './entities/TypeFood';
22
- export { User } from './entities/User';
23
16
  export { MasterPermission } from './entities/MasterPermission';
24
17
  export { MasterRole } from './entities/MasterRole';
18
+ export { Partner } from './entities/Partner';
19
+ export { PartnerNotification } from './entities/PartnerNotification';
25
20
  export { PartnerPermission } from './entities/PartnerPermission';
21
+ export { PartnerRole } from './entities/PartnerRole';
26
22
  export { PaymentMethod } from './entities/PaymentMethod';
27
- export { Terminal } from './entities/Terminal';
28
- export { TerminalSession } from './entities/TerminalSession';
23
+ export { Plan } from './entities/Plan';
24
+ export { Product } from './entities/Product';
29
25
  export { ProductGroup } from './entities/ProductGroup';
26
+ export { ProductGroupComplement } from './entities/productGroupComplement';
30
27
  export { ProductIngredient } from './entities/ProductIngredient';
28
+ export { ProductTopping } from './entities/ProductTopping';
29
+ export { Region } from './entities/Region';
31
30
  export { Request } from './entities/Request';
32
31
  export { RequestProduct } from './entities/RequestProduct';
33
32
  export { RequestProductGroupComplement } from './entities/RequestProductGroupComplement';
34
33
  export { RequestStatus } from './entities/RequestStatus';
35
34
  export { Square } from './entities/Square';
35
+ export { Terminal } from './entities/Terminal';
36
+ export { TerminalSession } from './entities/TerminalSession';
36
37
  export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient';
38
+ export { User } from './entities/User';
37
39
  export { UserAddress } from './entities/UserAddress';
38
- export { ProductGroupComplement } from './entities/productGroupComplement';
39
- export { PartnerNotification } from './entities/PartnerNotification';
40
40
  export { LocalsCompany } from './views/LocalsCompany';
41
+ export { BusinessType } from './entities/BusinessType';
@@ -1,66 +1,64 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalsCompany = exports.PartnerNotification = exports.ProductGroupComplement = exports.UserAddress = exports.TypeMeasureIngredient = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.ProductIngredient = exports.ProductGroup = exports.TerminalSession = exports.Terminal = exports.PaymentMethod = exports.PartnerPermission = exports.MasterRole = exports.MasterPermission = exports.User = exports.TypeFood = exports.Master = exports.Region = exports.ProductTopping = exports.Product = exports.Plan = exports.LocalQualification = exports.DiscountCodeCompany = exports.Day = exports.Configuration = exports.CodeRedemptionHistoryUser = exports.PartnerRole = exports.Partner = exports.Local = exports.DiscountCodeUser = exports.CodeRedemptionHistoryCompany = exports.Country = exports.Company = exports.City = exports.ScheduleCategory = exports.Category = void 0;
3
+ exports.BusinessType = exports.LocalsCompany = 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;
4
+ var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
5
+ Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
4
6
  var Category_1 = require("./entities/Category");
5
7
  Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return Category_1.Category; } });
6
8
  var CategorySchedule_1 = require("./entities/CategorySchedule");
7
9
  Object.defineProperty(exports, "ScheduleCategory", { enumerable: true, get: function () { return CategorySchedule_1.ScheduleCategory; } });
8
10
  var City_1 = require("./entities/City");
9
11
  Object.defineProperty(exports, "City", { enumerable: true, get: function () { return City_1.City; } });
10
- var Company_1 = require("./entities/Company");
11
- Object.defineProperty(exports, "Company", { enumerable: true, get: function () { return Company_1.Company; } });
12
- var Country_1 = require("./entities/Country");
13
- Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
14
12
  var CodeRedemptionHistoryCompany_1 = require("./entities/CodeRedemptionHistoryCompany");
15
13
  Object.defineProperty(exports, "CodeRedemptionHistoryCompany", { enumerable: true, get: function () { return CodeRedemptionHistoryCompany_1.CodeRedemptionHistoryCompany; } });
16
- var DiscountCodeUser_1 = require("./entities/DiscountCodeUser");
17
- Object.defineProperty(exports, "DiscountCodeUser", { enumerable: true, get: function () { return DiscountCodeUser_1.DiscountCodeUser; } });
18
- var Local_1 = require("./entities/Local");
19
- Object.defineProperty(exports, "Local", { enumerable: true, get: function () { return Local_1.Local; } });
20
- var Partner_1 = require("./entities/Partner");
21
- Object.defineProperty(exports, "Partner", { enumerable: true, get: function () { return Partner_1.Partner; } });
22
- var PartnerRole_1 = require("./entities/PartnerRole");
23
- Object.defineProperty(exports, "PartnerRole", { enumerable: true, get: function () { return PartnerRole_1.PartnerRole; } });
24
14
  var CodeRedemptionHistoryUser_1 = require("./entities/CodeRedemptionHistoryUser");
25
15
  Object.defineProperty(exports, "CodeRedemptionHistoryUser", { enumerable: true, get: function () { return CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser; } });
16
+ var Company_1 = require("./entities/Company");
17
+ Object.defineProperty(exports, "Company", { enumerable: true, get: function () { return Company_1.Company; } });
26
18
  var Configuration_1 = require("./entities/Configuration");
27
19
  Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return Configuration_1.Configuration; } });
20
+ var Country_1 = require("./entities/Country");
21
+ Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
28
22
  var Day_1 = require("./entities/Day");
29
23
  Object.defineProperty(exports, "Day", { enumerable: true, get: function () { return Day_1.Day; } });
30
24
  var DiscountCodeCompany_1 = require("./entities/DiscountCodeCompany");
31
25
  Object.defineProperty(exports, "DiscountCodeCompany", { enumerable: true, get: function () { return DiscountCodeCompany_1.DiscountCodeCompany; } });
26
+ var DiscountCodeUser_1 = require("./entities/DiscountCodeUser");
27
+ Object.defineProperty(exports, "DiscountCodeUser", { enumerable: true, get: function () { return DiscountCodeUser_1.DiscountCodeUser; } });
28
+ var Local_1 = require("./entities/Local");
29
+ Object.defineProperty(exports, "Local", { enumerable: true, get: function () { return Local_1.Local; } });
32
30
  var LocalQualification_1 = require("./entities/LocalQualification");
33
31
  Object.defineProperty(exports, "LocalQualification", { enumerable: true, get: function () { return LocalQualification_1.LocalQualification; } });
34
- var Plan_1 = require("./entities/Plan");
35
- Object.defineProperty(exports, "Plan", { enumerable: true, get: function () { return Plan_1.Plan; } });
36
- var Product_1 = require("./entities/Product");
37
- Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return Product_1.Product; } });
38
- var ProductTopping_1 = require("./entities/ProductTopping");
39
- Object.defineProperty(exports, "ProductTopping", { enumerable: true, get: function () { return ProductTopping_1.ProductTopping; } });
40
- var Region_1 = require("./entities/Region");
41
- Object.defineProperty(exports, "Region", { enumerable: true, get: function () { return Region_1.Region; } });
42
32
  var Master_1 = require("./entities/Master");
43
33
  Object.defineProperty(exports, "Master", { enumerable: true, get: function () { return Master_1.Master; } });
44
- var TypeFood_1 = require("./entities/TypeFood");
45
- Object.defineProperty(exports, "TypeFood", { enumerable: true, get: function () { return TypeFood_1.TypeFood; } });
46
- var User_1 = require("./entities/User");
47
- Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
48
34
  var MasterPermission_1 = require("./entities/MasterPermission");
49
35
  Object.defineProperty(exports, "MasterPermission", { enumerable: true, get: function () { return MasterPermission_1.MasterPermission; } });
50
36
  var MasterRole_1 = require("./entities/MasterRole");
51
37
  Object.defineProperty(exports, "MasterRole", { enumerable: true, get: function () { return MasterRole_1.MasterRole; } });
38
+ var Partner_1 = require("./entities/Partner");
39
+ Object.defineProperty(exports, "Partner", { enumerable: true, get: function () { return Partner_1.Partner; } });
40
+ var PartnerNotification_1 = require("./entities/PartnerNotification");
41
+ Object.defineProperty(exports, "PartnerNotification", { enumerable: true, get: function () { return PartnerNotification_1.PartnerNotification; } });
52
42
  var PartnerPermission_1 = require("./entities/PartnerPermission");
53
43
  Object.defineProperty(exports, "PartnerPermission", { enumerable: true, get: function () { return PartnerPermission_1.PartnerPermission; } });
44
+ var PartnerRole_1 = require("./entities/PartnerRole");
45
+ Object.defineProperty(exports, "PartnerRole", { enumerable: true, get: function () { return PartnerRole_1.PartnerRole; } });
54
46
  var PaymentMethod_1 = require("./entities/PaymentMethod");
55
47
  Object.defineProperty(exports, "PaymentMethod", { enumerable: true, get: function () { return PaymentMethod_1.PaymentMethod; } });
56
- var Terminal_1 = require("./entities/Terminal");
57
- Object.defineProperty(exports, "Terminal", { enumerable: true, get: function () { return Terminal_1.Terminal; } });
58
- var TerminalSession_1 = require("./entities/TerminalSession");
59
- Object.defineProperty(exports, "TerminalSession", { enumerable: true, get: function () { return TerminalSession_1.TerminalSession; } });
48
+ var Plan_1 = require("./entities/Plan");
49
+ Object.defineProperty(exports, "Plan", { enumerable: true, get: function () { return Plan_1.Plan; } });
50
+ var Product_1 = require("./entities/Product");
51
+ Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return Product_1.Product; } });
60
52
  var ProductGroup_1 = require("./entities/ProductGroup");
61
53
  Object.defineProperty(exports, "ProductGroup", { enumerable: true, get: function () { return ProductGroup_1.ProductGroup; } });
54
+ var productGroupComplement_1 = require("./entities/productGroupComplement");
55
+ Object.defineProperty(exports, "ProductGroupComplement", { enumerable: true, get: function () { return productGroupComplement_1.ProductGroupComplement; } });
62
56
  var ProductIngredient_1 = require("./entities/ProductIngredient");
63
57
  Object.defineProperty(exports, "ProductIngredient", { enumerable: true, get: function () { return ProductIngredient_1.ProductIngredient; } });
58
+ var ProductTopping_1 = require("./entities/ProductTopping");
59
+ Object.defineProperty(exports, "ProductTopping", { enumerable: true, get: function () { return ProductTopping_1.ProductTopping; } });
60
+ var Region_1 = require("./entities/Region");
61
+ Object.defineProperty(exports, "Region", { enumerable: true, get: function () { return Region_1.Region; } });
64
62
  var Request_1 = require("./entities/Request");
65
63
  Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return Request_1.Request; } });
66
64
  var RequestProduct_1 = require("./entities/RequestProduct");
@@ -71,13 +69,17 @@ var RequestStatus_1 = require("./entities/RequestStatus");
71
69
  Object.defineProperty(exports, "RequestStatus", { enumerable: true, get: function () { return RequestStatus_1.RequestStatus; } });
72
70
  var Square_1 = require("./entities/Square");
73
71
  Object.defineProperty(exports, "Square", { enumerable: true, get: function () { return Square_1.Square; } });
72
+ var Terminal_1 = require("./entities/Terminal");
73
+ Object.defineProperty(exports, "Terminal", { enumerable: true, get: function () { return Terminal_1.Terminal; } });
74
+ var TerminalSession_1 = require("./entities/TerminalSession");
75
+ Object.defineProperty(exports, "TerminalSession", { enumerable: true, get: function () { return TerminalSession_1.TerminalSession; } });
74
76
  var TypeMeasureIngredient_1 = require("./entities/TypeMeasureIngredient");
75
77
  Object.defineProperty(exports, "TypeMeasureIngredient", { enumerable: true, get: function () { return TypeMeasureIngredient_1.TypeMeasureIngredient; } });
78
+ var User_1 = require("./entities/User");
79
+ Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
76
80
  var UserAddress_1 = require("./entities/UserAddress");
77
81
  Object.defineProperty(exports, "UserAddress", { enumerable: true, get: function () { return UserAddress_1.UserAddress; } });
78
- var productGroupComplement_1 = require("./entities/productGroupComplement");
79
- Object.defineProperty(exports, "ProductGroupComplement", { enumerable: true, get: function () { return productGroupComplement_1.ProductGroupComplement; } });
80
- var PartnerNotification_1 = require("./entities/PartnerNotification");
81
- Object.defineProperty(exports, "PartnerNotification", { enumerable: true, get: function () { return PartnerNotification_1.PartnerNotification; } });
82
82
  var LocalsCompany_1 = require("./views/LocalsCompany");
83
83
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
84
+ var BusinessType_1 = require("./entities/BusinessType");
85
+ Object.defineProperty(exports, "BusinessType", { enumerable: true, get: function () { return BusinessType_1.BusinessType; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.0.9",
3
+ "version": "2.1.0",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,35 @@
1
+ import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
2
+ import { Region } from './Region'
3
+ import { BusinessTypeProduct } from './BusinessTypeProduct'
4
+
5
+ @Entity({
6
+ name: 'business_type',
7
+ comment:
8
+ 'Almacenar los tipos de negocio qué se van a poder agregar en asumano.',
9
+ })
10
+ export class BusinessType {
11
+ @PrimaryGeneratedColumn({
12
+ comment: 'Número de identificación (ID) único de cada registro.',
13
+ })
14
+ id: number
15
+
16
+ @Column({ length: 50, comment: 'Nombre del tipo de negocio.' })
17
+ name: string
18
+
19
+ @Column({
20
+ type: 'json',
21
+ nullable: true,
22
+ comment: 'Descripción del tipo de negocio.',
23
+ })
24
+ description: string
25
+
26
+ @Column({
27
+ default: 1,
28
+ comment:
29
+ 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
30
+ })
31
+ status: number
32
+
33
+ @OneToMany(() => BusinessTypeProduct, (businessTypeProduct) => businessTypeProduct.business_type)
34
+ businessTypesProduct: BusinessTypeProduct[]
35
+ }
@@ -1,21 +1,36 @@
1
1
  import {
2
2
  Column,
3
3
  Entity,
4
+ JoinColumn,
4
5
  JoinTable,
5
6
  ManyToMany,
7
+ ManyToOne,
6
8
  PrimaryGeneratedColumn,
7
9
  } from 'typeorm'
8
- import { Company } from './Company'
10
+ import { Local } from '..'
11
+ import { BusinessType } from './BusinessType'
9
12
 
10
- @Entity('type_food', {
11
- comment: 'Tipo de comida que va a tener la plataforma.',
13
+ @Entity('business_type_product', {
14
+ comment:
15
+ 'Tabla para agregar los productos qué el local va tener por el tipo de negocio.',
12
16
  })
13
- export class TypeFood {
17
+ export class BusinessTypeProduct {
14
18
  @PrimaryGeneratedColumn({
15
19
  comment: 'Número de identificación (ID) único de cada registro.',
16
20
  })
17
21
  id: number
18
22
 
23
+ @ManyToOne(
24
+ () => BusinessType,
25
+ (businessType) => businessType.businessTypesProduct,
26
+ {
27
+ onDelete: 'RESTRICT',
28
+ onUpdate: 'NO ACTION',
29
+ }
30
+ )
31
+ @JoinColumn({ name: 'business_type' })
32
+ business_type: BusinessType
33
+
19
34
  @Column({
20
35
  length: 40,
21
36
  comment:
@@ -37,17 +52,17 @@ export class TypeFood {
37
52
  })
38
53
  status: number
39
54
 
40
- @ManyToMany(() => Company)
55
+ @ManyToMany(() => Local)
41
56
  @JoinTable({
42
- name: 'type_food_company',
57
+ name: 'business_type_product_local',
43
58
  joinColumn: {
44
- name: 'company',
59
+ name: 'local',
45
60
  referencedColumnName: 'id',
46
61
  },
47
62
  inverseJoinColumn: {
48
- name: 'type_food',
63
+ name: 'business_type_product',
49
64
  referencedColumnName: 'id',
50
65
  },
51
66
  })
52
- companies: Company[]
67
+ business_type_products: Local[]
53
68
  }
@@ -2,8 +2,6 @@ import {
2
2
  Column,
3
3
  Entity,
4
4
  JoinColumn,
5
- JoinTable,
6
- ManyToMany,
7
5
  ManyToOne,
8
6
  OneToMany,
9
7
  PrimaryGeneratedColumn,
@@ -12,12 +10,10 @@ import { City } from './City'
12
10
  import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany'
13
11
  import { DiscountCodeUser } from './DiscountCodeUser'
14
12
  import { Local } from './Local'
15
- import { Plan } from './Plan'
16
- import { ProductTopping } from './ProductTopping'
17
- import { TypeFood } from './TypeFood'
18
- import { User } from './User'
19
13
  import { Partner } from './Partner'
20
14
  import { PartnerRole } from './PartnerRole'
15
+ import { Plan } from './Plan'
16
+ import { ProductTopping } from './ProductTopping'
21
17
 
22
18
  @Entity({
23
19
  comment:
@@ -114,12 +110,6 @@ export class Company {
114
110
  })
115
111
  status: number
116
112
 
117
- @ManyToMany(() => TypeFood, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' })
118
- @JoinTable({
119
- name: 'type_food_company',
120
- })
121
- types_food: TypeFood[]
122
-
123
113
  @OneToMany(() => Local, (local) => local.company)
124
114
  locals: Local[]
125
115
 
@@ -19,6 +19,7 @@ import { Square } from './Square'
19
19
  import { Terminal } from './Terminal'
20
20
  import { User } from './User'
21
21
  import { Partner } from './Partner'
22
+ import { BusinessTypeProduct } from './BusinessTypeProduct'
22
23
 
23
24
  @Entity({ comment: 'Locales disponibles de las empresas (company).' })
24
25
  export class Local {
@@ -131,4 +132,18 @@ export class Local {
131
132
  name: 'user_favorite_local',
132
133
  })
133
134
  users_favorite_local: User[]
135
+
136
+ @ManyToMany(() => BusinessTypeProduct)
137
+ @JoinTable({
138
+ name: 'business_type_product_local',
139
+ joinColumn: {
140
+ name: 'business_type_product',
141
+ referencedColumnName: 'id',
142
+ },
143
+ inverseJoinColumn: {
144
+ name: 'local',
145
+ referencedColumnName: 'id',
146
+ },
147
+ })
148
+ business_type_products: BusinessTypeProduct[]
134
149
  }
@@ -1,40 +1,41 @@
1
+ export { BusinessTypeProduct } from './entities/BusinessTypeProduct'
1
2
  export { Category } from './entities/Category'
2
3
  export { ScheduleCategory } from './entities/CategorySchedule'
3
4
  export { City } from './entities/City'
4
- export { Company } from './entities/Company'
5
- export { Country } from './entities/Country'
6
5
  export { CodeRedemptionHistoryCompany } from './entities/CodeRedemptionHistoryCompany'
7
- export { DiscountCodeUser } from './entities/DiscountCodeUser'
8
- export { Local } from './entities/Local'
9
- export { Partner } from './entities/Partner'
10
- export { PartnerRole } from './entities/PartnerRole'
11
6
  export { CodeRedemptionHistoryUser } from './entities/CodeRedemptionHistoryUser'
7
+ export { Company } from './entities/Company'
12
8
  export { Configuration } from './entities/Configuration'
9
+ export { Country } from './entities/Country'
13
10
  export { Day } from './entities/Day'
14
11
  export { DiscountCodeCompany } from './entities/DiscountCodeCompany'
12
+ export { DiscountCodeUser } from './entities/DiscountCodeUser'
13
+ export { Local } from './entities/Local'
15
14
  export { LocalQualification } from './entities/LocalQualification'
16
- export { Plan } from './entities/Plan'
17
- export { Product } from './entities/Product'
18
- export { ProductTopping } from './entities/ProductTopping'
19
- export { Region } from './entities/Region'
20
15
  export { Master } from './entities/Master'
21
- export { TypeFood } from './entities/TypeFood'
22
- export { User } from './entities/User'
23
16
  export { MasterPermission } from './entities/MasterPermission'
24
17
  export { MasterRole } from './entities/MasterRole'
18
+ export { Partner } from './entities/Partner'
19
+ export { PartnerNotification } from './entities/PartnerNotification'
25
20
  export { PartnerPermission } from './entities/PartnerPermission'
21
+ export { PartnerRole } from './entities/PartnerRole'
26
22
  export { PaymentMethod } from './entities/PaymentMethod'
27
- export { Terminal } from './entities/Terminal'
28
- export { TerminalSession } from './entities/TerminalSession'
23
+ export { Plan } from './entities/Plan'
24
+ export { Product } from './entities/Product'
29
25
  export { ProductGroup } from './entities/ProductGroup'
26
+ export { ProductGroupComplement } from './entities/productGroupComplement'
30
27
  export { ProductIngredient } from './entities/ProductIngredient'
28
+ export { ProductTopping } from './entities/ProductTopping'
29
+ export { Region } from './entities/Region'
31
30
  export { Request } from './entities/Request'
32
31
  export { RequestProduct } from './entities/RequestProduct'
33
32
  export { RequestProductGroupComplement } from './entities/RequestProductGroupComplement'
34
33
  export { RequestStatus } from './entities/RequestStatus'
35
34
  export { Square } from './entities/Square'
35
+ export { Terminal } from './entities/Terminal'
36
+ export { TerminalSession } from './entities/TerminalSession'
36
37
  export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient'
38
+ export { User } from './entities/User'
37
39
  export { UserAddress } from './entities/UserAddress'
38
- export { ProductGroupComplement } from './entities/productGroupComplement'
39
- export { PartnerNotification } from './entities/PartnerNotification'
40
40
  export { LocalsCompany } from './views/LocalsCompany'
41
+ export { BusinessType } from './entities/BusinessType'