@natrave/shared-entities 1.4.32 → 1.4.33
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/app-auth/users/user.entity.d.ts +0 -1
- package/dist/app-auth/users/user.entity.d.ts.map +1 -1
- package/dist/app-auth/users/user.entity.js +3 -9
- package/dist/app-auth/users/utils/format-data.utils.d.ts +0 -1
- package/dist/app-auth/users/utils/format-data.utils.d.ts.map +1 -1
- package/dist/app-auth/users/utils/format-data.utils.js +0 -3
- package/dist/players/players/player.entity.d.ts +4 -2
- package/dist/players/players/player.entity.d.ts.map +1 -1
- package/dist/players/players/player.entity.js +22 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAa7C,qBAIa,IAAI;IAIf,EAAE,EAAE,MAAM,CAAC;IAUX,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IASvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAQpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAa7C,qBAIa,IAAI;IAIf,EAAE,EAAE,MAAM,CAAC;IAUX,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IASvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAQpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAStB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAUnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IASrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,aAAa,EAAE,YAAY,EAAE,CAAC;IAK9B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAKtC,MAAM,EAAE,MAAM,CAAC;IAGf,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IAMxC,WAAW,IAAI,IAAI;CAGpB"}
|
|
@@ -101,14 +101,6 @@ __decorateClass([
|
|
|
101
101
|
comment: "Endere\xE7o de email do usu\xE1rio."
|
|
102
102
|
})
|
|
103
103
|
], User.prototype, "email", 2);
|
|
104
|
-
__decorateClass([
|
|
105
|
-
Column({
|
|
106
|
-
type: "varchar",
|
|
107
|
-
length: 255,
|
|
108
|
-
nullable: true,
|
|
109
|
-
comment: "Apelido ou nome de usu\xE1rio do usu\xE1rio."
|
|
110
|
-
})
|
|
111
|
-
], User.prototype, "nickname", 2);
|
|
112
104
|
__decorateClass([
|
|
113
105
|
Column({
|
|
114
106
|
type: "enum",
|
|
@@ -154,7 +146,9 @@ __decorateClass([
|
|
|
154
146
|
})
|
|
155
147
|
], User.prototype, "userAuthProviders", 2);
|
|
156
148
|
__decorateClass([
|
|
157
|
-
OneToOne(() => Player, (player) => player.user, {
|
|
149
|
+
OneToOne(() => Player, (player) => player.user, {
|
|
150
|
+
onDelete: "CASCADE"
|
|
151
|
+
})
|
|
158
152
|
], User.prototype, "player", 2);
|
|
159
153
|
__decorateClass([
|
|
160
154
|
OneToMany(() => NotificationToken, (token) => token.user)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-data.utils.d.ts","sourceRoot":"","sources":["../../../../src/app-auth/users/utils/format-data.utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"format-data.utils.d.ts","sourceRoot":"","sources":["../../../../src/app-auth/users/utils/format-data.utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GAAG,IAAI,CAkBP"}
|
|
@@ -2,9 +2,6 @@ function formatUserBeforeInsertData(user) {
|
|
|
2
2
|
if (user.email) {
|
|
3
3
|
user.email = user.email.toLowerCase().trim();
|
|
4
4
|
}
|
|
5
|
-
if (user.nickname) {
|
|
6
|
-
user.nickname = user.nickname.toLowerCase().trim();
|
|
7
|
-
}
|
|
8
5
|
if (user.cpf) {
|
|
9
6
|
user.cpf = user.cpf.replace(/\D/g, "").trim();
|
|
10
7
|
}
|
|
@@ -4,13 +4,15 @@ import { PlayerPosition } from '../player-position';
|
|
|
4
4
|
import { PreferredLeg } from './enums/preferred-leg.enum';
|
|
5
5
|
export declare class Player {
|
|
6
6
|
id: number;
|
|
7
|
-
userId: string;
|
|
7
|
+
userId: string | null;
|
|
8
8
|
createdAt: Date;
|
|
9
9
|
updatedAt: Date;
|
|
10
|
+
nickname: string | null;
|
|
10
11
|
preferredLeg: PreferredLeg | null;
|
|
11
|
-
user: User;
|
|
12
|
+
user: User | null;
|
|
12
13
|
positions: PlayerPosition[];
|
|
13
14
|
teamMemberships: PlayerTeam[];
|
|
14
15
|
joinRequests: TeamJoinRequest[];
|
|
16
|
+
prepareData(): void;
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=player.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player.entity.d.ts","sourceRoot":"","sources":["../../../src/players/players/player.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"player.entity.d.ts","sourceRoot":"","sources":["../../../src/players/players/player.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,qBACa,MAAM;IAEjB,EAAE,EAAE,MAAM,CAAC;IAGX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAQhB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAQxB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IASlC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAUlB,SAAS,EAAE,cAAc,EAAE,CAAC;IAG5B,eAAe,EAAE,UAAU,EAAE,CAAC;IAG9B,YAAY,EAAE,eAAe,EAAE,CAAC;IAMhC,WAAW,IAAI,IAAI;CAKpB"}
|
|
@@ -9,6 +9,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
9
9
|
return result;
|
|
10
10
|
};
|
|
11
11
|
import {
|
|
12
|
+
BeforeInsert,
|
|
12
13
|
Column,
|
|
13
14
|
CreateDateColumn,
|
|
14
15
|
Entity,
|
|
@@ -25,12 +26,17 @@ import { PlayerTeam, TeamJoinRequest } from "../../teams/index.js";
|
|
|
25
26
|
import { PlayerPosition } from "../player-position/index.js";
|
|
26
27
|
import { PreferredLeg } from "./enums/preferred-leg.enum.js";
|
|
27
28
|
let Player = class {
|
|
29
|
+
prepareData() {
|
|
30
|
+
if (this.nickname) {
|
|
31
|
+
this.nickname = this.nickname.toLowerCase().trim();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
28
34
|
};
|
|
29
35
|
__decorateClass([
|
|
30
36
|
PrimaryGeneratedColumn()
|
|
31
37
|
], Player.prototype, "id", 2);
|
|
32
38
|
__decorateClass([
|
|
33
|
-
Column({ name: "user_id", type: "uuid", unique: true })
|
|
39
|
+
Column({ name: "user_id", type: "uuid", unique: true, nullable: true })
|
|
34
40
|
], Player.prototype, "userId", 2);
|
|
35
41
|
__decorateClass([
|
|
36
42
|
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
@@ -38,6 +44,14 @@ __decorateClass([
|
|
|
38
44
|
__decorateClass([
|
|
39
45
|
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
40
46
|
], Player.prototype, "updatedAt", 2);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
Column({
|
|
49
|
+
type: "varchar",
|
|
50
|
+
length: 255,
|
|
51
|
+
nullable: true,
|
|
52
|
+
comment: "Apelido ou nome de usu\xE1rio do jogador."
|
|
53
|
+
})
|
|
54
|
+
], Player.prototype, "nickname", 2);
|
|
41
55
|
__decorateClass([
|
|
42
56
|
Column({
|
|
43
57
|
type: "enum",
|
|
@@ -47,7 +61,10 @@ __decorateClass([
|
|
|
47
61
|
})
|
|
48
62
|
], Player.prototype, "preferredLeg", 2);
|
|
49
63
|
__decorateClass([
|
|
50
|
-
OneToOne(() => User, (user) => user.player, {
|
|
64
|
+
OneToOne(() => User, (user) => user.player, {
|
|
65
|
+
onDelete: "CASCADE",
|
|
66
|
+
nullable: true
|
|
67
|
+
}),
|
|
51
68
|
JoinColumn({ name: "user_id" })
|
|
52
69
|
], Player.prototype, "user", 2);
|
|
53
70
|
__decorateClass([
|
|
@@ -66,6 +83,9 @@ __decorateClass([
|
|
|
66
83
|
__decorateClass([
|
|
67
84
|
OneToMany(() => TeamJoinRequest, (tjr) => tjr.player)
|
|
68
85
|
], Player.prototype, "joinRequests", 2);
|
|
86
|
+
__decorateClass([
|
|
87
|
+
BeforeInsert()
|
|
88
|
+
], Player.prototype, "prepareData", 1);
|
|
69
89
|
Player = __decorateClass([
|
|
70
90
|
Entity("players")
|
|
71
91
|
], Player);
|