test-entity-library-asm 3.2.8 → 3.2.10
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,4 +1,4 @@
|
|
|
1
|
-
import { RequestLocal } from "..";
|
|
1
|
+
import { RequestLocal, UserAddress } from "..";
|
|
2
2
|
import { PaymentMethod } from "./PaymentMethod";
|
|
3
3
|
import { RequestProduct } from "./RequestProduct";
|
|
4
4
|
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
@@ -7,6 +7,7 @@ export declare class Request {
|
|
|
7
7
|
id: number;
|
|
8
8
|
code: string;
|
|
9
9
|
user: User;
|
|
10
|
+
address: UserAddress | null;
|
|
10
11
|
order_mode: number;
|
|
11
12
|
order_type: number;
|
|
12
13
|
payment_method: PaymentMethod;
|
package/dist/entities/Request.js
CHANGED
|
@@ -43,6 +43,15 @@ var Request = /** @class */ (function () {
|
|
|
43
43
|
(0, typeorm_1.JoinColumn)({ name: "user" }),
|
|
44
44
|
__metadata("design:type", User_1.User)
|
|
45
45
|
], Request.prototype, "user", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.UserAddress; }, function (userAddress) { return userAddress.requests; }, {
|
|
48
|
+
nullable: true,
|
|
49
|
+
onDelete: "NO ACTION",
|
|
50
|
+
onUpdate: "NO ACTION",
|
|
51
|
+
}),
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: "address" }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], Request.prototype, "address", void 0);
|
|
46
55
|
__decorate([
|
|
47
56
|
(0, typeorm_1.Column)({
|
|
48
57
|
default: 1,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Request } from "..";
|
|
2
|
+
import { City } from "./City";
|
|
3
|
+
import { User } from "./User";
|
|
3
4
|
export declare class UserAddress {
|
|
4
5
|
id: number;
|
|
5
6
|
user: User;
|
|
@@ -11,4 +12,7 @@ export declare class UserAddress {
|
|
|
11
12
|
tag: string;
|
|
12
13
|
delivery_details: number;
|
|
13
14
|
description: string;
|
|
15
|
+
selected: number;
|
|
16
|
+
deleted: number;
|
|
17
|
+
requests: Request[];
|
|
14
18
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserAddress = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
14
15
|
var City_1 = require("./City");
|
|
15
16
|
var User_1 = require("./User");
|
|
16
17
|
var UserAddress = /** @class */ (function () {
|
|
@@ -18,45 +19,45 @@ var UserAddress = /** @class */ (function () {
|
|
|
18
19
|
}
|
|
19
20
|
__decorate([
|
|
20
21
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
-
comment:
|
|
22
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
23
|
}),
|
|
23
24
|
__metadata("design:type", Number)
|
|
24
25
|
], UserAddress.prototype, "id", void 0);
|
|
25
26
|
__decorate([
|
|
26
27
|
(0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.addresses; }, {
|
|
27
|
-
onDelete:
|
|
28
|
-
onUpdate:
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
onUpdate: "NO ACTION",
|
|
29
30
|
}),
|
|
30
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "user" }),
|
|
31
32
|
__metadata("design:type", User_1.User)
|
|
32
33
|
], UserAddress.prototype, "user", void 0);
|
|
33
34
|
__decorate([
|
|
34
35
|
(0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.user_addresses; }, {
|
|
35
|
-
onDelete:
|
|
36
|
-
onUpdate:
|
|
36
|
+
onDelete: "RESTRICT",
|
|
37
|
+
onUpdate: "NO ACTION",
|
|
37
38
|
}),
|
|
38
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: "city" }),
|
|
39
40
|
__metadata("design:type", City_1.City)
|
|
40
41
|
], UserAddress.prototype, "city", void 0);
|
|
41
42
|
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ length: 120, comment:
|
|
43
|
+
(0, typeorm_1.Column)({ length: 120, comment: "Dirección." }),
|
|
43
44
|
__metadata("design:type", String)
|
|
44
45
|
], UserAddress.prototype, "address", void 0);
|
|
45
46
|
__decorate([
|
|
46
47
|
(0, typeorm_1.Column)({
|
|
47
|
-
type:
|
|
48
|
+
type: "decimal",
|
|
48
49
|
precision: 10,
|
|
49
50
|
scale: 8,
|
|
50
|
-
comment:
|
|
51
|
+
comment: "Latitud de la dirección.",
|
|
51
52
|
}),
|
|
52
53
|
__metadata("design:type", Number)
|
|
53
54
|
], UserAddress.prototype, "latitude", void 0);
|
|
54
55
|
__decorate([
|
|
55
56
|
(0, typeorm_1.Column)({
|
|
56
|
-
type:
|
|
57
|
+
type: "decimal",
|
|
57
58
|
precision: 10,
|
|
58
59
|
scale: 8,
|
|
59
|
-
comment:
|
|
60
|
+
comment: "Longitud de la dirección.",
|
|
60
61
|
}),
|
|
61
62
|
__metadata("design:type", Number)
|
|
62
63
|
], UserAddress.prototype, "longitude", void 0);
|
|
@@ -64,33 +65,51 @@ var UserAddress = /** @class */ (function () {
|
|
|
64
65
|
(0, typeorm_1.Column)({
|
|
65
66
|
length: 400,
|
|
66
67
|
nullable: true,
|
|
67
|
-
comment:
|
|
68
|
+
comment: "Detalles de la dirección, si es una casa, un conjunto, el apartamento.",
|
|
68
69
|
}),
|
|
69
70
|
__metadata("design:type", String)
|
|
70
71
|
], UserAddress.prototype, "details", void 0);
|
|
71
72
|
__decorate([
|
|
72
73
|
(0, typeorm_1.Column)({
|
|
73
74
|
length: 20,
|
|
74
|
-
comment:
|
|
75
|
+
comment: "Tipo de ubicación:\r\n1. Casa.\r\n2. Oficina.\r\n3. Pareja.\r\n4. Otro.\r\n\r\nEsto me agrega un campo de tipo texto con el tag.",
|
|
75
76
|
}),
|
|
76
77
|
__metadata("design:type", String)
|
|
77
78
|
], UserAddress.prototype, "tag", void 0);
|
|
78
79
|
__decorate([
|
|
79
80
|
(0, typeorm_1.Column)({
|
|
80
|
-
comment:
|
|
81
|
+
comment: "Campo que me dice si:\r\n1. Personal: Lo recibo yo.\r\n2. Portería: Lo recibe la portería.",
|
|
81
82
|
}),
|
|
82
83
|
__metadata("design:type", Number)
|
|
83
84
|
], UserAddress.prototype, "delivery_details", void 0);
|
|
84
85
|
__decorate([
|
|
85
86
|
(0, typeorm_1.Column)({
|
|
86
87
|
length: 400,
|
|
87
|
-
comment:
|
|
88
|
+
comment: "Campo para agregar una descripción más detallada de cómo llegar, o donde es la ubicación.",
|
|
88
89
|
}),
|
|
89
90
|
__metadata("design:type", String)
|
|
90
91
|
], UserAddress.prototype, "description", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({
|
|
94
|
+
comment: "Columna para saber el el registro se eliminó o no:\r\n0. No eliminado.\r\n1. Eliminado.",
|
|
95
|
+
default: 0,
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], UserAddress.prototype, "selected", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({
|
|
101
|
+
comment: "CColumna para saber sí la dirección está seleccionada por defecto:\r\n1. Por defecto.\r\n0. No está por defecto.",
|
|
102
|
+
default: 0,
|
|
103
|
+
}),
|
|
104
|
+
__metadata("design:type", Number)
|
|
105
|
+
], UserAddress.prototype, "deleted", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.OneToMany)(function () { return __1.Request; }, function (request) { return request.address; }),
|
|
108
|
+
__metadata("design:type", Array)
|
|
109
|
+
], UserAddress.prototype, "requests", void 0);
|
|
91
110
|
UserAddress = __decorate([
|
|
92
|
-
(0, typeorm_1.Entity)(
|
|
93
|
-
comment:
|
|
111
|
+
(0, typeorm_1.Entity)("user_address", {
|
|
112
|
+
comment: "Tabla creada para agregar las direcciones del usuario.\r\n\r\nEsta tabla es util para cuando se tenga la opción de domicilios.",
|
|
94
113
|
})
|
|
95
114
|
], UserAddress);
|
|
96
115
|
return UserAddress;
|
package/package.json
CHANGED
package/src/entities/Request.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
|
-
import { RequestLocal } from "..";
|
|
11
|
+
import { RequestLocal, UserAddress } from "..";
|
|
12
12
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
13
|
import { PaymentMethod } from "./PaymentMethod";
|
|
14
14
|
import { RequestProduct } from "./RequestProduct";
|
|
@@ -41,6 +41,14 @@ export class Request {
|
|
|
41
41
|
@JoinColumn({ name: "user" })
|
|
42
42
|
user: User;
|
|
43
43
|
|
|
44
|
+
@ManyToOne(() => UserAddress, (userAddress) => userAddress.requests, {
|
|
45
|
+
nullable: true,
|
|
46
|
+
onDelete: "NO ACTION",
|
|
47
|
+
onUpdate: "NO ACTION",
|
|
48
|
+
})
|
|
49
|
+
@JoinColumn({ name: "address" })
|
|
50
|
+
address: UserAddress | null;
|
|
51
|
+
|
|
44
52
|
@Column({
|
|
45
53
|
default: 1,
|
|
46
54
|
comment:
|
|
@@ -3,79 +3,98 @@ import {
|
|
|
3
3
|
Entity,
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
|
+
OneToMany,
|
|
6
7
|
PrimaryGeneratedColumn,
|
|
7
|
-
} from
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { Request } from "..";
|
|
10
|
+
import { City } from "./City";
|
|
11
|
+
import { User } from "./User";
|
|
10
12
|
|
|
11
|
-
@Entity(
|
|
13
|
+
@Entity("user_address", {
|
|
12
14
|
comment:
|
|
13
|
-
|
|
15
|
+
"Tabla creada para agregar las direcciones del usuario.\r\n\r\nEsta tabla es util para cuando se tenga la opción de domicilios.",
|
|
14
16
|
})
|
|
15
17
|
export class UserAddress {
|
|
16
18
|
@PrimaryGeneratedColumn({
|
|
17
|
-
comment:
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
20
|
})
|
|
19
|
-
id: number
|
|
21
|
+
id: number;
|
|
20
22
|
|
|
21
23
|
@ManyToOne(() => User, (user) => user.addresses, {
|
|
22
|
-
onDelete:
|
|
23
|
-
onUpdate:
|
|
24
|
+
onDelete: "CASCADE",
|
|
25
|
+
onUpdate: "NO ACTION",
|
|
24
26
|
})
|
|
25
|
-
@JoinColumn({ name:
|
|
26
|
-
user: User
|
|
27
|
+
@JoinColumn({ name: "user" })
|
|
28
|
+
user: User;
|
|
27
29
|
|
|
28
30
|
@ManyToOne(() => City, (city) => city.user_addresses, {
|
|
29
|
-
onDelete:
|
|
30
|
-
onUpdate:
|
|
31
|
+
onDelete: "RESTRICT",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
31
33
|
})
|
|
32
|
-
@JoinColumn({ name:
|
|
33
|
-
city: City
|
|
34
|
+
@JoinColumn({ name: "city" })
|
|
35
|
+
city: City;
|
|
34
36
|
|
|
35
|
-
@Column({ length: 120, comment:
|
|
36
|
-
address: string
|
|
37
|
+
@Column({ length: 120, comment: "Dirección." })
|
|
38
|
+
address: string;
|
|
37
39
|
|
|
38
40
|
@Column({
|
|
39
|
-
type:
|
|
41
|
+
type: "decimal",
|
|
40
42
|
precision: 10,
|
|
41
43
|
scale: 8,
|
|
42
|
-
comment:
|
|
44
|
+
comment: "Latitud de la dirección.",
|
|
43
45
|
})
|
|
44
|
-
latitude: number
|
|
46
|
+
latitude: number;
|
|
45
47
|
|
|
46
48
|
@Column({
|
|
47
|
-
type:
|
|
49
|
+
type: "decimal",
|
|
48
50
|
precision: 10,
|
|
49
51
|
scale: 8,
|
|
50
|
-
comment:
|
|
52
|
+
comment: "Longitud de la dirección.",
|
|
51
53
|
})
|
|
52
|
-
longitude: number
|
|
54
|
+
longitude: number;
|
|
53
55
|
|
|
54
56
|
@Column({
|
|
55
57
|
length: 400,
|
|
56
58
|
nullable: true,
|
|
57
59
|
comment:
|
|
58
|
-
|
|
60
|
+
"Detalles de la dirección, si es una casa, un conjunto, el apartamento.",
|
|
59
61
|
})
|
|
60
|
-
details: string
|
|
62
|
+
details: string;
|
|
61
63
|
|
|
62
64
|
@Column({
|
|
63
65
|
length: 20,
|
|
64
66
|
comment:
|
|
65
|
-
|
|
67
|
+
"Tipo de ubicación:\r\n1. Casa.\r\n2. Oficina.\r\n3. Pareja.\r\n4. Otro.\r\n\r\nEsto me agrega un campo de tipo texto con el tag.",
|
|
66
68
|
})
|
|
67
|
-
tag: string
|
|
69
|
+
tag: string;
|
|
68
70
|
|
|
69
71
|
@Column({
|
|
70
72
|
comment:
|
|
71
|
-
|
|
73
|
+
"Campo que me dice si:\r\n1. Personal: Lo recibo yo.\r\n2. Portería: Lo recibe la portería.",
|
|
72
74
|
})
|
|
73
|
-
delivery_details: number
|
|
75
|
+
delivery_details: number;
|
|
74
76
|
|
|
75
77
|
@Column({
|
|
76
78
|
length: 400,
|
|
77
79
|
comment:
|
|
78
|
-
|
|
80
|
+
"Campo para agregar una descripción más detallada de cómo llegar, o donde es la ubicación.",
|
|
79
81
|
})
|
|
80
|
-
description: string
|
|
82
|
+
description: string;
|
|
83
|
+
|
|
84
|
+
@Column({
|
|
85
|
+
comment:
|
|
86
|
+
"Columna para saber el el registro se eliminó o no:\r\n0. No eliminado.\r\n1. Eliminado.",
|
|
87
|
+
default: 0,
|
|
88
|
+
})
|
|
89
|
+
selected: number;
|
|
90
|
+
|
|
91
|
+
@Column({
|
|
92
|
+
comment:
|
|
93
|
+
"CColumna para saber sí la dirección está seleccionada por defecto:\r\n1. Por defecto.\r\n0. No está por defecto.",
|
|
94
|
+
default: 0,
|
|
95
|
+
})
|
|
96
|
+
deleted: number;
|
|
97
|
+
|
|
98
|
+
@OneToMany(() => Request, (request) => request.address)
|
|
99
|
+
requests: Request[];
|
|
81
100
|
}
|