@natrave/shared-entities 1.1.3 → 1.1.5
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.
- package/dist/app-auth/index.d.ts +6 -0
- package/dist/app-auth/index.d.ts.map +1 -0
- package/{src/app-auth/index.ts → dist/app-auth/index.js} +1 -0
- package/dist/app-auth/index.js.map +1 -0
- package/dist/app-auth/password-resets/index.d.ts +2 -0
- package/dist/app-auth/password-resets/index.d.ts.map +1 -0
- package/{src/app-auth/password-resets/index.ts → dist/app-auth/password-resets/index.js} +1 -0
- package/dist/app-auth/password-resets/index.js.map +1 -0
- package/dist/app-auth/password-resets/password-reset.entity.d.ts +11 -0
- package/dist/app-auth/password-resets/password-reset.entity.d.ts.map +1 -0
- package/dist/app-auth/password-resets/password-reset.entity.js +48 -0
- package/dist/app-auth/password-resets/password-reset.entity.js.map +1 -0
- package/dist/app-auth/refresh-tokens/index.d.ts +2 -0
- package/dist/app-auth/refresh-tokens/index.d.ts.map +1 -0
- package/{src/app-auth/refresh-tokens/index.ts → dist/app-auth/refresh-tokens/index.js} +1 -0
- package/dist/app-auth/refresh-tokens/index.js.map +1 -0
- package/dist/app-auth/refresh-tokens/refresh-token.entity.d.ts +11 -0
- package/dist/app-auth/refresh-tokens/refresh-token.entity.d.ts.map +1 -0
- package/dist/app-auth/refresh-tokens/refresh-token.entity.js +48 -0
- package/dist/app-auth/refresh-tokens/refresh-token.entity.js.map +1 -0
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.d.ts +6 -0
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.d.ts.map +1 -0
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.js +7 -0
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.js.map +1 -0
- package/dist/app-auth/user-auth-providers/index.d.ts +3 -0
- package/dist/app-auth/user-auth-providers/index.d.ts.map +1 -0
- package/{src/app-auth/user-auth-providers/index.ts → dist/app-auth/user-auth-providers/index.js} +1 -1
- package/dist/app-auth/user-auth-providers/index.js.map +1 -0
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.d.ts +13 -0
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.d.ts.map +1 -0
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.js +53 -0
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.js.map +1 -0
- package/dist/app-auth/user-verifications/enums/verification-type.enum.d.ts +5 -0
- package/dist/app-auth/user-verifications/enums/verification-type.enum.d.ts.map +1 -0
- package/dist/app-auth/user-verifications/enums/verification-type.enum.js +6 -0
- package/dist/app-auth/user-verifications/enums/verification-type.enum.js.map +1 -0
- package/dist/app-auth/user-verifications/index.d.ts +3 -0
- package/dist/app-auth/user-verifications/index.d.ts.map +1 -0
- package/{src/app-auth/user-verifications/index.ts → dist/app-auth/user-verifications/index.js} +1 -1
- package/dist/app-auth/user-verifications/index.js.map +1 -0
- package/dist/app-auth/user-verifications/user-verification.entity.d.ts +15 -0
- package/dist/app-auth/user-verifications/user-verification.entity.d.ts.map +1 -0
- package/dist/app-auth/user-verifications/user-verification.entity.js +60 -0
- package/dist/app-auth/user-verifications/user-verification.entity.js.map +1 -0
- package/dist/app-auth/users/index.d.ts +2 -0
- package/dist/app-auth/users/index.d.ts.map +1 -0
- package/{src/app-auth/users/index.ts → dist/app-auth/users/index.js} +1 -0
- package/dist/app-auth/users/index.js.map +1 -0
- package/dist/app-auth/users/user.entity.d.ts +29 -0
- package/dist/app-auth/users/user.entity.d.ts.map +1 -0
- package/dist/app-auth/users/user.entity.js +136 -0
- package/dist/app-auth/users/user.entity.js.map +1 -0
- package/dist/app-auth/users/utils/format-data.utils.d.ts +7 -0
- package/dist/app-auth/users/utils/format-data.utils.d.ts.map +1 -0
- package/dist/app-auth/users/utils/format-data.utils.js +19 -0
- package/dist/app-auth/users/utils/format-data.utils.js.map +1 -0
- package/dist/common/utils/decimal-transformer.utils.d.ts +5 -0
- package/dist/common/utils/decimal-transformer.utils.d.ts.map +1 -0
- package/dist/common/utils/decimal-transformer.utils.js +15 -0
- package/dist/common/utils/decimal-transformer.utils.js.map +1 -0
- package/dist/facilities/addresses/address.entity.d.ts +18 -0
- package/dist/facilities/addresses/address.entity.d.ts.map +1 -0
- package/dist/facilities/addresses/address.entity.js +87 -0
- package/dist/facilities/addresses/address.entity.js.map +1 -0
- package/dist/facilities/addresses/index.d.ts +2 -0
- package/dist/facilities/addresses/index.d.ts.map +1 -0
- package/{src/facilities/addresses/index.ts → dist/facilities/addresses/index.js} +1 -0
- package/dist/facilities/addresses/index.js.map +1 -0
- package/dist/facilities/facilities/enums/facility-status.enum.d.ts +6 -0
- package/dist/facilities/facilities/enums/facility-status.enum.d.ts.map +1 -0
- package/dist/facilities/facilities/enums/facility-status.enum.js +7 -0
- package/dist/facilities/facilities/enums/facility-status.enum.js.map +1 -0
- package/dist/facilities/facilities/facility.entity.d.ts +26 -0
- package/dist/facilities/facilities/facility.entity.d.ts.map +1 -0
- package/dist/facilities/facilities/facility.entity.js +124 -0
- package/dist/facilities/facilities/facility.entity.js.map +1 -0
- package/dist/facilities/facilities/index.d.ts +3 -0
- package/dist/facilities/facilities/index.d.ts.map +1 -0
- package/{src/facilities/facilities/index.ts → dist/facilities/facilities/index.js} +1 -1
- package/dist/facilities/facilities/index.js.map +1 -0
- package/dist/facilities/facilities/utils/sanititze.utils.d.ts +5 -0
- package/dist/facilities/facilities/utils/sanititze.utils.d.ts.map +1 -0
- package/dist/facilities/facilities/utils/sanititze.utils.js +12 -0
- package/dist/facilities/facilities/utils/sanititze.utils.js.map +1 -0
- package/dist/facilities/facility-images/facility-image.entity.d.ts +12 -0
- package/dist/facilities/facility-images/facility-image.entity.d.ts.map +1 -0
- package/dist/facilities/facility-images/facility-image.entity.js +59 -0
- package/dist/facilities/facility-images/facility-image.entity.js.map +1 -0
- package/dist/facilities/facility-images/index.d.ts +2 -0
- package/dist/facilities/facility-images/index.d.ts.map +1 -0
- package/{src/facilities/facility-images/index.ts → dist/facilities/facility-images/index.js} +1 -0
- package/dist/facilities/facility-images/index.js.map +1 -0
- package/dist/facilities/facility-owners/facility-owner.entity.d.ts +13 -0
- package/dist/facilities/facility-owners/facility-owner.entity.d.ts.map +1 -0
- package/dist/facilities/facility-owners/facility-owner.entity.js +65 -0
- package/dist/facilities/facility-owners/facility-owner.entity.js.map +1 -0
- package/dist/facilities/facility-owners/index.d.ts +2 -0
- package/dist/facilities/facility-owners/index.d.ts.map +1 -0
- package/{src/facilities/facility-owners/index.ts → dist/facilities/facility-owners/index.js} +1 -0
- package/dist/facilities/facility-owners/index.js.map +1 -0
- package/dist/facilities/facility-owners/utils/sanitize.utils.d.ts +5 -0
- package/dist/facilities/facility-owners/utils/sanitize.utils.d.ts.map +1 -0
- package/dist/facilities/facility-owners/utils/sanitize.utils.js +9 -0
- package/dist/facilities/facility-owners/utils/sanitize.utils.js.map +1 -0
- package/dist/facilities/fields/enums/surface-type.enum.d.ts +8 -0
- package/dist/facilities/fields/enums/surface-type.enum.d.ts.map +1 -0
- package/dist/facilities/fields/enums/surface-type.enum.js +9 -0
- package/dist/facilities/fields/enums/surface-type.enum.js.map +1 -0
- package/dist/facilities/fields/field.entity.d.ts +18 -0
- package/dist/facilities/fields/field.entity.d.ts.map +1 -0
- package/dist/facilities/fields/field.entity.js +72 -0
- package/dist/facilities/fields/field.entity.js.map +1 -0
- package/dist/facilities/fields/index.d.ts +3 -0
- package/dist/facilities/fields/index.d.ts.map +1 -0
- package/{src/facilities/fields/index.ts → dist/facilities/fields/index.js} +1 -1
- package/dist/facilities/fields/index.js.map +1 -0
- package/dist/facilities/index.d.ts +6 -0
- package/dist/facilities/index.d.ts.map +1 -0
- package/{src/facilities/index.ts → dist/facilities/index.js} +1 -0
- package/dist/facilities/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +1 -3
- package/dist/index.js.map +1 -0
- package/dist/payments/index.d.ts +4 -0
- package/dist/payments/index.d.ts.map +1 -0
- package/{src/payments/index.ts → dist/payments/index.js} +1 -2
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.d.ts +4 -0
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.d.ts.map +1 -0
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.js +5 -0
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.js.map +1 -0
- package/dist/payments/payment-providers/index.d.ts +3 -0
- package/dist/payments/payment-providers/index.d.ts.map +1 -0
- package/{src/payments/payment-providers/index.ts → dist/payments/payment-providers/index.js} +1 -1
- package/dist/payments/payment-providers/index.js.map +1 -0
- package/dist/payments/payment-providers/payment-provider.entity.d.ts +10 -0
- package/dist/payments/payment-providers/payment-provider.entity.d.ts.map +1 -0
- package/dist/payments/payment-providers/payment-provider.entity.js +50 -0
- package/dist/payments/payment-providers/payment-provider.entity.js.map +1 -0
- package/dist/payments/payments/enums/payment-method.enum.d.ts +5 -0
- package/dist/payments/payments/enums/payment-method.enum.d.ts.map +1 -0
- package/dist/payments/payments/enums/payment-method.enum.js +6 -0
- package/dist/payments/payments/enums/payment-method.enum.js.map +1 -0
- package/dist/payments/payments/enums/payment-status.enum.d.ts +10 -0
- package/dist/payments/payments/enums/payment-status.enum.d.ts.map +1 -0
- package/dist/payments/payments/enums/payment-status.enum.js +11 -0
- package/dist/payments/payments/enums/payment-status.enum.js.map +1 -0
- package/dist/payments/payments/index.d.ts +4 -0
- package/dist/payments/payments/index.d.ts.map +1 -0
- package/{src/payments/payments/index.ts → dist/payments/payments/index.js} +1 -2
- package/dist/payments/payments/index.js.map +1 -0
- package/dist/payments/payments/payment.entity.d.ts +19 -0
- package/dist/payments/payments/payment.entity.d.ts.map +1 -0
- package/dist/payments/payments/payment.entity.js +85 -0
- package/dist/payments/payments/payment.entity.js.map +1 -0
- package/dist/payments/user-payment-providers/index.d.ts +2 -0
- package/dist/payments/user-payment-providers/index.d.ts.map +1 -0
- package/{src/payments/user-payment-providers/index.ts → dist/payments/user-payment-providers/index.js} +1 -0
- package/dist/payments/user-payment-providers/index.js.map +1 -0
- package/dist/payments/user-payment-providers/user-payment-provider.entity.d.ts +13 -0
- package/dist/payments/user-payment-providers/user-payment-provider.entity.d.ts.map +1 -0
- package/dist/payments/user-payment-providers/user-payment-provider.entity.js +61 -0
- package/dist/payments/user-payment-providers/user-payment-provider.entity.js.map +1 -0
- package/dist/tournaments/index.d.ts +13 -0
- package/dist/tournaments/index.d.ts.map +1 -0
- package/{src/tournaments/index.ts → dist/tournaments/index.js} +1 -0
- package/dist/tournaments/index.js.map +1 -0
- package/dist/tournaments/tournament-facilities/index.d.ts +2 -0
- package/dist/tournaments/tournament-facilities/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-facilities/index.ts → dist/tournaments/tournament-facilities/index.js} +1 -0
- package/dist/tournaments/tournament-facilities/index.js.map +1 -0
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.d.ts +14 -0
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.js +61 -0
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.js.map +1 -0
- package/dist/tournaments/tournament-format-configs/index.d.ts +2 -0
- package/dist/tournaments/tournament-format-configs/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-format-configs/index.ts → dist/tournaments/tournament-format-configs/index.js} +1 -0
- package/dist/tournaments/tournament-format-configs/index.js.map +1 -0
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.d.ts +15 -0
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.js +76 -0
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.js.map +1 -0
- package/dist/tournaments/tournament-match-cards/index.d.ts +2 -0
- package/dist/tournaments/tournament-match-cards/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-match-cards/index.ts → dist/tournaments/tournament-match-cards/index.js} +1 -0
- package/dist/tournaments/tournament-match-cards/index.js.map +1 -0
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.d.ts +19 -0
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.js +75 -0
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.js.map +1 -0
- package/dist/tournaments/tournament-match-goals/index.d.ts +2 -0
- package/dist/tournaments/tournament-match-goals/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-match-goals/index.ts → dist/tournaments/tournament-match-goals/index.js} +1 -0
- package/dist/tournaments/tournament-match-goals/index.js.map +1 -0
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.d.ts +20 -0
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.js +79 -0
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.js.map +1 -0
- package/dist/tournaments/tournament-match-schemas/index.d.ts +2 -0
- package/dist/tournaments/tournament-match-schemas/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-match-schemas/index.ts → dist/tournaments/tournament-match-schemas/index.js} +1 -0
- package/dist/tournaments/tournament-match-schemas/index.js.map +1 -0
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.d.ts +12 -0
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.js +47 -0
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.js.map +1 -0
- package/dist/tournaments/tournament-matches/index.d.ts +2 -0
- package/dist/tournaments/tournament-matches/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-matches/index.ts → dist/tournaments/tournament-matches/index.js} +1 -0
- package/dist/tournaments/tournament-matches/index.js.map +1 -0
- package/dist/tournaments/tournament-matches/tournament-match.entity.d.ts +25 -0
- package/dist/tournaments/tournament-matches/tournament-match.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-matches/tournament-match.entity.js +97 -0
- package/dist/tournaments/tournament-matches/tournament-match.entity.js.map +1 -0
- package/dist/tournaments/tournament-payments/index.d.ts +2 -0
- package/dist/tournaments/tournament-payments/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-payments/index.ts → dist/tournaments/tournament-payments/index.js} +1 -0
- package/dist/tournaments/tournament-payments/index.js.map +1 -0
- package/dist/tournaments/tournament-payments/tournament-payment.entity.d.ts +16 -0
- package/dist/tournaments/tournament-payments/tournament-payment.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-payments/tournament-payment.entity.js +59 -0
- package/dist/tournaments/tournament-payments/tournament-payment.entity.js.map +1 -0
- package/dist/tournaments/tournament-players/index.d.ts +2 -0
- package/dist/tournaments/tournament-players/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-players/index.ts → dist/tournaments/tournament-players/index.js} +1 -0
- package/dist/tournaments/tournament-players/index.js.map +1 -0
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts +19 -0
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-players/tournament-player.entity.js +76 -0
- package/dist/tournaments/tournament-players/tournament-player.entity.js.map +1 -0
- package/dist/tournaments/tournament-prize-rules/index.d.ts +2 -0
- package/dist/tournaments/tournament-prize-rules/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-prize-rules/index.ts → dist/tournaments/tournament-prize-rules/index.js} +1 -0
- package/dist/tournaments/tournament-prize-rules/index.js.map +1 -0
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.d.ts +13 -0
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.js +55 -0
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.js.map +1 -0
- package/dist/tournaments/tournament-rules/index.d.ts +2 -0
- package/dist/tournaments/tournament-rules/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-rules/index.ts → dist/tournaments/tournament-rules/index.js} +1 -0
- package/dist/tournaments/tournament-rules/index.js.map +1 -0
- package/dist/tournaments/tournament-rules/tournament-rule.entity.d.ts +17 -0
- package/dist/tournaments/tournament-rules/tournament-rule.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-rules/tournament-rule.entity.js +77 -0
- package/dist/tournaments/tournament-rules/tournament-rule.entity.js.map +1 -0
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.d.ts +5 -0
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.d.ts.map +1 -0
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.js +6 -0
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.js.map +1 -0
- package/dist/tournaments/tournament-teams/index.d.ts +3 -0
- package/dist/tournaments/tournament-teams/index.d.ts.map +1 -0
- package/{src/tournaments/tournament-teams/index.ts → dist/tournaments/tournament-teams/index.js} +1 -1
- package/dist/tournaments/tournament-teams/index.js.map +1 -0
- package/dist/tournaments/tournament-teams/tournament-team.entity.d.ts +26 -0
- package/dist/tournaments/tournament-teams/tournament-team.entity.d.ts.map +1 -0
- package/dist/tournaments/tournament-teams/tournament-team.entity.js +100 -0
- package/dist/tournaments/tournament-teams/tournament-team.entity.js.map +1 -0
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.d.ts +2 -0
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.d.ts.map +1 -0
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.js +4 -0
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.js.map +1 -0
- package/dist/tournaments/tournaments/index.d.ts +2 -0
- package/dist/tournaments/tournaments/index.d.ts.map +1 -0
- package/{src/tournaments/tournaments/index.ts → dist/tournaments/tournaments/index.js} +1 -0
- package/dist/tournaments/tournaments/index.js.map +1 -0
- package/dist/tournaments/tournaments/tournament.entity.d.ts +39 -0
- package/dist/tournaments/tournaments/tournament.entity.d.ts.map +1 -0
- package/dist/tournaments/tournaments/tournament.entity.js +147 -0
- package/dist/tournaments/tournaments/tournament.entity.js.map +1 -0
- package/package.json +5 -2
- package/.changeset/README.md +0 -9
- package/.changeset/config.json +0 -11
- package/.github/workflows/release.yml +0 -80
- package/.husky/pre-commit +0 -4
- package/.husky/pre-push +0 -4
- package/.lintstagedrc.json +0 -5
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -12
- package/CHANGELOG.md +0 -29
- package/eslint.config.js +0 -84
- package/src/app-auth/password-resets/password-reset.entity.ts +0 -52
- package/src/app-auth/refresh-tokens/refresh-token.entity.ts +0 -52
- package/src/app-auth/user-auth-providers/enums/auth-provider.enum.ts +0 -24
- package/src/app-auth/user-auth-providers/user-auth-provider.entity.ts +0 -58
- package/src/app-auth/user-verifications/enums/verification-type.enum.ts +0 -19
- package/src/app-auth/user-verifications/user-verification.entity.ts +0 -62
- package/src/app-auth/users/user.entity.ts +0 -149
- package/src/app-auth/users/utils/format-data.utils.ts +0 -38
- package/src/common/utils/decimal-transformer.utils.ts +0 -13
- package/src/facilities/addresses/address.entity.ts +0 -82
- package/src/facilities/facilities/enums/facility-status.enum.ts +0 -25
- package/src/facilities/facilities/facility.entity.ts +0 -137
- package/src/facilities/facilities/utils/sanititze.utils.ts +0 -19
- package/src/facilities/facility-images/facility-image.entity.ts +0 -64
- package/src/facilities/facility-owners/facility-owner.entity.ts +0 -74
- package/src/facilities/facility-owners/utils/sanitize.utils.ts +0 -16
- package/src/facilities/fields/enums/surface-type.enum.ts +0 -35
- package/src/facilities/fields/field.entity.ts +0 -74
- package/src/payments/payment-providers/enums/payment-provider-name.enum.ts +0 -15
- package/src/payments/payment-providers/payment-provider.entity.ts +0 -61
- package/src/payments/payments/enums/payment-method.enum.ts +0 -20
- package/src/payments/payments/enums/payment-status.enum.ts +0 -45
- package/src/payments/payments/payment.entity.ts +0 -84
- package/src/payments/user-payment-providers/user-payment-provider.entity.ts +0 -73
- package/src/tournaments/tournament-facilities/tournament-facility.entity.ts +0 -67
- package/src/tournaments/tournament-format-configs/tournament-format-config.entity.ts +0 -98
- package/src/tournaments/tournament-match-cards/tournament-match-card.entity.ts +0 -86
- package/src/tournaments/tournament-match-goals/tournament-match-goal.entity.ts +0 -88
- package/src/tournaments/tournament-match-schemas/tournament-match-schema.entity.ts +0 -51
- package/src/tournaments/tournament-matches/tournament-match.entity.ts +0 -120
- package/src/tournaments/tournament-payments/tournament-payment.entity.ts +0 -67
- package/src/tournaments/tournament-players/tournament-player.entity.ts +0 -96
- package/src/tournaments/tournament-prize-rules/tournament-prize-rule.entity.ts +0 -65
- package/src/tournaments/tournament-rules/tournament-rule.entity.ts +0 -77
- package/src/tournaments/tournament-teams/enums/tournament-team-status.enum.ts +0 -21
- package/src/tournaments/tournament-teams/tournament-team.entity.ts +0 -121
- package/src/tournaments/tournament-teams/utils/invite-code-generator.ts +0 -12
- package/src/tournaments/tournaments/tournament.entity.ts +0 -153
- package/tsconfig.json +0 -29
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { ITournamentMatch, TournamentMatchPhase } from '@natrave/tournaments-service-types';
|
|
2
|
-
import {
|
|
3
|
-
Entity,
|
|
4
|
-
Column,
|
|
5
|
-
PrimaryGeneratedColumn,
|
|
6
|
-
CreateDateColumn,
|
|
7
|
-
UpdateDateColumn,
|
|
8
|
-
ManyToOne,
|
|
9
|
-
JoinColumn,
|
|
10
|
-
OneToMany,
|
|
11
|
-
} from 'typeorm';
|
|
12
|
-
|
|
13
|
-
import { Field } from 'facilities';
|
|
14
|
-
import { TournamentMatchCard } from 'tournaments/tournament-match-cards';
|
|
15
|
-
import { TournamentMatchGoal } from 'tournaments/tournament-match-goals';
|
|
16
|
-
import { TournamentTeam } from 'tournaments/tournament-teams';
|
|
17
|
-
import { Tournament } from 'tournaments/tournaments';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Entidade que representa uma partida de torneio.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* Esta entidade armazena os dados de uma partida de torneio, incluindo os identificadores dos times (casa e visitante),
|
|
24
|
-
* o identificador do campo (opcional), a data do jogo e as datas de criação e atualização do registro.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
@Entity('tournament_matches')
|
|
29
|
-
export class TournamentMatch implements ITournamentMatch {
|
|
30
|
-
@PrimaryGeneratedColumn()
|
|
31
|
-
id: number;
|
|
32
|
-
|
|
33
|
-
@Column({ name: 'tournament_id', type: 'int' })
|
|
34
|
-
tournamentId: number;
|
|
35
|
-
|
|
36
|
-
@Column({ name: 'home_team_id', type: 'int' })
|
|
37
|
-
homeTeamId: number;
|
|
38
|
-
|
|
39
|
-
@Column({ name: 'away_team_id', type: 'int' })
|
|
40
|
-
awayTeamId: number;
|
|
41
|
-
|
|
42
|
-
@Column({ name: 'field_id', type: 'int', nullable: true })
|
|
43
|
-
fieldId?: number;
|
|
44
|
-
|
|
45
|
-
@Column({ name: 'match_date', type: 'timestamptz' })
|
|
46
|
-
matchDate: Date;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Fase do torneio à qual a partida pertence.
|
|
50
|
-
*
|
|
51
|
-
* Pode representar uma fase de grupos (group_stage), round-robin, ou uma etapa do mata-mata
|
|
52
|
-
* (ex: round-of-16, quarter-final, semi-final, final).
|
|
53
|
-
* Esse campo é essencial para classificar e organizar as partidas dentro do contexto do torneio.
|
|
54
|
-
*/
|
|
55
|
-
@Column({ type: 'enum', enum: TournamentMatchPhase })
|
|
56
|
-
phase: TournamentMatchPhase;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Indica a rodada ou o número do jogo dentro da fase.
|
|
60
|
-
*
|
|
61
|
-
* - Para fases de grupos ou round robin, representa o número da rodada.
|
|
62
|
-
* - Para fases knockout com jogos de ida e volta, indica se é o jogo de ida (1) ou de volta (2).
|
|
63
|
-
*/
|
|
64
|
-
@Column({ name: 'round_indicator', type: 'int', default: 1 })
|
|
65
|
-
roundIndicator: number;
|
|
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 campo ao qual a partida esta associada.
|
|
77
|
-
*/
|
|
78
|
-
@ManyToOne(() => Field, (field) => field.tournamentMatches, { onDelete: 'SET NULL' })
|
|
79
|
-
@JoinColumn({ name: 'field_id' })
|
|
80
|
-
field?: Field;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Relação com o campeonato ao qual a partida esta associada.
|
|
84
|
-
*/
|
|
85
|
-
@ManyToOne(() => Tournament, (tournament) => tournament.matches, {
|
|
86
|
-
onDelete: 'CASCADE',
|
|
87
|
-
})
|
|
88
|
-
@JoinColumn({ name: 'tournament_id' })
|
|
89
|
-
tournament: Tournament;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Relação com o time da casa ao qual a partida esta associada.
|
|
93
|
-
*/
|
|
94
|
-
@ManyToOne(() => TournamentTeam, (team) => team.homeMatches, {
|
|
95
|
-
onDelete: 'CASCADE',
|
|
96
|
-
})
|
|
97
|
-
@JoinColumn({ name: 'home_team_id' })
|
|
98
|
-
homeTeam: TournamentTeam;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Relação com o time visitante ao qual a partida esta associada.
|
|
102
|
-
*/
|
|
103
|
-
@ManyToOne(() => TournamentTeam, (team) => team.awayMatches, {
|
|
104
|
-
onDelete: 'CASCADE',
|
|
105
|
-
})
|
|
106
|
-
@JoinColumn({ name: 'away_team_id' })
|
|
107
|
-
awayTeam: TournamentTeam;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Relação com os gols associados a partida.
|
|
111
|
-
*/
|
|
112
|
-
@OneToMany(() => TournamentMatchGoal, (goal) => goal.match)
|
|
113
|
-
goals: TournamentMatchGoal[];
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Relação com os cartões associados a partida.
|
|
117
|
-
*/
|
|
118
|
-
@OneToMany(() => TournamentMatchCard, (card) => card.match)
|
|
119
|
-
cards: TournamentMatchCard[];
|
|
120
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ITournamentPayment } from '@natrave/tournaments-service-types';
|
|
2
|
-
import {
|
|
3
|
-
Entity,
|
|
4
|
-
Column,
|
|
5
|
-
PrimaryGeneratedColumn,
|
|
6
|
-
CreateDateColumn,
|
|
7
|
-
UpdateDateColumn,
|
|
8
|
-
ManyToOne,
|
|
9
|
-
JoinColumn,
|
|
10
|
-
} from 'typeorm';
|
|
11
|
-
|
|
12
|
-
import { User } from 'app-auth';
|
|
13
|
-
import { Payment } from 'payments';
|
|
14
|
-
import { Tournament } from 'tournaments/tournaments';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Entidade que representa um pagamento realizado para um torneio.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Esta entidade armazena os dados do pagamento associado a um torneio,
|
|
21
|
-
* vinculando o pagamento a um usuário e ao torneio correspondente.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
@Entity('tournament_payments')
|
|
26
|
-
export class TournamentPayment implements ITournamentPayment {
|
|
27
|
-
@PrimaryGeneratedColumn('uuid')
|
|
28
|
-
id: string;
|
|
29
|
-
|
|
30
|
-
@Column({ name: 'payment_id', type: 'int' })
|
|
31
|
-
paymentId: number;
|
|
32
|
-
|
|
33
|
-
@Column({ name: 'tournament_id', type: 'int' })
|
|
34
|
-
tournamentId: number;
|
|
35
|
-
|
|
36
|
-
@Column({ name: 'user_id', type: 'uuid' })
|
|
37
|
-
userId: string;
|
|
38
|
-
|
|
39
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
40
|
-
createdAt: Date;
|
|
41
|
-
|
|
42
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
43
|
-
updatedAt: Date;
|
|
44
|
-
|
|
45
|
-
/** RELAÇÕES */
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Relação com o usuário ao qual o pagamento esta associado.
|
|
49
|
-
*/
|
|
50
|
-
@ManyToOne(() => User, { onDelete: 'CASCADE' })
|
|
51
|
-
@JoinColumn({ name: 'user_id' })
|
|
52
|
-
user: User;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Relação com o pagamento ao qual o pagamento do torneio esta associado.
|
|
56
|
-
*/
|
|
57
|
-
@ManyToOne(() => Payment, { onDelete: 'CASCADE', eager: true })
|
|
58
|
-
@JoinColumn({ name: 'payment_id' })
|
|
59
|
-
payment: Payment;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Relação com o torneio ao qual o pagamento do torneio esta associado.
|
|
63
|
-
*/
|
|
64
|
-
@ManyToOne(() => Tournament, { onDelete: 'CASCADE' })
|
|
65
|
-
@JoinColumn({ name: 'tournament_id' })
|
|
66
|
-
tournament: Tournament;
|
|
67
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { ITournamentPlayer } 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
|
-
OneToMany,
|
|
13
|
-
} from 'typeorm';
|
|
14
|
-
|
|
15
|
-
import { User } from 'app-auth';
|
|
16
|
-
import { TournamentMatchCard } from 'tournaments/tournament-match-cards';
|
|
17
|
-
import { TournamentMatchGoal } from 'tournaments/tournament-match-goals';
|
|
18
|
-
import { TournamentTeam } from 'tournaments/tournament-teams';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Entidade que representa um jogador de torneio.
|
|
22
|
-
*
|
|
23
|
-
* @remarks
|
|
24
|
-
* Esta entidade associa um usuário a um time em um torneio e indica se o usuário é o dono do time.
|
|
25
|
-
*
|
|
26
|
-
* São utilizados:
|
|
27
|
-
* - Uma restrição única para garantir que um usuário não seja associado a mais de um time no mesmo torneio.
|
|
28
|
-
* - Índices em "userId" e "teamId" para otimizar consultas.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
@Entity('tournament_players')
|
|
33
|
-
@Unique(['userId', 'teamId'])
|
|
34
|
-
@Index('IDX_user_id', ['userId'])
|
|
35
|
-
@Index('IDX_team_id', ['teamId'])
|
|
36
|
-
export class TournamentPlayer implements ITournamentPlayer {
|
|
37
|
-
@PrimaryGeneratedColumn()
|
|
38
|
-
id: number;
|
|
39
|
-
|
|
40
|
-
@Column({ name: 'user_id', type: 'uuid' })
|
|
41
|
-
userId: string;
|
|
42
|
-
|
|
43
|
-
@Column({ name: 'team_id', type: 'int' })
|
|
44
|
-
teamId: number;
|
|
45
|
-
|
|
46
|
-
@Column({ name: 'is_owner', type: 'boolean', default: false })
|
|
47
|
-
isOwner: boolean;
|
|
48
|
-
|
|
49
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
50
|
-
createdAt: Date;
|
|
51
|
-
|
|
52
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
53
|
-
updatedAt: Date;
|
|
54
|
-
|
|
55
|
-
/** RELAÇÕES */
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Relação com o time ao qual o jogador esta associado.
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
@ManyToOne(() => TournamentTeam, (team) => team.players, {
|
|
62
|
-
onDelete: 'CASCADE',
|
|
63
|
-
eager: true,
|
|
64
|
-
})
|
|
65
|
-
@JoinColumn({ name: 'team_id' })
|
|
66
|
-
team: TournamentTeam;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Relação com o usuário ao qual os jogador esta associado.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
@ManyToOne(() => User, (user) => user.tournamentPlayers, {
|
|
73
|
-
onDelete: 'CASCADE',
|
|
74
|
-
eager: true,
|
|
75
|
-
})
|
|
76
|
-
@JoinColumn({ name: 'user_id' })
|
|
77
|
-
user: User;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Relação com os gols associados ao jogador.
|
|
81
|
-
*/
|
|
82
|
-
@OneToMany(() => TournamentMatchGoal, (goal) => goal.scorer)
|
|
83
|
-
goals: TournamentMatchGoal[];
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Relação com as assistências associados ao jogador.
|
|
87
|
-
*/
|
|
88
|
-
@OneToMany(() => TournamentMatchGoal, (goal) => goal.assist)
|
|
89
|
-
assists: TournamentMatchGoal[];
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Relação com os cartões associados ao jogador.
|
|
93
|
-
*/
|
|
94
|
-
@OneToMany(() => TournamentMatchCard, (card) => card.player)
|
|
95
|
-
cards: TournamentMatchCard[];
|
|
96
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ITournamentPrizeRule } from '@natrave/tournaments-service-types';
|
|
2
|
-
import {
|
|
3
|
-
Entity,
|
|
4
|
-
Column,
|
|
5
|
-
PrimaryGeneratedColumn,
|
|
6
|
-
CreateDateColumn,
|
|
7
|
-
UpdateDateColumn,
|
|
8
|
-
Index,
|
|
9
|
-
Check,
|
|
10
|
-
ManyToOne,
|
|
11
|
-
JoinColumn,
|
|
12
|
-
} from 'typeorm';
|
|
13
|
-
|
|
14
|
-
import { Tournament } from 'tournaments/tournaments';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Entidade que representa as regras de premiação para torneios.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Esta entidade armazena o valor do prêmio, a classificação associada e, opcionalmente, uma descrição,
|
|
21
|
-
* garantindo que o valor do prêmio e a classificação sejam não-negativos.
|
|
22
|
-
*
|
|
23
|
-
* São utilizados:
|
|
24
|
-
* - Um índice composto em [tournamentId, rank] para otimizar consultas por torneio e posição.
|
|
25
|
-
* - Check constraints para assegurar que "amount" e "rank" sejam maiores ou iguais a zero.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
@Entity('tournament_prize_rules')
|
|
30
|
-
@Index(['tournamentId', 'rank'])
|
|
31
|
-
@Check('CHK_TOURNAMENT_PRIZE_RULES_NON_NEGATIVE', 'amount >= 0 AND rank >= 0')
|
|
32
|
-
export class TournamentPrizeRule implements ITournamentPrizeRule {
|
|
33
|
-
@PrimaryGeneratedColumn()
|
|
34
|
-
id: number;
|
|
35
|
-
|
|
36
|
-
@Column({ name: 'tournament_id', type: 'int' })
|
|
37
|
-
tournamentId: number;
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'int' })
|
|
40
|
-
amount: number;
|
|
41
|
-
|
|
42
|
-
@Column({ type: 'int' })
|
|
43
|
-
rank: number;
|
|
44
|
-
|
|
45
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
46
|
-
description?: string;
|
|
47
|
-
|
|
48
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
49
|
-
createdAt: Date;
|
|
50
|
-
|
|
51
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
52
|
-
updatedAt: Date;
|
|
53
|
-
|
|
54
|
-
/** RELAÇÕES */
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Relação com o torneio ao qual as regras estão associadas.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
@ManyToOne(() => Tournament, (tournament) => tournament.prizeRules, {
|
|
61
|
-
onDelete: 'CASCADE',
|
|
62
|
-
})
|
|
63
|
-
@JoinColumn({ name: 'tournament_id' })
|
|
64
|
-
tournament: Tournament;
|
|
65
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ITournamentRule } from '@natrave/tournaments-service-types';
|
|
2
|
-
import {
|
|
3
|
-
Entity,
|
|
4
|
-
Column,
|
|
5
|
-
PrimaryGeneratedColumn,
|
|
6
|
-
CreateDateColumn,
|
|
7
|
-
UpdateDateColumn,
|
|
8
|
-
JoinColumn,
|
|
9
|
-
Check,
|
|
10
|
-
OneToOne,
|
|
11
|
-
} from 'typeorm';
|
|
12
|
-
|
|
13
|
-
import { Tournament } from 'tournaments/tournaments';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Entidade que representa as regras de um torneio.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Esta entidade armazena os limites de jogadores por time, faixas etárias, número mínimo e máximo de times,
|
|
20
|
-
* além de informações adicionais, como observações e URL do regulamento em PDF.
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
@Entity('tournament_rules')
|
|
25
|
-
@Check('CHK_PLAYERS_PER_TEAM', '"max_player_per_team" >= "min_player_per_team"')
|
|
26
|
-
@Check('CHK_MIN_AGE', '"min_age" >= 0')
|
|
27
|
-
@Check('CHK_MAX_AGE', '"max_age" IS NULL OR "max_age" > "min_age"')
|
|
28
|
-
export class TournamentRule implements ITournamentRule {
|
|
29
|
-
@PrimaryGeneratedColumn()
|
|
30
|
-
id: number;
|
|
31
|
-
|
|
32
|
-
@Column({ name: 'tournament_id', type: 'int', unique: true })
|
|
33
|
-
tournamentId: number;
|
|
34
|
-
|
|
35
|
-
@Column({ name: 'max_player_per_team', type: 'int' })
|
|
36
|
-
maxPlayerPerTeam: number;
|
|
37
|
-
|
|
38
|
-
@Column({ name: 'min_player_per_team', type: 'int' })
|
|
39
|
-
minPlayerPerTeam: number;
|
|
40
|
-
|
|
41
|
-
@Column({ name: 'min_age', type: 'int' })
|
|
42
|
-
minAge: number;
|
|
43
|
-
|
|
44
|
-
@Column({ name: 'max_age', type: 'int', nullable: true })
|
|
45
|
-
maxAge?: number;
|
|
46
|
-
|
|
47
|
-
@Column({ name: 'expected_teams', type: 'int' })
|
|
48
|
-
expectedTeams: number;
|
|
49
|
-
|
|
50
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
51
|
-
notes?: string;
|
|
52
|
-
|
|
53
|
-
@Column({
|
|
54
|
-
name: 'regulation_pdf_url',
|
|
55
|
-
type: 'varchar',
|
|
56
|
-
length: 500,
|
|
57
|
-
nullable: true,
|
|
58
|
-
})
|
|
59
|
-
regulationPdfUrl?: string;
|
|
60
|
-
|
|
61
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
62
|
-
createdAt: Date;
|
|
63
|
-
|
|
64
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
65
|
-
updatedAt: Date;
|
|
66
|
-
|
|
67
|
-
/** RELAÇÕES */
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Relação com o torneio ao qual as regras estão associadas.
|
|
71
|
-
*/
|
|
72
|
-
@OneToOne(() => Tournament, (tournament) => tournament.rule, {
|
|
73
|
-
cascade: true,
|
|
74
|
-
})
|
|
75
|
-
@JoinColumn({ name: 'tournament_id' })
|
|
76
|
-
tournament: Tournament;
|
|
77
|
-
}
|
|
@@ -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,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
|
-
}
|