test-entity-library-asm 3.2.2 → 3.2.4
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/Partner.d.ts +2 -1
- package/dist/entities/Partner.js +4 -0
- package/dist/entities/RequestLocal.d.ts +3 -1
- package/dist/entities/RequestLocal.js +12 -1
- package/dist/entities/RequestLocalHistory.d.ts +9 -0
- package/dist/entities/RequestLocalHistory.js +70 -0
- package/dist/entities.views.routes.d.ts +1 -0
- package/dist/entities.views.routes.js +3 -1
- package/package.json +1 -1
- package/src/entities/Partner.ts +7 -0
- package/src/entities/RequestLocal.ts +15 -2
- package/src/entities/RequestLocalHistory.ts +57 -0
- package/src/entities.views.routes.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Category, MasterNotification, PartnerSession, Product, VerifyLocal } from "..";
|
|
1
|
+
import { Category, MasterNotification, PartnerSession, Product, RequestLocalHistory, VerifyLocal } from "..";
|
|
2
2
|
import { City } from "./City";
|
|
3
3
|
import { Company } from "./Company";
|
|
4
4
|
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
@@ -37,4 +37,5 @@ export declare class Partner {
|
|
|
37
37
|
partners_category_update_by: Category[];
|
|
38
38
|
partners_category_created_by: Category[];
|
|
39
39
|
partners_session: PartnerSession[];
|
|
40
|
+
updated_by_history: RequestLocalHistory[];
|
|
40
41
|
}
|
package/dist/entities/Partner.js
CHANGED
|
@@ -229,6 +229,10 @@ var Partner = /** @class */ (function () {
|
|
|
229
229
|
(0, typeorm_1.OneToMany)(function () { return __1.PartnerSession; }, function (partnerSession) { return partnerSession.partner; }),
|
|
230
230
|
__metadata("design:type", Array)
|
|
231
231
|
], Partner.prototype, "partners_session", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, typeorm_1.OneToMany)(function () { return __1.RequestLocalHistory; }, function (requestLocalHistory) { return requestLocalHistory.updated_by; }),
|
|
234
|
+
__metadata("design:type", Array)
|
|
235
|
+
], Partner.prototype, "updated_by_history", void 0);
|
|
232
236
|
Partner = __decorate([
|
|
233
237
|
(0, typeorm_1.Entity)({
|
|
234
238
|
comment: "Tabla agregada para los usuarios qué quieran registrar su local o empresa de comida rápida en la plataforma.\r\n\r\nEste usuario es independiente a los usuarios de la tabla `user` ya que tiene diferentes plataformas.\r\n\r\nTambién van a estar los usuarios qué el administrador/dueño desee agregar como empleados/colaboradores.",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Local, Request } from "..";
|
|
1
|
+
import { Local, Request, RequestLocalHistory } from "..";
|
|
2
2
|
export declare class RequestLocal {
|
|
3
3
|
id: number;
|
|
4
4
|
request: Request;
|
|
5
5
|
local: Local;
|
|
6
|
+
total_cost: string;
|
|
6
7
|
status: number;
|
|
8
|
+
requests_local_history: RequestLocalHistory[];
|
|
7
9
|
}
|
|
@@ -33,13 +33,24 @@ var RequestLocal = /** @class */ (function () {
|
|
|
33
33
|
(0, typeorm_1.JoinColumn)({ name: "local" }),
|
|
34
34
|
__metadata("design:type", __1.Local)
|
|
35
35
|
], RequestLocal.prototype, "local", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({
|
|
38
|
+
length: 20,
|
|
39
|
+
comment: "Costo total del pedido. ",
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], RequestLocal.prototype, "total_cost", void 0);
|
|
36
43
|
__decorate([
|
|
37
44
|
(0, typeorm_1.Column)({
|
|
38
45
|
default: 1,
|
|
39
|
-
comment: "
|
|
46
|
+
comment: "Estado en el que se encuentra un pedido.\r\n0. En proceso: El usuario está agregando los productos del/los local/es.\r\n1. Creado: El usuario ya creó el pedido con los prductos en los/el local/es especificado/s.\r\n2. Cancelado: El usuario canceló el pedido, esto sólo se permite si aún no está pago el pedido.\r\n3. Rechazado: Si un local canceló el pedido por x circustancias. Cabe resaltar que si el pedido fue solicitado a más de un local, el estado 3 sólo se agregaría al pedido si todos los locales cancelaron (Se tiene un estado para cada local en la tabla request_local) -> Aún no se sabe si este estado va.\r\n4. Finalizado: El pedido fue entregado y también pagado. Si el pedido se realizó en varios locales, entonces sólo se pasará a Finalizado, cuando todos los locales a los que se le hizo el pedido están pagos y con los productos entregados.",
|
|
40
47
|
}),
|
|
41
48
|
__metadata("design:type", Number)
|
|
42
49
|
], RequestLocal.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.OneToMany)(function () { return __1.RequestLocalHistory; }, function (requestLocalHistory) { return requestLocalHistory.request_local; }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], RequestLocal.prototype, "requests_local_history", void 0);
|
|
43
54
|
RequestLocal = __decorate([
|
|
44
55
|
(0, typeorm_1.Entity)({
|
|
45
56
|
comment: "Tabla para guardar las relaciones de un pedido y los locales",
|
|
@@ -0,0 +1,70 @@
|
|
|
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.RequestLocalHistory = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
15
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
16
|
+
var RequestLocalHistory = /** @class */ (function () {
|
|
17
|
+
function RequestLocalHistory() {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], RequestLocalHistory.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.RequestLocal; }, function (requestLocal) { return requestLocal.requests_local_history; }, {
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
onUpdate: "NO ACTION",
|
|
27
|
+
}),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "request_local" }),
|
|
29
|
+
__metadata("design:type", __1.RequestLocal)
|
|
30
|
+
], RequestLocalHistory.prototype, "request_local", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({
|
|
33
|
+
comment: "Estado en el que se encuentra el registro.",
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], RequestLocalHistory.prototype, "status", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({
|
|
39
|
+
length: 600,
|
|
40
|
+
nullable: true,
|
|
41
|
+
comment: "Comentarios del cambio de estado del registro.",
|
|
42
|
+
}),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], RequestLocalHistory.prototype, "comment", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.updated_by_history; }, {
|
|
47
|
+
onDelete: "CASCADE",
|
|
48
|
+
onUpdate: "NO ACTION",
|
|
49
|
+
nullable: true,
|
|
50
|
+
}),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
52
|
+
__metadata("design:type", __1.Partner)
|
|
53
|
+
], RequestLocalHistory.prototype, "updated_by", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({
|
|
56
|
+
type: "datetime",
|
|
57
|
+
comment: "Fecha en la que realizó el cambio.",
|
|
58
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], RequestLocalHistory.prototype, "updated", void 0);
|
|
62
|
+
RequestLocalHistory = __decorate([
|
|
63
|
+
(0, typeorm_1.Entity)({
|
|
64
|
+
comment: "Con esta tabla podemos llevar el control de cambios qué se le han realizado al pedido.",
|
|
65
|
+
name: "request_local_history",
|
|
66
|
+
})
|
|
67
|
+
], RequestLocalHistory);
|
|
68
|
+
return RequestLocalHistory;
|
|
69
|
+
}());
|
|
70
|
+
exports.RequestLocalHistory = RequestLocalHistory;
|
|
@@ -50,6 +50,7 @@ export { ProductDate } from "./entities/ProductDate";
|
|
|
50
50
|
export { ToppingImage } from "./entities/ToppingImage";
|
|
51
51
|
export { PartnerSession } from "./entities/PartnerSession";
|
|
52
52
|
export { RequestLocal } from "./entities/RequestLocal";
|
|
53
|
+
export { RequestLocalHistory } from "./entities/RequestLocalHistory";
|
|
53
54
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
54
55
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
55
56
|
export { MasterNotifications } from "./views/MasterNotifications";
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = 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.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
18
|
+
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = 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");
|
|
@@ -120,6 +120,8 @@ var PartnerSession_1 = require("./entities/PartnerSession");
|
|
|
120
120
|
Object.defineProperty(exports, "PartnerSession", { enumerable: true, get: function () { return PartnerSession_1.PartnerSession; } });
|
|
121
121
|
var RequestLocal_1 = require("./entities/RequestLocal");
|
|
122
122
|
Object.defineProperty(exports, "RequestLocal", { enumerable: true, get: function () { return RequestLocal_1.RequestLocal; } });
|
|
123
|
+
var RequestLocalHistory_1 = require("./entities/RequestLocalHistory");
|
|
124
|
+
Object.defineProperty(exports, "RequestLocalHistory", { enumerable: true, get: function () { return RequestLocalHistory_1.RequestLocalHistory; } });
|
|
123
125
|
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
124
126
|
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
|
125
127
|
var VerifyLocals_1 = require("./views/VerifyLocals");
|
package/package.json
CHANGED
package/src/entities/Partner.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
MasterNotification,
|
|
14
14
|
PartnerSession,
|
|
15
15
|
Product,
|
|
16
|
+
RequestLocalHistory,
|
|
16
17
|
VerifyLocal,
|
|
17
18
|
} from "..";
|
|
18
19
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
@@ -218,4 +219,10 @@ export class Partner {
|
|
|
218
219
|
|
|
219
220
|
@OneToMany(() => PartnerSession, (partnerSession) => partnerSession.partner)
|
|
220
221
|
partners_session: PartnerSession[];
|
|
222
|
+
|
|
223
|
+
@OneToMany(
|
|
224
|
+
() => RequestLocalHistory,
|
|
225
|
+
(requestLocalHistory) => requestLocalHistory.updated_by
|
|
226
|
+
)
|
|
227
|
+
updated_by_history: RequestLocalHistory[];
|
|
221
228
|
}
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
Entity,
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
|
+
OneToMany,
|
|
6
7
|
PrimaryGeneratedColumn,
|
|
7
8
|
} from "typeorm";
|
|
8
|
-
import { Local, Request } from "..";
|
|
9
|
+
import { Local, Request, RequestLocalHistory } from "..";
|
|
9
10
|
|
|
10
11
|
@Entity({
|
|
11
12
|
comment: "Tabla para guardar las relaciones de un pedido y los locales",
|
|
@@ -27,10 +28,22 @@ export class RequestLocal {
|
|
|
27
28
|
@JoinColumn({ name: "local" })
|
|
28
29
|
local: Local;
|
|
29
30
|
|
|
31
|
+
@Column({
|
|
32
|
+
length: 20,
|
|
33
|
+
comment: "Costo total del pedido. ",
|
|
34
|
+
})
|
|
35
|
+
total_cost: string;
|
|
36
|
+
|
|
30
37
|
@Column({
|
|
31
38
|
default: 1,
|
|
32
39
|
comment:
|
|
33
|
-
"
|
|
40
|
+
"Estado en el que se encuentra un pedido.\r\n0. En proceso: El usuario está agregando los productos del/los local/es.\r\n1. Creado: El usuario ya creó el pedido con los prductos en los/el local/es especificado/s.\r\n2. Cancelado: El usuario canceló el pedido, esto sólo se permite si aún no está pago el pedido.\r\n3. Rechazado: Si un local canceló el pedido por x circustancias. Cabe resaltar que si el pedido fue solicitado a más de un local, el estado 3 sólo se agregaría al pedido si todos los locales cancelaron (Se tiene un estado para cada local en la tabla request_local) -> Aún no se sabe si este estado va.\r\n4. Finalizado: El pedido fue entregado y también pagado. Si el pedido se realizó en varios locales, entonces sólo se pasará a Finalizado, cuando todos los locales a los que se le hizo el pedido están pagos y con los productos entregados.",
|
|
34
41
|
})
|
|
35
42
|
status: number;
|
|
43
|
+
|
|
44
|
+
@OneToMany(
|
|
45
|
+
() => RequestLocalHistory,
|
|
46
|
+
(requestLocalHistory) => requestLocalHistory.request_local
|
|
47
|
+
)
|
|
48
|
+
requests_local_history: RequestLocalHistory[];
|
|
36
49
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
Entity,
|
|
4
|
+
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Partner, RequestLocal } from "..";
|
|
9
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
|
+
|
|
11
|
+
@Entity({
|
|
12
|
+
comment:
|
|
13
|
+
"Con esta tabla podemos llevar el control de cambios qué se le han realizado al pedido.",
|
|
14
|
+
name: "request_local_history",
|
|
15
|
+
})
|
|
16
|
+
export class RequestLocalHistory {
|
|
17
|
+
@PrimaryGeneratedColumn()
|
|
18
|
+
id: number;
|
|
19
|
+
|
|
20
|
+
@ManyToOne(
|
|
21
|
+
() => RequestLocal,
|
|
22
|
+
(requestLocal) => requestLocal.requests_local_history,
|
|
23
|
+
{
|
|
24
|
+
onDelete: "CASCADE",
|
|
25
|
+
onUpdate: "NO ACTION",
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
@JoinColumn({ name: "request_local" })
|
|
29
|
+
request_local: RequestLocal;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
comment: "Estado en el que se encuentra el registro.",
|
|
33
|
+
})
|
|
34
|
+
status: number;
|
|
35
|
+
|
|
36
|
+
@Column({
|
|
37
|
+
length: 600,
|
|
38
|
+
nullable: true,
|
|
39
|
+
comment: "Comentarios del cambio de estado del registro.",
|
|
40
|
+
})
|
|
41
|
+
comment: string;
|
|
42
|
+
|
|
43
|
+
@ManyToOne(() => Partner, (partner) => partner.updated_by_history, {
|
|
44
|
+
onDelete: "CASCADE",
|
|
45
|
+
onUpdate: "NO ACTION",
|
|
46
|
+
nullable: true,
|
|
47
|
+
})
|
|
48
|
+
@JoinColumn({ name: "updated_by" })
|
|
49
|
+
updated_by: Partner;
|
|
50
|
+
|
|
51
|
+
@Column({
|
|
52
|
+
type: "datetime",
|
|
53
|
+
comment: "Fecha en la que realizó el cambio.",
|
|
54
|
+
transformer: new DateTransformer(),
|
|
55
|
+
})
|
|
56
|
+
updated: Date;
|
|
57
|
+
}
|
|
@@ -50,6 +50,7 @@ export { ProductDate } from "./entities/ProductDate";
|
|
|
50
50
|
export { ToppingImage } from "./entities/ToppingImage";
|
|
51
51
|
export { PartnerSession } from "./entities/PartnerSession";
|
|
52
52
|
export { RequestLocal } from "./entities/RequestLocal";
|
|
53
|
+
export { RequestLocalHistory } from "./entities/RequestLocalHistory";
|
|
53
54
|
|
|
54
55
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
55
56
|
export { VerifyLocals } from "./views/VerifyLocals";
|