@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,124 +1,121 @@
|
|
|
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
|
+
BeforeUpdate,
|
|
14
|
+
Column,
|
|
15
|
+
CreateDateColumn,
|
|
16
|
+
DeleteDateColumn,
|
|
17
|
+
Entity,
|
|
18
|
+
Index,
|
|
19
|
+
JoinColumn,
|
|
20
|
+
ManyToOne,
|
|
21
|
+
OneToMany,
|
|
22
|
+
PrimaryGeneratedColumn,
|
|
23
|
+
Unique,
|
|
24
|
+
UpdateDateColumn
|
|
25
|
+
} from "typeorm";
|
|
26
|
+
import { TournamentFacility } from "../../tournaments";
|
|
27
|
+
import { Address } from "../addresses";
|
|
28
|
+
import { FacilityImage } from "../facility-images";
|
|
29
|
+
import { FacilityOwner } from "../facility-owners";
|
|
30
|
+
import { Field } from "../fields";
|
|
31
|
+
import { FacilityStatus } from "./enums/facility-status.enum.js";
|
|
32
|
+
import { sanitizeFacility } from "./utils/sanititze.utils.js";
|
|
33
|
+
let Facility = class {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.status = FacilityStatus.PENDING;
|
|
36
|
+
this.deletedAt = null;
|
|
37
|
+
}
|
|
38
|
+
sanitizeFields() {
|
|
39
|
+
sanitizeFacility(this);
|
|
40
|
+
}
|
|
9
41
|
};
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
], Facility.prototype, "
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
], Facility.prototype, "
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
], Facility.prototype, "
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
], Facility.prototype, "
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
JoinColumn({ name: 'address_id' }),
|
|
87
|
-
__metadata("design:type", Address)
|
|
88
|
-
], Facility.prototype, "address", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
ManyToOne(() => FacilityOwner, (owner) => owner.facilities, {
|
|
91
|
-
onDelete: 'CASCADE',
|
|
92
|
-
onUpdate: 'CASCADE',
|
|
93
|
-
}),
|
|
94
|
-
JoinColumn({ name: 'facility_owner_id' }),
|
|
95
|
-
__metadata("design:type", FacilityOwner)
|
|
96
|
-
], Facility.prototype, "facilityOwner", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
OneToMany(() => Field, (field) => field.facility),
|
|
99
|
-
__metadata("design:type", Array)
|
|
100
|
-
], Facility.prototype, "fields", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
OneToMany(() => FacilityImage, (facilityImage) => facilityImage.facility),
|
|
103
|
-
__metadata("design:type", Array)
|
|
104
|
-
], Facility.prototype, "facilityImages", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
OneToMany(() => TournamentFacility, (tournamentFacility) => tournamentFacility.facility),
|
|
107
|
-
__metadata("design:type", Array)
|
|
108
|
-
], Facility.prototype, "tournamentFacilities", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
BeforeInsert(),
|
|
111
|
-
BeforeUpdate(),
|
|
112
|
-
__metadata("design:type", Function),
|
|
113
|
-
__metadata("design:paramtypes", []),
|
|
114
|
-
__metadata("design:returntype", void 0)
|
|
115
|
-
], Facility.prototype, "sanitizeFields", null);
|
|
116
|
-
Facility = __decorate([
|
|
117
|
-
Entity('facilities'),
|
|
118
|
-
Unique(['name', 'facilityOwnerId']),
|
|
119
|
-
Index('idx_facility_owner', ['facilityOwnerId']),
|
|
120
|
-
Index('idx_facility_address', ['addressId']),
|
|
121
|
-
Index('idx_facility_status', ['status'])
|
|
42
|
+
__decorateClass([
|
|
43
|
+
PrimaryGeneratedColumn()
|
|
44
|
+
], Facility.prototype, "id", 2);
|
|
45
|
+
__decorateClass([
|
|
46
|
+
Column({ name: "facility_owner_id", type: "int" })
|
|
47
|
+
], Facility.prototype, "facilityOwnerId", 2);
|
|
48
|
+
__decorateClass([
|
|
49
|
+
Column({ name: "address_id", type: "int" })
|
|
50
|
+
], Facility.prototype, "addressId", 2);
|
|
51
|
+
__decorateClass([
|
|
52
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
53
|
+
], Facility.prototype, "createdAt", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
56
|
+
], Facility.prototype, "updatedAt", 2);
|
|
57
|
+
__decorateClass([
|
|
58
|
+
Column({ name: "name", type: "varchar", length: 255 })
|
|
59
|
+
], Facility.prototype, "name", 2);
|
|
60
|
+
__decorateClass([
|
|
61
|
+
Column({
|
|
62
|
+
name: "contact_email",
|
|
63
|
+
type: "varchar",
|
|
64
|
+
length: 255,
|
|
65
|
+
nullable: true
|
|
66
|
+
})
|
|
67
|
+
], Facility.prototype, "contactEmail", 2);
|
|
68
|
+
__decorateClass([
|
|
69
|
+
Column({ name: "contact_phone", type: "varchar", length: 16 })
|
|
70
|
+
], Facility.prototype, "contactPhone", 2);
|
|
71
|
+
__decorateClass([
|
|
72
|
+
Column({
|
|
73
|
+
type: "enum",
|
|
74
|
+
enum: FacilityStatus,
|
|
75
|
+
enumName: "facility_status"
|
|
76
|
+
})
|
|
77
|
+
], Facility.prototype, "status", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
Column({ name: "cnpj", type: "varchar", length: 14, nullable: true })
|
|
80
|
+
], Facility.prototype, "cnpj", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
DeleteDateColumn({ name: "deleted_at", type: "timestamptz", nullable: true })
|
|
83
|
+
], Facility.prototype, "deletedAt", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
ManyToOne(() => Address, (address) => address.facilities, {
|
|
86
|
+
eager: true,
|
|
87
|
+
onDelete: "CASCADE",
|
|
88
|
+
onUpdate: "CASCADE"
|
|
89
|
+
}),
|
|
90
|
+
JoinColumn({ name: "address_id" })
|
|
91
|
+
], Facility.prototype, "address", 2);
|
|
92
|
+
__decorateClass([
|
|
93
|
+
ManyToOne(() => FacilityOwner, (owner) => owner.facilities, {
|
|
94
|
+
onDelete: "CASCADE",
|
|
95
|
+
onUpdate: "CASCADE"
|
|
96
|
+
}),
|
|
97
|
+
JoinColumn({ name: "facility_owner_id" })
|
|
98
|
+
], Facility.prototype, "facilityOwner", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
OneToMany(() => Field, (field) => field.facility)
|
|
101
|
+
], Facility.prototype, "fields", 2);
|
|
102
|
+
__decorateClass([
|
|
103
|
+
OneToMany(() => FacilityImage, (facilityImage) => facilityImage.facility)
|
|
104
|
+
], Facility.prototype, "facilityImages", 2);
|
|
105
|
+
__decorateClass([
|
|
106
|
+
OneToMany(() => TournamentFacility, (tournamentFacility) => tournamentFacility.facility)
|
|
107
|
+
], Facility.prototype, "tournamentFacilities", 2);
|
|
108
|
+
__decorateClass([
|
|
109
|
+
BeforeInsert(),
|
|
110
|
+
BeforeUpdate()
|
|
111
|
+
], Facility.prototype, "sanitizeFields", 1);
|
|
112
|
+
Facility = __decorateClass([
|
|
113
|
+
Entity("facilities"),
|
|
114
|
+
Unique(["name", "facilityOwnerId"]),
|
|
115
|
+
Index("idx_facility_owner", ["facilityOwnerId"]),
|
|
116
|
+
Index("idx_facility_address", ["addressId"]),
|
|
117
|
+
Index("idx_facility_status", ["status"])
|
|
122
118
|
], Facility);
|
|
123
|
-
export {
|
|
124
|
-
|
|
119
|
+
export {
|
|
120
|
+
Facility
|
|
121
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Facility } from "./facility.entity.js";
|
|
2
|
+
import { FacilityStatus } from "./enums/facility-status.enum.js";
|
|
3
|
+
export {
|
|
4
|
+
Facility,
|
|
5
|
+
FacilityStatus
|
|
6
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
if (facility.contactEmail) {
|
|
9
|
-
facility.contactEmail = facility.contactEmail.toLowerCase().trim();
|
|
1
|
+
function sanitizeFacility(facility) {
|
|
2
|
+
if (facility.cnpj) {
|
|
3
|
+
facility.cnpj = facility.cnpj.replace(/[^\d]/g, "").trim();
|
|
4
|
+
if (facility.cnpj.length !== 14) {
|
|
5
|
+
facility.cnpj = void 0;
|
|
10
6
|
}
|
|
7
|
+
}
|
|
8
|
+
if (facility.contactEmail) {
|
|
9
|
+
facility.contactEmail = facility.contactEmail.toLowerCase().trim();
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
export {
|
|
13
|
+
sanitizeFacility
|
|
14
|
+
};
|
|
@@ -1,59 +1,63 @@
|
|
|
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
|
+
Index,
|
|
16
|
+
JoinColumn,
|
|
17
|
+
ManyToOne,
|
|
18
|
+
PrimaryGeneratedColumn,
|
|
19
|
+
Unique,
|
|
20
|
+
UpdateDateColumn
|
|
21
|
+
} from "typeorm";
|
|
22
|
+
import { Facility } from "../facilities";
|
|
23
|
+
let FacilityImage = class {
|
|
9
24
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
], FacilityImage.prototype, "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
JoinColumn({ name: 'facility_id' }),
|
|
47
|
-
__metadata("design:type", Facility)
|
|
48
|
-
], FacilityImage.prototype, "facility", void 0);
|
|
49
|
-
FacilityImage = __decorate([
|
|
50
|
-
Entity('facility_images'),
|
|
51
|
-
Index('IDX_facility_images_facilityId', ['facilityId']),
|
|
52
|
-
Index('IDX_facility_images_unique_primary', ['facilityId'], {
|
|
53
|
-
unique: true,
|
|
54
|
-
where: `"is_primary" = true`,
|
|
55
|
-
}),
|
|
56
|
-
Unique('UQ_facility_images_facility_url', ['facilityId', 'url'])
|
|
25
|
+
__decorateClass([
|
|
26
|
+
PrimaryGeneratedColumn()
|
|
27
|
+
], FacilityImage.prototype, "id", 2);
|
|
28
|
+
__decorateClass([
|
|
29
|
+
Column({ name: "facility_id", type: "int" })
|
|
30
|
+
], FacilityImage.prototype, "facilityId", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
33
|
+
], FacilityImage.prototype, "createdAt", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
36
|
+
], FacilityImage.prototype, "updatedAt", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
Column({ type: "text" })
|
|
39
|
+
], FacilityImage.prototype, "url", 2);
|
|
40
|
+
__decorateClass([
|
|
41
|
+
Column({ type: "text", nullable: true, default: null })
|
|
42
|
+
], FacilityImage.prototype, "description", 2);
|
|
43
|
+
__decorateClass([
|
|
44
|
+
Column({ name: "is_primary", type: "boolean", default: false })
|
|
45
|
+
], FacilityImage.prototype, "isPrimary", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
ManyToOne(() => Facility, (facility) => facility.facilityImages, {
|
|
48
|
+
onDelete: "CASCADE"
|
|
49
|
+
}),
|
|
50
|
+
JoinColumn({ name: "facility_id" })
|
|
51
|
+
], FacilityImage.prototype, "facility", 2);
|
|
52
|
+
FacilityImage = __decorateClass([
|
|
53
|
+
Entity("facility_images"),
|
|
54
|
+
Index("IDX_facility_images_facilityId", ["facilityId"]),
|
|
55
|
+
Index("IDX_facility_images_unique_primary", ["facilityId"], {
|
|
56
|
+
unique: true,
|
|
57
|
+
where: `"is_primary" = true`
|
|
58
|
+
}),
|
|
59
|
+
Unique("UQ_facility_images_facility_url", ["facilityId", "url"])
|
|
57
60
|
], FacilityImage);
|
|
58
|
-
export {
|
|
59
|
-
|
|
61
|
+
export {
|
|
62
|
+
FacilityImage
|
|
63
|
+
};
|
|
@@ -1,65 +1,67 @@
|
|
|
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
|
+
BeforeUpdate,
|
|
14
|
+
Column,
|
|
15
|
+
CreateDateColumn,
|
|
16
|
+
Entity,
|
|
17
|
+
Index,
|
|
18
|
+
OneToMany,
|
|
19
|
+
PrimaryGeneratedColumn,
|
|
20
|
+
Unique,
|
|
21
|
+
UpdateDateColumn
|
|
22
|
+
} from "typeorm";
|
|
23
|
+
import { Facility } from "../facilities/facility.entity";
|
|
24
|
+
import { sanitizeFacilityOwner } from "./utils/sanitize.utils.js";
|
|
25
|
+
let FacilityOwner = class {
|
|
26
|
+
sanitizeFields() {
|
|
27
|
+
sanitizeFacilityOwner(this);
|
|
28
|
+
}
|
|
9
29
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
], FacilityOwner.prototype, "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
], FacilityOwner.prototype, "
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
], FacilityOwner.prototype, "
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
__decorate([
|
|
45
|
-
Column({ name: 'contact_phone', type: 'varchar', length: 16 }),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], FacilityOwner.prototype, "contactPhone", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
OneToMany(() => Facility, (facility) => facility.facilityOwner),
|
|
50
|
-
__metadata("design:type", Array)
|
|
51
|
-
], FacilityOwner.prototype, "facilities", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
BeforeInsert(),
|
|
54
|
-
BeforeUpdate(),
|
|
55
|
-
__metadata("design:type", Function),
|
|
56
|
-
__metadata("design:paramtypes", []),
|
|
57
|
-
__metadata("design:returntype", void 0)
|
|
58
|
-
], FacilityOwner.prototype, "sanitizeFields", null);
|
|
59
|
-
FacilityOwner = __decorate([
|
|
60
|
-
Entity('facility_owners'),
|
|
61
|
-
Unique(['contactEmail']),
|
|
62
|
-
Unique(['cnpj'])
|
|
30
|
+
__decorateClass([
|
|
31
|
+
PrimaryGeneratedColumn()
|
|
32
|
+
], FacilityOwner.prototype, "id", 2);
|
|
33
|
+
__decorateClass([
|
|
34
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
35
|
+
], FacilityOwner.prototype, "createdAt", 2);
|
|
36
|
+
__decorateClass([
|
|
37
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
38
|
+
], FacilityOwner.prototype, "updatedAt", 2);
|
|
39
|
+
__decorateClass([
|
|
40
|
+
Column({ type: "varchar", length: 255 })
|
|
41
|
+
], FacilityOwner.prototype, "name", 2);
|
|
42
|
+
__decorateClass([
|
|
43
|
+
Index(),
|
|
44
|
+
Column({ name: "contact_email", type: "varchar", length: 255, nullable: true })
|
|
45
|
+
], FacilityOwner.prototype, "contactEmail", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
Index(),
|
|
48
|
+
Column({ name: "cnpj", type: "varchar", length: 14, nullable: true })
|
|
49
|
+
], FacilityOwner.prototype, "cnpj", 2);
|
|
50
|
+
__decorateClass([
|
|
51
|
+
Column({ name: "contact_phone", type: "varchar", length: 16 })
|
|
52
|
+
], FacilityOwner.prototype, "contactPhone", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
OneToMany(() => Facility, (facility) => facility.facilityOwner)
|
|
55
|
+
], FacilityOwner.prototype, "facilities", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
BeforeInsert(),
|
|
58
|
+
BeforeUpdate()
|
|
59
|
+
], FacilityOwner.prototype, "sanitizeFields", 1);
|
|
60
|
+
FacilityOwner = __decorateClass([
|
|
61
|
+
Entity("facility_owners"),
|
|
62
|
+
Unique(["contactEmail"]),
|
|
63
|
+
Unique(["cnpj"])
|
|
63
64
|
], FacilityOwner);
|
|
64
|
-
export {
|
|
65
|
-
|
|
65
|
+
export {
|
|
66
|
+
FacilityOwner
|
|
67
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function sanitizeFacilityOwner(owner) {
|
|
2
|
+
if (owner.cnpj) {
|
|
3
|
+
owner.cnpj = owner.cnpj.replace(/[^\d]/g, "").trim();
|
|
4
|
+
}
|
|
5
|
+
if (owner.contactEmail) {
|
|
6
|
+
owner.contactEmail = owner.contactEmail.toLowerCase().trim();
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
export {
|
|
10
|
+
sanitizeFacilityOwner
|
|
11
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(FieldSurfaceType ||
|
|
9
|
-
|
|
1
|
+
var FieldSurfaceType = /* @__PURE__ */ ((FieldSurfaceType2) => {
|
|
2
|
+
FieldSurfaceType2["GRASS"] = "grass";
|
|
3
|
+
FieldSurfaceType2["TURF"] = "turf";
|
|
4
|
+
FieldSurfaceType2["CLAY"] = "clay";
|
|
5
|
+
FieldSurfaceType2["SAND"] = "sand";
|
|
6
|
+
FieldSurfaceType2["HARDWOOD"] = "hardwood";
|
|
7
|
+
return FieldSurfaceType2;
|
|
8
|
+
})(FieldSurfaceType || {});
|
|
9
|
+
export {
|
|
10
|
+
FieldSurfaceType
|
|
11
|
+
};
|