@natrave/shared-entities 8.49.0 → 9.1.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/identity/views/member-identity-views.sql.d.ts +1 -0
- package/dist/identity/views/member-identity-views.sql.d.ts.map +1 -1
- package/dist/identity/views/member-identity-views.sql.js +29 -1
- package/dist/players/players/player.entity.d.ts +0 -2
- package/dist/players/players/player.entity.d.ts.map +1 -1
- package/dist/players/players/player.entity.js +0 -17
- package/package.json +1 -1
|
@@ -8,5 +8,6 @@ export interface MemberIdentityViewsVersion {
|
|
|
8
8
|
down: readonly string[];
|
|
9
9
|
}
|
|
10
10
|
export declare const MEMBER_IDENTITY_VIEWS_V1: MemberIdentityViewsVersion;
|
|
11
|
+
export declare const MEMBER_IDENTITY_VIEWS_V2: MemberIdentityViewsVersion;
|
|
11
12
|
export declare const MEMBER_IDENTITY_VIEWS_LATEST: MemberIdentityViewsVersion;
|
|
12
13
|
//# sourceMappingURL=member-identity-views.sql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-identity-views.sql.d.ts","sourceRoot":"","sources":["../../../src/identity/views/member-identity-views.sql.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAG5E,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AA6GD,eAAO,MAAM,wBAAwB,EAAE,0BAsBtC,CAAC;AAGF,eAAO,MAAM,4BAA4B,4BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"member-identity-views.sql.d.ts","sourceRoot":"","sources":["../../../src/identity/views/member-identity-views.sql.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAG5E,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AA6GD,eAAO,MAAM,wBAAwB,EAAE,0BAsBtC,CAAC;AAkBF,eAAO,MAAM,wBAAwB,EAAE,0BAmBtC,CAAC;AAGF,eAAO,MAAM,4BAA4B,4BAA2B,CAAC"}
|
|
@@ -104,10 +104,38 @@ const MEMBER_IDENTITY_VIEWS_V1 = {
|
|
|
104
104
|
`DROP VIEW IF EXISTS ${MEMBER_TEAM_IDENTITY_VIEW}`
|
|
105
105
|
]
|
|
106
106
|
};
|
|
107
|
-
const
|
|
107
|
+
const TEAM_SELECT_V2 = TEAM_SELECT_V1.replace(
|
|
108
|
+
"COALESCE(NULLIF(btrim(u.name), ''), NULLIF(btrim(p.nickname), '')) AS name",
|
|
109
|
+
"NULLIF(btrim(u.name), '') AS name"
|
|
110
|
+
);
|
|
111
|
+
if (TEAM_SELECT_V2 === TEAM_SELECT_V1) {
|
|
112
|
+
throw new Error("member-identity-views: a v2 n\xE3o removeu players.nickname da camada da pessoa");
|
|
113
|
+
}
|
|
114
|
+
const MEMBER_IDENTITY_VIEWS_V2 = {
|
|
115
|
+
version: 2,
|
|
116
|
+
teamSelect: TEAM_SELECT_V2,
|
|
117
|
+
tournamentSelect: TOURNAMENT_SELECT_V1,
|
|
118
|
+
up: [
|
|
119
|
+
`DROP VIEW IF EXISTS ${MEMBER_TOURNAMENT_IDENTITY_VIEW}`,
|
|
120
|
+
`DROP VIEW IF EXISTS ${MEMBER_TEAM_IDENTITY_VIEW}`,
|
|
121
|
+
`CREATE VIEW ${MEMBER_TEAM_IDENTITY_VIEW} AS ${TEAM_SELECT_V2}`,
|
|
122
|
+
`CREATE VIEW ${MEMBER_TOURNAMENT_IDENTITY_VIEW} AS ${TOURNAMENT_SELECT_V1}`,
|
|
123
|
+
comment(
|
|
124
|
+
`VIEW ${MEMBER_TEAM_IDENTITY_VIEW}`,
|
|
125
|
+
"Identidade v2 do membro no time: player_teams, depois a conta (users). Sem conta, s\xF3 o nome do time. Defini\xE7\xE3o em @natrave/shared-entities (docs/IDENTIDADE.md)."
|
|
126
|
+
),
|
|
127
|
+
comment(
|
|
128
|
+
`VIEW ${MEMBER_TOURNAMENT_IDENTITY_VIEW}`,
|
|
129
|
+
"Identidade v2 do membro na categoria: tournament_players, depois member_team_identity. Defini\xE7\xE3o em @natrave/shared-entities (docs/IDENTIDADE.md)."
|
|
130
|
+
)
|
|
131
|
+
],
|
|
132
|
+
down: MEMBER_IDENTITY_VIEWS_V1.up
|
|
133
|
+
};
|
|
134
|
+
const MEMBER_IDENTITY_VIEWS_LATEST = MEMBER_IDENTITY_VIEWS_V2;
|
|
108
135
|
export {
|
|
109
136
|
MEMBER_IDENTITY_VIEWS_LATEST,
|
|
110
137
|
MEMBER_IDENTITY_VIEWS_V1,
|
|
138
|
+
MEMBER_IDENTITY_VIEWS_V2,
|
|
111
139
|
MEMBER_TEAM_IDENTITY_VIEW,
|
|
112
140
|
MEMBER_TOURNAMENT_IDENTITY_VIEW
|
|
113
141
|
};
|
|
@@ -9,13 +9,11 @@ export declare class Player {
|
|
|
9
9
|
createdAt: Date;
|
|
10
10
|
updatedAt: Date;
|
|
11
11
|
deletedAt: Date | null;
|
|
12
|
-
nickname: string | null;
|
|
13
12
|
preferredLeg: PreferredLeg | null;
|
|
14
13
|
user: User | null;
|
|
15
14
|
positions: PlayerPosition[];
|
|
16
15
|
teamMemberships: PlayerTeam[];
|
|
17
16
|
joinRequests: TeamJoinRequest[];
|
|
18
17
|
personalData: PlayerPersonalData | null;
|
|
19
|
-
prepareData(): void;
|
|
20
18
|
}
|
|
21
19
|
//# 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":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,qBAEa,MAAM;IAGjB,EAAE,EAAE,MAAM,CAAC;IAGX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAgBvB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IASlC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAWlB,SAAS,EAAE,cAAc,EAAE,CAAC;IAG5B,eAAe,EAAE,UAAU,EAAE,CAAC;IAE9B,YAAY,EAAE,eAAe,EAAE,CAAC;IAGhC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC"}
|
|
@@ -9,7 +9,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
9
9
|
return result;
|
|
10
10
|
};
|
|
11
11
|
import {
|
|
12
|
-
BeforeInsert,
|
|
13
12
|
Column,
|
|
14
13
|
CreateDateColumn,
|
|
15
14
|
DeleteDateColumn,
|
|
@@ -29,11 +28,6 @@ import { PlayerPersonalData } from "../player-personal-data/index.js";
|
|
|
29
28
|
import { PlayerPosition } from "../player-position/index.js";
|
|
30
29
|
import { PreferredLeg } from "./enums/preferred-leg.enum.js";
|
|
31
30
|
let Player = class {
|
|
32
|
-
prepareData() {
|
|
33
|
-
if (this.nickname) {
|
|
34
|
-
this.nickname = this.nickname.trim();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
31
|
};
|
|
38
32
|
__decorateClass([
|
|
39
33
|
PrimaryGeneratedColumn()
|
|
@@ -55,14 +49,6 @@ __decorateClass([
|
|
|
55
49
|
comment: "Data e hora em que o usu\xE1rio foi deletado (soft delete), se aplic\xE1vel."
|
|
56
50
|
})
|
|
57
51
|
], Player.prototype, "deletedAt", 2);
|
|
58
|
-
__decorateClass([
|
|
59
|
-
Column({
|
|
60
|
-
type: "varchar",
|
|
61
|
-
length: 255,
|
|
62
|
-
nullable: true,
|
|
63
|
-
comment: "Apelido ou nome de usu\xE1rio do jogador."
|
|
64
|
-
})
|
|
65
|
-
], Player.prototype, "nickname", 2);
|
|
66
52
|
__decorateClass([
|
|
67
53
|
Column({
|
|
68
54
|
type: "enum",
|
|
@@ -98,9 +84,6 @@ __decorateClass([
|
|
|
98
84
|
__decorateClass([
|
|
99
85
|
OneToOne(() => PlayerPersonalData, (personalData) => personalData.player)
|
|
100
86
|
], Player.prototype, "personalData", 2);
|
|
101
|
-
__decorateClass([
|
|
102
|
-
BeforeInsert()
|
|
103
|
-
], Player.prototype, "prepareData", 1);
|
|
104
87
|
Player = __decorateClass([
|
|
105
88
|
Entity("players"),
|
|
106
89
|
Index("IDX_players_deleted_at", ["deletedAt"])
|