test-entity-library-asm 2.0.4 → 2.0.6
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/City.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { User } from './User';
|
|
|
5
5
|
import { Partner } from './Partner';
|
|
6
6
|
import { Master } from './Master';
|
|
7
7
|
import { UserAddress } from './UserAddress';
|
|
8
|
+
import { Square } from '..';
|
|
8
9
|
export declare class City {
|
|
9
10
|
id: number;
|
|
10
11
|
region: Region;
|
|
@@ -16,4 +17,5 @@ export declare class City {
|
|
|
16
17
|
partners: Partner[];
|
|
17
18
|
masters: Master[];
|
|
18
19
|
user_addresses: UserAddress[];
|
|
20
|
+
squares: Square[];
|
|
19
21
|
}
|
package/dist/entities/City.js
CHANGED
|
@@ -18,6 +18,7 @@ var User_1 = require("./User");
|
|
|
18
18
|
var Partner_1 = require("./Partner");
|
|
19
19
|
var Master_1 = require("./Master");
|
|
20
20
|
var UserAddress_1 = require("./UserAddress");
|
|
21
|
+
var __1 = require("..");
|
|
21
22
|
var City = /** @class */ (function () {
|
|
22
23
|
function City() {
|
|
23
24
|
}
|
|
@@ -70,6 +71,10 @@ var City = /** @class */ (function () {
|
|
|
70
71
|
(0, typeorm_1.OneToMany)(function () { return UserAddress_1.UserAddress; }, function (userAddress) { return userAddress.city; }),
|
|
71
72
|
__metadata("design:type", Array)
|
|
72
73
|
], City.prototype, "user_addresses", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.OneToMany)(function () { return __1.Square; }, function (square) { return square.city; }),
|
|
76
|
+
__metadata("design:type", Array)
|
|
77
|
+
], City.prototype, "squares", void 0);
|
|
73
78
|
City = __decorate([
|
|
74
79
|
(0, typeorm_1.Entity)({ comment: 'Ciudades donde está visible la plataforma.' })
|
|
75
80
|
], City);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Local } from './Local';
|
|
2
2
|
import { User } from './User';
|
|
3
|
+
import { City } from './City';
|
|
3
4
|
export declare class Square {
|
|
4
5
|
id: number;
|
|
5
6
|
name: string;
|
|
7
|
+
city: City;
|
|
6
8
|
address: string;
|
|
9
|
+
latitude: number;
|
|
10
|
+
longitude: number;
|
|
7
11
|
details: string;
|
|
8
12
|
maximum_number_locals: number;
|
|
9
13
|
email: string;
|
package/dist/entities/Square.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.Square = void 0;
|
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
14
|
var Local_1 = require("./Local");
|
|
15
15
|
var User_1 = require("./User");
|
|
16
|
+
var City_1 = require("./City");
|
|
16
17
|
var Square = /** @class */ (function () {
|
|
17
18
|
function Square() {
|
|
18
19
|
}
|
|
@@ -26,10 +27,26 @@ var Square = /** @class */ (function () {
|
|
|
26
27
|
(0, typeorm_1.Column)({ length: 50, comment: 'Nombre del centro comercial/plazoleta.' }),
|
|
27
28
|
__metadata("design:type", String)
|
|
28
29
|
], Square.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.squares; }, {
|
|
32
|
+
onDelete: 'RESTRICT',
|
|
33
|
+
onUpdate: 'NO ACTION',
|
|
34
|
+
}),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: 'city' }),
|
|
36
|
+
__metadata("design:type", City_1.City)
|
|
37
|
+
], Square.prototype, "city", void 0);
|
|
29
38
|
__decorate([
|
|
30
39
|
(0, typeorm_1.Column)({ length: 100, comment: 'Dirección del centro comercial/plazoleta.' }),
|
|
31
40
|
__metadata("design:type", String)
|
|
32
41
|
], Square.prototype, "address", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 8 }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Square.prototype, "latitude", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 8 }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], Square.prototype, "longitude", void 0);
|
|
33
50
|
__decorate([
|
|
34
51
|
(0, typeorm_1.Column)({
|
|
35
52
|
type: 'mediumtext',
|
package/package.json
CHANGED
package/src/entities/City.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { User } from './User'
|
|
|
13
13
|
import { Partner } from './Partner'
|
|
14
14
|
import { Master } from './Master'
|
|
15
15
|
import { UserAddress } from './UserAddress'
|
|
16
|
+
import { Square } from '..'
|
|
16
17
|
|
|
17
18
|
@Entity({ comment: 'Ciudades donde está visible la plataforma.' })
|
|
18
19
|
export class City {
|
|
@@ -55,4 +56,7 @@ export class City {
|
|
|
55
56
|
|
|
56
57
|
@OneToMany(() => UserAddress, (userAddress) => userAddress.city)
|
|
57
58
|
user_addresses: UserAddress[]
|
|
59
|
+
|
|
60
|
+
@OneToMany(() => Square, (square) => square.city)
|
|
61
|
+
squares: Square[]
|
|
58
62
|
}
|
package/src/entities/Square.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Column,
|
|
3
3
|
Entity,
|
|
4
|
+
JoinColumn,
|
|
4
5
|
JoinTable,
|
|
5
6
|
ManyToMany,
|
|
7
|
+
ManyToOne,
|
|
6
8
|
OneToMany,
|
|
7
9
|
PrimaryColumn,
|
|
8
10
|
} from 'typeorm'
|
|
9
11
|
import { Local } from './Local'
|
|
10
12
|
import { User } from './User'
|
|
13
|
+
import { City } from './City'
|
|
11
14
|
|
|
12
15
|
@Entity({
|
|
13
16
|
comment:
|
|
@@ -22,9 +25,22 @@ export class Square {
|
|
|
22
25
|
@Column({ length: 50, comment: 'Nombre del centro comercial/plazoleta.' })
|
|
23
26
|
name: string
|
|
24
27
|
|
|
28
|
+
@ManyToOne(() => City, (city) => city.squares, {
|
|
29
|
+
onDelete: 'RESTRICT',
|
|
30
|
+
onUpdate: 'NO ACTION',
|
|
31
|
+
})
|
|
32
|
+
@JoinColumn({ name: 'city' })
|
|
33
|
+
city: City
|
|
34
|
+
|
|
25
35
|
@Column({ length: 100, comment: 'Dirección del centro comercial/plazoleta.' })
|
|
26
36
|
address: string
|
|
27
37
|
|
|
38
|
+
@Column({ type: 'decimal', precision: 10, scale: 8 })
|
|
39
|
+
latitude: number
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'decimal', precision: 10, scale: 8 })
|
|
42
|
+
longitude: number
|
|
43
|
+
|
|
28
44
|
@Column({
|
|
29
45
|
type: 'mediumtext',
|
|
30
46
|
nullable: true,
|