test-entity-library-asm 1.1.9 → 1.2.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.
- package/dist/entities/Category.d.ts +5 -3
- package/dist/entities/Category.js +38 -13
- package/dist/entities/CategorySchedule.d.ts +10 -0
- package/dist/entities/CategorySchedule.js +67 -0
- package/dist/entities/City.d.ts +3 -2
- package/dist/entities/City.js +35 -10
- package/dist/entities/CodeRedemptionHistoryCompany.d.ts +4 -3
- package/dist/entities/CodeRedemptionHistoryCompany.js +31 -10
- package/dist/entities/CodeRedemptionHistoryUser.js +13 -6
- package/dist/entities/Company.d.ts +2 -1
- package/dist/entities/Company.js +64 -18
- package/dist/entities/Configuration.d.ts +2 -1
- package/dist/entities/Configuration.js +26 -4
- package/dist/entities/Country.d.ts +2 -1
- package/dist/entities/Country.js +33 -11
- package/dist/entities/Day.d.ts +2 -1
- package/dist/entities/Day.js +31 -6
- package/dist/entities/DiscountCodeCompany.d.ts +2 -1
- package/dist/entities/DiscountCodeCompany.js +42 -12
- package/dist/entities/DiscountCodeUser.js +24 -13
- package/dist/entities/Local.d.ts +14 -2
- package/dist/entities/Local.js +73 -13
- package/dist/entities/LocalQualification.d.ts +10 -0
- package/dist/entities/LocalQualification.js +76 -0
- package/dist/entities/Master.d.ts +2 -1
- package/dist/entities/Master.js +26 -4
- package/dist/entities/PaymentMethod.d.ts +13 -0
- package/dist/entities/PaymentMethod.js +102 -0
- package/dist/entities/Permission.d.ts +2 -1
- package/dist/entities/Permission.js +32 -8
- package/dist/entities/Plan.d.ts +2 -1
- package/dist/entities/Plan.js +38 -10
- package/dist/entities/Product.d.ts +8 -1
- package/dist/entities/Product.js +62 -12
- package/dist/entities/ProductGroup.js +16 -8
- package/dist/entities/ProductIngredient.d.ts +12 -0
- package/dist/entities/ProductIngredient.js +84 -0
- package/dist/entities/ProductTopping.d.ts +2 -1
- package/dist/entities/ProductTopping.js +33 -7
- package/dist/entities/Region.d.ts +3 -2
- package/dist/entities/Region.js +40 -10
- package/dist/entities/Request.d.ts +21 -0
- package/dist/entities/Request.js +137 -0
- package/dist/entities/RequestProduct.d.ts +12 -0
- package/dist/entities/RequestProduct.js +85 -0
- package/dist/entities/RequestProductGroupComplement.d.ts +11 -0
- package/dist/entities/RequestProductGroupComplement.js +80 -0
- package/dist/entities/RequestStatus.d.ts +11 -0
- package/dist/entities/RequestStatus.js +85 -0
- package/dist/entities/Role.js +11 -4
- package/dist/entities/RoleVisibleTo.d.ts +2 -1
- package/dist/entities/RoleVisibleTo.js +30 -5
- package/dist/entities/Square.d.ts +13 -0
- package/dist/entities/Square.js +97 -0
- package/dist/entities/Terminal.d.ts +2 -0
- package/dist/entities/Terminal.js +21 -4
- package/dist/entities/TerminalSession.d.ts +3 -2
- package/dist/entities/TerminalSession.js +41 -8
- package/dist/entities/TypeFood.d.ts +2 -1
- package/dist/entities/TypeFood.js +33 -6
- package/dist/entities/TypeMeasureIngredient.d.ts +9 -0
- package/dist/entities/TypeMeasureIngredient.js +73 -0
- package/dist/entities/User.d.ts +17 -7
- package/dist/entities/User.js +104 -25
- package/dist/entities/productGroupComplement.d.ts +4 -1
- package/dist/entities/productGroupComplement.js +35 -8
- package/package.json +1 -1
- package/src/entities/Category.ts +33 -15
- package/src/entities/CategorySchedule.ts +35 -0
- package/src/entities/City.ts +18 -8
- package/src/entities/CodeRedemptionHistoryCompany.ts +17 -9
- package/src/entities/CodeRedemptionHistoryUser.ts +15 -6
- package/src/entities/Company.ts +51 -17
- package/src/entities/Configuration.ts +10 -4
- package/src/entities/Country.ts +23 -11
- package/src/entities/Day.ts +16 -6
- package/src/entities/DiscountCodeCompany.ts +26 -11
- package/src/entities/DiscountCodeUser.ts +25 -12
- package/src/entities/Local.ts +54 -12
- package/src/entities/LocalQualification.ts +45 -0
- package/src/entities/Master.ts +17 -4
- package/src/entities/PaymentMethod.ts +72 -0
- package/src/entities/Permission.ts +16 -7
- package/src/entities/Plan.ts +22 -9
- package/src/entities/Product.ts +47 -11
- package/src/entities/ProductGroup.ts +18 -8
- package/src/entities/ProductIngredient.ts +55 -0
- package/src/entities/ProductTopping.ts +17 -6
- package/src/entities/Region.ts +24 -8
- package/src/entities/Request.ts +107 -0
- package/src/entities/RequestProduct.ts +51 -0
- package/src/entities/RequestProductGroupComplement.ts +55 -0
- package/src/entities/RequestStatus.ts +55 -0
- package/src/entities/Role.ts +12 -4
- package/src/entities/RoleVisibleTo.ts +13 -4
- package/src/entities/Square.ts +56 -0
- package/src/entities/Terminal.ts +24 -4
- package/src/entities/TerminalSession.ts +28 -10
- package/src/entities/TypeFood.ts +18 -5
- package/src/entities/TypeMeasureIngredient.ts +46 -0
- package/src/entities/User.ts +93 -28
- package/src/entities/productGroupComplement.ts +23 -7
- package/src/entities/ScheduleCategory.ts +0 -32
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ProductIngredient = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var Product_1 = require("./Product");
|
|
30
|
+
var TypeMeasureIngredient_1 = require("./TypeMeasureIngredient");
|
|
31
|
+
var ProductIngredient = /** @class */ (function (_super) {
|
|
32
|
+
__extends(ProductIngredient, _super);
|
|
33
|
+
function ProductIngredient() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
}
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
38
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ProductIngredient.prototype, "id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)(function () { return Product_1.Product; }, function (product) { return product.product_ingredients; }, {
|
|
44
|
+
onDelete: 'CASCADE',
|
|
45
|
+
onUpdate: 'NO ACTION',
|
|
46
|
+
}),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: 'product' }),
|
|
48
|
+
__metadata("design:type", Product_1.Product)
|
|
49
|
+
], ProductIngredient.prototype, "product", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ length: 30, comment: 'Nombre del ingrediente.' }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], ProductIngredient.prototype, "name", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(function () { return TypeMeasureIngredient_1.TypeMeasureIngredient; }, function (typeMeasureIngredient) { return typeMeasureIngredient.type_measure_ingredients; }, {
|
|
56
|
+
onDelete: 'CASCADE',
|
|
57
|
+
onUpdate: 'NO ACTION',
|
|
58
|
+
}),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: 'type_measure_ingredient' }),
|
|
60
|
+
__metadata("design:type", TypeMeasureIngredient_1.TypeMeasureIngredient)
|
|
61
|
+
], ProductIngredient.prototype, "type_measure_ingredient", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ comment: 'Cantidad del ingrediente.' }),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], ProductIngredient.prototype, "quantity", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], ProductIngredient.prototype, "created", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({
|
|
72
|
+
default: 1,
|
|
73
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en los reportes de inventario.\r\n0. Inactivo: No será visible en los reportes de inventario.',
|
|
74
|
+
}),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], ProductIngredient.prototype, "status", void 0);
|
|
77
|
+
ProductIngredient = __decorate([
|
|
78
|
+
(0, typeorm_1.Entity)('product_ingredient', {
|
|
79
|
+
comment: 'Ingredientes que tendrá un producto específico. Esto se hace para guardar la información del inventario que se tiene y el que se gasta diario, esto genera un reporte donde el cliente puede ver qué cosas fueron usadas.',
|
|
80
|
+
})
|
|
81
|
+
], ProductIngredient);
|
|
82
|
+
return ProductIngredient;
|
|
83
|
+
}(typeorm_1.BaseEntity));
|
|
84
|
+
exports.ProductIngredient = ProductIngredient;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
1
2
|
import { Company } from './Company';
|
|
2
3
|
import { ProductGroup } from './ProductGroup';
|
|
3
|
-
export declare class ProductTopping {
|
|
4
|
+
export declare class ProductTopping extends BaseEntity {
|
|
4
5
|
id: number;
|
|
5
6
|
company: Company;
|
|
6
7
|
name: string;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13,27 +28,38 @@ exports.ProductTopping = void 0;
|
|
|
13
28
|
var typeorm_1 = require("typeorm");
|
|
14
29
|
var Company_1 = require("./Company");
|
|
15
30
|
var ProductGroup_1 = require("./ProductGroup");
|
|
16
|
-
var ProductTopping = /** @class */ (function () {
|
|
31
|
+
var ProductTopping = /** @class */ (function (_super) {
|
|
32
|
+
__extends(ProductTopping, _super);
|
|
17
33
|
function ProductTopping() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
35
|
}
|
|
19
36
|
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
38
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
39
|
+
}),
|
|
21
40
|
__metadata("design:type", Number)
|
|
22
41
|
], ProductTopping.prototype, "id", void 0);
|
|
23
42
|
__decorate([
|
|
24
|
-
(0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.product_toppings; }
|
|
43
|
+
(0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.product_toppings; }, {
|
|
44
|
+
nullable: true,
|
|
45
|
+
onDelete: 'CASCADE',
|
|
46
|
+
onUpdate: 'NO ACTION',
|
|
47
|
+
}),
|
|
25
48
|
(0, typeorm_1.JoinColumn)({ name: 'company' }),
|
|
26
49
|
__metadata("design:type", Company_1.Company)
|
|
27
50
|
], ProductTopping.prototype, "company", void 0);
|
|
28
51
|
__decorate([
|
|
29
52
|
(0, typeorm_1.Column)({
|
|
30
53
|
length: 50,
|
|
31
|
-
comment: 'El
|
|
54
|
+
comment: 'El `name` se refiere al id de los archivos de lenguaje que está en `locales` del proyecto. \n\nEsto se hace para qué sirva el multilenguaje en el proyecto. \n\nCabe recalcar qué las empresas pueden crear sus propios toppings, entonces no pasa nada el lenguaje en el que ellos lo escriban.',
|
|
32
55
|
}),
|
|
33
56
|
__metadata("design:type", String)
|
|
34
57
|
], ProductTopping.prototype, "name", void 0);
|
|
35
58
|
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
default: 1,
|
|
61
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en los reportes de inventario.\r\n0. Inactivo: No será visible en los reportes de inventario.',
|
|
62
|
+
}),
|
|
37
63
|
__metadata("design:type", Number)
|
|
38
64
|
], ProductTopping.prototype, "status", void 0);
|
|
39
65
|
__decorate([
|
|
@@ -42,9 +68,9 @@ var ProductTopping = /** @class */ (function () {
|
|
|
42
68
|
], ProductTopping.prototype, "product_groups", void 0);
|
|
43
69
|
ProductTopping = __decorate([
|
|
44
70
|
(0, typeorm_1.Entity)('product_topping', {
|
|
45
|
-
comment: 'Tabla
|
|
71
|
+
comment: 'Tabla donde habrán varios toppings por defecto para que el usuario los pueda agregar a sus productos y editarlos a su gusto.\r\n\r\nUn administrador/usuario con permisos podrá crear los toppings para cada empresa si es necesario.',
|
|
46
72
|
})
|
|
47
73
|
], ProductTopping);
|
|
48
74
|
return ProductTopping;
|
|
49
|
-
}());
|
|
75
|
+
}(typeorm_1.BaseEntity));
|
|
50
76
|
exports.ProductTopping = ProductTopping;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
1
2
|
import { Country } from './Country';
|
|
2
3
|
import { City } from './City';
|
|
3
|
-
export declare class Region {
|
|
4
|
+
export declare class Region extends BaseEntity {
|
|
4
5
|
id: number;
|
|
5
|
-
name: string;
|
|
6
6
|
country: Country;
|
|
7
|
+
name: string;
|
|
7
8
|
status: number;
|
|
8
9
|
cities: City[];
|
|
9
10
|
}
|
package/dist/entities/Region.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13,24 +28,37 @@ exports.Region = void 0;
|
|
|
13
28
|
var typeorm_1 = require("typeorm");
|
|
14
29
|
var Country_1 = require("./Country");
|
|
15
30
|
var City_1 = require("./City");
|
|
16
|
-
var Region = /** @class */ (function () {
|
|
31
|
+
var Region = /** @class */ (function (_super) {
|
|
32
|
+
__extends(Region, _super);
|
|
17
33
|
function Region() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
35
|
}
|
|
19
36
|
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
38
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
39
|
+
}),
|
|
21
40
|
__metadata("design:type", Number)
|
|
22
41
|
], Region.prototype, "id", void 0);
|
|
23
42
|
__decorate([
|
|
24
|
-
(0, typeorm_1.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(0, typeorm_1.ManyToOne)(function () { return Country_1.Country; }, function (country) { return country.regions; }),
|
|
43
|
+
(0, typeorm_1.ManyToOne)(function () { return Country_1.Country; }, function (country) { return country.regions; }, {
|
|
44
|
+
onDelete: 'RESTRICT',
|
|
45
|
+
onUpdate: 'NO ACTION',
|
|
46
|
+
}),
|
|
29
47
|
(0, typeorm_1.JoinColumn)({ name: 'country' }),
|
|
30
48
|
__metadata("design:type", Country_1.Country)
|
|
31
49
|
], Region.prototype, "country", void 0);
|
|
32
50
|
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)({
|
|
51
|
+
(0, typeorm_1.Column)({
|
|
52
|
+
length: 50,
|
|
53
|
+
comment: 'Nombre de la región/departamento/estado.\r\n\r\nID/KEY de la variable que se encuentra en los archivos `locales` para el multilenguaje.',
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Region.prototype, "name", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({
|
|
59
|
+
default: 1,
|
|
60
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
61
|
+
}),
|
|
34
62
|
__metadata("design:type", Number)
|
|
35
63
|
], Region.prototype, "status", void 0);
|
|
36
64
|
__decorate([
|
|
@@ -38,8 +66,10 @@ var Region = /** @class */ (function () {
|
|
|
38
66
|
__metadata("design:type", Array)
|
|
39
67
|
], Region.prototype, "cities", void 0);
|
|
40
68
|
Region = __decorate([
|
|
41
|
-
(0, typeorm_1.Entity)(
|
|
69
|
+
(0, typeorm_1.Entity)({
|
|
70
|
+
comment: 'Regiones/departamentos donde estará visible la plataforma.',
|
|
71
|
+
})
|
|
42
72
|
], Region);
|
|
43
73
|
return Region;
|
|
44
|
-
}());
|
|
74
|
+
}(typeorm_1.BaseEntity));
|
|
45
75
|
exports.Region = Region;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Local } from './Local';
|
|
3
|
+
import { PaymentMethod } from './PaymentMethod';
|
|
4
|
+
import { RequestStatus } from './RequestStatus';
|
|
5
|
+
import { User } from './User';
|
|
6
|
+
import { RequestProduct } from './RequestProduct';
|
|
7
|
+
import { RequestProductGroupComplement } from './RequestProductGroupComplement';
|
|
8
|
+
export declare class Request extends BaseEntity {
|
|
9
|
+
id: number;
|
|
10
|
+
user: User;
|
|
11
|
+
local: Local;
|
|
12
|
+
order_type: number;
|
|
13
|
+
payment_method: PaymentMethod;
|
|
14
|
+
order_cost: string;
|
|
15
|
+
status: RequestStatus;
|
|
16
|
+
details: string;
|
|
17
|
+
comments: string;
|
|
18
|
+
requests_group: User[];
|
|
19
|
+
request_products: RequestProduct[];
|
|
20
|
+
request_product_group_complements: RequestProductGroupComplement[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.Request = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var Local_1 = require("./Local");
|
|
30
|
+
var PaymentMethod_1 = require("./PaymentMethod");
|
|
31
|
+
var RequestStatus_1 = require("./RequestStatus");
|
|
32
|
+
var User_1 = require("./User");
|
|
33
|
+
var RequestProduct_1 = require("./RequestProduct");
|
|
34
|
+
var RequestProductGroupComplement_1 = require("./RequestProductGroupComplement");
|
|
35
|
+
var Request = /** @class */ (function (_super) {
|
|
36
|
+
__extends(Request, _super);
|
|
37
|
+
function Request() {
|
|
38
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
39
|
+
}
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
42
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Request.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.requests; }, {
|
|
48
|
+
nullable: true,
|
|
49
|
+
onDelete: 'SET NULL',
|
|
50
|
+
onUpdate: 'NO ACTION',
|
|
51
|
+
}),
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: 'user' }),
|
|
53
|
+
__metadata("design:type", User_1.User)
|
|
54
|
+
], Request.prototype, "user", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.requests; }, {
|
|
57
|
+
onDelete: 'CASCADE',
|
|
58
|
+
onUpdate: 'NO ACTION',
|
|
59
|
+
}),
|
|
60
|
+
(0, typeorm_1.JoinColumn)({ name: 'local' }),
|
|
61
|
+
__metadata("design:type", Local_1.Local)
|
|
62
|
+
], Request.prototype, "local", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
default: 1,
|
|
66
|
+
comment: 'Este campo hace referencia a si el tipo es:\r\n\r\n1. Individual: Un solo usuario ordena y paga.\r\n\r\n2. Grupal: El usuario principal puede agregar a otros colaboradores para realizar un pedido grupal (a tener en cuenta que el usuario principal es el único que puede realizar el pago del pedido).',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], Request.prototype, "order_type", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(function () { return PaymentMethod_1.PaymentMethod; }, function (paymentMethod) { return paymentMethod.requests; }, {
|
|
72
|
+
onDelete: 'RESTRICT',
|
|
73
|
+
onUpdate: 'NO ACTION',
|
|
74
|
+
}),
|
|
75
|
+
(0, typeorm_1.JoinColumn)({ name: 'payment_method' }),
|
|
76
|
+
__metadata("design:type", PaymentMethod_1.PaymentMethod)
|
|
77
|
+
], Request.prototype, "payment_method", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
length: 30,
|
|
81
|
+
comment: 'Costo total del pedido, aquí toca tener en cuenta los productos (request_product) que se agreguen al pedido (request) y los complementos (request_product_group_complement).',
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], Request.prototype, "order_cost", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.ManyToOne)(function () { return RequestStatus_1.RequestStatus; }, function (requestStatus) { return requestStatus.requests; }, {
|
|
87
|
+
onDelete: 'RESTRICT',
|
|
88
|
+
onUpdate: 'NO ACTION',
|
|
89
|
+
}),
|
|
90
|
+
(0, typeorm_1.JoinColumn)({ name: 'status' }),
|
|
91
|
+
__metadata("design:type", RequestStatus_1.RequestStatus)
|
|
92
|
+
], Request.prototype, "status", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({
|
|
95
|
+
length: 400,
|
|
96
|
+
comment: 'Los detalles que el usuario agrega al pedido, puede ser alguna sugerencia u otra cosa.',
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], Request.prototype, "details", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({
|
|
102
|
+
length: 400,
|
|
103
|
+
comment: 'Comentarios del pedido, este los realiza el cliente (local).',
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], Request.prototype, "comments", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.ManyToMany)(function () { return User_1.User; }),
|
|
109
|
+
(0, typeorm_1.JoinTable)({
|
|
110
|
+
name: 'request_group',
|
|
111
|
+
joinColumn: {
|
|
112
|
+
name: 'user',
|
|
113
|
+
referencedColumnName: 'id',
|
|
114
|
+
},
|
|
115
|
+
inverseJoinColumn: {
|
|
116
|
+
name: 'request',
|
|
117
|
+
referencedColumnName: 'id',
|
|
118
|
+
},
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", Array)
|
|
121
|
+
], Request.prototype, "requests_group", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.OneToMany)(function () { return RequestProduct_1.RequestProduct; }, function (requestProduct) { return requestProduct.request; }),
|
|
124
|
+
__metadata("design:type", Array)
|
|
125
|
+
], Request.prototype, "request_products", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.OneToMany)(function () { return RequestProductGroupComplement_1.RequestProductGroupComplement; }, function (requestProduct) { return requestProduct.request; }),
|
|
128
|
+
__metadata("design:type", Array)
|
|
129
|
+
], Request.prototype, "request_product_group_complements", void 0);
|
|
130
|
+
Request = __decorate([
|
|
131
|
+
(0, typeorm_1.Entity)({
|
|
132
|
+
comment: 'Tabla para agregar los pedidos realizados a través de la plataforma.',
|
|
133
|
+
})
|
|
134
|
+
], Request);
|
|
135
|
+
return Request;
|
|
136
|
+
}(typeorm_1.BaseEntity));
|
|
137
|
+
exports.Request = Request;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Product } from './Product';
|
|
3
|
+
import { Request } from './Request';
|
|
4
|
+
import { User } from './User';
|
|
5
|
+
export declare class RequestProduct extends BaseEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
request: Request;
|
|
8
|
+
product: Product;
|
|
9
|
+
user: User;
|
|
10
|
+
quantity: number;
|
|
11
|
+
comments: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.RequestProduct = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var Product_1 = require("./Product");
|
|
30
|
+
var Request_1 = require("./Request");
|
|
31
|
+
var User_1 = require("./User");
|
|
32
|
+
var RequestProduct = /** @class */ (function (_super) {
|
|
33
|
+
__extends(RequestProduct, _super);
|
|
34
|
+
function RequestProduct() {
|
|
35
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
39
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], RequestProduct.prototype, "id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(function () { return Request_1.Request; }, function (request) { return request.request_products; }, {
|
|
45
|
+
onDelete: 'CASCADE',
|
|
46
|
+
onUpdate: 'NO ACTION',
|
|
47
|
+
}),
|
|
48
|
+
(0, typeorm_1.JoinColumn)({ name: 'request' }),
|
|
49
|
+
__metadata("design:type", Request_1.Request)
|
|
50
|
+
], RequestProduct.prototype, "request", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.ManyToOne)(function () { return Product_1.Product; }, function (product) { return product.request_products; }, {
|
|
53
|
+
onDelete: 'CASCADE',
|
|
54
|
+
onUpdate: 'NO ACTION',
|
|
55
|
+
}),
|
|
56
|
+
(0, typeorm_1.JoinColumn)({ name: 'product' }),
|
|
57
|
+
__metadata("design:type", Product_1.Product)
|
|
58
|
+
], RequestProduct.prototype, "product", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.request_products; }, {
|
|
61
|
+
onDelete: 'CASCADE',
|
|
62
|
+
onUpdate: 'NO ACTION',
|
|
63
|
+
}),
|
|
64
|
+
(0, typeorm_1.JoinColumn)({ name: 'user' }),
|
|
65
|
+
__metadata("design:type", User_1.User)
|
|
66
|
+
], RequestProduct.prototype, "user", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ comment: 'Cantidad del producto (product).' }),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], RequestProduct.prototype, "quantity", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({
|
|
73
|
+
length: 30,
|
|
74
|
+
comment: 'Comentarios del producto, si hay alguna sugerencia o solicitud.',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], RequestProduct.prototype, "comments", void 0);
|
|
78
|
+
RequestProduct = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)('request_product', {
|
|
80
|
+
comment: 'Productos que están en el pedido.',
|
|
81
|
+
})
|
|
82
|
+
], RequestProduct);
|
|
83
|
+
return RequestProduct;
|
|
84
|
+
}(typeorm_1.BaseEntity));
|
|
85
|
+
exports.RequestProduct = RequestProduct;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Request } from './Request';
|
|
3
|
+
import { User } from './User';
|
|
4
|
+
import { ProductGroupComplement } from './productGroupComplement';
|
|
5
|
+
export declare class RequestProductGroupComplement extends BaseEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
request: Request;
|
|
8
|
+
product_group_complement: ProductGroupComplement;
|
|
9
|
+
user: User;
|
|
10
|
+
quantity: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.RequestProductGroupComplement = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var Request_1 = require("./Request");
|
|
30
|
+
var User_1 = require("./User");
|
|
31
|
+
var productGroupComplement_1 = require("./productGroupComplement");
|
|
32
|
+
var RequestProductGroupComplement = /** @class */ (function (_super) {
|
|
33
|
+
__extends(RequestProductGroupComplement, _super);
|
|
34
|
+
function RequestProductGroupComplement() {
|
|
35
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
39
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], RequestProductGroupComplement.prototype, "id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(function () { return Request_1.Request; }, function (request) { return request.request_product_group_complements; }, {
|
|
45
|
+
onDelete: 'CASCADE',
|
|
46
|
+
onUpdate: 'NO ACTION',
|
|
47
|
+
}),
|
|
48
|
+
(0, typeorm_1.JoinColumn)({ name: 'request' }),
|
|
49
|
+
__metadata("design:type", Request_1.Request)
|
|
50
|
+
], RequestProductGroupComplement.prototype, "request", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.ManyToOne)(function () { return productGroupComplement_1.ProductGroupComplement; }, function (productGroupComplement) {
|
|
53
|
+
return productGroupComplement.request_product_group_complements;
|
|
54
|
+
}, {
|
|
55
|
+
onDelete: 'CASCADE',
|
|
56
|
+
onUpdate: 'NO ACTION',
|
|
57
|
+
}),
|
|
58
|
+
(0, typeorm_1.JoinColumn)({ name: 'product_group_complement' }),
|
|
59
|
+
__metadata("design:type", productGroupComplement_1.ProductGroupComplement)
|
|
60
|
+
], RequestProductGroupComplement.prototype, "product_group_complement", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.request_product_group_complements; }, {
|
|
63
|
+
onDelete: 'CASCADE',
|
|
64
|
+
onUpdate: 'NO ACTION',
|
|
65
|
+
}),
|
|
66
|
+
(0, typeorm_1.JoinColumn)({ name: 'user' }),
|
|
67
|
+
__metadata("design:type", User_1.User)
|
|
68
|
+
], RequestProductGroupComplement.prototype, "user", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ comment: 'Cantidad de cada complemento.' }),
|
|
71
|
+
__metadata("design:type", Number)
|
|
72
|
+
], RequestProductGroupComplement.prototype, "quantity", void 0);
|
|
73
|
+
RequestProductGroupComplement = __decorate([
|
|
74
|
+
(0, typeorm_1.Entity)('request_product_group_complement', {
|
|
75
|
+
comment: 'Complementos (toppings) que el usuario va a poder agregar por cada producto.',
|
|
76
|
+
})
|
|
77
|
+
], RequestProductGroupComplement);
|
|
78
|
+
return RequestProductGroupComplement;
|
|
79
|
+
}(typeorm_1.BaseEntity));
|
|
80
|
+
exports.RequestProductGroupComplement = RequestProductGroupComplement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Request } from './Request';
|
|
3
|
+
export declare class RequestStatus extends BaseEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
code: number;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
visible_to: number;
|
|
9
|
+
status: number;
|
|
10
|
+
requests: Request[];
|
|
11
|
+
}
|