@natrave/shared-entities 1.1.3 → 1.1.4

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 (80) hide show
  1. package/package.json +5 -2
  2. package/.changeset/README.md +0 -9
  3. package/.changeset/config.json +0 -11
  4. package/.github/workflows/release.yml +0 -80
  5. package/.husky/pre-commit +0 -4
  6. package/.husky/pre-push +0 -4
  7. package/.lintstagedrc.json +0 -5
  8. package/.prettierignore +0 -2
  9. package/.prettierrc.json +0 -12
  10. package/CHANGELOG.md +0 -29
  11. package/eslint.config.js +0 -84
  12. package/src/app-auth/index.ts +0 -5
  13. package/src/app-auth/password-resets/index.ts +0 -1
  14. package/src/app-auth/password-resets/password-reset.entity.ts +0 -52
  15. package/src/app-auth/refresh-tokens/index.ts +0 -1
  16. package/src/app-auth/refresh-tokens/refresh-token.entity.ts +0 -52
  17. package/src/app-auth/user-auth-providers/enums/auth-provider.enum.ts +0 -24
  18. package/src/app-auth/user-auth-providers/index.ts +0 -3
  19. package/src/app-auth/user-auth-providers/user-auth-provider.entity.ts +0 -58
  20. package/src/app-auth/user-verifications/enums/verification-type.enum.ts +0 -19
  21. package/src/app-auth/user-verifications/index.ts +0 -3
  22. package/src/app-auth/user-verifications/user-verification.entity.ts +0 -62
  23. package/src/app-auth/users/index.ts +0 -1
  24. package/src/app-auth/users/user.entity.ts +0 -149
  25. package/src/app-auth/users/utils/format-data.utils.ts +0 -38
  26. package/src/common/utils/decimal-transformer.utils.ts +0 -13
  27. package/src/facilities/addresses/address.entity.ts +0 -82
  28. package/src/facilities/addresses/index.ts +0 -1
  29. package/src/facilities/facilities/enums/facility-status.enum.ts +0 -25
  30. package/src/facilities/facilities/facility.entity.ts +0 -137
  31. package/src/facilities/facilities/index.ts +0 -3
  32. package/src/facilities/facilities/utils/sanititze.utils.ts +0 -19
  33. package/src/facilities/facility-images/facility-image.entity.ts +0 -64
  34. package/src/facilities/facility-images/index.ts +0 -1
  35. package/src/facilities/facility-owners/facility-owner.entity.ts +0 -74
  36. package/src/facilities/facility-owners/index.ts +0 -1
  37. package/src/facilities/facility-owners/utils/sanitize.utils.ts +0 -16
  38. package/src/facilities/fields/enums/surface-type.enum.ts +0 -35
  39. package/src/facilities/fields/field.entity.ts +0 -74
  40. package/src/facilities/fields/index.ts +0 -3
  41. package/src/facilities/index.ts +0 -5
  42. package/src/index.ts +0 -7
  43. package/src/payments/index.ts +0 -5
  44. package/src/payments/payment-providers/enums/payment-provider-name.enum.ts +0 -15
  45. package/src/payments/payment-providers/index.ts +0 -3
  46. package/src/payments/payment-providers/payment-provider.entity.ts +0 -61
  47. package/src/payments/payments/enums/payment-method.enum.ts +0 -20
  48. package/src/payments/payments/enums/payment-status.enum.ts +0 -45
  49. package/src/payments/payments/index.ts +0 -5
  50. package/src/payments/payments/payment.entity.ts +0 -84
  51. package/src/payments/user-payment-providers/index.ts +0 -1
  52. package/src/payments/user-payment-providers/user-payment-provider.entity.ts +0 -73
  53. package/src/tournaments/index.ts +0 -12
  54. package/src/tournaments/tournament-facilities/index.ts +0 -1
  55. package/src/tournaments/tournament-facilities/tournament-facility.entity.ts +0 -67
  56. package/src/tournaments/tournament-format-configs/index.ts +0 -1
  57. package/src/tournaments/tournament-format-configs/tournament-format-config.entity.ts +0 -98
  58. package/src/tournaments/tournament-match-cards/index.ts +0 -1
  59. package/src/tournaments/tournament-match-cards/tournament-match-card.entity.ts +0 -86
  60. package/src/tournaments/tournament-match-goals/index.ts +0 -1
  61. package/src/tournaments/tournament-match-goals/tournament-match-goal.entity.ts +0 -88
  62. package/src/tournaments/tournament-match-schemas/index.ts +0 -1
  63. package/src/tournaments/tournament-match-schemas/tournament-match-schema.entity.ts +0 -51
  64. package/src/tournaments/tournament-matches/index.ts +0 -1
  65. package/src/tournaments/tournament-matches/tournament-match.entity.ts +0 -120
  66. package/src/tournaments/tournament-payments/index.ts +0 -1
  67. package/src/tournaments/tournament-payments/tournament-payment.entity.ts +0 -67
  68. package/src/tournaments/tournament-players/index.ts +0 -1
  69. package/src/tournaments/tournament-players/tournament-player.entity.ts +0 -96
  70. package/src/tournaments/tournament-prize-rules/index.ts +0 -1
  71. package/src/tournaments/tournament-prize-rules/tournament-prize-rule.entity.ts +0 -65
  72. package/src/tournaments/tournament-rules/index.ts +0 -1
  73. package/src/tournaments/tournament-rules/tournament-rule.entity.ts +0 -77
  74. package/src/tournaments/tournament-teams/enums/tournament-team-status.enum.ts +0 -21
  75. package/src/tournaments/tournament-teams/index.ts +0 -3
  76. package/src/tournaments/tournament-teams/tournament-team.entity.ts +0 -121
  77. package/src/tournaments/tournament-teams/utils/invite-code-generator.ts +0 -12
  78. package/src/tournaments/tournaments/index.ts +0 -1
  79. package/src/tournaments/tournaments/tournament.entity.ts +0 -153
  80. package/tsconfig.json +0 -29
@@ -1,21 +0,0 @@
1
- /**
2
- * Enum que representa os status de um time em um torneio.
3
- *
4
- * @remarks
5
- * Este enum fornece valores para identificar o status do time, garantindo consistência
6
- * ao referenciar o status na aplicação.
7
- *
8
- * @public
9
- */
10
- export enum TournamentTeamStatus {
11
- /**
12
- * Status "default": indica que o time foi criado automaticamente e ainda não foi
13
- * personalizado ou inscrito pelo usuário.
14
- */
15
- DEFAULT = 'default',
16
-
17
- /**
18
- * Status "registered": indica que o time foi registrado e personalizado pelo usuário.
19
- */
20
- REGISTERED = 'registered',
21
- }
@@ -1,3 +0,0 @@
1
- export { TournamentTeam } from './tournament-team.entity';
2
-
3
- export { TournamentTeamStatus } from './enums/tournament-team-status.enum';
@@ -1,121 +0,0 @@
1
- import { ITournamentTeam } from '@natrave/tournaments-service-types';
2
- import {
3
- Entity,
4
- Column,
5
- PrimaryGeneratedColumn,
6
- CreateDateColumn,
7
- UpdateDateColumn,
8
- ManyToOne,
9
- JoinColumn,
10
- Unique,
11
- Index,
12
- BeforeInsert,
13
- OneToMany,
14
- } from 'typeorm';
15
-
16
- import { TournamentMatchCard } from 'tournaments/tournament-match-cards';
17
- import { TournamentMatchGoal } from 'tournaments/tournament-match-goals';
18
- import { TournamentMatch } from 'tournaments/tournament-matches';
19
- import { TournamentPlayer } from 'tournaments/tournament-players';
20
- import { Tournament } from 'tournaments/tournaments';
21
-
22
- import { TournamentTeamStatus } from './enums/tournament-team-status.enum';
23
- import { generateRandomInviteCode } from './utils/invite-code-generator';
24
-
25
- /**
26
- * Entidade que representa um time de torneio.
27
- *
28
- * @remarks
29
- * Esta entidade armazena informações básicas sobre o time de um torneio, como o nome, logo, descrição e código de convite único.
30
- * Além disso, mantém a referência ao torneio ao qual o time está associado e registra as datas de criação e atualização.
31
- *
32
- * @public
33
- */
34
- @Entity('tournament_teams')
35
- @Unique(['tournamentId', 'name'])
36
- @Unique(['inviteCode'])
37
- @Index('IDX_tournament_team_tournament_id', ['tournamentId'])
38
- @Index('IDX_tournament_team_invite_code', ['inviteCode'])
39
- export class TournamentTeam implements ITournamentTeam {
40
- @PrimaryGeneratedColumn()
41
- id: number;
42
-
43
- @Column({ name: 'tournament_id', type: 'int' })
44
- tournamentId: number;
45
-
46
- @Column({ type: 'varchar', length: 100 })
47
- name: string;
48
-
49
- @Column({ name: 'team_logo_url', type: 'text', nullable: true })
50
- teamLogoUrl?: string;
51
-
52
- @Column({ type: 'varchar', length: 255, nullable: true })
53
- description?: string;
54
-
55
- @Column({ name: 'invite_code', type: 'varchar', length: 5, unique: true })
56
- inviteCode: string;
57
-
58
- /**
59
- * Status do time no torneio.
60
- *
61
- * Por padrão, o status será "default", indicando que o time é um placeholder
62
- * que ainda não foi registrado/personalizado pelo usuário.
63
- */
64
- @Column({ type: 'enum', enum: TournamentTeamStatus, default: TournamentTeamStatus.DEFAULT })
65
- status: TournamentTeamStatus;
66
-
67
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
68
- createdAt: Date;
69
-
70
- @UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
71
- updatedAt: Date;
72
-
73
- /** RELAÇÕES */
74
-
75
- /**
76
- * Relação com o torneio ao qual o time está associado.
77
- */
78
- @ManyToOne(() => Tournament, (tournament) => tournament.teams, {
79
- onDelete: 'CASCADE',
80
- })
81
- @JoinColumn({ name: 'tournament_id' })
82
- tournament: Tournament;
83
-
84
- /**
85
- * Relação com os jogadores associados ao time.
86
- */
87
- @OneToMany(() => TournamentPlayer, (player) => player.team)
88
- players: TournamentPlayer[];
89
-
90
- /**
91
- * Relação com as partidas em casa associadas ao time.
92
- */
93
- @OneToMany(() => TournamentMatch, (match) => match.homeTeam)
94
- homeMatches: TournamentMatch[];
95
-
96
- /**
97
- * Relação com as partidas fora de casa associadas ao time.
98
- */
99
- @OneToMany(() => TournamentMatch, (match) => match.awayTeam)
100
- awayMatches: TournamentMatch[];
101
-
102
- /**
103
- * Relação com os gols associados ao time.
104
- */
105
- @OneToMany(() => TournamentMatchGoal, (goal) => goal.team)
106
- goals: TournamentMatchGoal[];
107
-
108
- /**
109
- * Relação com os cartões associados ao time.
110
- */
111
- @OneToMany(() => TournamentMatchCard, (card) => card.team)
112
- cards: TournamentMatchCard[];
113
-
114
- /**
115
- * Gera o código de convite antes de inserir o registro.
116
- */
117
- @BeforeInsert()
118
- generateInviteCode(): void {
119
- this.inviteCode = generateRandomInviteCode();
120
- }
121
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Gera um código de convite aleatório com 5 dígitos.
3
- *
4
- * @returns {string} Um código de convite como string.
5
- *
6
- * @remarks
7
- * A função utiliza o método Math.random para gerar um número aleatório entre 10000 e 99999,
8
- * garantindo que o código tenha sempre 5 dígitos.
9
- */
10
- export function generateRandomInviteCode(): string {
11
- return Math.floor(10000 + Math.random() * 90000).toString();
12
- }
@@ -1 +0,0 @@
1
- export { Tournament } from './tournament.entity';
@@ -1,153 +0,0 @@
1
- import { DayOfWeek, ITournament, TournamentGender } from '@natrave/tournaments-service-types';
2
- import {
3
- Entity,
4
- Column,
5
- PrimaryGeneratedColumn,
6
- CreateDateColumn,
7
- UpdateDateColumn,
8
- OneToMany,
9
- OneToOne,
10
- ManyToOne,
11
- JoinColumn,
12
- } from 'typeorm';
13
-
14
- import { TournamentFacility } from 'tournaments/tournament-facilities';
15
- import { TournamentFormatConfig } from 'tournaments/tournament-format-configs';
16
- import { TournamentMatchSchema } from 'tournaments/tournament-match-schemas';
17
- import { TournamentMatch } from 'tournaments/tournament-matches';
18
- import { TournamentPayment } from 'tournaments/tournament-payments';
19
- import { TournamentPrizeRule } from 'tournaments/tournament-prize-rules';
20
- import { TournamentRule } from 'tournaments/tournament-rules';
21
- import { TournamentTeam } from 'tournaments/tournament-teams';
22
-
23
- /**
24
- * Entidade que representa um torneio.
25
- *
26
- * @remarks
27
- * Esta entidade armazena todas as propriedades essenciais de um torneio, como datas, formato, regras,
28
- * dias de partida, informações de localização e gênero, além das datas de criação e atualização.
29
- *
30
- * @public
31
- */
32
- @Entity('tournaments')
33
- export class Tournament implements ITournament {
34
- @PrimaryGeneratedColumn()
35
- id: number;
36
-
37
- @Column({ type: 'varchar', length: 255 })
38
- name: string;
39
-
40
- @Column({ name: 'initial_date', type: 'timestamptz' })
41
- initialDate: Date;
42
-
43
- @Column({ name: 'end_date', type: 'timestamptz' })
44
- endDate: Date;
45
-
46
- @Column({ type: 'text', nullable: true })
47
- description?: string | null;
48
-
49
- @Column({ name: 'tournament_image', type: 'text', nullable: true })
50
- tournamentImage?: string | null;
51
-
52
- @Column({ name: 'match_schema_id', type: 'int', nullable: true })
53
- matchSchemaId?: number | null;
54
-
55
- @Column({ name: 'rule_id', type: 'int' })
56
- ruleId: number;
57
-
58
- @Column({ name: 'format_config_id', type: 'int' })
59
- formatConfigId: number;
60
-
61
- @Column({
62
- name: 'match_days',
63
- type: 'enum',
64
- enum: Object.values(DayOfWeek),
65
- array: true,
66
- })
67
- matchDays: DayOfWeek[];
68
-
69
- @Column({ name: 'price_per_team', type: 'int' })
70
- pricePerTeam: number;
71
-
72
- @Column({ name: 'match_start_time', type: 'time' })
73
- matchStartTime: string;
74
-
75
- @Column({ name: 'match_end_time', type: 'time' })
76
- matchEndTime: string;
77
-
78
- @Column({ type: 'varchar', length: 100 })
79
- city: string;
80
-
81
- @Column({ type: 'varchar', length: 2 })
82
- state: string;
83
-
84
- @Column({
85
- type: 'enum',
86
- enum: Object.values(TournamentGender),
87
- })
88
- gender: TournamentGender;
89
-
90
- @Column({ name: 'deleted_at', type: 'timestamptz', nullable: true })
91
- deletedAt: Date | null;
92
-
93
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
94
- createdAt: Date;
95
-
96
- @UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
97
- updatedAt: Date;
98
-
99
- /** RELAÇÕES */
100
-
101
- /**
102
- * Relação com o esquema de partidas associado ao torneio.
103
- */
104
- @ManyToOne(() => TournamentMatchSchema, (matchSchema) => matchSchema.tournaments, {
105
- onDelete: 'CASCADE',
106
- })
107
- @JoinColumn({ name: 'match_schema_id' })
108
- matchSchema: TournamentMatchSchema;
109
-
110
- /**
111
- * Relação com os times associados ao torneio.
112
- */
113
- @OneToMany(() => TournamentTeam, (team) => team.tournament)
114
- teams: TournamentTeam[];
115
-
116
- /**
117
- * Relação com as regras do torneio.
118
- */
119
- @OneToOne(() => TournamentRule, (rule) => rule.tournament, { cascade: true })
120
- @JoinColumn({ name: 'rule_id' })
121
- rule: TournamentRule;
122
-
123
- /**
124
- * Relação com o formato do torneio.
125
- */
126
- @OneToOne(() => TournamentFormatConfig, (format) => format.tournament, { cascade: true })
127
- @JoinColumn({ name: 'format_config_id' })
128
- format: TournamentFormatConfig;
129
-
130
- /**
131
- * Relação com as regras de premiação associadas ao torneio.
132
- */
133
- @OneToMany(() => TournamentPrizeRule, (prizeRule) => prizeRule.tournament)
134
- prizeRules: TournamentPrizeRule[];
135
-
136
- /**
137
- * Relação com os pagamentos associados ao torneio.
138
- */
139
- @OneToMany(() => TournamentPayment, (payment) => payment.tournament)
140
- payments: TournamentPayment[];
141
-
142
- /**
143
- * Relação com as partidas associadas ao torneio.
144
- */
145
- @OneToMany(() => TournamentMatch, (match) => match.tournament)
146
- matches: TournamentMatch[];
147
-
148
- /**
149
- * Relação com os estabelecimentos associadas ao torneio.
150
- */
151
- @OneToMany(() => TournamentFacility, (facility) => facility.tournament)
152
- tournamentFacilities: TournamentFacility[];
153
- }
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "dist",
4
- "module": "ESNext",
5
- "target": "ES2021",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "sourceMap": true,
9
- "strict": true,
10
- "moduleResolution": "node",
11
- "esModuleInterop": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "allowSyntheticDefaultImports": true,
14
- "skipLibCheck": true,
15
- "resolveJsonModule": true,
16
- "noImplicitAny": true,
17
- "noUnusedLocals": true,
18
- "noUnusedParameters": true,
19
- "noFallthroughCasesInSwitch": true,
20
- "removeComments": true,
21
- "experimentalDecorators": true,
22
- "emitDecoratorMetadata": true,
23
- "strictPropertyInitialization": false,
24
- "baseUrl": "./src"
25
- },
26
-
27
- "include": ["src"],
28
- "exclude": ["node_modules", "dist", "tests"]
29
- }