@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,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formata os dados do usuário antes de inseri-los no banco.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Esta função ajusta os campos de email, username, CPF e telefone do usuário:
|
|
6
|
-
* - Converte email e username para minúsculas e remove espaços desnecessários.
|
|
7
|
-
* - Remove caracteres não numéricos do CPF.
|
|
8
|
-
* - Remove caracteres não numéricos do telefone, adiciona o código do Brasil (55) se necessário e prefixa com "+".
|
|
9
|
-
*
|
|
10
|
-
* @param user - A instância do usuário a ser formatada.
|
|
11
|
-
*/
|
|
12
|
-
export function formatUserBeforeInsertData(user: {
|
|
13
|
-
email?: string;
|
|
14
|
-
username?: string;
|
|
15
|
-
cpf?: string;
|
|
16
|
-
phone?: string;
|
|
17
|
-
}): void {
|
|
18
|
-
if (user.email) {
|
|
19
|
-
user.email = user.email.toLowerCase().trim();
|
|
20
|
-
}
|
|
21
|
-
if (user.username) {
|
|
22
|
-
user.username = user.username.toLowerCase().trim();
|
|
23
|
-
}
|
|
24
|
-
if (user.cpf) {
|
|
25
|
-
// Remove qualquer caractere que não seja número
|
|
26
|
-
user.cpf = user.cpf.replace(/\D/g, '').trim();
|
|
27
|
-
}
|
|
28
|
-
if (user.phone) {
|
|
29
|
-
// Remove todos os caracteres que não são números
|
|
30
|
-
user.phone = user.phone.replace(/\D/g, '').trim();
|
|
31
|
-
// Garante que o telefone tenha o código do Brasil (55)
|
|
32
|
-
if (!user.phone.startsWith('55')) {
|
|
33
|
-
user.phone = `55${user.phone}`;
|
|
34
|
-
}
|
|
35
|
-
// Adiciona o sinal de "+" ao início do telefone
|
|
36
|
-
user.phone = `+${user.phone}`;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const DecimalTransformer = {
|
|
2
|
-
to: (value: number): number => {
|
|
3
|
-
if (typeof value !== 'number' || isNaN(value)) {
|
|
4
|
-
return NaN;
|
|
5
|
-
}
|
|
6
|
-
return value;
|
|
7
|
-
},
|
|
8
|
-
from: (value: string): number => {
|
|
9
|
-
if (!value) return NaN;
|
|
10
|
-
const parsed = parseFloat(value.trim());
|
|
11
|
-
return isNaN(parsed) ? NaN : parsed;
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
OneToMany,
|
|
8
|
-
} from 'typeorm';
|
|
9
|
-
|
|
10
|
-
import { DecimalTransformer } from 'common/utils/decimal-transformer.utils';
|
|
11
|
-
import { Facility } from 'facilities/facilities/facility.entity';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Entidade que representa um endereço.
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* Esta entidade armazena os dados de endereço, como rua, número, complemento, bairro, cidade, estado,
|
|
18
|
-
* código postal, país, latitude e longitude. Além disso, mantém a relação com o estabelecimentos associadas a este endereço.
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
@Entity('addresses')
|
|
23
|
-
export class Address {
|
|
24
|
-
@PrimaryGeneratedColumn()
|
|
25
|
-
id: number;
|
|
26
|
-
|
|
27
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
28
|
-
createdAt: Date;
|
|
29
|
-
|
|
30
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
31
|
-
updatedAt: Date;
|
|
32
|
-
|
|
33
|
-
@Column({ name: 'street_address', type: 'varchar', length: 255 })
|
|
34
|
-
streetAddress: string;
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'varchar', length: 10 })
|
|
37
|
-
number: string;
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
40
|
-
complement?: string;
|
|
41
|
-
|
|
42
|
-
@Column({ type: 'varchar', length: 100 })
|
|
43
|
-
neighborhood: string;
|
|
44
|
-
|
|
45
|
-
@Column({ type: 'varchar', length: 100 })
|
|
46
|
-
city: string;
|
|
47
|
-
|
|
48
|
-
@Column({ type: 'varchar', length: 100 })
|
|
49
|
-
state: string;
|
|
50
|
-
|
|
51
|
-
@Column({ name: 'postal_code', type: 'varchar', length: 20 })
|
|
52
|
-
postalCode: string;
|
|
53
|
-
|
|
54
|
-
@Column({ type: 'varchar', length: 100 })
|
|
55
|
-
country: string;
|
|
56
|
-
|
|
57
|
-
@Column({
|
|
58
|
-
type: 'decimal',
|
|
59
|
-
precision: 10,
|
|
60
|
-
scale: 8,
|
|
61
|
-
transformer: DecimalTransformer,
|
|
62
|
-
})
|
|
63
|
-
latitude: number;
|
|
64
|
-
|
|
65
|
-
@Column({
|
|
66
|
-
type: 'decimal',
|
|
67
|
-
precision: 11,
|
|
68
|
-
scale: 8,
|
|
69
|
-
transformer: DecimalTransformer,
|
|
70
|
-
})
|
|
71
|
-
longitude: number;
|
|
72
|
-
|
|
73
|
-
/** RELAÇÕES */
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Relação com os estabelecimentos associadas a este endereço.
|
|
77
|
-
*/
|
|
78
|
-
@OneToMany(() => Facility, (facility) => facility.address, {
|
|
79
|
-
onDelete: 'CASCADE',
|
|
80
|
-
})
|
|
81
|
-
facilities: Facility[];
|
|
82
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum que representa os status dos estabelecimentos.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Este enum fornece valores para identificar o status de um estabelecimento,
|
|
6
|
-
* garantindo consistência ao referenciar o status na aplicação.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export enum FacilityStatus {
|
|
11
|
-
/**
|
|
12
|
-
* Estabelecimento pendente de aprovação.
|
|
13
|
-
*/
|
|
14
|
-
PENDING = 'pending',
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Estabelecimento aprovado.
|
|
18
|
-
*/
|
|
19
|
-
APPROVED = 'approved',
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Estabelecimento rejeitado.
|
|
23
|
-
*/
|
|
24
|
-
REJECTED = 'rejected',
|
|
25
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
DeleteDateColumn,
|
|
8
|
-
Unique,
|
|
9
|
-
OneToMany,
|
|
10
|
-
BeforeInsert,
|
|
11
|
-
BeforeUpdate,
|
|
12
|
-
ManyToOne,
|
|
13
|
-
JoinColumn,
|
|
14
|
-
Index,
|
|
15
|
-
} from 'typeorm';
|
|
16
|
-
|
|
17
|
-
import { Address } from 'facilities/addresses';
|
|
18
|
-
import { FacilityImage } from 'facilities/facility-images';
|
|
19
|
-
import { FacilityOwner } from 'facilities/facility-owners';
|
|
20
|
-
import { Field } from 'facilities/fields';
|
|
21
|
-
import { TournamentFacility } from 'tournaments';
|
|
22
|
-
|
|
23
|
-
import { FacilityStatus } from './enums/facility-status.enum';
|
|
24
|
-
import { sanitizeFacility } from './utils/sanititze.utils';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Entidade que representa um estabelecimento.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Esta entidade armazena os dados de um estabelecimento, incluindo informações de contato,
|
|
31
|
-
* status e CNPJ. Além disso, mantém as relações com o proprietário, endereço,
|
|
32
|
-
* campos, usuários, imagens e torneios associados a este estabelecimento.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
@Entity('facilities')
|
|
37
|
-
@Unique(['name', 'facilityOwnerId'])
|
|
38
|
-
@Index('idx_facility_owner', ['facilityOwnerId'])
|
|
39
|
-
@Index('idx_facility_address', ['addressId'])
|
|
40
|
-
@Index('idx_facility_status', ['status'])
|
|
41
|
-
export class Facility {
|
|
42
|
-
@PrimaryGeneratedColumn()
|
|
43
|
-
id: number;
|
|
44
|
-
|
|
45
|
-
@Column({ name: 'facility_owner_id', type: 'int' })
|
|
46
|
-
facilityOwnerId: number;
|
|
47
|
-
|
|
48
|
-
@Column({ name: 'address_id', type: 'int' })
|
|
49
|
-
addressId: number;
|
|
50
|
-
|
|
51
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
52
|
-
createdAt: Date;
|
|
53
|
-
|
|
54
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
55
|
-
updatedAt: Date;
|
|
56
|
-
|
|
57
|
-
@Column({ name: 'name', type: 'varchar', length: 255 })
|
|
58
|
-
name: string;
|
|
59
|
-
|
|
60
|
-
@Column({
|
|
61
|
-
name: 'contact_email',
|
|
62
|
-
type: 'varchar',
|
|
63
|
-
length: 255,
|
|
64
|
-
nullable: true,
|
|
65
|
-
})
|
|
66
|
-
contactEmail?: string;
|
|
67
|
-
|
|
68
|
-
@Column({ name: 'contact_phone', type: 'varchar', length: 16 })
|
|
69
|
-
contactPhone: string;
|
|
70
|
-
|
|
71
|
-
@Column({
|
|
72
|
-
type: 'enum',
|
|
73
|
-
enum: FacilityStatus,
|
|
74
|
-
enumName: 'facility_status',
|
|
75
|
-
})
|
|
76
|
-
status: FacilityStatus = FacilityStatus.PENDING;
|
|
77
|
-
|
|
78
|
-
@Column({ name: 'cnpj', type: 'varchar', length: 14, nullable: true })
|
|
79
|
-
cnpj?: string;
|
|
80
|
-
|
|
81
|
-
@DeleteDateColumn({ name: 'deleted_at', type: 'timestamptz', nullable: true })
|
|
82
|
-
deletedAt: Date | null = null;
|
|
83
|
-
|
|
84
|
-
/** RELAÇÕES */
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Relação com o endereço associado a este estabelecimento.
|
|
88
|
-
*/
|
|
89
|
-
@ManyToOne(() => Address, (address) => address.facilities, {
|
|
90
|
-
eager: true,
|
|
91
|
-
onDelete: 'CASCADE',
|
|
92
|
-
onUpdate: 'CASCADE',
|
|
93
|
-
})
|
|
94
|
-
@JoinColumn({ name: 'address_id' })
|
|
95
|
-
address: Address;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Relação com o owner associado a este estabelecimento.
|
|
99
|
-
*/
|
|
100
|
-
@ManyToOne(() => FacilityOwner, (owner) => owner.facilities, {
|
|
101
|
-
onDelete: 'CASCADE',
|
|
102
|
-
onUpdate: 'CASCADE',
|
|
103
|
-
})
|
|
104
|
-
@JoinColumn({ name: 'facility_owner_id' })
|
|
105
|
-
facilityOwner: FacilityOwner;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Relação com os campos associados a este estabelecimento.
|
|
109
|
-
*/
|
|
110
|
-
@OneToMany(() => Field, (field) => field.facility)
|
|
111
|
-
fields: Field[];
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Relação com as imagens do estabelecimento.
|
|
115
|
-
*/
|
|
116
|
-
@OneToMany(() => FacilityImage, (facilityImage) => facilityImage.facility)
|
|
117
|
-
facilityImages: FacilityImage[];
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Relação com os torneios associados a este estabelecimento.
|
|
121
|
-
*/
|
|
122
|
-
@OneToMany(() => TournamentFacility, (tournamentFacility) => tournamentFacility.facility)
|
|
123
|
-
tournamentFacilities: TournamentFacility[];
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Sanitiza os campos do estabelecimento antes de inserir ou atualizar o registro.
|
|
127
|
-
*
|
|
128
|
-
* @remarks
|
|
129
|
-
* A lógica de sanitização foi delegada à função externa `sanitizeFacility`,
|
|
130
|
-
* seguindo o princípio de responsabilidade única (SRP) para facilitar a manutenção e testabilidade.
|
|
131
|
-
*/
|
|
132
|
-
@BeforeInsert()
|
|
133
|
-
@BeforeUpdate()
|
|
134
|
-
sanitizeFields(): void {
|
|
135
|
-
sanitizeFacility(this);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sanitiza os campos do estabelecimento.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Esta função remove caracteres não numéricos do CNPJ e sanitiza o email de contato.
|
|
6
|
-
*
|
|
7
|
-
* @param facility - A instância do estabelecimento a ser sanitizada.
|
|
8
|
-
*/
|
|
9
|
-
export function sanitizeFacility(facility: { cnpj?: string; contactEmail?: string }): void {
|
|
10
|
-
if (facility.cnpj) {
|
|
11
|
-
facility.cnpj = facility.cnpj.replace(/[^\d]/g, '').trim();
|
|
12
|
-
if (facility.cnpj.length !== 14) {
|
|
13
|
-
facility.cnpj = undefined;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (facility.contactEmail) {
|
|
17
|
-
facility.contactEmail = facility.contactEmail.toLowerCase().trim();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
ManyToOne,
|
|
8
|
-
JoinColumn,
|
|
9
|
-
Index,
|
|
10
|
-
Unique,
|
|
11
|
-
} from 'typeorm';
|
|
12
|
-
|
|
13
|
-
import { Facility } from 'facilities/facilities';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Entidade que representa uma imagem de estabelecimento.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Esta entidade armazena os dados de uma imagem associada a um estabelecimento,
|
|
20
|
-
* incluindo a URL, descrição e indicação se a imagem é a principal.
|
|
21
|
-
* Além disso, mantém a relação com o estabelecimento ao qual a imagem está associada.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
@Entity('facility_images')
|
|
26
|
-
@Index('IDX_facility_images_facilityId', ['facilityId'])
|
|
27
|
-
@Index('IDX_facility_images_unique_primary', ['facilityId'], {
|
|
28
|
-
unique: true,
|
|
29
|
-
where: `"is_primary" = true`,
|
|
30
|
-
})
|
|
31
|
-
@Unique('UQ_facility_images_facility_url', ['facilityId', 'url'])
|
|
32
|
-
export class FacilityImage {
|
|
33
|
-
@PrimaryGeneratedColumn()
|
|
34
|
-
id: number;
|
|
35
|
-
|
|
36
|
-
@Column({ name: 'facility_id', type: 'int' })
|
|
37
|
-
facilityId: number;
|
|
38
|
-
|
|
39
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
40
|
-
createdAt: Date;
|
|
41
|
-
|
|
42
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
43
|
-
updatedAt: Date;
|
|
44
|
-
|
|
45
|
-
@Column({ type: 'text' })
|
|
46
|
-
url: string;
|
|
47
|
-
|
|
48
|
-
@Column({ type: 'text', nullable: true, default: null })
|
|
49
|
-
description: string;
|
|
50
|
-
|
|
51
|
-
@Column({ name: 'is_primary', type: 'boolean', default: false })
|
|
52
|
-
isPrimary: boolean;
|
|
53
|
-
|
|
54
|
-
/** RELAÇÕES */
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Relação com o estabelecimento ao qual esta imagem está associada.
|
|
58
|
-
*/
|
|
59
|
-
@ManyToOne(() => Facility, (facility) => facility.facilityImages, {
|
|
60
|
-
onDelete: 'CASCADE',
|
|
61
|
-
})
|
|
62
|
-
@JoinColumn({ name: 'facility_id' })
|
|
63
|
-
facility: Facility;
|
|
64
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
Unique,
|
|
8
|
-
BeforeInsert,
|
|
9
|
-
BeforeUpdate,
|
|
10
|
-
OneToMany,
|
|
11
|
-
Index,
|
|
12
|
-
} from 'typeorm';
|
|
13
|
-
|
|
14
|
-
import { Facility } from 'facilities/facilities/facility.entity';
|
|
15
|
-
|
|
16
|
-
import { sanitizeFacilityOwner } from './utils/sanitize.utils';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Entidade que representa um proprietário de estabelecimento.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Esta entidade armazena os dados de um proprietário, como nome, email de contato, CNPJ e telefone.
|
|
23
|
-
* Também mantém as relações com estabelecimentos.
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
@Entity('facility_owners')
|
|
28
|
-
@Unique(['contactEmail'])
|
|
29
|
-
@Unique(['cnpj'])
|
|
30
|
-
export class FacilityOwner {
|
|
31
|
-
@PrimaryGeneratedColumn()
|
|
32
|
-
id: number;
|
|
33
|
-
|
|
34
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
35
|
-
createdAt: Date;
|
|
36
|
-
|
|
37
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
38
|
-
updatedAt: Date;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'varchar', length: 255 })
|
|
41
|
-
name: string;
|
|
42
|
-
|
|
43
|
-
@Index()
|
|
44
|
-
@Column({ name: 'contact_email', type: 'varchar', length: 255, nullable: true })
|
|
45
|
-
contactEmail: string;
|
|
46
|
-
|
|
47
|
-
@Index()
|
|
48
|
-
@Column({ name: 'cnpj', type: 'varchar', length: 14, nullable: true })
|
|
49
|
-
cnpj?: string;
|
|
50
|
-
|
|
51
|
-
@Column({ name: 'contact_phone', type: 'varchar', length: 16 })
|
|
52
|
-
contactPhone: string;
|
|
53
|
-
|
|
54
|
-
/** RELAÇÕES */
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Relação com os estabelecimentos associadas a este proprietário.
|
|
58
|
-
*/
|
|
59
|
-
@OneToMany(() => Facility, (facility) => facility.facilityOwner)
|
|
60
|
-
facilities: Facility[];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Sanitiza os campos do proprietário antes de inserir ou atualizar o registro.
|
|
64
|
-
*
|
|
65
|
-
* @remarks
|
|
66
|
-
* A lógica de sanitização foi delegada à função externa `sanitizeFacilityOwner`,
|
|
67
|
-
* seguindo o princípio de responsabilidade única (SRP) e facilitando a manutenção e testabilidade do código.
|
|
68
|
-
*/
|
|
69
|
-
@BeforeInsert()
|
|
70
|
-
@BeforeUpdate()
|
|
71
|
-
sanitizeFields(): void {
|
|
72
|
-
sanitizeFacilityOwner(this);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sanitiza os campos do proprietário do estabelecimento.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Esta função remove caracteres não numéricos do CNPJ e converte o email de contato para minúsculas, removendo espaços.
|
|
6
|
-
*
|
|
7
|
-
* @param owner - A instância de FacilityOwner a ser sanitizada.
|
|
8
|
-
*/
|
|
9
|
-
export function sanitizeFacilityOwner(owner: { cnpj?: string; contactEmail?: string }): void {
|
|
10
|
-
if (owner.cnpj) {
|
|
11
|
-
owner.cnpj = owner.cnpj.replace(/[^\d]/g, '').trim();
|
|
12
|
-
}
|
|
13
|
-
if (owner.contactEmail) {
|
|
14
|
-
owner.contactEmail = owner.contactEmail.toLowerCase().trim();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum que representa os tipos de superfície de um campo.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Este enum fornece os valores possíveis para o tipo de superfície de um campo,
|
|
6
|
-
* permitindo diferenciar entre gramado, sintético, areia, madeira, entre outros.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export enum FieldSurfaceType {
|
|
11
|
-
/**
|
|
12
|
-
* Campo com superfície de grama natural.
|
|
13
|
-
*/
|
|
14
|
-
GRASS = 'grass',
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Campo com superfície de grama sintética (turf).
|
|
18
|
-
*/
|
|
19
|
-
TURF = 'turf',
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Campo com superfície de saibro (clay).
|
|
23
|
-
*/
|
|
24
|
-
CLAY = 'clay',
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Campo com superfície de areia.
|
|
28
|
-
*/
|
|
29
|
-
SAND = 'sand',
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Campo com superfície de madeira (indoor).
|
|
33
|
-
*/
|
|
34
|
-
HARDWOOD = 'hardwood',
|
|
35
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
ManyToOne,
|
|
8
|
-
JoinColumn,
|
|
9
|
-
Unique,
|
|
10
|
-
OneToMany,
|
|
11
|
-
} from 'typeorm';
|
|
12
|
-
|
|
13
|
-
import { Facility } from 'facilities/facilities';
|
|
14
|
-
import { TournamentMatch } from 'tournaments';
|
|
15
|
-
|
|
16
|
-
import { FieldSurfaceType } from './enums/surface-type.enum';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Entidade que representa um campo.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Esta entidade armazena os dados de um campo associado a um estabelecimento, incluindo seu nome, tipo de superfície,
|
|
23
|
-
* dimensões, se é coberto e o número recomendado de jogadores por time. Além disso, mantém as relações com
|
|
24
|
-
* disponibilidades, imagens, sessões de jogo e partidas de torneio associadas.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
@Entity('fields')
|
|
29
|
-
@Unique(['name', 'facilityId'])
|
|
30
|
-
export class Field {
|
|
31
|
-
@PrimaryGeneratedColumn()
|
|
32
|
-
id: number;
|
|
33
|
-
|
|
34
|
-
@Column({ name: 'facility_id', type: 'int' })
|
|
35
|
-
facilityId: number;
|
|
36
|
-
|
|
37
|
-
@ManyToOne(() => Facility, (facility) => facility.fields, {
|
|
38
|
-
onDelete: 'CASCADE',
|
|
39
|
-
})
|
|
40
|
-
@JoinColumn({ name: 'facility_id' })
|
|
41
|
-
facility: Facility;
|
|
42
|
-
|
|
43
|
-
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
44
|
-
createdAt: Date;
|
|
45
|
-
|
|
46
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
47
|
-
updatedAt: Date;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'varchar', length: 255 })
|
|
50
|
-
name: string;
|
|
51
|
-
|
|
52
|
-
@Column({ name: 'surface_type', type: 'enum', enum: FieldSurfaceType })
|
|
53
|
-
surfaceType: FieldSurfaceType;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'decimal', precision: 5, scale: 2 })
|
|
56
|
-
length: number;
|
|
57
|
-
|
|
58
|
-
@Column({ type: 'decimal', precision: 5, scale: 2 })
|
|
59
|
-
width: number;
|
|
60
|
-
|
|
61
|
-
@Column({ name: 'is_indoor', type: 'boolean', default: false })
|
|
62
|
-
isIndoor: boolean;
|
|
63
|
-
|
|
64
|
-
@Column({ name: 'recommended_players_per_team', type: 'int' })
|
|
65
|
-
recommendedPlayersPerTeam: number;
|
|
66
|
-
|
|
67
|
-
/** RELAÇÕES */
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Relação com as partidas de torneio associadas a este campo.
|
|
71
|
-
*/
|
|
72
|
-
@OneToMany(() => TournamentMatch, (tournamentMatch) => tournamentMatch.field)
|
|
73
|
-
tournamentMatches: TournamentMatch[];
|
|
74
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum que representa os nomes dos provedores de pagamento.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Este enum fornece valores para identificar o provedor de pagamento utilizado,
|
|
6
|
-
* garantindo consistência ao referenciar o provedor na aplicação.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export enum PaymentProviderName {
|
|
11
|
-
/**
|
|
12
|
-
* Provedor de pagamento Pagar.me.
|
|
13
|
-
*/
|
|
14
|
-
PAGARME = 'pagarme',
|
|
15
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
CreateDateColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
OneToMany,
|
|
8
|
-
Index,
|
|
9
|
-
Unique,
|
|
10
|
-
} from 'typeorm';
|
|
11
|
-
|
|
12
|
-
import { UserPaymentProvider } from 'payments/user-payment-providers';
|
|
13
|
-
|
|
14
|
-
import { PaymentProviderName } from './enums/payment-provider-name.enum';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Entidade que representa os provedores de pagamento disponíveis no sistema.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Esta entidade armazena os dados do provedor de pagamento, identificando-o pelo nome (baseado no enum PaymentProviderName)
|
|
21
|
-
* e registrando as datas de criação e atualização. Também mantém a relação com os provedores de pagamento associados aos usuários.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
@Entity('payment_providers')
|
|
26
|
-
@Unique(['name'])
|
|
27
|
-
@Index(['name'])
|
|
28
|
-
export class PaymentProvider {
|
|
29
|
-
@PrimaryGeneratedColumn()
|
|
30
|
-
id: number;
|
|
31
|
-
|
|
32
|
-
@Column({
|
|
33
|
-
type: 'enum',
|
|
34
|
-
enum: PaymentProviderName,
|
|
35
|
-
unique: true,
|
|
36
|
-
})
|
|
37
|
-
name: PaymentProviderName;
|
|
38
|
-
|
|
39
|
-
@CreateDateColumn({
|
|
40
|
-
name: 'created_at',
|
|
41
|
-
type: 'timestamptz',
|
|
42
|
-
})
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
|
|
45
|
-
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
46
|
-
updatedAt: Date;
|
|
47
|
-
|
|
48
|
-
/** RELAÇÕES */
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Relação com os provedores de pagamento de usuário associados a este provedor.
|
|
52
|
-
*/
|
|
53
|
-
@OneToMany(
|
|
54
|
-
() => UserPaymentProvider,
|
|
55
|
-
(userPaymentProvider) => userPaymentProvider.paymentProvider,
|
|
56
|
-
{
|
|
57
|
-
cascade: true,
|
|
58
|
-
},
|
|
59
|
-
)
|
|
60
|
-
userPaymentProviders: UserPaymentProvider[];
|
|
61
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum que representa os métodos de pagamento disponíveis.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Este enum fornece valores para identificar o método de pagamento utilizado,
|
|
6
|
-
* garantindo consistência ao referenciar o método de pagamento na aplicação.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export enum PaymentMethod {
|
|
11
|
-
/**
|
|
12
|
-
* Pagamento via PIX.
|
|
13
|
-
*/
|
|
14
|
-
PIX = 'pix',
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Pagamento com cartão de crédito.
|
|
18
|
-
*/
|
|
19
|
-
CREDIT_CARD = 'credit_card',
|
|
20
|
-
}
|