@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -10,6 +10,9 @@
10
10
  "require": "./dist/index.cjs"
11
11
  },
12
12
  "type": "module",
13
+ "files": [
14
+ "dist"
15
+ ],
13
16
  "repository": {
14
17
  "type": "git",
15
18
  "url": "https://github.com/na-trave/shared-entities.git"
@@ -39,7 +42,7 @@
39
42
  "ts-node": "^10.9.2"
40
43
  },
41
44
  "dependencies": {
42
- "@natrave/tournaments-service-types": "^1.1.4",
45
+ "@natrave/tournaments-service-types": "^1.1.5",
43
46
  "reflect-metadata": "^0.2.2",
44
47
  "typeorm": "^0.3.21"
45
48
  },
@@ -1,9 +0,0 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool
4
- that works with multi-package repos, or single-package repos to help you version and publish your
5
- code. You can find the full documentation for it
6
- [in our repository](https://github.com/changesets/changesets)
7
-
8
- We have a quick list of common questions to get you started engaging with this project in
9
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,80 +0,0 @@
1
- on:
2
- push:
3
- branches:
4
- - main
5
-
6
- jobs:
7
- release:
8
- name: Criar Release & Publicar no npm
9
- runs-on: ubuntu-latest
10
-
11
- steps:
12
- - name: 🚀 Checkout do código
13
- uses: actions/checkout@v4
14
-
15
- - name: 📦 Setup Node.js
16
- uses: actions/setup-node@v4
17
- with:
18
- node-version: 'lts/*'
19
- registry-url: 'https://registry.npmjs.org/'
20
-
21
- - name: 🔑 Ativar e preparar Corepack (pnpm)
22
- run: |
23
- corepack enable
24
- corepack prepare pnpm@latest --activate
25
-
26
- - name: 📥 Instalar dependências
27
- run: pnpm install --frozen-lockfile
28
-
29
- - name: 🔎 Rodar lint e checagem de tipos
30
- run: |
31
- pnpm lint
32
- pnpm check:types
33
-
34
- - name: 🚀 Criar versão se necessário
35
- id: version
36
- run: pnpm changeset version
37
- env:
38
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
-
40
- - name: 🔄 Commitar alterações de versão
41
- run: |
42
- # Configurar usuário do Git para o commit
43
- git config user.name "github-actions[bot]"
44
- git config user.email "github-actions[bot]@users.noreply.github.com"
45
-
46
- # Adicionar todas as alterações
47
- git add .
48
-
49
- # Verificar se há alterações para commit
50
- if git diff-index --quiet HEAD; then
51
- echo "✅ Nenhuma alteração para commitar."
52
- else
53
- # Commitar as alterações
54
- git commit -m "chore(release): commit version bump e changesets"
55
- # Fazer push para a branch atual
56
- git push origin HEAD:${{ github.ref }}
57
- fi
58
- env:
59
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60
-
61
- - name: ⏭️ Pular publicação se não houver mudanças
62
- if: steps.version.outputs.skipped == 'true'
63
- run: echo "🟡 Nenhuma mudança detectada, pulando publicação."
64
-
65
- - name: 🔍 Verificar se NPM_TOKEN está configurado
66
- run: |
67
- if [ -z "$NODE_AUTH_TOKEN" ]; then
68
- echo "❌ NPM_TOKEN não está configurado corretamente!"
69
- exit 1
70
- else
71
- echo "✅ NPM_TOKEN está configurado corretamente."
72
- fi
73
- env:
74
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
75
-
76
- - name: 📦 Publicar no npm
77
- if: steps.version.outputs.skipped != 'true'
78
- run: pnpm publish --access public
79
- env:
80
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- echo "🔍 Rodando Lint-Staged..."
2
- pnpm exec lint-staged || (echo "❌ Lint-Staged falhou! Corrija os erros antes de commitar." && exit 1)
3
-
4
- echo "✅ Código validado com sucesso! Commit permitido."
package/.husky/pre-push DELETED
@@ -1,4 +0,0 @@
1
- echo "🔍 Rodando Lint antes do push..."
2
- pnpm lint || (echo "❌ Lint falhou! Corrija os erros antes de fazer push." && exit 1)
3
-
4
- echo "✅ Código validado com sucesso! Push permitido."
@@ -1,5 +0,0 @@
1
- {
2
- "**/*.ts": ["eslint --fix --cache --max-warnings=0", "prettier --write"],
3
- "*.json": ["prettier --write"],
4
- "*.md": ["prettier --write"]
5
- }
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules/
2
- dist/
package/.prettierrc.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "semi": true,
5
- "printWidth": 100,
6
- "tabWidth": 2,
7
- "bracketSpacing": true,
8
- "arrowParens": "always",
9
- "endOfLine": "lf",
10
- "quoteProps": "preserve",
11
- "proseWrap": "always"
12
- }
package/CHANGELOG.md DELETED
@@ -1,29 +0,0 @@
1
- # @natrave/shared-entities
2
-
3
- ## 1.1.3
4
-
5
- ### Patch Changes
6
-
7
- - f2cdf1f: adicionado novo formato de partidas fora ou em casa, adicionado logica de estagio da
8
- partida e indicacao de round e mudanca das regras do campeonato para expectedTeams ao inves de
9
- minTeams e maxTeams"
10
- - da171c8: refactor: substitui flags booleanas por enums de modo de disputa e permite
11
- knockoutMatchMode ser null
12
-
13
- ## 1.1.2
14
-
15
- ### Patch Changes
16
-
17
- - 4113a58: Adiciona campo status (enum 'default' e 'registered') à entidade TournamentTeam
18
-
19
- ## 1.1.1
20
-
21
- ### Patch Changes
22
-
23
- - 56516cc: build
24
-
25
- ## 1.1.0
26
-
27
- ### Minor Changes
28
-
29
- - 3db4aa9: entidades iniciais
package/eslint.config.js DELETED
@@ -1,84 +0,0 @@
1
- import js from '@eslint/js';
2
- import tseslint from '@typescript-eslint/eslint-plugin';
3
- import tsparser from '@typescript-eslint/parser';
4
- import prettier from 'eslint-plugin-prettier';
5
- import importPlugin from 'eslint-plugin-import';
6
- import unusedImports from 'eslint-plugin-unused-imports';
7
-
8
- export default [
9
- js.configs.recommended,
10
- {
11
- files: ['**/*.ts'],
12
- languageOptions: {
13
- parser: tsparser,
14
- sourceType: 'module',
15
- parserOptions: {
16
- project: ['./tsconfig.json'],
17
- },
18
- },
19
- ignores: ['**/*.d.ts', 'dist/', 'node_modules/'],
20
- plugins: {
21
- '@typescript-eslint': tseslint,
22
- prettier,
23
- import: importPlugin,
24
- 'unused-imports': unusedImports,
25
- },
26
- settings: {
27
- 'import/resolver': {
28
- typescript: {
29
- project: './tsconfig.json',
30
- },
31
- node: {
32
- extensions: ['.js', '.ts'],
33
- },
34
- },
35
- },
36
- rules: {
37
- 'prettier/prettier': 'error',
38
- 'no-unused-vars': 'off',
39
- '@typescript-eslint/no-unused-vars': [
40
- 'error',
41
- {
42
- argsIgnorePattern: '^_',
43
- varsIgnorePattern: '^_',
44
- caughtErrorsIgnorePattern: '^_',
45
- ignoreRestSiblings: true,
46
- },
47
- ],
48
- '@typescript-eslint/explicit-function-return-type': 'off',
49
- '@typescript-eslint/explicit-module-boundary-types': 'off',
50
- '@typescript-eslint/consistent-type-imports': 'error',
51
- '@typescript-eslint/no-explicit-any': 'warn',
52
- 'import/extensions': [
53
- 'error',
54
- 'ignorePackages',
55
- {
56
- js: 'never',
57
- ts: 'never',
58
- },
59
- ],
60
- 'import/order': [
61
- 'error',
62
- {
63
- groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
64
- 'newlines-between': 'always',
65
- alphabetize: { order: 'asc', caseInsensitive: true },
66
- },
67
- ],
68
- 'import/no-unresolved': 'error',
69
- 'import/no-absolute-path': 'error',
70
- 'import/no-duplicates': 'error',
71
- 'import/no-extraneous-dependencies': [
72
- 'error',
73
- {
74
- devDependencies: ['**/*.test.ts', '**/*.spec.ts'],
75
- },
76
- ],
77
- 'unused-imports/no-unused-imports': 'error',
78
- 'unused-imports/no-unused-vars': [
79
- 'warn',
80
- { vars: 'all', args: 'after-used', argsIgnorePattern: '^_' },
81
- ],
82
- },
83
- },
84
- ];
@@ -1,5 +0,0 @@
1
- export * from './password-resets';
2
- export * from './refresh-tokens';
3
- export * from './user-auth-providers';
4
- export * from './user-verifications';
5
- export * from './users';
@@ -1 +0,0 @@
1
- export { PasswordReset } from './password-reset.entity';
@@ -1,52 +0,0 @@
1
- import {
2
- Entity,
3
- Column,
4
- PrimaryGeneratedColumn,
5
- CreateDateColumn,
6
- ManyToOne,
7
- JoinColumn,
8
- Unique,
9
- } from 'typeorm';
10
-
11
- import { User } from 'app-auth/users';
12
-
13
- /**
14
- * Entidade que representa um reset de senha.
15
- *
16
- * @remarks
17
- * Esta entidade armazena os dados relacionados ao processo de reset de senha de um usuário,
18
- * incluindo a data de criação, expiração e o momento em que o reset foi utilizado (se aplicável).
19
- * Também associa o reset ao respectivo usuário, garantindo a integridade da operação.
20
- *
21
- * @public
22
- */
23
- @Entity('password_resets')
24
- @Unique(['token', 'userId'])
25
- export class PasswordReset {
26
- @PrimaryGeneratedColumn()
27
- id: number;
28
-
29
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
30
- createdAt: Date;
31
-
32
- @Column({ name: 'expires_at', type: 'timestamptz' })
33
- expiresAt: Date;
34
-
35
- @Column({ name: 'used_at', type: 'timestamptz', nullable: true })
36
- usedAt: Date | null;
37
-
38
- @Column({ name: 'user_id', type: 'uuid' })
39
- userId: string;
40
-
41
- @Column({ type: 'varchar', length: 255 })
42
- token: string;
43
-
44
- /** RELAÇÕES */
45
-
46
- /**
47
- * Relação com o usuário ao qual o reset de senha está associado.
48
- */
49
- @ManyToOne(() => User, (user) => user.passwordResets, { onDelete: 'CASCADE' })
50
- @JoinColumn({ name: 'user_id' })
51
- user: User;
52
- }
@@ -1 +0,0 @@
1
- export { RefreshToken } from './refresh-token.entity';
@@ -1,52 +0,0 @@
1
- import {
2
- Entity,
3
- Column,
4
- PrimaryGeneratedColumn,
5
- CreateDateColumn,
6
- ManyToOne,
7
- Unique,
8
- JoinColumn,
9
- } from 'typeorm';
10
-
11
- import { User } from 'app-auth/users';
12
-
13
- /**
14
- * Entidade que representa um refresh token.
15
- *
16
- * @remarks
17
- * Esta entidade armazena os dados relativos a um token de atualização utilizado para manter
18
- * a sessão de um usuário ativa. Ela inclui a data de criação, expiração, e a data de revogação
19
- * (caso aplicável), além de armazenar o token propriamente dito e sua associação com um usuário.
20
- *
21
- * @public
22
- */
23
- @Entity('refresh_tokens')
24
- @Unique(['token'])
25
- export class RefreshToken {
26
- @PrimaryGeneratedColumn('uuid')
27
- id: string;
28
-
29
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
30
- createdAt: Date;
31
-
32
- @Column({ name: 'expires_at', type: 'timestamptz' })
33
- expiresAt: Date;
34
-
35
- @Column({ name: 'revoked_at', type: 'timestamptz', nullable: true })
36
- revokedAt: Date | null;
37
-
38
- @Column({ type: 'varchar', length: 255, unique: true })
39
- token: string;
40
-
41
- @Column({ name: 'user_id', type: 'uuid' })
42
- userId: string;
43
-
44
- /** RELAÇÕES */
45
-
46
- /**
47
- * Relação com o usuário ao qual o refresh token pertence.
48
- */
49
- @ManyToOne(() => User, (user) => user.refreshTokens, { onDelete: 'CASCADE' })
50
- @JoinColumn({ name: 'user_id' })
51
- user: User;
52
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Enum que representa os provedores de autenticação.
3
- *
4
- * @remarks
5
- * Este enum fornece valores para identificar o provedor de autenticação utilizado pelo usuário.
6
- *
7
- * @public
8
- */
9
- export enum AuthProvider {
10
- /**
11
- * Provedor de autenticação do Google.
12
- */
13
- GOOGLE = 'google',
14
-
15
- /**
16
- * Provedor de autenticação do Meta.
17
- */
18
- META = 'meta',
19
-
20
- /**
21
- * Provedor de autenticação da Apple.
22
- */
23
- APPLE = 'apple',
24
- }
@@ -1,3 +0,0 @@
1
- export { AuthProvider } from './enums/auth-provider.enum';
2
-
3
- export { UserAuthProvider } from './user-auth-provider.entity';
@@ -1,58 +0,0 @@
1
- import {
2
- Entity,
3
- Column,
4
- PrimaryGeneratedColumn,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- ManyToOne,
8
- JoinColumn,
9
- Unique,
10
- } from 'typeorm';
11
-
12
- import { User } from 'app-auth/users';
13
-
14
- import { AuthProvider } from './enums/auth-provider.enum';
15
-
16
- /**
17
- * Entidade que representa um provedor de autenticação associado a um usuário.
18
- *
19
- * @remarks
20
- * Esta entidade armazena os dados relacionados aos provedores de autenticação, incluindo o token do provedor,
21
- * o identificador do usuário no provedor e a associação com o usuário local.
22
- * Uma combinação única de provider e providerUserId é garantida para evitar duplicatas.
23
- *
24
- * @public
25
- */
26
- @Entity('user_auth_providers')
27
- @Unique(['provider', 'providerUserId'])
28
- export class UserAuthProvider {
29
- @PrimaryGeneratedColumn()
30
- id: number;
31
-
32
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
33
- createdAt: Date;
34
-
35
- @UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
36
- updatedAt: Date;
37
-
38
- @Column({ name: 'user_id', type: 'uuid' })
39
- userId: string;
40
-
41
- @Column({ type: 'enum', enum: AuthProvider })
42
- provider: AuthProvider;
43
-
44
- @Column({ name: 'provider_user_id', type: 'text' })
45
- providerUserId: string;
46
-
47
- @Column({ name: 'provider_token', type: 'text', nullable: true })
48
- providerToken: string | null;
49
-
50
- /** RELAÇÕES */
51
-
52
- /**
53
- * Relação com o usuário ao qual o provedor de autenticação está associado.
54
- */
55
- @ManyToOne(() => User, (user) => user.userAuthProviders, { onDelete: 'CASCADE' })
56
- @JoinColumn({ name: 'user_id' })
57
- user: User;
58
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * Enum que representa os tipos de verificação.
3
- *
4
- * @remarks
5
- * Este enum fornece valores para indicar o tipo de verificação de usuário, seja por email ou telefone.
6
- *
7
- * @public
8
- */
9
- export enum VerificationType {
10
- /**
11
- * Verificação via email.
12
- */
13
- EMAIL = 'email',
14
-
15
- /**
16
- * Verificação via telefone.
17
- */
18
- PHONE = 'phone',
19
- }
@@ -1,3 +0,0 @@
1
- export { VerificationType } from './enums/verification-type.enum';
2
-
3
- export { UserVerification } from './user-verification.entity';
@@ -1,62 +0,0 @@
1
- import {
2
- Entity,
3
- Column,
4
- PrimaryGeneratedColumn,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- ManyToOne,
8
- JoinColumn,
9
- } from 'typeorm';
10
-
11
- import { User } from 'app-auth/users';
12
-
13
- import { VerificationType } from './enums/verification-type.enum';
14
-
15
- /**
16
- * Entidade que representa uma verificação de usuário.
17
- *
18
- * @remarks
19
- * Esta entidade armazena os dados relacionados a uma verificação de usuário, incluindo
20
- * as datas de criação, expiração e verificação (se aplicável), o status do token e o tipo
21
- * de verificação (por exemplo, email ou telefone). Também associa a verificação ao respectivo usuário.
22
- *
23
- * @public
24
- */
25
- @Entity('user_verifications')
26
- export class UserVerification {
27
- @PrimaryGeneratedColumn()
28
- id: number;
29
-
30
- @CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
31
- createdAt: Date;
32
-
33
- @UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
34
- updatedAt: Date;
35
-
36
- @Column({ name: 'expires_at', type: 'timestamptz' })
37
- expiresAt: Date;
38
-
39
- @Column({ name: 'verified_at', type: 'timestamptz', nullable: true })
40
- verifiedAt: Date | null;
41
-
42
- @Column({ type: 'boolean', default: false })
43
- isInvalid: boolean;
44
-
45
- @Column({ type: 'varchar', length: 255, unique: true })
46
- token: string;
47
-
48
- @Column({ name: 'user_id', type: 'uuid' })
49
- userId: string;
50
-
51
- @Column({ type: 'enum', enum: VerificationType })
52
- type: VerificationType;
53
-
54
- /** RELAÇÕES */
55
-
56
- /**
57
- * Relação com o usuário ao qual a verificação está associada.
58
- */
59
- @ManyToOne(() => User, (user) => user.verifications, { onDelete: 'CASCADE' })
60
- @JoinColumn({ name: 'user_id' })
61
- user: User;
62
- }
@@ -1 +0,0 @@
1
- export { User } from './user.entity';