@natrave/shared-entities 7.31.0 → 7.33.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.
@@ -5,15 +5,15 @@ export declare class TeamPlayerMergeHistory {
5
5
  teamId: number;
6
6
  joinRequestId: number | null;
7
7
  executedByUserId: string | null;
8
- sourcePlayerTeamId: number;
8
+ sourcePlayerTeamId: number | null;
9
9
  sourcePlayerId: number | null;
10
10
  targetPlayerTeamId: number;
11
11
  targetPlayerId: number;
12
12
  createdAt: Date;
13
13
  team: Team;
14
14
  sourcePlayerTeam: PlayerTeam | null;
15
- targetPlayerTeam: PlayerTeam | null;
15
+ targetPlayerTeam: PlayerTeam;
16
16
  sourcePlayer: Player | null;
17
- targetPlayer: Player | null;
17
+ targetPlayer: Player;
18
18
  }
19
19
  //# sourceMappingURL=team-player-merge-history.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team-player-merge-history.entity.d.ts","sourceRoot":"","sources":["../../../src/history-logs/team-player-merge-history/team-player-merge-history.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/C,qBAIa,sBAAsB;IAIjC,EAAE,EAAE,MAAM,CAAC;IAQX,MAAM,EAAE,MAAM,CAAC;IAQf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,kBAAkB,EAAE,MAAM,CAAC;IAQ3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ9B,kBAAkB,EAAE,MAAM,CAAC;IAO3B,cAAc,EAAE,MAAM,CAAC;IAQvB,SAAS,EAAE,IAAI,CAAC;IAKhB,IAAI,EAAE,IAAI,CAAC;IAIX,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAC;IAIpC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAC;IAIpC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAI5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
1
+ {"version":3,"file":"team-player-merge-history.entity.d.ts","sourceRoot":"","sources":["../../../src/history-logs/team-player-merge-history/team-player-merge-history.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/C,qBAIa,sBAAsB;IAIjC,EAAE,EAAE,MAAM,CAAC;IAQX,MAAM,EAAE,MAAM,CAAC;IAQf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAWhC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQlC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ9B,kBAAkB,EAAE,MAAM,CAAC;IAO3B,cAAc,EAAE,MAAM,CAAC;IAQvB,SAAS,EAAE,IAAI,CAAC;IAKhB,IAAI,EAAE,IAAI,CAAC;IAIX,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAC;IAMpC,gBAAgB,EAAE,UAAU,CAAC;IAI7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAI5B,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -53,7 +53,8 @@ __decorateClass([
53
53
  Column({
54
54
  name: "source_player_team_id",
55
55
  type: "int",
56
- comment: "FK player_teams.id que foi convertido em gen\xE9rico."
56
+ nullable: true,
57
+ comment: "FK player_teams.id que foi convertido em gen\xE9rico. NULL quando o usu\xE1rio n\xE3o tinha v\xEDnculo anterior no time (ex.: claim de jogador sem conta sem hist\xF3rico)."
57
58
  })
58
59
  ], TeamPlayerMergeHistory.prototype, "sourcePlayerTeamId", 2);
59
60
  __decorateClass([
@@ -94,7 +95,7 @@ __decorateClass([
94
95
  JoinColumn({ name: "source_player_team_id" })
95
96
  ], TeamPlayerMergeHistory.prototype, "sourcePlayerTeam", 2);
96
97
  __decorateClass([
97
- ManyToOne(() => PlayerTeam, { onDelete: "SET NULL" }),
98
+ ManyToOne(() => PlayerTeam, { onDelete: "RESTRICT" }),
98
99
  JoinColumn({ name: "target_player_team_id" })
99
100
  ], TeamPlayerMergeHistory.prototype, "targetPlayerTeam", 2);
100
101
  __decorateClass([
@@ -102,7 +103,7 @@ __decorateClass([
102
103
  JoinColumn({ name: "source_player_id" })
103
104
  ], TeamPlayerMergeHistory.prototype, "sourcePlayer", 2);
104
105
  __decorateClass([
105
- ManyToOne(() => Player, { onDelete: "SET NULL" }),
106
+ ManyToOne(() => Player, { onDelete: "RESTRICT" }),
106
107
  JoinColumn({ name: "target_player_id" })
107
108
  ], TeamPlayerMergeHistory.prototype, "targetPlayer", 2);
108
109
  TeamPlayerMergeHistory = __decorateClass([
@@ -0,0 +1,5 @@
1
+ export declare enum MatchCreationSource {
2
+ TABLE_GENERATION = "table_generation",
3
+ ORGANIZER = "organizer"
4
+ }
5
+ //# sourceMappingURL=match-creation-source.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-creation-source.enum.d.ts","sourceRoot":"","sources":["../../../../src/tournaments/tournament-matches/enums/match-creation-source.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,mBAAmB;IAK7B,gBAAgB,qBAAqB;IAKrC,SAAS,cAAc;CACxB"}
@@ -0,0 +1,8 @@
1
+ var MatchCreationSource = /* @__PURE__ */ ((MatchCreationSource2) => {
2
+ MatchCreationSource2["TABLE_GENERATION"] = "table_generation";
3
+ MatchCreationSource2["ORGANIZER"] = "organizer";
4
+ return MatchCreationSource2;
5
+ })(MatchCreationSource || {});
6
+ export {
7
+ MatchCreationSource
8
+ };
@@ -1,3 +1,4 @@
1
+ export { MatchCreationSource } from './enums/match-creation-source.enum';
1
2
  export { MatchScoresheetSource } from './enums/match-scoresheet-source.enum';
2
3
  export { TournamentMatch } from './tournament-match.entity';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-matches/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-matches/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,6 +1,8 @@
1
+ import { MatchCreationSource } from "./enums/match-creation-source.enum.js";
1
2
  import { MatchScoresheetSource } from "./enums/match-scoresheet-source.enum.js";
2
3
  import { TournamentMatch } from "./tournament-match.entity.js";
3
4
  export {
5
+ MatchCreationSource,
4
6
  MatchScoresheetSource,
5
7
  TournamentMatch
6
8
  };
@@ -1,4 +1,4 @@
1
- import { ITournamentMatch, MatchStatus, TournamentMatchPhase } from '@natrave/tournaments-service-types';
1
+ import { MatchStatus, TournamentMatchPhase } from '@natrave/tournaments-service-types';
2
2
  import { TournamentBracket } from '../tournament-brackets';
3
3
  import { TournamentFacility } from '../tournament-facilities';
4
4
  import { TournamentMatchCard } from '../tournament-match-cards';
@@ -7,8 +7,9 @@ import { TournamentMatchSubstitution } from '../tournament-match-substitutions';
7
7
  import { TournamentPenaltyShootout } from '../tournament-penalty-shootouts';
8
8
  import { TournamentTeam } from '../tournament-teams';
9
9
  import { Tournament } from '../tournaments';
10
+ import { MatchCreationSource } from './enums/match-creation-source.enum';
10
11
  import { MatchScoresheetSource } from './enums/match-scoresheet-source.enum';
11
- export declare class TournamentMatch implements ITournamentMatch {
12
+ export declare class TournamentMatch {
12
13
  id: number;
13
14
  tournamentId: number;
14
15
  homeTeamId: number | null;
@@ -31,6 +32,8 @@ export declare class TournamentMatch implements ITournamentMatch {
31
32
  advancingTeamId: number | null;
32
33
  advancementReason: string | null;
33
34
  scoresheetSource: MatchScoresheetSource | null;
35
+ creationSource: MatchCreationSource;
36
+ createdByOrganizationUserId: number | null;
34
37
  facility?: TournamentFacility;
35
38
  tournament: Tournament;
36
39
  homeTeam: TournamentTeam;
@@ -1 +1 @@
1
- {"version":3,"file":"tournament-match.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-matches/tournament-match.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAe5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,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,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,qBAgDa,eAAgB,YAAW,gBAAgB;IAItD,EAAE,EAAE,MAAM,CAAC;IAOX,YAAY,EAAE,MAAM,CAAC;IAQrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,UAAU,CAAC,EAAE,MAAM,CAAC;IASpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,GAAG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IAAI,GAAG,IAAI,CAAC;IAWvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAU/B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAUjC,gBAAgB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAY/C,cAAc,EAAE,mBAAmB,CAAC;IAWpC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAM9B,UAAU,EAAE,UAAU,CAAC;IAMvB,QAAQ,EAAE,cAAc,CAAC;IAMzB,QAAQ,EAAE,cAAc,CAAC;IAIzB,eAAe,CAAC,EAAE,cAAc,CAAC;IAGjC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAG7B,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAG7B,aAAa,EAAE,2BAA2B,EAAE,CAAC;IAG7C,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IAGtC,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;IAGvC,eAAe,EAAE,yBAAyB,CAAC;CAC5C"}
@@ -8,10 +8,7 @@ var __decorateClass = (decorators, target, key, kind) => {
8
8
  if (kind && result) __defProp(target, key, result);
9
9
  return result;
10
10
  };
11
- import {
12
- MatchStatus,
13
- TournamentMatchPhase
14
- } from "@natrave/tournaments-service-types";
11
+ import { MatchStatus, TournamentMatchPhase } from "@natrave/tournaments-service-types";
15
12
  import {
16
13
  Check,
17
14
  Column,
@@ -33,6 +30,7 @@ import { TournamentMatchSubstitution } from "../tournament-match-substitutions/i
33
30
  import { TournamentPenaltyShootout } from "../tournament-penalty-shootouts/index.js";
34
31
  import { TournamentTeam } from "../tournament-teams/index.js";
35
32
  import { Tournament } from "../tournaments/index.js";
33
+ import { MatchCreationSource } from "./enums/match-creation-source.enum.js";
36
34
  import { MatchScoresheetSource } from "./enums/match-scoresheet-source.enum.js";
37
35
  let TournamentMatch = class {
38
36
  };
@@ -205,6 +203,23 @@ __decorateClass([
205
203
  comment: "Origem da s\xFAmula usada para finalizar a partida: ao vivo ou p\xF3s-jogo."
206
204
  })
207
205
  ], TournamentMatch.prototype, "scoresheetSource", 2);
206
+ __decorateClass([
207
+ Column({
208
+ name: "creation_source",
209
+ type: "enum",
210
+ enum: MatchCreationSource,
211
+ default: MatchCreationSource.TABLE_GENERATION,
212
+ comment: "Quem originou a partida: a gera\xE7\xE3o de tabela do campeonato, ou o organizador criando um jogo extra \xE0 m\xE3o. NOT NULL com default \u2014 quem gera a tabela n\xE3o precisa conhecer a coluna, e as partidas anteriores a ela ficam como geradas, que \xE9 o que de fato eram."
213
+ })
214
+ ], TournamentMatch.prototype, "creationSource", 2);
215
+ __decorateClass([
216
+ Column({
217
+ name: "created_by_organization_user_id",
218
+ type: "int",
219
+ nullable: true,
220
+ comment: "organization_users.id de quem criou a partida \xE0 m\xE3o. Sem FK declarada (tabela de outro servi\xE7o), no mesmo padr\xE3o de tournament_players.called_up_by_organization_user_id. NULL quando a partida veio da gera\xE7\xE3o de tabela."
221
+ })
222
+ ], TournamentMatch.prototype, "createdByOrganizationUserId", 2);
208
223
  __decorateClass([
209
224
  ManyToOne(() => TournamentFacility, (facility) => facility.matches, {
210
225
  onDelete: "SET NULL"
@@ -275,6 +290,9 @@ TournamentMatch = __decorateClass([
275
290
  Index("idx_tournament_matches_forfeited_by_team", ["tournamentId", "forfeitedByTeamId"], {
276
291
  where: `"status" = 'WALKOVER'`
277
292
  }),
293
+ Index("idx_tournament_matches_organizer_created", ["tournamentId"], {
294
+ where: `"creation_source" = 'organizer'`
295
+ }),
278
296
  Check(`
279
297
  (
280
298
  (status = 'WALKOVER' AND forfeited_by_team_id IS NOT NULL)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "7.31.0",
3
+ "version": "7.33.0",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",