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,54 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IChallenge } from "./Challenge";
|
|
4
|
+
export declare enum TicketOrderPaymentMethod {
|
|
5
|
+
WALLET = "WALLET",
|
|
6
|
+
CREDIT_CARD = "CREDIT_CARD",
|
|
7
|
+
DEBIT_CARD = "DEBIT_CARD",
|
|
8
|
+
PIX = "PIX"
|
|
9
|
+
}
|
|
10
|
+
export declare enum TicketOrderStatus {
|
|
11
|
+
DRAFT = "DRAFT",
|
|
12
|
+
PENDING = "PENDING",
|
|
13
|
+
PAID = "PAID",
|
|
14
|
+
CANCELLED = "CANCELLED"
|
|
15
|
+
}
|
|
16
|
+
export interface IAcceptTermsOfChallenge {
|
|
17
|
+
accepted: boolean;
|
|
18
|
+
acceptedAtDateTime: Date;
|
|
19
|
+
acceptedAppVersion: string;
|
|
20
|
+
contentAccepted: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ITicketOrder {
|
|
23
|
+
_id: Types.ObjectId;
|
|
24
|
+
sequenceNumber: number;
|
|
25
|
+
account: Types.ObjectId | IAccount;
|
|
26
|
+
challenge: Types.ObjectId | IChallenge;
|
|
27
|
+
status: TicketOrderStatus;
|
|
28
|
+
paymentMethod: TicketOrderPaymentMethod;
|
|
29
|
+
amount: number;
|
|
30
|
+
unitValue: number;
|
|
31
|
+
totalValue: number;
|
|
32
|
+
coupons: string[];
|
|
33
|
+
acceptTermsOfChallenge: IAcceptTermsOfChallenge;
|
|
34
|
+
createdAtDateTime: Date;
|
|
35
|
+
updatedAtDateTime: Date;
|
|
36
|
+
}
|
|
37
|
+
export declare const AcceptTermsOfChallengeSchema: Schema<IAcceptTermsOfChallenge, import("mongoose").Model<IAcceptTermsOfChallenge, any, any, any, import("mongoose").Document<unknown, any, IAcceptTermsOfChallenge, any> & IAcceptTermsOfChallenge & {
|
|
38
|
+
_id: Types.ObjectId;
|
|
39
|
+
} & {
|
|
40
|
+
__v: number;
|
|
41
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IAcceptTermsOfChallenge, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IAcceptTermsOfChallenge>, {}> & import("mongoose").FlatRecord<IAcceptTermsOfChallenge> & {
|
|
42
|
+
_id: Types.ObjectId;
|
|
43
|
+
} & {
|
|
44
|
+
__v: number;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const TicketOrderSchema: Schema<ITicketOrder, import("mongoose").Model<ITicketOrder, any, any, any, import("mongoose").Document<unknown, any, ITicketOrder, any> & ITicketOrder & Required<{
|
|
47
|
+
_id: Types.ObjectId;
|
|
48
|
+
}> & {
|
|
49
|
+
__v: number;
|
|
50
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITicketOrder, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITicketOrder>, {}> & import("mongoose").FlatRecord<ITicketOrder> & Required<{
|
|
51
|
+
_id: Types.ObjectId;
|
|
52
|
+
}> & {
|
|
53
|
+
__v: number;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketOrderSchema = exports.AcceptTermsOfChallengeSchema = exports.TicketOrderStatus = exports.TicketOrderPaymentMethod = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
var TicketOrderPaymentMethod;
|
|
6
|
+
(function (TicketOrderPaymentMethod) {
|
|
7
|
+
TicketOrderPaymentMethod["WALLET"] = "WALLET";
|
|
8
|
+
TicketOrderPaymentMethod["CREDIT_CARD"] = "CREDIT_CARD";
|
|
9
|
+
TicketOrderPaymentMethod["DEBIT_CARD"] = "DEBIT_CARD";
|
|
10
|
+
TicketOrderPaymentMethod["PIX"] = "PIX";
|
|
11
|
+
})(TicketOrderPaymentMethod || (exports.TicketOrderPaymentMethod = TicketOrderPaymentMethod = {}));
|
|
12
|
+
var TicketOrderStatus;
|
|
13
|
+
(function (TicketOrderStatus) {
|
|
14
|
+
TicketOrderStatus["DRAFT"] = "DRAFT";
|
|
15
|
+
TicketOrderStatus["PENDING"] = "PENDING";
|
|
16
|
+
TicketOrderStatus["PAID"] = "PAID";
|
|
17
|
+
TicketOrderStatus["CANCELLED"] = "CANCELLED";
|
|
18
|
+
})(TicketOrderStatus || (exports.TicketOrderStatus = TicketOrderStatus = {}));
|
|
19
|
+
exports.AcceptTermsOfChallengeSchema = new mongoose_1.Schema({
|
|
20
|
+
accepted: { type: Boolean, required: true },
|
|
21
|
+
acceptedAtDateTime: { type: Date, required: true },
|
|
22
|
+
acceptedAppVersion: { type: String, required: true },
|
|
23
|
+
contentAccepted: { type: String, required: true },
|
|
24
|
+
});
|
|
25
|
+
exports.TicketOrderSchema = new mongoose_1.Schema({
|
|
26
|
+
sequenceNumber: { type: Number, required: true },
|
|
27
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
28
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
29
|
+
status: { type: String, required: true, enum: TicketOrderStatus },
|
|
30
|
+
paymentMethod: { type: String, required: true, enum: TicketOrderPaymentMethod },
|
|
31
|
+
amount: { type: Number, required: true },
|
|
32
|
+
unitValue: { type: Number, required: true },
|
|
33
|
+
totalValue: { type: Number, required: true },
|
|
34
|
+
coupons: { type: [String], required: true },
|
|
35
|
+
acceptTermsOfChallenge: { type: exports.AcceptTermsOfChallengeSchema, required: true },
|
|
36
|
+
}, {
|
|
37
|
+
timestamps: {
|
|
38
|
+
createdAt: "createdAtDateTime",
|
|
39
|
+
updatedAt: "updatedAtDateTime"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
exports.TicketOrderSchema.index({ account: 1 });
|
|
43
|
+
exports.TicketOrderSchema.index({ challenge: 1 });
|
|
44
|
+
exports.TicketOrderSchema.index({ status: 1 });
|
|
45
|
+
exports.TicketOrderSchema.index({ paymentMethod: 1 });
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IFile } from "./File";
|
|
4
|
+
export declare enum WalletMovimentStatus {
|
|
5
|
+
PENDING = "PENDING",
|
|
6
|
+
COMPLETED = "COMPLETED",
|
|
7
|
+
CANCELLED = "CANCELLED"
|
|
8
|
+
}
|
|
9
|
+
export declare enum WalletMovimentType {
|
|
10
|
+
DEPOSIT = "DEPOSIT",
|
|
11
|
+
WITHDRAW = "WITHDRAW",
|
|
12
|
+
BUY_TICKET = "BUY_TICKET",
|
|
13
|
+
AWARD = "AWARD"
|
|
14
|
+
}
|
|
15
|
+
export interface IWalletMoviment {
|
|
16
|
+
_id: Types.ObjectId;
|
|
17
|
+
account: Types.ObjectId | IAccount;
|
|
18
|
+
description: string;
|
|
19
|
+
valueMovemented: number;
|
|
20
|
+
fee: number;
|
|
21
|
+
typeMovement: WalletMovimentType;
|
|
22
|
+
balanceBefore: number;
|
|
23
|
+
balanceAfter: number;
|
|
24
|
+
status: WalletMovimentStatus;
|
|
25
|
+
confirmDateTime: Date;
|
|
26
|
+
manual: boolean;
|
|
27
|
+
files: IFile[];
|
|
28
|
+
pagarmeOrder: {
|
|
29
|
+
id: string;
|
|
30
|
+
code: string;
|
|
31
|
+
status: string;
|
|
32
|
+
amount: number;
|
|
33
|
+
gatewayId: string;
|
|
34
|
+
paymentMethod: string;
|
|
35
|
+
};
|
|
36
|
+
pagarmeCharges: {
|
|
37
|
+
id: string;
|
|
38
|
+
code: string;
|
|
39
|
+
status: string;
|
|
40
|
+
amount: number;
|
|
41
|
+
gatewayId: string;
|
|
42
|
+
paymentMethod: string;
|
|
43
|
+
lastTransaction: {
|
|
44
|
+
id: string;
|
|
45
|
+
status: string;
|
|
46
|
+
success: boolean;
|
|
47
|
+
gatewayId: string;
|
|
48
|
+
amount: number;
|
|
49
|
+
qrCode: string;
|
|
50
|
+
qrCodeUrl: string;
|
|
51
|
+
providerTId: string;
|
|
52
|
+
expireDateTime: Date;
|
|
53
|
+
transactionType: string;
|
|
54
|
+
};
|
|
55
|
+
}[];
|
|
56
|
+
createdAtDateTime: Date;
|
|
57
|
+
updatedAtDateTime: Date;
|
|
58
|
+
}
|
|
59
|
+
export declare const WalletMovimentSchema: Schema<IWalletMoviment, import("mongoose").Model<IWalletMoviment, any, any, any, import("mongoose").Document<unknown, any, IWalletMoviment, any> & IWalletMoviment & Required<{
|
|
60
|
+
_id: Types.ObjectId;
|
|
61
|
+
}> & {
|
|
62
|
+
__v: number;
|
|
63
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IWalletMoviment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IWalletMoviment>, {}> & import("mongoose").FlatRecord<IWalletMoviment> & Required<{
|
|
64
|
+
_id: Types.ObjectId;
|
|
65
|
+
}> & {
|
|
66
|
+
__v: number;
|
|
67
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletMovimentSchema = exports.WalletMovimentType = exports.WalletMovimentStatus = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const File_1 = require("./File");
|
|
6
|
+
var WalletMovimentStatus;
|
|
7
|
+
(function (WalletMovimentStatus) {
|
|
8
|
+
WalletMovimentStatus["PENDING"] = "PENDING";
|
|
9
|
+
WalletMovimentStatus["COMPLETED"] = "COMPLETED";
|
|
10
|
+
WalletMovimentStatus["CANCELLED"] = "CANCELLED";
|
|
11
|
+
})(WalletMovimentStatus || (exports.WalletMovimentStatus = WalletMovimentStatus = {}));
|
|
12
|
+
var WalletMovimentType;
|
|
13
|
+
(function (WalletMovimentType) {
|
|
14
|
+
WalletMovimentType["DEPOSIT"] = "DEPOSIT";
|
|
15
|
+
WalletMovimentType["WITHDRAW"] = "WITHDRAW";
|
|
16
|
+
WalletMovimentType["BUY_TICKET"] = "BUY_TICKET";
|
|
17
|
+
WalletMovimentType["AWARD"] = "AWARD";
|
|
18
|
+
})(WalletMovimentType || (exports.WalletMovimentType = WalletMovimentType = {}));
|
|
19
|
+
exports.WalletMovimentSchema = new mongoose_1.Schema({
|
|
20
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
21
|
+
description: { type: String, required: true },
|
|
22
|
+
valueMovemented: { type: Number, required: true },
|
|
23
|
+
fee: { type: Number, required: false },
|
|
24
|
+
typeMovement: { type: String, required: true, enum: WalletMovimentType },
|
|
25
|
+
balanceBefore: { type: Number, required: true },
|
|
26
|
+
balanceAfter: { type: Number, required: true },
|
|
27
|
+
confirmDateTime: { type: Date, required: false },
|
|
28
|
+
status: { type: String, required: true, enum: WalletMovimentStatus },
|
|
29
|
+
files: { type: [File_1.FileSchema], required: false },
|
|
30
|
+
manual: { type: Boolean, required: false },
|
|
31
|
+
pagarmeOrder: {
|
|
32
|
+
type: {
|
|
33
|
+
id: { type: String, required: false },
|
|
34
|
+
code: { type: String, required: false },
|
|
35
|
+
status: { type: String, required: false },
|
|
36
|
+
amount: { type: Number, required: false },
|
|
37
|
+
gatewayId: { type: String, required: false },
|
|
38
|
+
paymentMethod: { type: String, required: false },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
pagarmeCharges: {
|
|
42
|
+
type: [{
|
|
43
|
+
id: { type: String, required: false },
|
|
44
|
+
code: { type: String, required: false },
|
|
45
|
+
status: { type: String, required: false },
|
|
46
|
+
amount: { type: Number, required: false },
|
|
47
|
+
gatewayId: { type: String, required: false },
|
|
48
|
+
paymentMethod: { type: String, required: false },
|
|
49
|
+
lastTransaction: {
|
|
50
|
+
id: { type: String, required: false },
|
|
51
|
+
status: { type: String, required: false },
|
|
52
|
+
success: { type: Boolean, required: false },
|
|
53
|
+
gatewayId: { type: String, required: false },
|
|
54
|
+
amount: { type: Number, required: false },
|
|
55
|
+
qrCode: { type: String, required: false },
|
|
56
|
+
qrCodeUrl: { type: String, required: false },
|
|
57
|
+
providerTId: { type: String, required: false },
|
|
58
|
+
expireDateTime: { type: Date, required: false },
|
|
59
|
+
transactionType: { type: String, required: false },
|
|
60
|
+
}
|
|
61
|
+
}],
|
|
62
|
+
required: false,
|
|
63
|
+
},
|
|
64
|
+
}, {
|
|
65
|
+
timestamps: {
|
|
66
|
+
createdAt: "createdAtDateTime",
|
|
67
|
+
updatedAt: "updatedAtDateTime"
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
exports.WalletMovimentSchema.index({ account: 1 });
|
|
71
|
+
exports.WalletMovimentSchema.index({ status: 1 });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./Access";
|
|
2
|
+
export * from "./Account";
|
|
3
|
+
export * from "./AccountDeletionRequest";
|
|
4
|
+
export * from "./AdminComunication";
|
|
5
|
+
export * from "./AdminEventComunication";
|
|
6
|
+
export * from "./AdminTemplateEmail";
|
|
7
|
+
export * from "./AdminTemplatePush";
|
|
8
|
+
export * from "./Challenge";
|
|
9
|
+
export * from "./ChallengeRound";
|
|
10
|
+
export * from "./Championship";
|
|
11
|
+
export * from "./ChampionshipClassification";
|
|
12
|
+
export * from "./ChampionshipMatch";
|
|
13
|
+
export * from "./ChampionshipPhase";
|
|
14
|
+
export * from "./ChampionshipRound";
|
|
15
|
+
export * from "./File";
|
|
16
|
+
export * from "./Team";
|
|
17
|
+
export * from "./Ticket";
|
|
18
|
+
export * from "./TicketGuess";
|
|
19
|
+
export * from "./TicketOrder";
|
|
20
|
+
export * from "./WalletMoviment";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Access"), exports);
|
|
18
|
+
__exportStar(require("./Account"), exports);
|
|
19
|
+
__exportStar(require("./AccountDeletionRequest"), exports);
|
|
20
|
+
__exportStar(require("./AdminComunication"), exports);
|
|
21
|
+
__exportStar(require("./AdminEventComunication"), exports);
|
|
22
|
+
__exportStar(require("./AdminTemplateEmail"), exports);
|
|
23
|
+
__exportStar(require("./AdminTemplatePush"), exports);
|
|
24
|
+
__exportStar(require("./Challenge"), exports);
|
|
25
|
+
__exportStar(require("./ChallengeRound"), exports);
|
|
26
|
+
__exportStar(require("./Championship"), exports);
|
|
27
|
+
__exportStar(require("./ChampionshipClassification"), exports);
|
|
28
|
+
__exportStar(require("./ChampionshipMatch"), exports);
|
|
29
|
+
__exportStar(require("./ChampionshipPhase"), exports);
|
|
30
|
+
__exportStar(require("./ChampionshipRound"), exports);
|
|
31
|
+
__exportStar(require("./File"), exports);
|
|
32
|
+
__exportStar(require("./Team"), exports);
|
|
33
|
+
__exportStar(require("./Ticket"), exports);
|
|
34
|
+
__exportStar(require("./TicketGuess"), exports);
|
|
35
|
+
__exportStar(require("./TicketOrder"), exports);
|
|
36
|
+
__exportStar(require("./WalletMoviment"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status da rodada no campeonato.
|
|
3
|
+
* IN_HOMOLOGATION = fechamento da rodada no campeonato calculou vencedores e atualizou ChallengeRound.matches; aguarda homologação no desafio.
|
|
4
|
+
* FINISHED = rodada encerrada; desafio não pode usar como rodada mínima uma rodada já FINISHED.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ChallengeRoundStatus {
|
|
7
|
+
CANCELLED = "CANCELLED",
|
|
8
|
+
SCHEDULED = "SCHEDULED",
|
|
9
|
+
OPEN_TO_GUESS = "OPEN_TO_GUESS",
|
|
10
|
+
CLOSED_TO_GUESS = "CLOSED_TO_GUESS",
|
|
11
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
12
|
+
IN_HOMOLOGATION = "IN_HOMOLOGATION",
|
|
13
|
+
FINISHED = "FINISHED"
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChallengeRoundStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Status da rodada no campeonato.
|
|
6
|
+
* IN_HOMOLOGATION = fechamento da rodada no campeonato calculou vencedores e atualizou ChallengeRound.matches; aguarda homologação no desafio.
|
|
7
|
+
* FINISHED = rodada encerrada; desafio não pode usar como rodada mínima uma rodada já FINISHED.
|
|
8
|
+
*/
|
|
9
|
+
var ChallengeRoundStatus;
|
|
10
|
+
(function (ChallengeRoundStatus) {
|
|
11
|
+
ChallengeRoundStatus["CANCELLED"] = "CANCELLED";
|
|
12
|
+
ChallengeRoundStatus["SCHEDULED"] = "SCHEDULED";
|
|
13
|
+
ChallengeRoundStatus["OPEN_TO_GUESS"] = "OPEN_TO_GUESS";
|
|
14
|
+
ChallengeRoundStatus["CLOSED_TO_GUESS"] = "CLOSED_TO_GUESS";
|
|
15
|
+
ChallengeRoundStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
16
|
+
ChallengeRoundStatus["IN_HOMOLOGATION"] = "IN_HOMOLOGATION";
|
|
17
|
+
ChallengeRoundStatus["FINISHED"] = "FINISHED";
|
|
18
|
+
})(ChallengeRoundStatus || (exports.ChallengeRoundStatus = ChallengeRoundStatus = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChallengeStatus = void 0;
|
|
4
|
+
var ChallengeStatus;
|
|
5
|
+
(function (ChallengeStatus) {
|
|
6
|
+
ChallengeStatus["DRAFT"] = "DRAFT";
|
|
7
|
+
ChallengeStatus["OPEN_TO_BUY_TICKETS"] = "OPEN_TO_BUY_TICKETS";
|
|
8
|
+
ChallengeStatus["RUNNING"] = "RUNNING";
|
|
9
|
+
ChallengeStatus["FINISHED"] = "FINISHED";
|
|
10
|
+
})(ChallengeStatus || (exports.ChallengeStatus = ChallengeStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modo de disputa dos grupos na fase.
|
|
3
|
+
* TODOS_SE_ENFRENTAM_NO_MESMO_GRUPO: os times do mesmo grupo se enfrentam.
|
|
4
|
+
* GRUPO_ENFRENTA_GRUPO: os times enfrentam times de grupos diferentes do seu.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum GroupMatchMode {
|
|
7
|
+
SAME_GROUP = "SAME_GROUP",
|
|
8
|
+
OTHER_GROUPS = "OTHER_GROUPS"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupMatchMode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Modo de disputa dos grupos na fase.
|
|
6
|
+
* TODOS_SE_ENFRENTAM_NO_MESMO_GRUPO: os times do mesmo grupo se enfrentam.
|
|
7
|
+
* GRUPO_ENFRENTA_GRUPO: os times enfrentam times de grupos diferentes do seu.
|
|
8
|
+
*/
|
|
9
|
+
var GroupMatchMode;
|
|
10
|
+
(function (GroupMatchMode) {
|
|
11
|
+
GroupMatchMode["SAME_GROUP"] = "SAME_GROUP";
|
|
12
|
+
GroupMatchMode["OTHER_GROUPS"] = "OTHER_GROUPS";
|
|
13
|
+
})(GroupMatchMode || (exports.GroupMatchMode = GroupMatchMode = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Status do confronto (jogo).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MatchStatus = void 0;
|
|
7
|
+
var MatchStatus;
|
|
8
|
+
(function (MatchStatus) {
|
|
9
|
+
MatchStatus["PENDING"] = "PENDING";
|
|
10
|
+
MatchStatus["SCHEDULED"] = "SCHEDULED";
|
|
11
|
+
MatchStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
12
|
+
MatchStatus["FINISHED"] = "FINISHED";
|
|
13
|
+
MatchStatus["POSTPONED"] = "POSTPONED";
|
|
14
|
+
MatchStatus["CANCELLED"] = "CANCELLED";
|
|
15
|
+
})(MatchStatus || (exports.MatchStatus = MatchStatus = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de modalidade
|
|
3
|
+
*/
|
|
4
|
+
export declare enum Modality {
|
|
5
|
+
SOCCER = "SOCCER",
|
|
6
|
+
BASKETBALL = "BASKETBALL",
|
|
7
|
+
TENNIS = "TENNIS",
|
|
8
|
+
VOLLEYBALL = "VOLLEYBALL",
|
|
9
|
+
HANDBALL = "HANDBALL",
|
|
10
|
+
GOLF = "GOLF",
|
|
11
|
+
BASEBALL = "BASEBALL",
|
|
12
|
+
HOCKEY = "HOCKEY",
|
|
13
|
+
AMERICAN_FOOTBALL = "AMERICAN_FOOTBALL",
|
|
14
|
+
RUGBY = "RUGBY"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tipo de modalidade
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Modality = void 0;
|
|
7
|
+
var Modality;
|
|
8
|
+
(function (Modality) {
|
|
9
|
+
Modality["SOCCER"] = "SOCCER";
|
|
10
|
+
Modality["BASKETBALL"] = "BASKETBALL";
|
|
11
|
+
Modality["TENNIS"] = "TENNIS";
|
|
12
|
+
Modality["VOLLEYBALL"] = "VOLLEYBALL";
|
|
13
|
+
Modality["HANDBALL"] = "HANDBALL";
|
|
14
|
+
Modality["GOLF"] = "GOLF";
|
|
15
|
+
Modality["BASEBALL"] = "BASEBALL";
|
|
16
|
+
Modality["HOCKEY"] = "HOCKEY";
|
|
17
|
+
Modality["AMERICAN_FOOTBALL"] = "AMERICAN_FOOTBALL";
|
|
18
|
+
Modality["RUGBY"] = "RUGBY";
|
|
19
|
+
})(Modality || (exports.Modality = Modality = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhaseType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de disputa de uma fase do campeonato.
|
|
6
|
+
* Cada fase possui apenas um tipo.
|
|
7
|
+
*/
|
|
8
|
+
var PhaseType;
|
|
9
|
+
(function (PhaseType) {
|
|
10
|
+
PhaseType["PONTO_CORRIDO"] = "PONTO_CORRIDO";
|
|
11
|
+
PhaseType["MATA_MATA"] = "MATA_MATA";
|
|
12
|
+
})(PhaseType || (exports.PhaseType = PhaseType = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modo de classificação para a próxima fase (pode ser mais de um).
|
|
3
|
+
* OS_X_PRIMEIROS_DE_CADA_GRUPO: os X primeiros de cada grupo.
|
|
4
|
+
* OS_X_PRIMEIROS_GERAL: os X primeiros na classificação geral.
|
|
5
|
+
* OS_X_MELHORES_X_COLOCADO: os X melhores Yº colocados (ex.: melhores 3º colocados).
|
|
6
|
+
*/
|
|
7
|
+
export declare enum QualificationMode {
|
|
8
|
+
POSITION_INTO_GROUP = "POSITION_INTO_GROUP",
|
|
9
|
+
POSITION_GENERAL = "POSITION_GENERAL"
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QualificationMode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Modo de classificação para a próxima fase (pode ser mais de um).
|
|
6
|
+
* OS_X_PRIMEIROS_DE_CADA_GRUPO: os X primeiros de cada grupo.
|
|
7
|
+
* OS_X_PRIMEIROS_GERAL: os X primeiros na classificação geral.
|
|
8
|
+
* OS_X_MELHORES_X_COLOCADO: os X melhores Yº colocados (ex.: melhores 3º colocados).
|
|
9
|
+
*/
|
|
10
|
+
var QualificationMode;
|
|
11
|
+
(function (QualificationMode) {
|
|
12
|
+
QualificationMode["POSITION_INTO_GROUP"] = "POSITION_INTO_GROUP";
|
|
13
|
+
QualificationMode["POSITION_GENERAL"] = "POSITION_GENERAL";
|
|
14
|
+
})(QualificationMode || (exports.QualificationMode = QualificationMode = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status da rodada no campeonato.
|
|
3
|
+
* IN_HOMOLOGATION = fechamento da rodada no campeonato calculou vencedores e atualizou ChallengeRound.matches; aguarda homologação no desafio.
|
|
4
|
+
* FINISHED = rodada encerrada; desafio não pode usar como rodada mínima uma rodada já FINISHED.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum RoundStatus {
|
|
7
|
+
CANCELLED = "CANCELLED",
|
|
8
|
+
SCHEDULED = "SCHEDULED",
|
|
9
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
10
|
+
IN_HOMOLOGATION = "IN_HOMOLOGATION",
|
|
11
|
+
FINISHED = "FINISHED"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoundStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Status da rodada no campeonato.
|
|
6
|
+
* IN_HOMOLOGATION = fechamento da rodada no campeonato calculou vencedores e atualizou ChallengeRound.matches; aguarda homologação no desafio.
|
|
7
|
+
* FINISHED = rodada encerrada; desafio não pode usar como rodada mínima uma rodada já FINISHED.
|
|
8
|
+
*/
|
|
9
|
+
var RoundStatus;
|
|
10
|
+
(function (RoundStatus) {
|
|
11
|
+
RoundStatus["CANCELLED"] = "CANCELLED";
|
|
12
|
+
RoundStatus["SCHEDULED"] = "SCHEDULED";
|
|
13
|
+
RoundStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
14
|
+
RoundStatus["IN_HOMOLOGATION"] = "IN_HOMOLOGATION";
|
|
15
|
+
RoundStatus["FINISHED"] = "FINISHED";
|
|
16
|
+
})(RoundStatus || (exports.RoundStatus = RoundStatus = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { PhaseType } from "./PhaseType";
|
|
2
|
+
export { RoundStatus } from "./RoundStatus";
|
|
3
|
+
export { MatchStatus } from "./MatchStatus";
|
|
4
|
+
export { Modality } from "./Modality";
|
|
5
|
+
export { GroupMatchMode } from "./GroupMatchMode";
|
|
6
|
+
export { QualificationMode } from "./QualificationMode";
|
|
7
|
+
export { ChallengeStatus } from "./ChallengeStatus";
|
|
8
|
+
export { ChallengeRoundStatus } from "./ChallengeRoundStatus";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChallengeRoundStatus = exports.ChallengeStatus = exports.QualificationMode = exports.GroupMatchMode = exports.Modality = exports.MatchStatus = exports.RoundStatus = exports.PhaseType = void 0;
|
|
4
|
+
var PhaseType_1 = require("./PhaseType");
|
|
5
|
+
Object.defineProperty(exports, "PhaseType", { enumerable: true, get: function () { return PhaseType_1.PhaseType; } });
|
|
6
|
+
var RoundStatus_1 = require("./RoundStatus");
|
|
7
|
+
Object.defineProperty(exports, "RoundStatus", { enumerable: true, get: function () { return RoundStatus_1.RoundStatus; } });
|
|
8
|
+
var MatchStatus_1 = require("./MatchStatus");
|
|
9
|
+
Object.defineProperty(exports, "MatchStatus", { enumerable: true, get: function () { return MatchStatus_1.MatchStatus; } });
|
|
10
|
+
var Modality_1 = require("./Modality");
|
|
11
|
+
Object.defineProperty(exports, "Modality", { enumerable: true, get: function () { return Modality_1.Modality; } });
|
|
12
|
+
var GroupMatchMode_1 = require("./GroupMatchMode");
|
|
13
|
+
Object.defineProperty(exports, "GroupMatchMode", { enumerable: true, get: function () { return GroupMatchMode_1.GroupMatchMode; } });
|
|
14
|
+
var QualificationMode_1 = require("./QualificationMode");
|
|
15
|
+
Object.defineProperty(exports, "QualificationMode", { enumerable: true, get: function () { return QualificationMode_1.QualificationMode; } });
|
|
16
|
+
var ChallengeStatus_1 = require("./ChallengeStatus");
|
|
17
|
+
Object.defineProperty(exports, "ChallengeStatus", { enumerable: true, get: function () { return ChallengeStatus_1.ChallengeStatus; } });
|
|
18
|
+
var ChallengeRoundStatus_1 = require("./ChallengeRoundStatus");
|
|
19
|
+
Object.defineProperty(exports, "ChallengeRoundStatus", { enumerable: true, get: function () { return ChallengeRoundStatus_1.ChallengeRoundStatus; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./utils";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CASE_SENSITIVE = exports.generateCode = void 0;
|
|
37
|
+
const crypto = __importStar(require("crypto"));
|
|
38
|
+
const generateCode = (length, uppercase = CASE_SENSITIVE.LOWER_CASE, prefix = "") => {
|
|
39
|
+
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
40
|
+
const charsetLength = charset.length;
|
|
41
|
+
const randomBytesBuffer = crypto.randomBytes(length);
|
|
42
|
+
let code = prefix;
|
|
43
|
+
// Converte cada byte aleatório em um caractere alfanumérico
|
|
44
|
+
for (let i = 0; i < length; i++) {
|
|
45
|
+
const randomIndex = randomBytesBuffer[i] % charsetLength;
|
|
46
|
+
code += charset[randomIndex];
|
|
47
|
+
}
|
|
48
|
+
// const code = `${prefix}${crypto.randomBytes(length).toString("hex")}`
|
|
49
|
+
if (uppercase === CASE_SENSITIVE.UPPER_CASE) {
|
|
50
|
+
return code.toUpperCase();
|
|
51
|
+
}
|
|
52
|
+
return code;
|
|
53
|
+
};
|
|
54
|
+
exports.generateCode = generateCode;
|
|
55
|
+
var CASE_SENSITIVE;
|
|
56
|
+
(function (CASE_SENSITIVE) {
|
|
57
|
+
CASE_SENSITIVE[CASE_SENSITIVE["UPPER_CASE"] = 0] = "UPPER_CASE";
|
|
58
|
+
CASE_SENSITIVE[CASE_SENSITIVE["LOWER_CASE"] = 1] = "LOWER_CASE";
|
|
59
|
+
})(CASE_SENSITIVE || (exports.CASE_SENSITIVE = CASE_SENSITIVE = {}));
|