c2-desafiox 1.0.106
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/index.d.ts +7 -0
- package/dist/index.js +23 -0
- package/dist/models/Access.d.ts +55 -0
- package/dist/models/Access.js +18 -0
- package/dist/models/Account.d.ts +29 -0
- package/dist/models/Account.js +28 -0
- package/dist/models/AccountDeletionRequest.d.ts +31 -0
- package/dist/models/AccountDeletionRequest.js +35 -0
- package/dist/models/AccountNotification.d.ts +110 -0
- package/dist/models/AccountNotification.js +25 -0
- package/dist/models/AdminComunication.d.ts +102 -0
- package/dist/models/AdminComunication.js +23 -0
- package/dist/models/AdminEventComunication.d.ts +236 -0
- package/dist/models/AdminEventComunication.js +54 -0
- package/dist/models/AdminNotification.d.ts +86 -0
- package/dist/models/AdminNotification.js +26 -0
- package/dist/models/AdminTemplateEmail.d.ts +40 -0
- package/dist/models/AdminTemplateEmail.js +19 -0
- package/dist/models/AdminTemplatePush.d.ts +68 -0
- package/dist/models/AdminTemplatePush.js +23 -0
- package/dist/models/Challenge.d.ts +40 -0
- package/dist/models/Challenge.js +38 -0
- package/dist/models/ChallengeRound.d.ts +41 -0
- package/dist/models/ChallengeRound.js +24 -0
- package/dist/models/Championship.d.ts +23 -0
- package/dist/models/Championship.js +20 -0
- package/dist/models/ChampionshipClassification.d.ts +31 -0
- package/dist/models/ChampionshipClassification.js +26 -0
- package/dist/models/ChampionshipMatch.d.ts +33 -0
- package/dist/models/ChampionshipMatch.js +32 -0
- package/dist/models/ChampionshipPhase.d.ts +101 -0
- package/dist/models/ChampionshipPhase.js +55 -0
- package/dist/models/ChampionshipRound.d.ts +26 -0
- package/dist/models/ChampionshipRound.js +31 -0
- package/dist/models/File.d.ts +33 -0
- package/dist/models/File.js +12 -0
- package/dist/models/Team.d.ts +23 -0
- package/dist/models/Team.js +21 -0
- package/dist/models/Ticket.d.ts +34 -0
- package/dist/models/Ticket.js +33 -0
- package/dist/models/TicketGuess.d.ts +33 -0
- package/dist/models/TicketGuess.js +31 -0
- package/dist/models/TicketOrder.d.ts +54 -0
- package/dist/models/TicketOrder.js +45 -0
- package/dist/models/WalletMoviment.d.ts +67 -0
- package/dist/models/WalletMoviment.js +71 -0
- package/dist/models/index.d.ts +20 -0
- package/dist/models/index.js +36 -0
- package/dist/types/ChallengeRoundStatus.d.ts +14 -0
- package/dist/types/ChallengeRoundStatus.js +18 -0
- package/dist/types/ChallengeStatus.d.ts +6 -0
- package/dist/types/ChallengeStatus.js +10 -0
- package/dist/types/GroupMatchMode.d.ts +9 -0
- package/dist/types/GroupMatchMode.js +13 -0
- package/dist/types/MatchStatus.d.ts +11 -0
- package/dist/types/MatchStatus.js +15 -0
- package/dist/types/Modality.d.ts +15 -0
- package/dist/types/Modality.js +19 -0
- package/dist/types/PhaseType.d.ts +8 -0
- package/dist/types/PhaseType.js +12 -0
- package/dist/types/QualificationMode.d.ts +10 -0
- package/dist/types/QualificationMode.js +14 -0
- package/dist/types/RoundStatus.d.ts +12 -0
- package/dist/types/RoundStatus.js +16 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +19 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +59 -0
- package/package.json +36 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChallengeRoundSchema = exports.ChallengeMatchSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const ChallengeRoundStatus_1 = require("../types/ChallengeRoundStatus");
|
|
6
|
+
exports.ChallengeMatchSchema = new mongoose_1.Schema({
|
|
7
|
+
match: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-match", required: true },
|
|
8
|
+
enabled: { type: Boolean, required: true, default: true },
|
|
9
|
+
teamWinner: { type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: false },
|
|
10
|
+
isDraw: { type: Boolean, required: false, default: false }
|
|
11
|
+
}, { _id: false });
|
|
12
|
+
exports.ChallengeRoundSchema = new mongoose_1.Schema({
|
|
13
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
14
|
+
round: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-round", required: true },
|
|
15
|
+
matches: [{ type: exports.ChallengeMatchSchema }],
|
|
16
|
+
enabled: { type: Boolean, required: true, default: true },
|
|
17
|
+
status: { type: String, required: true, enum: ChallengeRoundStatus_1.ChallengeRoundStatus, default: ChallengeRoundStatus_1.ChallengeRoundStatus.SCHEDULED },
|
|
18
|
+
sequenceOrder: { type: Number, required: false }
|
|
19
|
+
}, {
|
|
20
|
+
timestamps: {
|
|
21
|
+
createdAt: "createdAtDateTime",
|
|
22
|
+
updatedAt: "updatedAtDateTime"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { Modality } from "../types/Modality";
|
|
3
|
+
import { ITeam } from "./Team";
|
|
4
|
+
export interface IChampionship {
|
|
5
|
+
_id: Types.ObjectId;
|
|
6
|
+
name: string;
|
|
7
|
+
slug?: string;
|
|
8
|
+
startDate?: Date;
|
|
9
|
+
endDate?: Date;
|
|
10
|
+
teams: Types.ObjectId[] | ITeam[];
|
|
11
|
+
modality: Modality;
|
|
12
|
+
createdAtDateTime: Date;
|
|
13
|
+
updatedAtDateTime: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare const ChampionshipSchema: Schema<IChampionship, import("mongoose").Model<IChampionship, any, any, any, import("mongoose").Document<unknown, any, IChampionship, any> & IChampionship & Required<{
|
|
16
|
+
_id: Types.ObjectId;
|
|
17
|
+
}> & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChampionship, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChampionship>, {}> & import("mongoose").FlatRecord<IChampionship> & Required<{
|
|
20
|
+
_id: Types.ObjectId;
|
|
21
|
+
}> & {
|
|
22
|
+
__v: number;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChampionshipSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const Modality_1 = require("../types/Modality");
|
|
6
|
+
exports.ChampionshipSchema = new mongoose_1.Schema({
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
slug: { type: String, required: false },
|
|
9
|
+
startDate: { type: Date, required: false },
|
|
10
|
+
endDate: { type: Date, required: false },
|
|
11
|
+
teams: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: true }],
|
|
12
|
+
modality: { type: String, required: true, enum: Modality_1.Modality }
|
|
13
|
+
}, {
|
|
14
|
+
timestamps: {
|
|
15
|
+
createdAt: "createdAtDateTime",
|
|
16
|
+
updatedAt: "updatedAtDateTime"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
exports.ChampionshipSchema.index({ slug: 1 }, { unique: true, sparse: true });
|
|
20
|
+
exports.ChampionshipSchema.index({ modality: 1 });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IChampionship } from "./Championship";
|
|
3
|
+
import { IChampionshipPhase, ISlots } from "./ChampionshipPhase";
|
|
4
|
+
import { ITeam } from "./Team";
|
|
5
|
+
export interface IChampionshipClassification {
|
|
6
|
+
_id: Types.ObjectId;
|
|
7
|
+
slot: Types.ObjectId | ISlots;
|
|
8
|
+
championship: Types.ObjectId | IChampionship;
|
|
9
|
+
phase: Types.ObjectId | IChampionshipPhase;
|
|
10
|
+
team: Types.ObjectId | ITeam;
|
|
11
|
+
group: string;
|
|
12
|
+
matchesPlayed: number;
|
|
13
|
+
points: number;
|
|
14
|
+
wins: number;
|
|
15
|
+
losses: number;
|
|
16
|
+
draws: number;
|
|
17
|
+
goalsFor: number;
|
|
18
|
+
goalsAgainst: number;
|
|
19
|
+
goalDifference: number;
|
|
20
|
+
createdAtDateTime: Date;
|
|
21
|
+
updatedAtDateTime: Date;
|
|
22
|
+
}
|
|
23
|
+
export declare const ChampionshipClassificationSchema: Schema<IChampionshipClassification, import("mongoose").Model<IChampionshipClassification, any, any, any, import("mongoose").Document<unknown, any, IChampionshipClassification, any> & IChampionshipClassification & Required<{
|
|
24
|
+
_id: Types.ObjectId;
|
|
25
|
+
}> & {
|
|
26
|
+
__v: number;
|
|
27
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChampionshipClassification, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChampionshipClassification>, {}> & import("mongoose").FlatRecord<IChampionshipClassification> & Required<{
|
|
28
|
+
_id: Types.ObjectId;
|
|
29
|
+
}> & {
|
|
30
|
+
__v: number;
|
|
31
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChampionshipClassificationSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.ChampionshipClassificationSchema = new mongoose_1.Schema({
|
|
6
|
+
championship: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship", required: true },
|
|
7
|
+
phase: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-phase", required: true },
|
|
8
|
+
slot: { type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
9
|
+
team: { type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: false },
|
|
10
|
+
group: { type: String, required: true },
|
|
11
|
+
matchesPlayed: { type: Number, required: true, default: 0 },
|
|
12
|
+
points: { type: Number, required: true, default: 0 },
|
|
13
|
+
wins: { type: Number, required: true, default: 0 },
|
|
14
|
+
losses: { type: Number, required: true, default: 0 },
|
|
15
|
+
draws: { type: Number, required: true, default: 0 },
|
|
16
|
+
goalsFor: { type: Number, required: true, default: 0 },
|
|
17
|
+
goalsAgainst: { type: Number, required: true, default: 0 },
|
|
18
|
+
goalDifference: { type: Number, required: true, default: 0 },
|
|
19
|
+
}, {
|
|
20
|
+
timestamps: {
|
|
21
|
+
createdAt: "createdAtDateTime",
|
|
22
|
+
updatedAt: "updatedAtDateTime"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.ChampionshipClassificationSchema.index({ championship: 1 });
|
|
26
|
+
exports.ChampionshipClassificationSchema.index({ phase: 1, slot: 1 }, { unique: true });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { MatchStatus } from "../types/MatchStatus";
|
|
3
|
+
import { IChampionship } from "./Championship";
|
|
4
|
+
import { IChampionshipPhase, ISlots } from "./ChampionshipPhase";
|
|
5
|
+
import { IChampionshipRound } from "./ChampionshipRound";
|
|
6
|
+
export interface IChampionshipMatch {
|
|
7
|
+
_id: Types.ObjectId;
|
|
8
|
+
number: number;
|
|
9
|
+
championship: Types.ObjectId | IChampionship;
|
|
10
|
+
phase: Types.ObjectId | IChampionshipPhase;
|
|
11
|
+
round: Types.ObjectId | IChampionshipRound;
|
|
12
|
+
group?: string;
|
|
13
|
+
slotHome: ISlots;
|
|
14
|
+
slotAway: ISlots;
|
|
15
|
+
scheduledAt?: Date;
|
|
16
|
+
homeScore?: number;
|
|
17
|
+
homeScoreTieBreak?: number;
|
|
18
|
+
awayScore?: number;
|
|
19
|
+
awayScoreTieBreak?: number;
|
|
20
|
+
status: MatchStatus;
|
|
21
|
+
matchDateTime: Date;
|
|
22
|
+
createdAtDateTime: Date;
|
|
23
|
+
updatedAtDateTime: Date;
|
|
24
|
+
}
|
|
25
|
+
export declare const ChampionshipMatchSchema: Schema<IChampionshipMatch, import("mongoose").Model<IChampionshipMatch, any, any, any, import("mongoose").Document<unknown, any, IChampionshipMatch, any> & IChampionshipMatch & Required<{
|
|
26
|
+
_id: Types.ObjectId;
|
|
27
|
+
}> & {
|
|
28
|
+
__v: number;
|
|
29
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChampionshipMatch, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChampionshipMatch>, {}> & import("mongoose").FlatRecord<IChampionshipMatch> & Required<{
|
|
30
|
+
_id: Types.ObjectId;
|
|
31
|
+
}> & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChampionshipMatchSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MatchStatus_1 = require("../types/MatchStatus");
|
|
6
|
+
const ChampionshipPhase_1 = require("./ChampionshipPhase");
|
|
7
|
+
exports.ChampionshipMatchSchema = new mongoose_1.Schema({
|
|
8
|
+
number: { type: Number, required: true },
|
|
9
|
+
championship: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship", required: true },
|
|
10
|
+
phase: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-phase", required: true },
|
|
11
|
+
round: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-round", required: true },
|
|
12
|
+
group: { type: String, required: false },
|
|
13
|
+
slotHome: { type: ChampionshipPhase_1.SlotsSchema, required: true },
|
|
14
|
+
slotAway: { type: ChampionshipPhase_1.SlotsSchema, required: true },
|
|
15
|
+
scheduledAt: { type: Date, required: false },
|
|
16
|
+
homeScore: { type: Number, required: false },
|
|
17
|
+
homeScoreTieBreak: { type: Number, required: false },
|
|
18
|
+
awayScore: { type: Number, required: false },
|
|
19
|
+
awayScoreTieBreak: { type: Number, required: false },
|
|
20
|
+
status: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
enum: MatchStatus_1.MatchStatus
|
|
24
|
+
},
|
|
25
|
+
matchDateTime: { type: Date, required: false },
|
|
26
|
+
}, {
|
|
27
|
+
timestamps: {
|
|
28
|
+
createdAt: "createdAtDateTime",
|
|
29
|
+
updatedAt: "updatedAtDateTime"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
exports.ChampionshipMatchSchema.index({ round: 1 });
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { GroupMatchMode } from "../types/GroupMatchMode";
|
|
3
|
+
import { QualificationMode } from "../types/QualificationMode";
|
|
4
|
+
import { IChampionship } from "./Championship";
|
|
5
|
+
import { ITeam } from "./Team";
|
|
6
|
+
/** Time na fase, com identificador opcional de grupo (ex.: "A", "B" na fase de grupos). */
|
|
7
|
+
export interface IPhaseParticipant {
|
|
8
|
+
team: Types.ObjectId | ITeam;
|
|
9
|
+
}
|
|
10
|
+
export interface IGroup {
|
|
11
|
+
name: string;
|
|
12
|
+
slots: ISlots[];
|
|
13
|
+
}
|
|
14
|
+
export interface ISlots {
|
|
15
|
+
_id: Types.ObjectId;
|
|
16
|
+
label?: string;
|
|
17
|
+
team?: Types.ObjectId | ITeam;
|
|
18
|
+
}
|
|
19
|
+
export interface IChampionshipPhase {
|
|
20
|
+
_id: Types.ObjectId;
|
|
21
|
+
description: string;
|
|
22
|
+
championship: Types.ObjectId | IChampionship;
|
|
23
|
+
order: number;
|
|
24
|
+
matchRules?: IMatchRules;
|
|
25
|
+
amountSlotsByGroup: number;
|
|
26
|
+
groups: IGroup[];
|
|
27
|
+
qualifiedRules: IQualifiedRule[];
|
|
28
|
+
qualifiedsSlots: IQualifiedsSlots[];
|
|
29
|
+
createdAtDateTime: Date;
|
|
30
|
+
updatedAtDateTime: Date;
|
|
31
|
+
}
|
|
32
|
+
export interface IQualifiedsSlots extends ISlots {
|
|
33
|
+
priority: number;
|
|
34
|
+
position: number;
|
|
35
|
+
group?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IMatchRules {
|
|
38
|
+
mode: GroupMatchMode;
|
|
39
|
+
twoLegs: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface IQualifiedRule {
|
|
42
|
+
priority: number;
|
|
43
|
+
mode: QualificationMode;
|
|
44
|
+
position: number;
|
|
45
|
+
limit: number;
|
|
46
|
+
label: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const SlotsSchema: Schema<ISlots, import("mongoose").Model<ISlots, any, any, any, import("mongoose").Document<unknown, any, ISlots, any> & ISlots & Required<{
|
|
49
|
+
_id: Types.ObjectId;
|
|
50
|
+
}> & {
|
|
51
|
+
__v: number;
|
|
52
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ISlots, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ISlots>, {}> & import("mongoose").FlatRecord<ISlots> & Required<{
|
|
53
|
+
_id: Types.ObjectId;
|
|
54
|
+
}> & {
|
|
55
|
+
__v: number;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const QualifiedsSlotsSchema: Schema<IQualifiedsSlots, import("mongoose").Model<IQualifiedsSlots, any, any, any, import("mongoose").Document<unknown, any, IQualifiedsSlots, any> & IQualifiedsSlots & Required<{
|
|
58
|
+
_id: Types.ObjectId;
|
|
59
|
+
}> & {
|
|
60
|
+
__v: number;
|
|
61
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IQualifiedsSlots, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IQualifiedsSlots>, {}> & import("mongoose").FlatRecord<IQualifiedsSlots> & Required<{
|
|
62
|
+
_id: Types.ObjectId;
|
|
63
|
+
}> & {
|
|
64
|
+
__v: number;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const GroupSchema: Schema<IGroup, import("mongoose").Model<IGroup, any, any, any, import("mongoose").Document<unknown, any, IGroup, any> & IGroup & {
|
|
67
|
+
_id: Types.ObjectId;
|
|
68
|
+
} & {
|
|
69
|
+
__v: number;
|
|
70
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IGroup, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IGroup>, {}> & import("mongoose").FlatRecord<IGroup> & {
|
|
71
|
+
_id: Types.ObjectId;
|
|
72
|
+
} & {
|
|
73
|
+
__v: number;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const QualifiedRuleSchema: Schema<IQualifiedRule, import("mongoose").Model<IQualifiedRule, any, any, any, import("mongoose").Document<unknown, any, IQualifiedRule, any> & IQualifiedRule & {
|
|
76
|
+
_id: Types.ObjectId;
|
|
77
|
+
} & {
|
|
78
|
+
__v: number;
|
|
79
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IQualifiedRule, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IQualifiedRule>, {}> & import("mongoose").FlatRecord<IQualifiedRule> & {
|
|
80
|
+
_id: Types.ObjectId;
|
|
81
|
+
} & {
|
|
82
|
+
__v: number;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const MatchRulesSchema: Schema<IMatchRules, import("mongoose").Model<IMatchRules, any, any, any, import("mongoose").Document<unknown, any, IMatchRules, any> & IMatchRules & {
|
|
85
|
+
_id: Types.ObjectId;
|
|
86
|
+
} & {
|
|
87
|
+
__v: number;
|
|
88
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IMatchRules, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IMatchRules>, {}> & import("mongoose").FlatRecord<IMatchRules> & {
|
|
89
|
+
_id: Types.ObjectId;
|
|
90
|
+
} & {
|
|
91
|
+
__v: number;
|
|
92
|
+
}>;
|
|
93
|
+
export declare const ChampionshipPhaseSchema: Schema<IChampionshipPhase, import("mongoose").Model<IChampionshipPhase, any, any, any, import("mongoose").Document<unknown, any, IChampionshipPhase, any> & IChampionshipPhase & Required<{
|
|
94
|
+
_id: Types.ObjectId;
|
|
95
|
+
}> & {
|
|
96
|
+
__v: number;
|
|
97
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChampionshipPhase, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChampionshipPhase>, {}> & import("mongoose").FlatRecord<IChampionshipPhase> & Required<{
|
|
98
|
+
_id: Types.ObjectId;
|
|
99
|
+
}> & {
|
|
100
|
+
__v: number;
|
|
101
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChampionshipPhaseSchema = exports.MatchRulesSchema = exports.QualifiedRuleSchema = exports.GroupSchema = exports.QualifiedsSlotsSchema = exports.SlotsSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const GroupMatchMode_1 = require("../types/GroupMatchMode");
|
|
6
|
+
const QualificationMode_1 = require("../types/QualificationMode");
|
|
7
|
+
exports.SlotsSchema = new mongoose_1.Schema({
|
|
8
|
+
_id: { type: mongoose_1.Schema.Types.ObjectId, default: () => new mongoose_1.Types.ObjectId() },
|
|
9
|
+
label: { type: String, required: false },
|
|
10
|
+
team: { type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: false },
|
|
11
|
+
});
|
|
12
|
+
exports.QualifiedsSlotsSchema = new mongoose_1.Schema({
|
|
13
|
+
_id: { type: mongoose_1.Schema.Types.ObjectId, default: () => new mongoose_1.Types.ObjectId() },
|
|
14
|
+
label: { type: String, required: true },
|
|
15
|
+
team: { type: mongoose_1.Schema.Types.ObjectId, ref: "team" },
|
|
16
|
+
priority: { type: Number, required: true },
|
|
17
|
+
position: { type: Number, required: true },
|
|
18
|
+
group: { type: String, required: false, default: "" }
|
|
19
|
+
});
|
|
20
|
+
exports.GroupSchema = new mongoose_1.Schema({
|
|
21
|
+
name: { type: String, required: true },
|
|
22
|
+
slots: { type: [exports.SlotsSchema], required: true, default: [] },
|
|
23
|
+
}, { _id: false });
|
|
24
|
+
exports.QualifiedRuleSchema = new mongoose_1.Schema({
|
|
25
|
+
priority: { type: Number, required: true },
|
|
26
|
+
mode: { type: String, required: true, enum: QualificationMode_1.QualificationMode },
|
|
27
|
+
position: { type: Number, required: true },
|
|
28
|
+
limit: { type: Number, required: true },
|
|
29
|
+
label: { type: String, default: "" },
|
|
30
|
+
});
|
|
31
|
+
exports.MatchRulesSchema = new mongoose_1.Schema({
|
|
32
|
+
mode: { type: String, required: true, enum: GroupMatchMode_1.GroupMatchMode },
|
|
33
|
+
twoLegs: { type: Boolean, required: true, default: false },
|
|
34
|
+
});
|
|
35
|
+
exports.ChampionshipPhaseSchema = new mongoose_1.Schema({
|
|
36
|
+
description: { type: String, required: true },
|
|
37
|
+
championship: {
|
|
38
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
39
|
+
ref: "championship",
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
order: { type: Number, required: true },
|
|
43
|
+
amountSlotsByGroup: { type: Number, required: true, default: 2 },
|
|
44
|
+
groups: { type: [exports.GroupSchema], required: true, default: [] },
|
|
45
|
+
matchRules: { type: exports.MatchRulesSchema, required: true },
|
|
46
|
+
qualifiedRules: { type: [exports.QualifiedRuleSchema], required: true },
|
|
47
|
+
qualifiedsSlots: { type: [exports.QualifiedsSlotsSchema], required: true, default: [] }
|
|
48
|
+
}, {
|
|
49
|
+
timestamps: {
|
|
50
|
+
createdAt: "createdAtDateTime",
|
|
51
|
+
updatedAt: "updatedAtDateTime"
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
exports.ChampionshipPhaseSchema.index({ championship: 1 });
|
|
55
|
+
exports.ChampionshipPhaseSchema.index({ championship: 1, order: 1 }, { unique: true });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { RoundStatus } from "../types/RoundStatus";
|
|
3
|
+
import { IChampionshipPhase } from "./ChampionshipPhase";
|
|
4
|
+
import { IChampionship } from "./Championship";
|
|
5
|
+
export interface IChampionshipRound {
|
|
6
|
+
_id: Types.ObjectId;
|
|
7
|
+
phase: Types.ObjectId | IChampionshipPhase;
|
|
8
|
+
championship: Types.ObjectId | IChampionship;
|
|
9
|
+
roundIndexInPhase: number;
|
|
10
|
+
globalRoundIndex: number;
|
|
11
|
+
label?: string;
|
|
12
|
+
startDate?: Date;
|
|
13
|
+
endDate?: Date;
|
|
14
|
+
status: RoundStatus;
|
|
15
|
+
createdAtDateTime: Date;
|
|
16
|
+
updatedAtDateTime: Date;
|
|
17
|
+
}
|
|
18
|
+
export declare const ChampionshipRoundSchema: Schema<IChampionshipRound, import("mongoose").Model<IChampionshipRound, any, any, any, import("mongoose").Document<unknown, any, IChampionshipRound, any> & IChampionshipRound & Required<{
|
|
19
|
+
_id: Types.ObjectId;
|
|
20
|
+
}> & {
|
|
21
|
+
__v: number;
|
|
22
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChampionshipRound, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChampionshipRound>, {}> & import("mongoose").FlatRecord<IChampionshipRound> & Required<{
|
|
23
|
+
_id: Types.ObjectId;
|
|
24
|
+
}> & {
|
|
25
|
+
__v: number;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChampionshipRoundSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const RoundStatus_1 = require("../types/RoundStatus");
|
|
6
|
+
exports.ChampionshipRoundSchema = new mongoose_1.Schema({
|
|
7
|
+
phase: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-phase", required: true },
|
|
8
|
+
championship: {
|
|
9
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
10
|
+
ref: "championship",
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
roundIndexInPhase: { type: Number, required: true },
|
|
14
|
+
globalRoundIndex: { type: Number, required: true },
|
|
15
|
+
label: { type: String, required: false },
|
|
16
|
+
startDate: { type: Date, required: false },
|
|
17
|
+
endDate: { type: Date, required: false },
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
enum: RoundStatus_1.RoundStatus
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
timestamps: {
|
|
25
|
+
createdAt: "createdAtDateTime",
|
|
26
|
+
updatedAt: "updatedAtDateTime"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
exports.ChampionshipRoundSchema.index({ phase: 1 });
|
|
30
|
+
exports.ChampionshipRoundSchema.index({ championship: 1 });
|
|
31
|
+
exports.ChampionshipRoundSchema.index({ championship: 1, globalRoundIndex: 1 }, { unique: true });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
export interface IFile {
|
|
3
|
+
contentType: string;
|
|
4
|
+
format: string;
|
|
5
|
+
description: string;
|
|
6
|
+
url: string;
|
|
7
|
+
fileBase64: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FileSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
10
|
+
timestamps: {
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
};
|
|
14
|
+
}, {} & {
|
|
15
|
+
contentType: string;
|
|
16
|
+
description: string;
|
|
17
|
+
format?: string | null | undefined;
|
|
18
|
+
url?: string | null | undefined;
|
|
19
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
20
|
+
contentType: string;
|
|
21
|
+
description: string;
|
|
22
|
+
format?: string | null | undefined;
|
|
23
|
+
url?: string | null | undefined;
|
|
24
|
+
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
25
|
+
contentType: string;
|
|
26
|
+
description: string;
|
|
27
|
+
format?: string | null | undefined;
|
|
28
|
+
url?: string | null | undefined;
|
|
29
|
+
}> & {
|
|
30
|
+
_id: import("mongoose").Types.ObjectId;
|
|
31
|
+
} & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.FileSchema = new mongoose_1.Schema({
|
|
6
|
+
contentType: { type: String, required: true },
|
|
7
|
+
format: { type: String },
|
|
8
|
+
description: { type: String, required: true },
|
|
9
|
+
url: { type: String }
|
|
10
|
+
}, {
|
|
11
|
+
timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
|
|
12
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { Modality } from "../types/Modality";
|
|
3
|
+
import { IFile } from "./File";
|
|
4
|
+
export interface ITeam {
|
|
5
|
+
_id: Types.ObjectId;
|
|
6
|
+
name: string;
|
|
7
|
+
shortName?: string;
|
|
8
|
+
logoUrl?: string;
|
|
9
|
+
image?: IFile;
|
|
10
|
+
externalId?: string;
|
|
11
|
+
modality: Modality;
|
|
12
|
+
createdAtDateTime: Date;
|
|
13
|
+
updatedAtDateTime: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare const TeamSchema: Schema<ITeam, import("mongoose").Model<ITeam, any, any, any, import("mongoose").Document<unknown, any, ITeam, any> & ITeam & Required<{
|
|
16
|
+
_id: Types.ObjectId;
|
|
17
|
+
}> & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITeam, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITeam>, {}> & import("mongoose").FlatRecord<ITeam> & Required<{
|
|
20
|
+
_id: Types.ObjectId;
|
|
21
|
+
}> & {
|
|
22
|
+
__v: number;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const Modality_1 = require("../types/Modality");
|
|
6
|
+
const File_1 = require("./File");
|
|
7
|
+
exports.TeamSchema = new mongoose_1.Schema({
|
|
8
|
+
name: { type: String, required: true },
|
|
9
|
+
shortName: { type: String, required: false },
|
|
10
|
+
logoUrl: { type: String, required: false },
|
|
11
|
+
image: { type: File_1.FileSchema, required: false },
|
|
12
|
+
externalId: { type: String, required: false },
|
|
13
|
+
modality: { type: String, required: true, enum: Modality_1.Modality }
|
|
14
|
+
}, {
|
|
15
|
+
timestamps: {
|
|
16
|
+
createdAt: "createdAtDateTime",
|
|
17
|
+
updatedAt: "updatedAtDateTime"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
exports.TeamSchema.index({ name: 1, modality: 1 }, { unique: true });
|
|
21
|
+
exports.TeamSchema.index({ externalId: 1 }, { unique: true, sparse: true });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IChallenge } from "./Challenge";
|
|
4
|
+
import { ITicketOrder } from "./TicketOrder";
|
|
5
|
+
export declare enum TicketStatusInGamming {
|
|
6
|
+
READY = "READY",
|
|
7
|
+
SCALLING = "SCALLING",
|
|
8
|
+
DROPPED = "DROPPED"
|
|
9
|
+
}
|
|
10
|
+
export declare enum TicketStatusFinancial {
|
|
11
|
+
NOT_PAID = "NOT_PAID",
|
|
12
|
+
PAID = "PAID",
|
|
13
|
+
CANCELLED = "CANCELLED"
|
|
14
|
+
}
|
|
15
|
+
export interface ITicket {
|
|
16
|
+
_id: Types.ObjectId;
|
|
17
|
+
code: string;
|
|
18
|
+
account: Types.ObjectId | IAccount;
|
|
19
|
+
challenge: Types.ObjectId | IChallenge;
|
|
20
|
+
statusInGamming: TicketStatusInGamming;
|
|
21
|
+
statusFinancial: TicketStatusFinancial;
|
|
22
|
+
ticketOrder: Types.ObjectId | ITicketOrder;
|
|
23
|
+
createdAtDateTime: Date;
|
|
24
|
+
updatedAtDateTime: Date;
|
|
25
|
+
}
|
|
26
|
+
export declare const TicketSchema: Schema<ITicket, import("mongoose").Model<ITicket, any, any, any, import("mongoose").Document<unknown, any, ITicket, any> & ITicket & Required<{
|
|
27
|
+
_id: Types.ObjectId;
|
|
28
|
+
}> & {
|
|
29
|
+
__v: number;
|
|
30
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITicket, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITicket>, {}> & import("mongoose").FlatRecord<ITicket> & Required<{
|
|
31
|
+
_id: Types.ObjectId;
|
|
32
|
+
}> & {
|
|
33
|
+
__v: number;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketSchema = exports.TicketStatusFinancial = exports.TicketStatusInGamming = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
var TicketStatusInGamming;
|
|
6
|
+
(function (TicketStatusInGamming) {
|
|
7
|
+
TicketStatusInGamming["READY"] = "READY";
|
|
8
|
+
TicketStatusInGamming["SCALLING"] = "SCALLING";
|
|
9
|
+
TicketStatusInGamming["DROPPED"] = "DROPPED";
|
|
10
|
+
})(TicketStatusInGamming || (exports.TicketStatusInGamming = TicketStatusInGamming = {}));
|
|
11
|
+
var TicketStatusFinancial;
|
|
12
|
+
(function (TicketStatusFinancial) {
|
|
13
|
+
TicketStatusFinancial["NOT_PAID"] = "NOT_PAID";
|
|
14
|
+
TicketStatusFinancial["PAID"] = "PAID";
|
|
15
|
+
TicketStatusFinancial["CANCELLED"] = "CANCELLED";
|
|
16
|
+
})(TicketStatusFinancial || (exports.TicketStatusFinancial = TicketStatusFinancial = {}));
|
|
17
|
+
exports.TicketSchema = new mongoose_1.Schema({
|
|
18
|
+
code: { type: String, required: true },
|
|
19
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
20
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
21
|
+
statusInGamming: { type: String, required: true, enum: TicketStatusInGamming },
|
|
22
|
+
statusFinancial: { type: String, required: true, enum: TicketStatusFinancial },
|
|
23
|
+
ticketOrder: { type: mongoose_1.Schema.Types.ObjectId, ref: "ticket-order", required: true },
|
|
24
|
+
}, {
|
|
25
|
+
timestamps: {
|
|
26
|
+
createdAt: "createdAtDateTime",
|
|
27
|
+
updatedAt: "updatedAtDateTime"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports.TicketSchema.index({ account: 1 });
|
|
31
|
+
exports.TicketSchema.index({ challenge: 1 });
|
|
32
|
+
exports.TicketSchema.index({ statusInGamming: 1 });
|
|
33
|
+
exports.TicketSchema.index({ statusFinancial: 1 });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IChallenge } from "./Challenge";
|
|
4
|
+
import { ITeam } from "./Team";
|
|
5
|
+
import { IChallengeRound } from "./ChallengeRound";
|
|
6
|
+
import { ITicket } from "./Ticket";
|
|
7
|
+
export declare enum TicketGuessStatus {
|
|
8
|
+
PENDING = "PENDING",
|
|
9
|
+
RIGHT = "RIGHT",
|
|
10
|
+
WRONG = "WRONG"
|
|
11
|
+
}
|
|
12
|
+
export interface ITicketGuess {
|
|
13
|
+
_id: Types.ObjectId;
|
|
14
|
+
account: Types.ObjectId | IAccount;
|
|
15
|
+
challenge: Types.ObjectId | IChallenge;
|
|
16
|
+
challengeRound: Types.ObjectId | IChallengeRound;
|
|
17
|
+
ticket: Types.ObjectId | ITicket;
|
|
18
|
+
guess: Types.ObjectId | ITeam;
|
|
19
|
+
guessStatus: TicketGuessStatus;
|
|
20
|
+
isAutomatic: boolean;
|
|
21
|
+
notes: string;
|
|
22
|
+
createdAtDateTime: Date;
|
|
23
|
+
updatedAtDateTime: Date;
|
|
24
|
+
}
|
|
25
|
+
export declare const TicketGuessSchema: Schema<ITicketGuess, import("mongoose").Model<ITicketGuess, any, any, any, import("mongoose").Document<unknown, any, ITicketGuess, any> & ITicketGuess & Required<{
|
|
26
|
+
_id: Types.ObjectId;
|
|
27
|
+
}> & {
|
|
28
|
+
__v: number;
|
|
29
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITicketGuess, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITicketGuess>, {}> & import("mongoose").FlatRecord<ITicketGuess> & Required<{
|
|
30
|
+
_id: Types.ObjectId;
|
|
31
|
+
}> & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketGuessSchema = exports.TicketGuessStatus = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
var TicketGuessStatus;
|
|
6
|
+
(function (TicketGuessStatus) {
|
|
7
|
+
TicketGuessStatus["PENDING"] = "PENDING";
|
|
8
|
+
TicketGuessStatus["RIGHT"] = "RIGHT";
|
|
9
|
+
TicketGuessStatus["WRONG"] = "WRONG";
|
|
10
|
+
})(TicketGuessStatus || (exports.TicketGuessStatus = TicketGuessStatus = {}));
|
|
11
|
+
exports.TicketGuessSchema = new mongoose_1.Schema({
|
|
12
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
13
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
14
|
+
challengeRound: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge-round", required: true },
|
|
15
|
+
ticket: { type: mongoose_1.Schema.Types.ObjectId, ref: "ticket", required: true },
|
|
16
|
+
guess: { type: mongoose_1.Schema.Types.ObjectId, ref: "team" },
|
|
17
|
+
guessStatus: { type: String, enum: TicketGuessStatus, default: TicketGuessStatus.PENDING },
|
|
18
|
+
isAutomatic: { type: Boolean, default: false },
|
|
19
|
+
notes: { type: String, default: "" },
|
|
20
|
+
}, {
|
|
21
|
+
timestamps: {
|
|
22
|
+
createdAt: "createdAtDateTime",
|
|
23
|
+
updatedAt: "updatedAtDateTime"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
exports.TicketGuessSchema.index({ account: 1, ticket: 1, challengeRound: 1 }, { unique: true });
|
|
27
|
+
exports.TicketGuessSchema.index({ account: 1 });
|
|
28
|
+
exports.TicketGuessSchema.index({ challenge: 1 });
|
|
29
|
+
exports.TicketGuessSchema.index({ challengeRound: 1 });
|
|
30
|
+
exports.TicketGuessSchema.index({ ticket: 1 });
|
|
31
|
+
exports.TicketGuessSchema.index({ team: 1 });
|