@natrave/shared-entities 1.2.25 → 1.2.26

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.
@@ -8,6 +8,7 @@ export * from './tournament-match-schemas';
8
8
  export * from './tournament-matches';
9
9
  export * from './tournament-matches-availability';
10
10
  export * from './tournament-payments';
11
+ export * from './tournament-player-rules';
11
12
  export * from './tournament-players';
12
13
  export * from './tournament-prize-rules';
13
14
  export * from './tournament-rules';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tournaments/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tournaments/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -8,6 +8,7 @@ export * from "./tournament-match-schemas/index.js";
8
8
  export * from "./tournament-matches/index.js";
9
9
  export * from "./tournament-matches-availability/index.js";
10
10
  export * from "./tournament-payments/index.js";
11
+ export * from "./tournament-player-rules/index.js";
11
12
  export * from "./tournament-players/index.js";
12
13
  export * from "./tournament-prize-rules/index.js";
13
14
  export * from "./tournament-rules/index.js";
@@ -0,0 +1,2 @@
1
+ export { TournamentPlayerRule } from './tournament-player-rule.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-player-rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { TournamentPlayerRule } from "./tournament-player-rule.entity.js";
2
+ export {
3
+ TournamentPlayerRule
4
+ };
@@ -0,0 +1,14 @@
1
+ import { ITournamentPlayerRule } from '@natrave/tournaments-service-types';
2
+ import { Tournament } from '../tournaments';
3
+ export declare class TournamentPlayerRule implements ITournamentPlayerRule {
4
+ id: number;
5
+ tournamentId: number;
6
+ maxPlayerPerTeam?: number | null;
7
+ minPlayerPerTeam?: number | null;
8
+ minAge?: number | null;
9
+ maxAge?: number | null;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ tournament: Tournament;
13
+ }
14
+ //# sourceMappingURL=tournament-player-rule.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tournament-player-rule.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournament-player-rules/tournament-player-rule.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAY3E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAW5C,qBAIa,oBAAqB,YAAW,qBAAqB;IAEhE,EAAE,EAAE,MAAM,CAAC;IAQX,YAAY,EAAE,MAAM,CAAC;IAQrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOvB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAKhB,UAAU,EAAE,UAAU,CAAC;CACxB"}
@@ -0,0 +1,93 @@
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
+ OneToOne,
18
+ PrimaryGeneratedColumn,
19
+ UpdateDateColumn
20
+ } from "typeorm";
21
+ import { Tournament } from "../tournaments/index.js";
22
+ let TournamentPlayerRule = class {
23
+ };
24
+ __decorateClass([
25
+ PrimaryGeneratedColumn({ comment: "Identificador \xFAnico da regra de jogadores." })
26
+ ], TournamentPlayerRule.prototype, "id", 2);
27
+ __decorateClass([
28
+ Column({
29
+ name: "tournament_id",
30
+ type: "int",
31
+ unique: true,
32
+ comment: "ID do torneio associado a esta regra de jogadores."
33
+ })
34
+ ], TournamentPlayerRule.prototype, "tournamentId", 2);
35
+ __decorateClass([
36
+ Column({
37
+ name: "max_player_per_team",
38
+ type: "int",
39
+ nullable: true,
40
+ comment: "M\xE1ximo de jogadores permitidos por time."
41
+ })
42
+ ], TournamentPlayerRule.prototype, "maxPlayerPerTeam", 2);
43
+ __decorateClass([
44
+ Column({
45
+ name: "min_player_per_team",
46
+ type: "int",
47
+ nullable: true,
48
+ comment: "M\xEDnimo de jogadores exigidos por time."
49
+ })
50
+ ], TournamentPlayerRule.prototype, "minPlayerPerTeam", 2);
51
+ __decorateClass([
52
+ Column({
53
+ name: "min_age",
54
+ type: "int",
55
+ nullable: true,
56
+ comment: "Idade m\xEDnima exigida para os jogadores."
57
+ })
58
+ ], TournamentPlayerRule.prototype, "minAge", 2);
59
+ __decorateClass([
60
+ Column({
61
+ name: "max_age",
62
+ type: "int",
63
+ nullable: true,
64
+ comment: "Idade m\xE1xima permitida para os jogadores (opcional)."
65
+ })
66
+ ], TournamentPlayerRule.prototype, "maxAge", 2);
67
+ __decorateClass([
68
+ CreateDateColumn({
69
+ name: "created_at",
70
+ type: "timestamptz",
71
+ comment: "Data de cria\xE7\xE3o do registro."
72
+ })
73
+ ], TournamentPlayerRule.prototype, "createdAt", 2);
74
+ __decorateClass([
75
+ UpdateDateColumn({
76
+ name: "updated_at",
77
+ type: "timestamptz",
78
+ comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
79
+ })
80
+ ], TournamentPlayerRule.prototype, "updatedAt", 2);
81
+ __decorateClass([
82
+ OneToOne(() => Tournament, (tournament) => tournament.playerRule, { onDelete: "CASCADE" }),
83
+ JoinColumn({ name: "tournament_id" })
84
+ ], TournamentPlayerRule.prototype, "tournament", 2);
85
+ TournamentPlayerRule = __decorateClass([
86
+ Entity("tournament_player_rules"),
87
+ Check("CHK_PLAYERS_PER_TEAM", '"max_player_per_team" >= "min_player_per_team"'),
88
+ Check("CHK_MIN_AGE", '"min_age" >= 0'),
89
+ Check("CHK_MAX_AGE", '"max_age" IS NULL OR "max_age" > "min_age"')
90
+ ], TournamentPlayerRule);
91
+ export {
92
+ TournamentPlayerRule
93
+ };
@@ -1,12 +1,13 @@
1
1
  import { ITournament, TournamentGender, TournamentModality, TournamentStatus } from '@natrave/tournaments-service-types';
2
- import { TournamentCoupon } from '../tournament-coupons/tournament-coupon.entity';
2
+ import { TournamentCoupon } from '../tournament-coupons';
3
3
  import { TournamentFacility } from '../tournament-facilities';
4
4
  import { TournamentFormatConfig } from '../tournament-format-configs';
5
- import { TournamentGroup } from '../tournament-groups/';
5
+ import { TournamentGroup } from '../tournament-groups';
6
6
  import { TournamentMatchSchema } from '../tournament-match-schemas';
7
7
  import { TournamentMatch } from '../tournament-matches';
8
- import { TournamentMatchAvailability } from '../tournament-matches-availability/tournament-match-availability.entity';
8
+ import { TournamentMatchAvailability } from '../tournament-matches-availability';
9
9
  import { TournamentPayment } from '../tournament-payments';
10
+ import { TournamentPlayerRule } from '../tournament-player-rules';
10
11
  import { TournamentPrizeRule } from '../tournament-prize-rules';
11
12
  import { TournamentRule } from '../tournament-rules';
12
13
  import { TournamentTeam } from '../tournament-teams';
@@ -32,6 +33,7 @@ export declare class Tournament implements ITournament {
32
33
  teams: TournamentTeam[];
33
34
  groups: TournamentGroup[];
34
35
  rule: TournamentRule;
36
+ playerRule: TournamentPlayerRule;
35
37
  format: TournamentFormatConfig;
36
38
  prizeRules: TournamentPrizeRule[];
37
39
  payments: TournamentPayment[];
@@ -1 +1 @@
1
- {"version":3,"file":"tournament.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/tournaments/tournament.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAa5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,E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,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ9B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOtB,MAAM,EAAE,gBAAgB,CAAC;IASzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAShC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS3B,MAAM,EAAE,gBAAgB,CAAC;IAQzB,QAAQ,EAAE,kBAAkB,CAAC;IAQ7B,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAOvB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,WAAW,EAAE,qBAAqB,CAAC;IAGnC,KAAK,EAAE,cAAc,EAAE,CAAC;IAGxB,MAAM,EAAE,eAAe,EAAE,CAAC;IAG1B,IAAI,EAAE,cAAc,CAAC;IAGrB,UAAU,EAAE,oBAAoB,CAAC;IAGjC,MAAM,EAAE,sBAAsB,CAAC;IAG/B,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAGlC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAG9B,OAAO,EAAE,eAAe,EAAE,CAAC;IAG3B,oBAAoB,EAAE,kBAAkB,EAAE,CAAC;IAG3C,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAG5B,mBAAmB,EAAE,2BAA2B,EAAE,CAAC;CACpD"}
@@ -24,14 +24,15 @@ import {
24
24
  PrimaryGeneratedColumn,
25
25
  UpdateDateColumn
26
26
  } from "typeorm";
27
- import { TournamentCoupon } from "../tournament-coupons/tournament-coupon.entity.js";
27
+ import { TournamentCoupon } from "../tournament-coupons/index.js";
28
28
  import { TournamentFacility } from "../tournament-facilities/index.js";
29
29
  import { TournamentFormatConfig } from "../tournament-format-configs/index.js";
30
- import { TournamentGroup } from "../tournament-groups//index.js";
30
+ import { TournamentGroup } from "../tournament-groups/index.js";
31
31
  import { TournamentMatchSchema } from "../tournament-match-schemas/index.js";
32
32
  import { TournamentMatch } from "../tournament-matches/index.js";
33
- import { TournamentMatchAvailability } from "../tournament-matches-availability/tournament-match-availability.entity.js";
33
+ import { TournamentMatchAvailability } from "../tournament-matches-availability/index.js";
34
34
  import { TournamentPayment } from "../tournament-payments/index.js";
35
+ import { TournamentPlayerRule } from "../tournament-player-rules/index.js";
35
36
  import { TournamentPrizeRule } from "../tournament-prize-rules/index.js";
36
37
  import { TournamentRule } from "../tournament-rules/index.js";
37
38
  import { TournamentTeam } from "../tournament-teams/index.js";
@@ -172,6 +173,9 @@ __decorateClass([
172
173
  __decorateClass([
173
174
  OneToOne(() => TournamentRule, (rule) => rule.tournament)
174
175
  ], Tournament.prototype, "rule", 2);
176
+ __decorateClass([
177
+ OneToOne(() => TournamentPlayerRule, (rule) => rule.tournament)
178
+ ], Tournament.prototype, "playerRule", 2);
175
179
  __decorateClass([
176
180
  OneToOne(() => TournamentFormatConfig, (format) => format.tournament)
177
181
  ], Tournament.prototype, "format", 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "esbuild": "^0.25.2",
33
33
  "eslint": "^9.24.0",
34
34
  "eslint-config-prettier": "^10.1.1",
35
- "eslint-import-resolver-typescript": "^4.3.1",
35
+ "eslint-import-resolver-typescript": "^4.3.2",
36
36
  "eslint-plugin-import": "^2.31.0",
37
37
  "eslint-plugin-prettier": "^5.2.6",
38
38
  "eslint-plugin-unused-imports": "^4.1.4",
@@ -43,7 +43,7 @@
43
43
  "ts-node": "^10.9.2"
44
44
  },
45
45
  "dependencies": {
46
- "@natrave/tournaments-service-types": "^1.1.34",
46
+ "@natrave/tournaments-service-types": "^1.1.39",
47
47
  "reflect-metadata": "^0.2.2",
48
48
  "typeorm": "^0.3.22"
49
49
  },