@natrave/shared-entities 1.3.9 → 1.4.1
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/players/players/player.entity.d.ts +2 -2
- package/dist/players/players/player.entity.d.ts.map +1 -1
- package/dist/players/players/player.entity.js +3 -3
- package/dist/teams/index.d.ts +1 -0
- package/dist/teams/index.d.ts.map +1 -1
- package/dist/teams/index.js +1 -0
- package/dist/teams/player-team/index.d.ts +2 -0
- package/dist/teams/player-team/index.d.ts.map +1 -0
- package/dist/teams/player-team/index.js +4 -0
- package/dist/teams/player-team/player-team.entity.d.ts +14 -0
- package/dist/teams/player-team/player-team.entity.d.ts.map +1 -0
- package/dist/teams/player-team/player-team.entity.js +64 -0
- package/dist/teams/teams/team.entity.d.ts +2 -0
- package/dist/teams/teams/team.entity.d.ts.map +1 -1
- package/dist/teams/teams/team.entity.js +4 -0
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts +2 -2
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts.map +1 -1
- package/dist/tournaments/tournament-players/tournament-player.entity.js +19 -31
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from '../../app-auth';
|
|
2
|
-
import {
|
|
2
|
+
import { PlayerTeam } from '../../teams';
|
|
3
3
|
import { PlayerPosition } from '../player-position';
|
|
4
4
|
import { PreferredLeg } from './enums/preferred-leg.enum';
|
|
5
5
|
export declare class Player {
|
|
@@ -10,6 +10,6 @@ export declare class Player {
|
|
|
10
10
|
preferredLeg: PreferredLeg | null;
|
|
11
11
|
user: User;
|
|
12
12
|
positions: PlayerPosition[];
|
|
13
|
-
|
|
13
|
+
teamMemberships: PlayerTeam[];
|
|
14
14
|
}
|
|
15
15
|
//# 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":"AAaA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"player.entity.d.ts","sourceRoot":"","sources":["../../../src/players/players/player.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,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,CAAC;IAGf,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAQhB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAMlC,IAAI,EAAE,IAAI,CAAC;IAUX,SAAS,EAAE,cAAc,EAAE,CAAC;IAG5B,eAAe,EAAE,UAAU,EAAE,CAAC;CAC/B"}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
UpdateDateColumn
|
|
22
22
|
} from "typeorm";
|
|
23
23
|
import { User } from "../../app-auth/index.js";
|
|
24
|
-
import {
|
|
24
|
+
import { PlayerTeam } from "../../teams/index.js";
|
|
25
25
|
import { PlayerPosition } from "../player-position/index.js";
|
|
26
26
|
import { PreferredLeg } from "./enums/preferred-leg.enum.js";
|
|
27
27
|
let Player = class {
|
|
@@ -61,8 +61,8 @@ __decorateClass([
|
|
|
61
61
|
})
|
|
62
62
|
], Player.prototype, "positions", 2);
|
|
63
63
|
__decorateClass([
|
|
64
|
-
OneToMany(() =>
|
|
65
|
-
], Player.prototype, "
|
|
64
|
+
OneToMany(() => PlayerTeam, (pt) => pt.player)
|
|
65
|
+
], Player.prototype, "teamMemberships", 2);
|
|
66
66
|
Player = __decorateClass([
|
|
67
67
|
Entity("players")
|
|
68
68
|
], Player);
|
package/dist/teams/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/teams/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/teams/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
package/dist/teams/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/teams/player-team/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Player } from '../../players';
|
|
2
|
+
import { Team } from '../../teams';
|
|
3
|
+
import { TournamentPlayer } from '../../tournaments';
|
|
4
|
+
export declare class PlayerTeam {
|
|
5
|
+
id: number;
|
|
6
|
+
playerId: number;
|
|
7
|
+
teamId: number;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
player: Player;
|
|
11
|
+
team: Team;
|
|
12
|
+
tournamentPlayers: TournamentPlayer[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=player-team.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-team.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/player-team/player-team.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,qBAIa,UAAU;IAIrB,EAAE,EAAE,MAAM,CAAC;IAIX,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAKhB,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,EAAE,IAAI,CAAC;IAGX,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
import {
|
|
12
|
+
Column,
|
|
13
|
+
CreateDateColumn,
|
|
14
|
+
Entity,
|
|
15
|
+
Index,
|
|
16
|
+
JoinColumn,
|
|
17
|
+
ManyToOne,
|
|
18
|
+
OneToMany,
|
|
19
|
+
PrimaryGeneratedColumn,
|
|
20
|
+
Unique,
|
|
21
|
+
UpdateDateColumn
|
|
22
|
+
} from "typeorm";
|
|
23
|
+
import { Player } from "../../players/index.js";
|
|
24
|
+
import { Team } from "../../teams/index.js";
|
|
25
|
+
import { TournamentPlayer } from "../../tournaments/index.js";
|
|
26
|
+
let PlayerTeam = class {
|
|
27
|
+
};
|
|
28
|
+
__decorateClass([
|
|
29
|
+
PrimaryGeneratedColumn({
|
|
30
|
+
comment: "Identificador \xFAnico do v\xEDnculo jogador\u2013time."
|
|
31
|
+
})
|
|
32
|
+
], PlayerTeam.prototype, "id", 2);
|
|
33
|
+
__decorateClass([
|
|
34
|
+
Column({ name: "player_id", type: "int", comment: "FK players.id" })
|
|
35
|
+
], PlayerTeam.prototype, "playerId", 2);
|
|
36
|
+
__decorateClass([
|
|
37
|
+
Column({ name: "team_id", type: "int", comment: "FK teams.id" })
|
|
38
|
+
], PlayerTeam.prototype, "teamId", 2);
|
|
39
|
+
__decorateClass([
|
|
40
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
41
|
+
], PlayerTeam.prototype, "createdAt", 2);
|
|
42
|
+
__decorateClass([
|
|
43
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
44
|
+
], PlayerTeam.prototype, "updatedAt", 2);
|
|
45
|
+
__decorateClass([
|
|
46
|
+
ManyToOne(() => Player, (p) => p.teamMemberships, { onDelete: "CASCADE" }),
|
|
47
|
+
JoinColumn({ name: "player_id" })
|
|
48
|
+
], PlayerTeam.prototype, "player", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
ManyToOne(() => Team, (t) => t.playerMemberships, { onDelete: "CASCADE" }),
|
|
51
|
+
JoinColumn({ name: "team_id" })
|
|
52
|
+
], PlayerTeam.prototype, "team", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
OneToMany(() => TournamentPlayer, (tp) => tp.playerTeam)
|
|
55
|
+
], PlayerTeam.prototype, "tournamentPlayers", 2);
|
|
56
|
+
PlayerTeam = __decorateClass([
|
|
57
|
+
Entity("player_teams"),
|
|
58
|
+
Unique(["playerId", "teamId"]),
|
|
59
|
+
Index("IDX_player_teams_player_id", ["playerId"]),
|
|
60
|
+
Index("IDX_player_teams_team_id", ["teamId"])
|
|
61
|
+
], PlayerTeam);
|
|
62
|
+
export {
|
|
63
|
+
PlayerTeam
|
|
64
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BrazilianState } from '@natrave/tournaments-service-types';
|
|
2
|
+
import { PlayerTeam } from '../../teams';
|
|
2
3
|
import { TournamentTeam } from '../../tournaments';
|
|
3
4
|
export declare class Team {
|
|
4
5
|
id: number;
|
|
@@ -12,5 +13,6 @@ export declare class Team {
|
|
|
12
13
|
createdAt: Date;
|
|
13
14
|
updatedAt: Date;
|
|
14
15
|
tournamentTeams: TournamentTeam[];
|
|
16
|
+
playerMemberships: PlayerTeam[];
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=team.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/teams/team.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWpE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAEa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,cAAc,CAAC;IAGtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAGhB,eAAe,EAAE,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"team.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/teams/team.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAEa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,cAAc,CAAC;IAGtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAGhB,eAAe,EAAE,cAAc,EAAE,CAAC;IAGlC,iBAAiB,EAAE,UAAU,EAAE,CAAC;CACjC"}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
PrimaryGeneratedColumn,
|
|
19
19
|
UpdateDateColumn
|
|
20
20
|
} from "typeorm";
|
|
21
|
+
import { PlayerTeam } from "../../teams/index.js";
|
|
21
22
|
import { TournamentTeam } from "../../tournaments/index.js";
|
|
22
23
|
let Team = class {
|
|
23
24
|
};
|
|
@@ -54,6 +55,9 @@ __decorateClass([
|
|
|
54
55
|
__decorateClass([
|
|
55
56
|
OneToMany(() => TournamentTeam, (tt) => tt.team)
|
|
56
57
|
], Team.prototype, "tournamentTeams", 2);
|
|
58
|
+
__decorateClass([
|
|
59
|
+
OneToMany(() => PlayerTeam, (pt) => pt.team)
|
|
60
|
+
], Team.prototype, "playerMemberships", 2);
|
|
57
61
|
Team = __decorateClass([
|
|
58
62
|
Entity("teams"),
|
|
59
63
|
Index("UQ_team_name", ["name"], { unique: true })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITournamentPlayer } from '@natrave/tournaments-service-types';
|
|
2
|
-
import {
|
|
2
|
+
import { PlayerTeam } from '../../teams';
|
|
3
3
|
import { TournamentMatchCard } from '../tournament-match-cards';
|
|
4
4
|
import { TournamentMatchGoal } from '../tournament-match-goals';
|
|
5
5
|
import { TournamentTeam } from '../tournament-teams';
|
|
@@ -10,7 +10,7 @@ export declare class TournamentPlayer implements ITournamentPlayer {
|
|
|
10
10
|
isOwner: boolean;
|
|
11
11
|
createdAt: Date;
|
|
12
12
|
updatedAt: Date;
|
|
13
|
-
|
|
13
|
+
playerTeam: PlayerTeam;
|
|
14
14
|
team: TournamentTeam;
|
|
15
15
|
goals: TournamentMatchGoal[];
|
|
16
16
|
assists: TournamentMatchGoal[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tournament-player.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-players/tournament-player.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAcvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tournament-player.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-players/tournament-player.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAcvE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,qBAIa,gBAAiB,YAAW,iBAAiB;IAExD,EAAE,EAAE,MAAM,CAAC;IAIX,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IASf,OAAO,EAAE,OAAO,CAAC;IAGjB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAShB,UAAU,EAAE,UAAU,CAAC;IAOvB,IAAI,EAAE,cAAc,CAAC;IAGrB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAG7B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAG/B,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B"}
|
|
@@ -20,59 +20,47 @@ import {
|
|
|
20
20
|
Unique,
|
|
21
21
|
UpdateDateColumn
|
|
22
22
|
} from "typeorm";
|
|
23
|
-
import {
|
|
23
|
+
import { PlayerTeam } from "../../teams/index.js";
|
|
24
24
|
import { TournamentMatchCard } from "../tournament-match-cards/index.js";
|
|
25
25
|
import { TournamentMatchGoal } from "../tournament-match-goals/index.js";
|
|
26
26
|
import { TournamentTeam } from "../tournament-teams/index.js";
|
|
27
27
|
let TournamentPlayer = class {
|
|
28
28
|
};
|
|
29
29
|
__decorateClass([
|
|
30
|
-
PrimaryGeneratedColumn({
|
|
31
|
-
comment: "Identificador \xFAnico do jogador no torneio."
|
|
32
|
-
})
|
|
30
|
+
PrimaryGeneratedColumn({ comment: "ID \xFAnico." })
|
|
33
31
|
], TournamentPlayer.prototype, "id", 2);
|
|
34
32
|
__decorateClass([
|
|
35
|
-
Column({
|
|
36
|
-
name: "player_id",
|
|
37
|
-
type: "int",
|
|
38
|
-
comment: "Identificador do jogador associado ao torneio."
|
|
39
|
-
})
|
|
33
|
+
Column({ name: "player_id", type: "int", comment: "FK para players.id" })
|
|
40
34
|
], TournamentPlayer.prototype, "playerId", 2);
|
|
41
35
|
__decorateClass([
|
|
42
|
-
Column({
|
|
43
|
-
name: "team_id",
|
|
44
|
-
type: "int",
|
|
45
|
-
comment: "Identificador do time ao qual o jogador pertence no torneio."
|
|
46
|
-
})
|
|
36
|
+
Column({ name: "team_id", type: "int", comment: "FK para tournament_teams.id" })
|
|
47
37
|
], TournamentPlayer.prototype, "teamId", 2);
|
|
48
38
|
__decorateClass([
|
|
49
39
|
Column({
|
|
50
40
|
name: "is_owner",
|
|
51
41
|
type: "boolean",
|
|
52
42
|
default: false,
|
|
53
|
-
comment: "
|
|
43
|
+
comment: "Dono do time no torneio."
|
|
54
44
|
})
|
|
55
45
|
], TournamentPlayer.prototype, "isOwner", 2);
|
|
56
46
|
__decorateClass([
|
|
57
|
-
CreateDateColumn({
|
|
58
|
-
name: "created_at",
|
|
59
|
-
type: "timestamptz",
|
|
60
|
-
comment: "Data e hora em que o registro foi criado."
|
|
61
|
-
})
|
|
47
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
62
48
|
], TournamentPlayer.prototype, "createdAt", 2);
|
|
63
49
|
__decorateClass([
|
|
64
|
-
UpdateDateColumn({
|
|
65
|
-
name: "updated_at",
|
|
66
|
-
type: "timestamptz",
|
|
67
|
-
comment: "Data e hora da \xFAltima atualiza\xE7\xE3o do registro."
|
|
68
|
-
})
|
|
50
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
69
51
|
], TournamentPlayer.prototype, "updatedAt", 2);
|
|
70
52
|
__decorateClass([
|
|
71
|
-
ManyToOne(() =>
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
ManyToOne(() => PlayerTeam, (pt) => pt.tournamentPlayers, {
|
|
54
|
+
eager: true,
|
|
55
|
+
onDelete: "CASCADE"
|
|
56
|
+
}),
|
|
57
|
+
JoinColumn({ name: "player_team_id" })
|
|
58
|
+
], TournamentPlayer.prototype, "playerTeam", 2);
|
|
74
59
|
__decorateClass([
|
|
75
|
-
ManyToOne(() => TournamentTeam, (
|
|
60
|
+
ManyToOne(() => TournamentTeam, (tt) => tt.players, {
|
|
61
|
+
eager: true,
|
|
62
|
+
onDelete: "CASCADE"
|
|
63
|
+
}),
|
|
76
64
|
JoinColumn({ name: "team_id" })
|
|
77
65
|
], TournamentPlayer.prototype, "team", 2);
|
|
78
66
|
__decorateClass([
|
|
@@ -86,8 +74,8 @@ __decorateClass([
|
|
|
86
74
|
], TournamentPlayer.prototype, "cards", 2);
|
|
87
75
|
TournamentPlayer = __decorateClass([
|
|
88
76
|
Entity("tournament_players"),
|
|
89
|
-
Unique(["
|
|
90
|
-
Index("
|
|
77
|
+
Unique(["playerTeamId", "teamId"]),
|
|
78
|
+
Index("IDX_player_team_id", ["playerTeamId"]),
|
|
91
79
|
Index("IDX_team_id", ["teamId"])
|
|
92
80
|
], TournamentPlayer);
|
|
93
81
|
export {
|