@natrave/shared-entities 8.42.1 → 8.44.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.
Files changed (55) hide show
  1. package/dist/database-entities/index.d.ts +2 -2
  2. package/dist/database-entities/index.d.ts.map +1 -1
  3. package/dist/database-entities/index.js +11 -1
  4. package/dist/friendlies/enums/friendly-attendance-status.enum.d.ts +5 -0
  5. package/dist/friendlies/enums/friendly-attendance-status.enum.d.ts.map +1 -0
  6. package/dist/friendlies/enums/friendly-attendance-status.enum.js +8 -0
  7. package/dist/friendlies/enums/friendly-open-challenge-status.enum.d.ts +7 -0
  8. package/dist/friendlies/enums/friendly-open-challenge-status.enum.d.ts.map +1 -0
  9. package/dist/friendlies/enums/friendly-open-challenge-status.enum.js +10 -0
  10. package/dist/friendlies/enums/friendly-schedule-kind.enum.d.ts +7 -0
  11. package/dist/friendlies/enums/friendly-schedule-kind.enum.d.ts.map +1 -0
  12. package/dist/friendlies/enums/friendly-schedule-kind.enum.js +10 -0
  13. package/dist/friendlies/friendly-board-preferences/friendly-board-preference.entity.d.ts +9 -0
  14. package/dist/friendlies/friendly-board-preferences/friendly-board-preference.entity.d.ts.map +1 -0
  15. package/dist/friendlies/friendly-board-preferences/friendly-board-preference.entity.js +66 -0
  16. package/dist/friendlies/friendly-board-preferences/index.d.ts +2 -0
  17. package/dist/friendlies/friendly-board-preferences/index.d.ts.map +1 -0
  18. package/dist/friendlies/friendly-board-preferences/index.js +4 -0
  19. package/dist/friendlies/friendly-challenges/friendly-challenge.entity.d.ts +3 -0
  20. package/dist/friendlies/friendly-challenges/friendly-challenge.entity.d.ts.map +1 -1
  21. package/dist/friendlies/friendly-challenges/friendly-challenge.entity.js +16 -0
  22. package/dist/friendlies/friendly-match-attendances/friendly-match-attendance.entity.d.ts +21 -0
  23. package/dist/friendlies/friendly-match-attendances/friendly-match-attendance.entity.d.ts.map +1 -0
  24. package/dist/friendlies/friendly-match-attendances/friendly-match-attendance.entity.js +131 -0
  25. package/dist/friendlies/friendly-match-attendances/index.d.ts +2 -0
  26. package/dist/friendlies/friendly-match-attendances/index.d.ts.map +1 -0
  27. package/dist/friendlies/friendly-match-attendances/index.js +4 -0
  28. package/dist/friendlies/friendly-match-mvps/friendly-match-mvp.entity.d.ts +12 -0
  29. package/dist/friendlies/friendly-match-mvps/friendly-match-mvp.entity.d.ts.map +1 -0
  30. package/dist/friendlies/friendly-match-mvps/friendly-match-mvp.entity.js +81 -0
  31. package/dist/friendlies/friendly-match-mvps/index.d.ts +2 -0
  32. package/dist/friendlies/friendly-match-mvps/index.d.ts.map +1 -0
  33. package/dist/friendlies/friendly-match-mvps/index.js +4 -0
  34. package/dist/friendlies/friendly-matches/friendly-match.entity.d.ts +7 -0
  35. package/dist/friendlies/friendly-matches/friendly-match.entity.d.ts.map +1 -1
  36. package/dist/friendlies/friendly-matches/friendly-match.entity.js +20 -0
  37. package/dist/friendlies/friendly-mvp-votes/friendly-mvp-vote.entity.d.ts +17 -0
  38. package/dist/friendlies/friendly-mvp-votes/friendly-mvp-vote.entity.d.ts.map +1 -0
  39. package/dist/friendlies/friendly-mvp-votes/friendly-mvp-vote.entity.js +110 -0
  40. package/dist/friendlies/friendly-mvp-votes/index.d.ts +2 -0
  41. package/dist/friendlies/friendly-mvp-votes/index.d.ts.map +1 -0
  42. package/dist/friendlies/friendly-mvp-votes/index.js +4 -0
  43. package/dist/friendlies/friendly-open-challenges/friendly-open-challenge.entity.d.ts +36 -0
  44. package/dist/friendlies/friendly-open-challenges/friendly-open-challenge.entity.d.ts.map +1 -0
  45. package/dist/friendlies/friendly-open-challenges/friendly-open-challenge.entity.js +255 -0
  46. package/dist/friendlies/friendly-open-challenges/index.d.ts +2 -0
  47. package/dist/friendlies/friendly-open-challenges/index.d.ts.map +1 -0
  48. package/dist/friendlies/friendly-open-challenges/index.js +4 -0
  49. package/dist/friendlies/index.d.ts +8 -0
  50. package/dist/friendlies/index.d.ts.map +1 -1
  51. package/dist/friendlies/index.js +11 -0
  52. package/dist/tournaments/tournament-players/tournament-player.entity.d.ts +1 -0
  53. package/dist/tournaments/tournament-players/tournament-player.entity.d.ts.map +1 -1
  54. package/dist/tournaments/tournament-players/tournament-player.entity.js +9 -0
  55. package/package.json +1 -1
@@ -28,8 +28,11 @@ import { Team } from "../../teams/teams/team.entity.js";
28
28
  import { FriendlyMatchStatus } from "../enums/friendly-match-status.enum.js";
29
29
  import { FriendlyScoreStatus } from "../enums/friendly-score-status.enum.js";
30
30
  import { FriendlyChallenge } from "../friendly-challenges/friendly-challenge.entity.js";
31
+ import { FriendlyMatchAttendance } from "../friendly-match-attendances/friendly-match-attendance.entity.js";
31
32
  import { FriendlyMatchExtra } from "../friendly-match-extras/friendly-match-extra.entity.js";
32
33
  import { FriendlyMatchGoal } from "../friendly-match-goals/friendly-match-goal.entity.js";
34
+ import { FriendlyMatchMvp } from "../friendly-match-mvps/friendly-match-mvp.entity.js";
35
+ import { FriendlyMvpVote } from "../friendly-mvp-votes/friendly-mvp-vote.entity.js";
33
36
  import { FriendlyScoreEvent } from "../friendly-score-events/friendly-score-event.entity.js";
34
37
  const STATUSES = Object.values(FriendlyMatchStatus).map((status) => `'${status}'`).join(", ");
35
38
  const SCORE_STATUSES = Object.values(FriendlyScoreStatus).map((status) => `'${status}'`).join(", ");
@@ -165,6 +168,14 @@ __decorateClass([
165
168
  comment: "Data/hora do cancelamento. Preenchida exatamente em cancelled."
166
169
  })
167
170
  ], FriendlyMatch.prototype, "cancelledAt", 2);
171
+ __decorateClass([
172
+ Column({
173
+ name: "mvp_closed_at",
174
+ type: "timestamptz",
175
+ nullable: true,
176
+ comment: "Quando a vota\xE7\xE3o do craque fechou (com ou sem votos). Nulo enquanto n\xE3o abriu ou segue aberta."
177
+ })
178
+ ], FriendlyMatch.prototype, "mvpClosedAt", 2);
168
179
  __decorateClass([
169
180
  CreateDateColumn({
170
181
  name: "created_at",
@@ -244,6 +255,15 @@ __decorateClass([
244
255
  __decorateClass([
245
256
  OneToMany(() => FriendlyScoreEvent, (event) => event.match)
246
257
  ], FriendlyMatch.prototype, "scoreEvents", 2);
258
+ __decorateClass([
259
+ OneToMany(() => FriendlyMatchAttendance, (attendance) => attendance.match)
260
+ ], FriendlyMatch.prototype, "attendances", 2);
261
+ __decorateClass([
262
+ OneToMany(() => FriendlyMvpVote, (vote) => vote.match)
263
+ ], FriendlyMatch.prototype, "mvpVotes", 2);
264
+ __decorateClass([
265
+ OneToMany(() => FriendlyMatchMvp, (mvp) => mvp.match)
266
+ ], FriendlyMatch.prototype, "mvps", 2);
247
267
  FriendlyMatch = __decorateClass([
248
268
  Entity("friendly_matches"),
249
269
  Index("UQ_friendly_matches_challenge", ["friendlyChallengeId"], { unique: true }),
@@ -0,0 +1,17 @@
1
+ import { User } from '../../app-auth';
2
+ import { PlayerTeam } from '../../teams/player-team/player-team.entity';
3
+ import { FriendlyMatch } from '../friendly-matches/friendly-match.entity';
4
+ export declare class FriendlyMvpVote {
5
+ id: number;
6
+ friendlyMatchId: number;
7
+ voterUserId: string;
8
+ voterPlayerTeamId: number;
9
+ votedPlayerTeamId: number;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ match: FriendlyMatch;
13
+ voterUser: User;
14
+ voterPlayerTeam: PlayerTeam;
15
+ votedPlayerTeam: PlayerTeam;
16
+ }
17
+ //# sourceMappingURL=friendly-mvp-vote.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friendly-mvp-vote.entity.d.ts","sourceRoot":"","sources":["../../../src/friendlies/friendly-mvp-votes/friendly-mvp-vote.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAc1E,qBAGa,eAAe;IAK1B,EAAE,EAAE,MAAM,CAAC;IAOX,eAAe,EAAE,MAAM,CAAC;IAOxB,WAAW,EAAE,MAAM,CAAC;IAOpB,iBAAiB,EAAE,MAAM,CAAC;IAO1B,iBAAiB,EAAE,MAAM,CAAC;IAO1B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAShB,KAAK,EAAE,aAAa,CAAC;IAOrB,SAAS,EAAE,IAAI,CAAC;IAOhB,eAAe,EAAE,UAAU,CAAC;IAO5B,eAAe,EAAE,UAAU,CAAC;CAC7B"}
@@ -0,0 +1,110 @@
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
+ Check,
13
+ Column,
14
+ CreateDateColumn,
15
+ Entity,
16
+ JoinColumn,
17
+ ManyToOne,
18
+ PrimaryGeneratedColumn,
19
+ Unique,
20
+ UpdateDateColumn
21
+ } from "typeorm";
22
+ import { User } from "../../app-auth/index.js";
23
+ import { PlayerTeam } from "../../teams/player-team/player-team.entity.js";
24
+ import { FriendlyMatch } from "../friendly-matches/friendly-match.entity.js";
25
+ let FriendlyMvpVote = class {
26
+ };
27
+ __decorateClass([
28
+ PrimaryGeneratedColumn({
29
+ primaryKeyConstraintName: "PK_friendly_mvp_votes",
30
+ comment: "Identificador \xFAnico do voto."
31
+ })
32
+ ], FriendlyMvpVote.prototype, "id", 2);
33
+ __decorateClass([
34
+ Column({
35
+ name: "friendly_match_id",
36
+ type: "int",
37
+ comment: "FK friendly_matches.id."
38
+ })
39
+ ], FriendlyMvpVote.prototype, "friendlyMatchId", 2);
40
+ __decorateClass([
41
+ Column({
42
+ name: "voter_user_id",
43
+ type: "uuid",
44
+ comment: "FK users.id. Quem votou; um voto por pessoa e partida, troc\xE1vel na janela."
45
+ })
46
+ ], FriendlyMvpVote.prototype, "voterUserId", 2);
47
+ __decorateClass([
48
+ Column({
49
+ name: "voter_player_team_id",
50
+ type: "int",
51
+ comment: 'FK player_teams.id. O v\xEDnculo de quem votou, que disse "Vou".'
52
+ })
53
+ ], FriendlyMvpVote.prototype, "voterPlayerTeamId", 2);
54
+ __decorateClass([
55
+ Column({
56
+ name: "voted_player_team_id",
57
+ type: "int",
58
+ comment: "FK player_teams.id. O jogador votado, de qualquer um dos dois times."
59
+ })
60
+ ], FriendlyMvpVote.prototype, "votedPlayerTeamId", 2);
61
+ __decorateClass([
62
+ CreateDateColumn({
63
+ name: "created_at",
64
+ type: "timestamptz",
65
+ comment: "Data/hora do primeiro voto."
66
+ })
67
+ ], FriendlyMvpVote.prototype, "createdAt", 2);
68
+ __decorateClass([
69
+ UpdateDateColumn({
70
+ name: "updated_at",
71
+ type: "timestamptz",
72
+ comment: "Data/hora da \xFAltima troca de voto."
73
+ })
74
+ ], FriendlyMvpVote.prototype, "updatedAt", 2);
75
+ __decorateClass([
76
+ ManyToOne(() => FriendlyMatch, (match) => match.mvpVotes, { onDelete: "CASCADE" }),
77
+ JoinColumn({
78
+ name: "friendly_match_id",
79
+ foreignKeyConstraintName: "FK_friendly_mvp_votes_match"
80
+ })
81
+ ], FriendlyMvpVote.prototype, "match", 2);
82
+ __decorateClass([
83
+ ManyToOne(() => User, { onDelete: "CASCADE" }),
84
+ JoinColumn({
85
+ name: "voter_user_id",
86
+ foreignKeyConstraintName: "FK_friendly_mvp_votes_voter_user"
87
+ })
88
+ ], FriendlyMvpVote.prototype, "voterUser", 2);
89
+ __decorateClass([
90
+ ManyToOne(() => PlayerTeam, { onDelete: "CASCADE" }),
91
+ JoinColumn({
92
+ name: "voter_player_team_id",
93
+ foreignKeyConstraintName: "FK_friendly_mvp_votes_voter_player_team"
94
+ })
95
+ ], FriendlyMvpVote.prototype, "voterPlayerTeam", 2);
96
+ __decorateClass([
97
+ ManyToOne(() => PlayerTeam, { onDelete: "CASCADE" }),
98
+ JoinColumn({
99
+ name: "voted_player_team_id",
100
+ foreignKeyConstraintName: "FK_friendly_mvp_votes_voted_player_team"
101
+ })
102
+ ], FriendlyMvpVote.prototype, "votedPlayerTeam", 2);
103
+ FriendlyMvpVote = __decorateClass([
104
+ Entity("friendly_mvp_votes"),
105
+ Unique("UQ_friendly_mvp_votes_voter", ["friendlyMatchId", "voterUserId"]),
106
+ Check("CHK_friendly_mvp_votes_not_self", `"voter_player_team_id" <> "voted_player_team_id"`)
107
+ ], FriendlyMvpVote);
108
+ export {
109
+ FriendlyMvpVote
110
+ };
@@ -0,0 +1,2 @@
1
+ export { FriendlyMvpVote } from './friendly-mvp-vote.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/friendlies/friendly-mvp-votes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FriendlyMvpVote } from "./friendly-mvp-vote.entity.js";
2
+ export {
3
+ FriendlyMvpVote
4
+ };
@@ -0,0 +1,36 @@
1
+ import { User } from '../../app-auth';
2
+ import { Facility } from '../../facilities/facilities/facility.entity';
3
+ import { Modality } from '../../teams/team-modality/enums/modality.enum';
4
+ import { Team } from '../../teams/teams/team.entity';
5
+ import { FriendlyOpenChallengeStatus } from '../enums/friendly-open-challenge-status.enum';
6
+ import { FriendlyScheduleKind } from '../enums/friendly-schedule-kind.enum';
7
+ import { FriendlyChallenge } from '../friendly-challenges/friendly-challenge.entity';
8
+ export declare class FriendlyOpenChallenge {
9
+ id: number;
10
+ teamId: number;
11
+ modality: Modality;
12
+ status: FriendlyOpenChallengeStatus;
13
+ scheduleKind: FriendlyScheduleKind;
14
+ matchDate: string | null;
15
+ matchTime: string | null;
16
+ weekday: number | null;
17
+ facilityId: number | null;
18
+ expiresAt: Date;
19
+ createdByUserId: string;
20
+ acceptedFriendlyChallengeId: number | null;
21
+ acceptedByTeamId: number | null;
22
+ acceptedByUserId: string | null;
23
+ acceptedAt: Date | null;
24
+ closedByUserId: string | null;
25
+ closedAt: Date | null;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ team: Team;
29
+ facility: Facility | null;
30
+ createdByUser: User;
31
+ acceptedChallenge: FriendlyChallenge | null;
32
+ acceptedByTeam: Team | null;
33
+ acceptedByUser: User | null;
34
+ closedByUser: User | null;
35
+ }
36
+ //# sourceMappingURL=friendly-open-challenge.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friendly-open-challenge.entity.d.ts","sourceRoot":"","sources":["../../../src/friendlies/friendly-open-challenges/friendly-open-challenge.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AA2BrF,qBA6Ba,qBAAqB;IAKhC,EAAE,EAAE,MAAM,CAAC;IAOX,MAAM,EAAE,MAAM,CAAC;IAOf,QAAQ,EAAE,QAAQ,CAAC;IAQnB,MAAM,EAAE,2BAA2B,CAAC;IASpC,YAAY,EAAE,oBAAoB,CAAC;IAQnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAOzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAQvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,SAAS,EAAE,IAAI,CAAC;IAOhB,eAAe,EAAE,MAAM,CAAC;IASxB,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IAQxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ9B,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IAOtB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAShB,IAAI,EAAE,IAAI,CAAC;IAQX,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAO1B,aAAa,EAAE,IAAI,CAAC;IAOpB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAO5C,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;IAO5B,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;IAO5B,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B"}
@@ -0,0 +1,255 @@
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
+ Check,
13
+ Column,
14
+ CreateDateColumn,
15
+ Entity,
16
+ Index,
17
+ JoinColumn,
18
+ ManyToOne,
19
+ PrimaryGeneratedColumn,
20
+ UpdateDateColumn
21
+ } from "typeorm";
22
+ import { User } from "../../app-auth/index.js";
23
+ import { Facility } from "../../facilities/facilities/facility.entity.js";
24
+ import { Modality } from "../../teams/team-modality/enums/modality.enum.js";
25
+ import { Team } from "../../teams/teams/team.entity.js";
26
+ import { FriendlyOpenChallengeStatus } from "../enums/friendly-open-challenge-status.enum.js";
27
+ import { FriendlyScheduleKind } from "../enums/friendly-schedule-kind.enum.js";
28
+ import { FriendlyChallenge } from "../friendly-challenges/friendly-challenge.entity.js";
29
+ const STATUSES = Object.values(FriendlyOpenChallengeStatus).map((status) => `'${status}'`).join(", ");
30
+ const MODALITIES = Object.values(Modality).map((modality) => `'${modality}'`).join(", ");
31
+ const SCHEDULE_KINDS = Object.values(FriendlyScheduleKind).map((kind) => `'${kind}'`).join(", ");
32
+ let FriendlyOpenChallenge = class {
33
+ };
34
+ __decorateClass([
35
+ PrimaryGeneratedColumn({
36
+ primaryKeyConstraintName: "PK_friendly_open_challenges",
37
+ comment: "Identificador \xFAnico do desafio aberto (o item do mural)."
38
+ })
39
+ ], FriendlyOpenChallenge.prototype, "id", 2);
40
+ __decorateClass([
41
+ Column({
42
+ name: "team_id",
43
+ type: "int",
44
+ comment: "FK teams.id. Time que publicou e espera um advers\xE1rio."
45
+ })
46
+ ], FriendlyOpenChallenge.prototype, "teamId", 2);
47
+ __decorateClass([
48
+ Column({
49
+ type: "varchar",
50
+ length: 16,
51
+ comment: "Modalidade do jogo, com os valores de team_modalities.modality."
52
+ })
53
+ ], FriendlyOpenChallenge.prototype, "modality", 2);
54
+ __decorateClass([
55
+ Column({
56
+ type: "varchar",
57
+ length: 16,
58
+ default: FriendlyOpenChallengeStatus.OPEN,
59
+ comment: "open | accepted | cancelled | expired."
60
+ })
61
+ ], FriendlyOpenChallenge.prototype, "status", 2);
62
+ __decorateClass([
63
+ Column({
64
+ name: "schedule_kind",
65
+ type: "varchar",
66
+ length: 16,
67
+ comment: "date_time (data e hor\xE1rio) | date (s\xF3 data) | weekday (s\xF3 dia da semana) | open (tudo a combinar)."
68
+ })
69
+ ], FriendlyOpenChallenge.prototype, "scheduleKind", 2);
70
+ __decorateClass([
71
+ Column({
72
+ name: "match_date",
73
+ type: "date",
74
+ nullable: true,
75
+ comment: "Data proposta. S\xF3 em date_time e date."
76
+ })
77
+ ], FriendlyOpenChallenge.prototype, "matchDate", 2);
78
+ __decorateClass([
79
+ Column({
80
+ name: "match_time",
81
+ type: "time",
82
+ nullable: true,
83
+ comment: "Hor\xE1rio proposto (HH:MM:SS). S\xF3 em date_time."
84
+ })
85
+ ], FriendlyOpenChallenge.prototype, "matchTime", 2);
86
+ __decorateClass([
87
+ Column({
88
+ type: "smallint",
89
+ nullable: true,
90
+ comment: "Dia da semana proposto, 0 domingo a 6 s\xE1bado. S\xF3 em weekday."
91
+ })
92
+ ], FriendlyOpenChallenge.prototype, "weekday", 2);
93
+ __decorateClass([
94
+ Column({
95
+ name: "facility_id",
96
+ type: "int",
97
+ nullable: true,
98
+ comment: 'FK facilities.id. Local proposto; nulo \xE9 "a combinar".'
99
+ })
100
+ ], FriendlyOpenChallenge.prototype, "facilityId", 2);
101
+ __decorateClass([
102
+ Column({
103
+ name: "expires_at",
104
+ type: "timestamptz",
105
+ comment: "Quando sai do mural sem aceite: data e hor\xE1rio propostos em America/Sao_Paulo (00:00 sem hor\xE1rio); sem data, created_at + 7 dias."
106
+ })
107
+ ], FriendlyOpenChallenge.prototype, "expiresAt", 2);
108
+ __decorateClass([
109
+ Column({
110
+ name: "created_by_user_id",
111
+ type: "uuid",
112
+ comment: "FK users.id. Quem publicou; no amistoso que nasce, quem lan\xE7a o placar."
113
+ })
114
+ ], FriendlyOpenChallenge.prototype, "createdByUserId", 2);
115
+ __decorateClass([
116
+ Column({
117
+ name: "accepted_friendly_challenge_id",
118
+ type: "int",
119
+ nullable: true,
120
+ comment: "FK friendly_challenges.id. O amistoso que nasceu do aceite (j\xE1 accepted, com a partida)."
121
+ })
122
+ ], FriendlyOpenChallenge.prototype, "acceptedFriendlyChallengeId", 2);
123
+ __decorateClass([
124
+ Column({
125
+ name: "accepted_by_team_id",
126
+ type: "int",
127
+ nullable: true,
128
+ comment: "FK teams.id. O primeiro time que aceitou."
129
+ })
130
+ ], FriendlyOpenChallenge.prototype, "acceptedByTeamId", 2);
131
+ __decorateClass([
132
+ Column({
133
+ name: "accepted_by_user_id",
134
+ type: "uuid",
135
+ nullable: true,
136
+ comment: "FK users.id. Quem aceitou; no amistoso, quem responde o placar."
137
+ })
138
+ ], FriendlyOpenChallenge.prototype, "acceptedByUserId", 2);
139
+ __decorateClass([
140
+ Column({
141
+ name: "accepted_at",
142
+ type: "timestamptz",
143
+ nullable: true,
144
+ comment: "Data/hora do aceite. Preenchida exatamente em accepted."
145
+ })
146
+ ], FriendlyOpenChallenge.prototype, "acceptedAt", 2);
147
+ __decorateClass([
148
+ Column({
149
+ name: "closed_by_user_id",
150
+ type: "uuid",
151
+ nullable: true,
152
+ comment: "FK users.id. Quem cancelou. Nulo quando a rotina expirou."
153
+ })
154
+ ], FriendlyOpenChallenge.prototype, "closedByUserId", 2);
155
+ __decorateClass([
156
+ Column({
157
+ name: "closed_at",
158
+ type: "timestamptz",
159
+ nullable: true,
160
+ comment: "Data/hora do cancelamento ou da expira\xE7\xE3o."
161
+ })
162
+ ], FriendlyOpenChallenge.prototype, "closedAt", 2);
163
+ __decorateClass([
164
+ CreateDateColumn({
165
+ name: "created_at",
166
+ type: "timestamptz",
167
+ comment: "Data/hora da publica\xE7\xE3o no mural."
168
+ })
169
+ ], FriendlyOpenChallenge.prototype, "createdAt", 2);
170
+ __decorateClass([
171
+ UpdateDateColumn({
172
+ name: "updated_at",
173
+ type: "timestamptz",
174
+ comment: "Data/hora da \xFAltima atualiza\xE7\xE3o."
175
+ })
176
+ ], FriendlyOpenChallenge.prototype, "updatedAt", 2);
177
+ __decorateClass([
178
+ ManyToOne(() => Team, { onDelete: "RESTRICT" }),
179
+ JoinColumn({
180
+ name: "team_id",
181
+ foreignKeyConstraintName: "FK_friendly_open_challenges_team"
182
+ })
183
+ ], FriendlyOpenChallenge.prototype, "team", 2);
184
+ __decorateClass([
185
+ ManyToOne(() => Facility, { onDelete: "SET NULL" }),
186
+ JoinColumn({
187
+ name: "facility_id",
188
+ foreignKeyConstraintName: "FK_friendly_open_challenges_facility"
189
+ })
190
+ ], FriendlyOpenChallenge.prototype, "facility", 2);
191
+ __decorateClass([
192
+ ManyToOne(() => User, { onDelete: "RESTRICT" }),
193
+ JoinColumn({
194
+ name: "created_by_user_id",
195
+ foreignKeyConstraintName: "FK_friendly_open_challenges_created_by_user"
196
+ })
197
+ ], FriendlyOpenChallenge.prototype, "createdByUser", 2);
198
+ __decorateClass([
199
+ ManyToOne(() => FriendlyChallenge, { onDelete: "RESTRICT" }),
200
+ JoinColumn({
201
+ name: "accepted_friendly_challenge_id",
202
+ foreignKeyConstraintName: "FK_friendly_open_challenges_accepted_challenge"
203
+ })
204
+ ], FriendlyOpenChallenge.prototype, "acceptedChallenge", 2);
205
+ __decorateClass([
206
+ ManyToOne(() => Team, { onDelete: "RESTRICT" }),
207
+ JoinColumn({
208
+ name: "accepted_by_team_id",
209
+ foreignKeyConstraintName: "FK_friendly_open_challenges_accepted_by_team"
210
+ })
211
+ ], FriendlyOpenChallenge.prototype, "acceptedByTeam", 2);
212
+ __decorateClass([
213
+ ManyToOne(() => User, { onDelete: "RESTRICT" }),
214
+ JoinColumn({
215
+ name: "accepted_by_user_id",
216
+ foreignKeyConstraintName: "FK_friendly_open_challenges_accepted_by_user"
217
+ })
218
+ ], FriendlyOpenChallenge.prototype, "acceptedByUser", 2);
219
+ __decorateClass([
220
+ ManyToOne(() => User, { onDelete: "RESTRICT" }),
221
+ JoinColumn({
222
+ name: "closed_by_user_id",
223
+ foreignKeyConstraintName: "FK_friendly_open_challenges_closed_by_user"
224
+ })
225
+ ], FriendlyOpenChallenge.prototype, "closedByUser", 2);
226
+ FriendlyOpenChallenge = __decorateClass([
227
+ Entity("friendly_open_challenges"),
228
+ Index("IDX_friendly_open_challenges_team_status", ["teamId", "status"]),
229
+ Index("IDX_friendly_open_challenges_open", ["expiresAt"], {
230
+ where: `"status" = 'open'`
231
+ }),
232
+ Check("CHK_friendly_open_challenges_status", `"status" IN (${STATUSES})`),
233
+ Check("CHK_friendly_open_challenges_modality", `"modality" IN (${MODALITIES})`),
234
+ Check("CHK_friendly_open_challenges_schedule_kind", `"schedule_kind" IN (${SCHEDULE_KINDS})`),
235
+ Check(
236
+ "CHK_friendly_open_challenges_schedule",
237
+ `("schedule_kind" = 'date_time' AND "match_date" IS NOT NULL AND "match_time" IS NOT NULL AND "weekday" IS NULL) OR ("schedule_kind" = 'date' AND "match_date" IS NOT NULL AND "match_time" IS NULL AND "weekday" IS NULL) OR ("schedule_kind" = 'weekday' AND "match_date" IS NULL AND "match_time" IS NULL AND "weekday" IS NOT NULL) OR ("schedule_kind" = 'open' AND "match_date" IS NULL AND "match_time" IS NULL AND "weekday" IS NULL)`
238
+ ),
239
+ Check("CHK_friendly_open_challenges_weekday", `"weekday" IS NULL OR "weekday" BETWEEN 0 AND 6`),
240
+ Check(
241
+ "CHK_friendly_open_challenges_accepted",
242
+ `("status" = 'accepted') = ("accepted_at" IS NOT NULL AND "accepted_by_user_id" IS NOT NULL AND "accepted_by_team_id" IS NOT NULL AND "accepted_friendly_challenge_id" IS NOT NULL)`
243
+ ),
244
+ Check(
245
+ "CHK_friendly_open_challenges_closed",
246
+ `("status" IN ('cancelled', 'expired')) = ("closed_at" IS NOT NULL)`
247
+ ),
248
+ Check(
249
+ "CHK_friendly_open_challenges_distinct_teams",
250
+ `"accepted_by_team_id" IS NULL OR "accepted_by_team_id" <> "team_id"`
251
+ )
252
+ ], FriendlyOpenChallenge);
253
+ export {
254
+ FriendlyOpenChallenge
255
+ };
@@ -0,0 +1,2 @@
1
+ export { FriendlyOpenChallenge } from './friendly-open-challenge.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/friendlies/friendly-open-challenges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FriendlyOpenChallenge } from "./friendly-open-challenge.entity.js";
2
+ export {
3
+ FriendlyOpenChallenge
4
+ };
@@ -1,15 +1,23 @@
1
+ export { FriendlyAttendanceStatus } from './enums/friendly-attendance-status.enum';
1
2
  export { FriendlyChallengeStatus } from './enums/friendly-challenge-status.enum';
2
3
  export { FriendlyDeclineReason } from './enums/friendly-decline-reason.enum';
3
4
  export { FriendlyMatchStatus } from './enums/friendly-match-status.enum';
5
+ export { FriendlyOpenChallengeStatus } from './enums/friendly-open-challenge-status.enum';
4
6
  export { FriendlyResource } from './enums/friendly-resource.enum';
5
7
  export { FriendlyResponsible } from './enums/friendly-responsible.enum';
8
+ export { FriendlyScheduleKind } from './enums/friendly-schedule-kind.enum';
6
9
  export { FriendlyScoreEventType } from './enums/friendly-score-event-type.enum';
7
10
  export { FriendlyScoreStatus } from './enums/friendly-score-status.enum';
11
+ export * from './friendly-board-preferences';
8
12
  export * from './friendly-challenge-extras';
9
13
  export * from './friendly-challenges';
14
+ export * from './friendly-match-attendances';
10
15
  export * from './friendly-match-extras';
11
16
  export * from './friendly-match-goals';
17
+ export * from './friendly-match-mvps';
12
18
  export * from './friendly-matches';
19
+ export * from './friendly-mvp-votes';
20
+ export * from './friendly-open-challenges';
13
21
  export * from './friendly-requests';
14
22
  export * from './friendly-score-events';
15
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/friendlies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/friendlies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
@@ -1,23 +1,34 @@
1
+ import { FriendlyAttendanceStatus } from "./enums/friendly-attendance-status.enum.js";
1
2
  import { FriendlyChallengeStatus } from "./enums/friendly-challenge-status.enum.js";
2
3
  import { FriendlyDeclineReason } from "./enums/friendly-decline-reason.enum.js";
3
4
  import { FriendlyMatchStatus } from "./enums/friendly-match-status.enum.js";
5
+ import { FriendlyOpenChallengeStatus } from "./enums/friendly-open-challenge-status.enum.js";
4
6
  import { FriendlyResource } from "./enums/friendly-resource.enum.js";
5
7
  import { FriendlyResponsible } from "./enums/friendly-responsible.enum.js";
8
+ import { FriendlyScheduleKind } from "./enums/friendly-schedule-kind.enum.js";
6
9
  import { FriendlyScoreEventType } from "./enums/friendly-score-event-type.enum.js";
7
10
  import { FriendlyScoreStatus } from "./enums/friendly-score-status.enum.js";
11
+ export * from "./friendly-board-preferences/index.js";
8
12
  export * from "./friendly-challenge-extras/index.js";
9
13
  export * from "./friendly-challenges/index.js";
14
+ export * from "./friendly-match-attendances/index.js";
10
15
  export * from "./friendly-match-extras/index.js";
11
16
  export * from "./friendly-match-goals/index.js";
17
+ export * from "./friendly-match-mvps/index.js";
12
18
  export * from "./friendly-matches/index.js";
19
+ export * from "./friendly-mvp-votes/index.js";
20
+ export * from "./friendly-open-challenges/index.js";
13
21
  export * from "./friendly-requests/index.js";
14
22
  export * from "./friendly-score-events/index.js";
15
23
  export {
24
+ FriendlyAttendanceStatus,
16
25
  FriendlyChallengeStatus,
17
26
  FriendlyDeclineReason,
18
27
  FriendlyMatchStatus,
28
+ FriendlyOpenChallengeStatus,
19
29
  FriendlyResource,
20
30
  FriendlyResponsible,
31
+ FriendlyScheduleKind,
21
32
  FriendlyScoreEventType,
22
33
  FriendlyScoreStatus
23
34
  };
@@ -15,6 +15,7 @@ export declare class TournamentPlayer implements ITournamentPlayer {
15
15
  displayName: string | null;
16
16
  nickname: string | null;
17
17
  positions: Position[] | null;
18
+ photoUrl: string | null;
18
19
  calledUpBy: CallUpSource;
19
20
  calledUpByOrganizationUserId: number | null;
20
21
  originMatchId: number | null;
@@ -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;AAgBvE,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAC7E,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,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,qBAYa,gBAAiB,YAAW,iBAAiB;IAExD,EAAE,EAAE,MAAM,CAAC;IAIX,YAAY,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IASf,OAAO,EAAE,OAAO,CAAC;IA2BjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAU3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAS3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAgBxB,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAkB7B,UAAU,EAAE,YAAY,CAAC;IAczB,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;IAa5C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAShB,UAAU,EAAE,UAAU,CAAC;IAQvB,SAAS,EAAE,IAAI,GAAG,IAAI,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;IAI7B,eAAe,EAAE,2BAA2B,EAAE,CAAC;IAI/C,gBAAgB,EAAE,2BAA2B,EAAE,CAAC;CACjD"}
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;AAgBvE,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAC7E,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,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,qBAYa,gBAAiB,YAAW,iBAAiB;IAExD,EAAE,EAAE,MAAM,CAAC;IAIX,YAAY,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IASf,OAAO,EAAE,OAAO,CAAC;IA2BjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAU3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAS3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAgBxB,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAkB7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAkBxB,UAAU,EAAE,YAAY,CAAC;IAczB,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;IAa5C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAShB,UAAU,EAAE,UAAU,CAAC;IAQvB,SAAS,EAAE,IAAI,GAAG,IAAI,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;IAI7B,eAAe,EAAE,2BAA2B,EAAE,CAAC;IAI/C,gBAAgB,EAAE,2BAA2B,EAAE,CAAC;CACjD"}
@@ -82,6 +82,15 @@ __decorateClass([
82
82
  comment: "Posi\xE7\xF5es nesta categoria. Copiadas de player_teams na convoca\xE7\xE3o; {} \xE9 sem posi\xE7\xE3o."
83
83
  })
84
84
  ], TournamentPlayer.prototype, "positions", 2);
85
+ __decorateClass([
86
+ Column({
87
+ name: "photo_url",
88
+ type: "varchar",
89
+ length: 500,
90
+ nullable: true,
91
+ comment: "Foto da carteirinha nesta categoria. NULL usa a foto da conta (users.image_url)."
92
+ })
93
+ ], TournamentPlayer.prototype, "photoUrl", 2);
85
94
  __decorateClass([
86
95
  Column({
87
96
  name: "called_up_by",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "8.42.1",
3
+ "version": "8.44.0",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",