@natrave/shared-entities 1.1.8 → 1.2.0
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.js +5 -6
- package/dist/app-auth/password-resets/index.js +4 -2
- package/dist/app-auth/password-resets/password-reset.entity.js +48 -45
- package/dist/app-auth/refresh-tokens/index.js +4 -2
- package/dist/app-auth/refresh-tokens/refresh-token.entity.js +48 -45
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.js +9 -7
- package/dist/app-auth/user-auth-providers/index.js +6 -3
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.js +53 -50
- package/dist/app-auth/user-verifications/enums/verification-type.enum.js +8 -6
- package/dist/app-auth/user-verifications/index.js +6 -3
- package/dist/app-auth/user-verifications/user-verification.entity.js +57 -57
- package/dist/app-auth/users/index.js +4 -2
- package/dist/app-auth/users/user.entity.js +123 -133
- package/dist/app-auth/users/utils/format-data.utils.js +19 -17
- package/dist/common/utils/decimal-transformer.utils.js +15 -14
- package/dist/facilities/addresses/address.entity.js +79 -84
- package/dist/facilities/addresses/index.js +4 -2
- package/dist/facilities/facilities/enums/facility-status.enum.js +9 -7
- package/dist/facilities/facilities/facility.entity.js +118 -121
- package/dist/facilities/facilities/index.js +6 -3
- package/dist/facilities/facilities/utils/sanititze.utils.js +12 -10
- package/dist/facilities/facility-images/facility-image.entity.js +60 -56
- package/dist/facilities/facility-images/index.js +4 -2
- package/dist/facilities/facility-owners/facility-owner.entity.js +64 -62
- package/dist/facilities/facility-owners/index.js +4 -2
- package/dist/facilities/facility-owners/utils/sanitize.utils.js +10 -8
- package/dist/facilities/fields/enums/surface-type.enum.js +11 -9
- package/dist/facilities/fields/field.entity.js +69 -69
- package/dist/facilities/fields/index.js +6 -3
- package/dist/facilities/index.js +5 -6
- package/dist/index.js +4 -5
- package/dist/payments/index.js +3 -4
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.js +7 -5
- package/dist/payments/payment-providers/index.js +6 -3
- package/dist/payments/payment-providers/payment-provider.entity.js +57 -47
- package/dist/payments/payments/enums/payment-method.enum.js +8 -6
- package/dist/payments/payments/enums/payment-status.enum.js +13 -11
- package/dist/payments/payments/index.js +8 -4
- package/dist/payments/payments/payment.entity.js +79 -82
- package/dist/payments/user-payment-providers/index.js +4 -2
- package/dist/payments/user-payment-providers/user-payment-provider.entity.js +62 -58
- package/dist/tournaments/index.js +12 -13
- package/dist/tournaments/tournament-facilities/index.js +4 -2
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.js +62 -58
- package/dist/tournaments/tournament-format-configs/index.js +4 -2
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.js +70 -73
- package/dist/tournaments/tournament-match-cards/index.js +4 -2
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.js +74 -72
- package/dist/tournaments/tournament-match-goals/index.js +4 -2
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.js +74 -76
- package/dist/tournaments/tournament-match-schemas/index.js +4 -2
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.js +47 -44
- package/dist/tournaments/tournament-matches/index.js +4 -2
- package/dist/tournaments/tournament-matches/tournament-match.entity.js +89 -94
- package/dist/tournaments/tournament-payments/index.js +4 -2
- package/dist/tournaments/tournament-payments/tournament-payment.entity.js +57 -56
- package/dist/tournaments/tournament-players/index.js +4 -2
- package/dist/tournaments/tournament-players/tournament-player.entity.js +75 -73
- package/dist/tournaments/tournament-prize-rules/index.js +4 -2
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.js +56 -52
- package/dist/tournaments/tournament-rules/index.js +4 -2
- package/dist/tournaments/tournament-rules/tournament-rule.entity.js +73 -74
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.js +8 -6
- package/dist/tournaments/tournament-teams/index.js +6 -3
- package/dist/tournaments/tournament-teams/tournament-team.entity.js +93 -97
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.js +5 -3
- package/dist/tournaments/tournaments/index.js +4 -2
- package/dist/tournaments/tournaments/tournament.entity.js +129 -144
- package/package.json +4 -2
- package/dist/app-auth/index.d.ts +0 -6
- package/dist/app-auth/index.d.ts.map +0 -1
- package/dist/app-auth/index.js.map +0 -1
- package/dist/app-auth/password-resets/index.d.ts +0 -2
- package/dist/app-auth/password-resets/index.d.ts.map +0 -1
- package/dist/app-auth/password-resets/index.js.map +0 -1
- package/dist/app-auth/password-resets/password-reset.entity.d.ts +0 -11
- package/dist/app-auth/password-resets/password-reset.entity.d.ts.map +0 -1
- package/dist/app-auth/password-resets/password-reset.entity.js.map +0 -1
- package/dist/app-auth/refresh-tokens/index.d.ts +0 -2
- package/dist/app-auth/refresh-tokens/index.d.ts.map +0 -1
- package/dist/app-auth/refresh-tokens/index.js.map +0 -1
- package/dist/app-auth/refresh-tokens/refresh-token.entity.d.ts +0 -11
- package/dist/app-auth/refresh-tokens/refresh-token.entity.d.ts.map +0 -1
- package/dist/app-auth/refresh-tokens/refresh-token.entity.js.map +0 -1
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.d.ts +0 -6
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.d.ts.map +0 -1
- package/dist/app-auth/user-auth-providers/enums/auth-provider.enum.js.map +0 -1
- package/dist/app-auth/user-auth-providers/index.d.ts +0 -3
- package/dist/app-auth/user-auth-providers/index.d.ts.map +0 -1
- package/dist/app-auth/user-auth-providers/index.js.map +0 -1
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.d.ts +0 -13
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.d.ts.map +0 -1
- package/dist/app-auth/user-auth-providers/user-auth-provider.entity.js.map +0 -1
- package/dist/app-auth/user-verifications/enums/verification-type.enum.d.ts +0 -5
- package/dist/app-auth/user-verifications/enums/verification-type.enum.d.ts.map +0 -1
- package/dist/app-auth/user-verifications/enums/verification-type.enum.js.map +0 -1
- package/dist/app-auth/user-verifications/index.d.ts +0 -3
- package/dist/app-auth/user-verifications/index.d.ts.map +0 -1
- package/dist/app-auth/user-verifications/index.js.map +0 -1
- package/dist/app-auth/user-verifications/user-verification.entity.d.ts +0 -15
- package/dist/app-auth/user-verifications/user-verification.entity.d.ts.map +0 -1
- package/dist/app-auth/user-verifications/user-verification.entity.js.map +0 -1
- package/dist/app-auth/users/index.d.ts +0 -2
- package/dist/app-auth/users/index.d.ts.map +0 -1
- package/dist/app-auth/users/index.js.map +0 -1
- package/dist/app-auth/users/user.entity.d.ts +0 -29
- package/dist/app-auth/users/user.entity.d.ts.map +0 -1
- package/dist/app-auth/users/user.entity.js.map +0 -1
- package/dist/app-auth/users/utils/format-data.utils.d.ts +0 -7
- package/dist/app-auth/users/utils/format-data.utils.d.ts.map +0 -1
- package/dist/app-auth/users/utils/format-data.utils.js.map +0 -1
- package/dist/common/utils/decimal-transformer.utils.d.ts +0 -5
- package/dist/common/utils/decimal-transformer.utils.d.ts.map +0 -1
- package/dist/common/utils/decimal-transformer.utils.js.map +0 -1
- package/dist/facilities/addresses/address.entity.d.ts +0 -18
- package/dist/facilities/addresses/address.entity.d.ts.map +0 -1
- package/dist/facilities/addresses/address.entity.js.map +0 -1
- package/dist/facilities/addresses/index.d.ts +0 -2
- package/dist/facilities/addresses/index.d.ts.map +0 -1
- package/dist/facilities/addresses/index.js.map +0 -1
- package/dist/facilities/facilities/enums/facility-status.enum.d.ts +0 -6
- package/dist/facilities/facilities/enums/facility-status.enum.d.ts.map +0 -1
- package/dist/facilities/facilities/enums/facility-status.enum.js.map +0 -1
- package/dist/facilities/facilities/facility.entity.d.ts +0 -26
- package/dist/facilities/facilities/facility.entity.d.ts.map +0 -1
- package/dist/facilities/facilities/facility.entity.js.map +0 -1
- package/dist/facilities/facilities/index.d.ts +0 -3
- package/dist/facilities/facilities/index.d.ts.map +0 -1
- package/dist/facilities/facilities/index.js.map +0 -1
- package/dist/facilities/facilities/utils/sanititze.utils.d.ts +0 -5
- package/dist/facilities/facilities/utils/sanititze.utils.d.ts.map +0 -1
- package/dist/facilities/facilities/utils/sanititze.utils.js.map +0 -1
- package/dist/facilities/facility-images/facility-image.entity.d.ts +0 -12
- package/dist/facilities/facility-images/facility-image.entity.d.ts.map +0 -1
- package/dist/facilities/facility-images/facility-image.entity.js.map +0 -1
- package/dist/facilities/facility-images/index.d.ts +0 -2
- package/dist/facilities/facility-images/index.d.ts.map +0 -1
- package/dist/facilities/facility-images/index.js.map +0 -1
- package/dist/facilities/facility-owners/facility-owner.entity.d.ts +0 -13
- package/dist/facilities/facility-owners/facility-owner.entity.d.ts.map +0 -1
- package/dist/facilities/facility-owners/facility-owner.entity.js.map +0 -1
- package/dist/facilities/facility-owners/index.d.ts +0 -2
- package/dist/facilities/facility-owners/index.d.ts.map +0 -1
- package/dist/facilities/facility-owners/index.js.map +0 -1
- package/dist/facilities/facility-owners/utils/sanitize.utils.d.ts +0 -5
- package/dist/facilities/facility-owners/utils/sanitize.utils.d.ts.map +0 -1
- package/dist/facilities/facility-owners/utils/sanitize.utils.js.map +0 -1
- package/dist/facilities/fields/enums/surface-type.enum.d.ts +0 -8
- package/dist/facilities/fields/enums/surface-type.enum.d.ts.map +0 -1
- package/dist/facilities/fields/enums/surface-type.enum.js.map +0 -1
- package/dist/facilities/fields/field.entity.d.ts +0 -18
- package/dist/facilities/fields/field.entity.d.ts.map +0 -1
- package/dist/facilities/fields/field.entity.js.map +0 -1
- package/dist/facilities/fields/index.d.ts +0 -3
- package/dist/facilities/fields/index.d.ts.map +0 -1
- package/dist/facilities/fields/index.js.map +0 -1
- package/dist/facilities/index.d.ts +0 -6
- package/dist/facilities/index.d.ts.map +0 -1
- package/dist/facilities/index.js.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/payments/index.d.ts +0 -4
- package/dist/payments/index.d.ts.map +0 -1
- package/dist/payments/index.js.map +0 -1
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.d.ts +0 -4
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.d.ts.map +0 -1
- package/dist/payments/payment-providers/enums/payment-provider-name.enum.js.map +0 -1
- package/dist/payments/payment-providers/index.d.ts +0 -3
- package/dist/payments/payment-providers/index.d.ts.map +0 -1
- package/dist/payments/payment-providers/index.js.map +0 -1
- package/dist/payments/payment-providers/payment-provider.entity.d.ts +0 -10
- package/dist/payments/payment-providers/payment-provider.entity.d.ts.map +0 -1
- package/dist/payments/payment-providers/payment-provider.entity.js.map +0 -1
- package/dist/payments/payments/enums/payment-method.enum.d.ts +0 -5
- package/dist/payments/payments/enums/payment-method.enum.d.ts.map +0 -1
- package/dist/payments/payments/enums/payment-method.enum.js.map +0 -1
- package/dist/payments/payments/enums/payment-status.enum.d.ts +0 -10
- package/dist/payments/payments/enums/payment-status.enum.d.ts.map +0 -1
- package/dist/payments/payments/enums/payment-status.enum.js.map +0 -1
- package/dist/payments/payments/index.d.ts +0 -4
- package/dist/payments/payments/index.d.ts.map +0 -1
- package/dist/payments/payments/index.js.map +0 -1
- package/dist/payments/payments/payment.entity.d.ts +0 -19
- package/dist/payments/payments/payment.entity.d.ts.map +0 -1
- package/dist/payments/payments/payment.entity.js.map +0 -1
- package/dist/payments/user-payment-providers/index.d.ts +0 -2
- package/dist/payments/user-payment-providers/index.d.ts.map +0 -1
- package/dist/payments/user-payment-providers/index.js.map +0 -1
- package/dist/payments/user-payment-providers/user-payment-provider.entity.d.ts +0 -13
- package/dist/payments/user-payment-providers/user-payment-provider.entity.d.ts.map +0 -1
- package/dist/payments/user-payment-providers/user-payment-provider.entity.js.map +0 -1
- package/dist/tournaments/index.d.ts +0 -13
- package/dist/tournaments/index.d.ts.map +0 -1
- package/dist/tournaments/index.js.map +0 -1
- package/dist/tournaments/tournament-facilities/index.d.ts +0 -2
- package/dist/tournaments/tournament-facilities/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-facilities/index.js.map +0 -1
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.d.ts +0 -14
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-facilities/tournament-facility.entity.js.map +0 -1
- package/dist/tournaments/tournament-format-configs/index.d.ts +0 -2
- package/dist/tournaments/tournament-format-configs/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-format-configs/index.js.map +0 -1
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.d.ts +0 -15
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-format-configs/tournament-format-config.entity.js.map +0 -1
- package/dist/tournaments/tournament-match-cards/index.d.ts +0 -2
- package/dist/tournaments/tournament-match-cards/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-cards/index.js.map +0 -1
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.d.ts +0 -19
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-cards/tournament-match-card.entity.js.map +0 -1
- package/dist/tournaments/tournament-match-goals/index.d.ts +0 -2
- package/dist/tournaments/tournament-match-goals/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-goals/index.js.map +0 -1
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.d.ts +0 -20
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-goals/tournament-match-goal.entity.js.map +0 -1
- package/dist/tournaments/tournament-match-schemas/index.d.ts +0 -2
- package/dist/tournaments/tournament-match-schemas/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-schemas/index.js.map +0 -1
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.d.ts +0 -12
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-match-schemas/tournament-match-schema.entity.js.map +0 -1
- package/dist/tournaments/tournament-matches/index.d.ts +0 -2
- package/dist/tournaments/tournament-matches/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-matches/index.js.map +0 -1
- package/dist/tournaments/tournament-matches/tournament-match.entity.d.ts +0 -25
- package/dist/tournaments/tournament-matches/tournament-match.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-matches/tournament-match.entity.js.map +0 -1
- package/dist/tournaments/tournament-payments/index.d.ts +0 -2
- package/dist/tournaments/tournament-payments/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-payments/index.js.map +0 -1
- package/dist/tournaments/tournament-payments/tournament-payment.entity.d.ts +0 -16
- package/dist/tournaments/tournament-payments/tournament-payment.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-payments/tournament-payment.entity.js.map +0 -1
- package/dist/tournaments/tournament-players/index.d.ts +0 -2
- package/dist/tournaments/tournament-players/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-players/index.js.map +0 -1
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts +0 -19
- package/dist/tournaments/tournament-players/tournament-player.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-players/tournament-player.entity.js.map +0 -1
- package/dist/tournaments/tournament-prize-rules/index.d.ts +0 -2
- package/dist/tournaments/tournament-prize-rules/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-prize-rules/index.js.map +0 -1
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.d.ts +0 -13
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-prize-rules/tournament-prize-rule.entity.js.map +0 -1
- package/dist/tournaments/tournament-rules/index.d.ts +0 -2
- package/dist/tournaments/tournament-rules/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-rules/index.js.map +0 -1
- package/dist/tournaments/tournament-rules/tournament-rule.entity.d.ts +0 -17
- package/dist/tournaments/tournament-rules/tournament-rule.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-rules/tournament-rule.entity.js.map +0 -1
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.d.ts +0 -5
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.d.ts.map +0 -1
- package/dist/tournaments/tournament-teams/enums/tournament-team-status.enum.js.map +0 -1
- package/dist/tournaments/tournament-teams/index.d.ts +0 -3
- package/dist/tournaments/tournament-teams/index.d.ts.map +0 -1
- package/dist/tournaments/tournament-teams/index.js.map +0 -1
- package/dist/tournaments/tournament-teams/tournament-team.entity.d.ts +0 -26
- package/dist/tournaments/tournament-teams/tournament-team.entity.d.ts.map +0 -1
- package/dist/tournaments/tournament-teams/tournament-team.entity.js.map +0 -1
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.d.ts +0 -2
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.d.ts.map +0 -1
- package/dist/tournaments/tournament-teams/utils/invite-code-generator.js.map +0 -1
- package/dist/tournaments/tournaments/index.d.ts +0 -2
- package/dist/tournaments/tournaments/index.d.ts.map +0 -1
- package/dist/tournaments/tournaments/index.js.map +0 -1
- package/dist/tournaments/tournaments/tournament.entity.d.ts +0 -39
- package/dist/tournaments/tournaments/tournament.entity.d.ts.map +0 -1
- package/dist/tournaments/tournaments/tournament.entity.js.map +0 -1
|
@@ -1,136 +1,126 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
6
10
|
};
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
import {
|
|
12
|
+
BeforeInsert,
|
|
13
|
+
Column,
|
|
14
|
+
CreateDateColumn,
|
|
15
|
+
DeleteDateColumn,
|
|
16
|
+
Entity,
|
|
17
|
+
OneToMany,
|
|
18
|
+
PrimaryGeneratedColumn,
|
|
19
|
+
Unique,
|
|
20
|
+
UpdateDateColumn
|
|
21
|
+
} from "typeorm";
|
|
22
|
+
import { UserPaymentProvider } from "../../payments";
|
|
23
|
+
import { TournamentPlayer } from "../../tournaments";
|
|
24
|
+
import { PasswordReset } from "../password-resets";
|
|
25
|
+
import { RefreshToken } from "../refresh-tokens";
|
|
26
|
+
import { UserAuthProvider } from "../user-auth-providers";
|
|
27
|
+
import { UserVerification } from "../user-verifications";
|
|
28
|
+
import { formatUserBeforeInsertData } from "./utils/format-data.utils.js";
|
|
29
|
+
let User = class {
|
|
30
|
+
prepareData() {
|
|
31
|
+
formatUserBeforeInsertData(this);
|
|
32
|
+
}
|
|
9
33
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
], User.prototype, "
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
], User.prototype, "
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
], User.prototype, "passwordResets", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
OneToMany(() => UserVerification, (verification) => verification.user),
|
|
102
|
-
__metadata("design:type", Array)
|
|
103
|
-
], User.prototype, "verifications", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
OneToMany(() => UserAuthProvider, (userAuthProvider) => userAuthProvider.user, {
|
|
106
|
-
cascade: true,
|
|
107
|
-
}),
|
|
108
|
-
__metadata("design:type", Array)
|
|
109
|
-
], User.prototype, "userAuthProviders", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
OneToMany(() => TournamentPlayer, (tournamentPlayer) => tournamentPlayer.user, {
|
|
112
|
-
cascade: true,
|
|
113
|
-
}),
|
|
114
|
-
__metadata("design:type", Array)
|
|
115
|
-
], User.prototype, "tournamentPlayers", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
OneToMany(() => UserPaymentProvider, (userPaymentProvider) => userPaymentProvider.user, {
|
|
118
|
-
cascade: true,
|
|
119
|
-
}),
|
|
120
|
-
__metadata("design:type", Array)
|
|
121
|
-
], User.prototype, "userPaymentProviders", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
BeforeInsert(),
|
|
124
|
-
__metadata("design:type", Function),
|
|
125
|
-
__metadata("design:paramtypes", []),
|
|
126
|
-
__metadata("design:returntype", void 0)
|
|
127
|
-
], User.prototype, "prepareData", null);
|
|
128
|
-
User = __decorate([
|
|
129
|
-
Entity('users'),
|
|
130
|
-
Unique(['email']),
|
|
131
|
-
Unique(['username']),
|
|
132
|
-
Unique(['phone']),
|
|
133
|
-
Unique(['cpf'])
|
|
34
|
+
__decorateClass([
|
|
35
|
+
PrimaryGeneratedColumn("uuid")
|
|
36
|
+
], User.prototype, "id", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
Column({
|
|
39
|
+
name: "numeric_id",
|
|
40
|
+
type: "int",
|
|
41
|
+
unique: true,
|
|
42
|
+
nullable: false,
|
|
43
|
+
generated: "increment"
|
|
44
|
+
})
|
|
45
|
+
], User.prototype, "numericId", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
48
|
+
], User.prototype, "createdAt", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
51
|
+
], User.prototype, "updatedAt", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
DeleteDateColumn({ name: "deleted_at", type: "timestamptz", nullable: true })
|
|
54
|
+
], User.prototype, "deletedAt", 2);
|
|
55
|
+
__decorateClass([
|
|
56
|
+
Column({ name: "first_name", type: "varchar", length: 255, nullable: true })
|
|
57
|
+
], User.prototype, "firstName", 2);
|
|
58
|
+
__decorateClass([
|
|
59
|
+
Column({ name: "last_name", type: "varchar", length: 255, nullable: true })
|
|
60
|
+
], User.prototype, "lastName", 2);
|
|
61
|
+
__decorateClass([
|
|
62
|
+
Column({ type: "varchar", length: 255, unique: true })
|
|
63
|
+
], User.prototype, "email", 2);
|
|
64
|
+
__decorateClass([
|
|
65
|
+
Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
|
66
|
+
], User.prototype, "username", 2);
|
|
67
|
+
__decorateClass([
|
|
68
|
+
Column({ type: "varchar", length: 14, nullable: true, unique: true })
|
|
69
|
+
], User.prototype, "cpf", 2);
|
|
70
|
+
__decorateClass([
|
|
71
|
+
Column({
|
|
72
|
+
name: "phone",
|
|
73
|
+
type: "varchar",
|
|
74
|
+
length: 16,
|
|
75
|
+
unique: true,
|
|
76
|
+
nullable: true
|
|
77
|
+
})
|
|
78
|
+
], User.prototype, "phone", 2);
|
|
79
|
+
__decorateClass([
|
|
80
|
+
Column({
|
|
81
|
+
name: "password_hash",
|
|
82
|
+
type: "varchar",
|
|
83
|
+
length: 255,
|
|
84
|
+
nullable: true
|
|
85
|
+
})
|
|
86
|
+
], User.prototype, "passwordHash", 2);
|
|
87
|
+
__decorateClass([
|
|
88
|
+
Column({ name: "image_url", type: "varchar", length: 500, nullable: true })
|
|
89
|
+
], User.prototype, "imageUrl", 2);
|
|
90
|
+
__decorateClass([
|
|
91
|
+
OneToMany(() => RefreshToken, (refreshToken) => refreshToken.user)
|
|
92
|
+
], User.prototype, "refreshTokens", 2);
|
|
93
|
+
__decorateClass([
|
|
94
|
+
OneToMany(() => PasswordReset, (passwordReset) => passwordReset.user)
|
|
95
|
+
], User.prototype, "passwordResets", 2);
|
|
96
|
+
__decorateClass([
|
|
97
|
+
OneToMany(() => UserVerification, (verification) => verification.user)
|
|
98
|
+
], User.prototype, "verifications", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
OneToMany(() => UserAuthProvider, (userAuthProvider) => userAuthProvider.user, {
|
|
101
|
+
cascade: true
|
|
102
|
+
})
|
|
103
|
+
], User.prototype, "userAuthProviders", 2);
|
|
104
|
+
__decorateClass([
|
|
105
|
+
OneToMany(() => TournamentPlayer, (tournamentPlayer) => tournamentPlayer.user, {
|
|
106
|
+
cascade: true
|
|
107
|
+
})
|
|
108
|
+
], User.prototype, "tournamentPlayers", 2);
|
|
109
|
+
__decorateClass([
|
|
110
|
+
OneToMany(() => UserPaymentProvider, (userPaymentProvider) => userPaymentProvider.user, {
|
|
111
|
+
cascade: true
|
|
112
|
+
})
|
|
113
|
+
], User.prototype, "userPaymentProviders", 2);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
BeforeInsert()
|
|
116
|
+
], User.prototype, "prepareData", 1);
|
|
117
|
+
User = __decorateClass([
|
|
118
|
+
Entity("users"),
|
|
119
|
+
Unique(["email"]),
|
|
120
|
+
Unique(["username"]),
|
|
121
|
+
Unique(["phone"]),
|
|
122
|
+
Unique(["cpf"])
|
|
134
123
|
], User);
|
|
135
|
-
export {
|
|
136
|
-
|
|
124
|
+
export {
|
|
125
|
+
User
|
|
126
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
user.phone = `+${user.phone}`;
|
|
1
|
+
function formatUserBeforeInsertData(user) {
|
|
2
|
+
if (user.email) {
|
|
3
|
+
user.email = user.email.toLowerCase().trim();
|
|
4
|
+
}
|
|
5
|
+
if (user.username) {
|
|
6
|
+
user.username = user.username.toLowerCase().trim();
|
|
7
|
+
}
|
|
8
|
+
if (user.cpf) {
|
|
9
|
+
user.cpf = user.cpf.replace(/\D/g, "").trim();
|
|
10
|
+
}
|
|
11
|
+
if (user.phone) {
|
|
12
|
+
user.phone = user.phone.replace(/\D/g, "").trim();
|
|
13
|
+
if (!user.phone.startsWith("55")) {
|
|
14
|
+
user.phone = `55${user.phone}`;
|
|
17
15
|
}
|
|
16
|
+
user.phone = `+${user.phone}`;
|
|
17
|
+
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
export {
|
|
20
|
+
formatUserBeforeInsertData
|
|
21
|
+
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const DecimalTransformer = {
|
|
2
|
+
to: (value) => {
|
|
3
|
+
if (typeof value !== "number" || isNaN(value)) {
|
|
4
|
+
return NaN;
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
},
|
|
8
|
+
from: (value) => {
|
|
9
|
+
if (!value) return NaN;
|
|
10
|
+
const parsed = parseFloat(value.trim());
|
|
11
|
+
return isNaN(parsed) ? NaN : parsed;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
DecimalTransformer
|
|
14
16
|
};
|
|
15
|
-
//# sourceMappingURL=decimal-transformer.utils.js.map
|
|
@@ -1,87 +1,82 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
6
10
|
};
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
import {
|
|
12
|
+
Column,
|
|
13
|
+
CreateDateColumn,
|
|
14
|
+
Entity,
|
|
15
|
+
OneToMany,
|
|
16
|
+
PrimaryGeneratedColumn,
|
|
17
|
+
UpdateDateColumn
|
|
18
|
+
} from "typeorm";
|
|
19
|
+
import { DecimalTransformer } from "../../common/utils/decimal-transformer.utils";
|
|
20
|
+
import { Facility } from "../../facilities/facilities/facility.entity";
|
|
21
|
+
let Address = class {
|
|
9
22
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
], Address.prototype, "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
], Address.prototype, "
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
], Address.prototype, "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
], Address.prototype, "
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
], Address.prototype, "
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
__metadata("design:type", Number)
|
|
67
|
-
], Address.prototype, "latitude", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
Column({
|
|
70
|
-
type: 'decimal',
|
|
71
|
-
precision: 11,
|
|
72
|
-
scale: 8,
|
|
73
|
-
transformer: DecimalTransformer,
|
|
74
|
-
}),
|
|
75
|
-
__metadata("design:type", Number)
|
|
76
|
-
], Address.prototype, "longitude", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
OneToMany(() => Facility, (facility) => facility.address, {
|
|
79
|
-
onDelete: 'CASCADE',
|
|
80
|
-
}),
|
|
81
|
-
__metadata("design:type", Array)
|
|
82
|
-
], Address.prototype, "facilities", void 0);
|
|
83
|
-
Address = __decorate([
|
|
84
|
-
Entity('addresses')
|
|
23
|
+
__decorateClass([
|
|
24
|
+
PrimaryGeneratedColumn()
|
|
25
|
+
], Address.prototype, "id", 2);
|
|
26
|
+
__decorateClass([
|
|
27
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
28
|
+
], Address.prototype, "createdAt", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
31
|
+
], Address.prototype, "updatedAt", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
Column({ name: "street_address", type: "varchar", length: 255 })
|
|
34
|
+
], Address.prototype, "streetAddress", 2);
|
|
35
|
+
__decorateClass([
|
|
36
|
+
Column({ type: "varchar", length: 10 })
|
|
37
|
+
], Address.prototype, "number", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
Column({ type: "varchar", length: 100, nullable: true })
|
|
40
|
+
], Address.prototype, "complement", 2);
|
|
41
|
+
__decorateClass([
|
|
42
|
+
Column({ type: "varchar", length: 100 })
|
|
43
|
+
], Address.prototype, "neighborhood", 2);
|
|
44
|
+
__decorateClass([
|
|
45
|
+
Column({ type: "varchar", length: 100 })
|
|
46
|
+
], Address.prototype, "city", 2);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
Column({ type: "varchar", length: 100 })
|
|
49
|
+
], Address.prototype, "state", 2);
|
|
50
|
+
__decorateClass([
|
|
51
|
+
Column({ name: "postal_code", type: "varchar", length: 20 })
|
|
52
|
+
], Address.prototype, "postalCode", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
Column({ type: "varchar", length: 100 })
|
|
55
|
+
], Address.prototype, "country", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
Column({
|
|
58
|
+
type: "decimal",
|
|
59
|
+
precision: 10,
|
|
60
|
+
scale: 8,
|
|
61
|
+
transformer: DecimalTransformer
|
|
62
|
+
})
|
|
63
|
+
], Address.prototype, "latitude", 2);
|
|
64
|
+
__decorateClass([
|
|
65
|
+
Column({
|
|
66
|
+
type: "decimal",
|
|
67
|
+
precision: 11,
|
|
68
|
+
scale: 8,
|
|
69
|
+
transformer: DecimalTransformer
|
|
70
|
+
})
|
|
71
|
+
], Address.prototype, "longitude", 2);
|
|
72
|
+
__decorateClass([
|
|
73
|
+
OneToMany(() => Facility, (facility) => facility.address, {
|
|
74
|
+
onDelete: "CASCADE"
|
|
75
|
+
})
|
|
76
|
+
], Address.prototype, "facilities", 2);
|
|
77
|
+
Address = __decorateClass([
|
|
78
|
+
Entity("addresses")
|
|
85
79
|
], Address);
|
|
86
|
-
export {
|
|
87
|
-
|
|
80
|
+
export {
|
|
81
|
+
Address
|
|
82
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(FacilityStatus ||
|
|
7
|
-
|
|
1
|
+
var FacilityStatus = /* @__PURE__ */ ((FacilityStatus2) => {
|
|
2
|
+
FacilityStatus2["PENDING"] = "pending";
|
|
3
|
+
FacilityStatus2["APPROVED"] = "approved";
|
|
4
|
+
FacilityStatus2["REJECTED"] = "rejected";
|
|
5
|
+
return FacilityStatus2;
|
|
6
|
+
})(FacilityStatus || {});
|
|
7
|
+
export {
|
|
8
|
+
FacilityStatus
|
|
9
|
+
};
|