c2-desafiox 1.0.124 → 1.0.126
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/models/AdminAccount.d.ts +39 -0
- package/dist/models/AdminAccount.js +29 -0
- package/dist/models/Challenge.d.ts +2 -12
- package/dist/models/Challenge.js +2 -3
- package/dist/models/Ticket.d.ts +1 -0
- package/dist/models/Ticket.js +1 -0
- package/dist/models/TicketGuess.d.ts +3 -1
- package/dist/models/TicketGuess.js +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IFile } from "./File";
|
|
3
|
+
export interface IGoogleData {
|
|
4
|
+
accountId: string;
|
|
5
|
+
sub: string;
|
|
6
|
+
email: string;
|
|
7
|
+
emailVerified: boolean;
|
|
8
|
+
name: string;
|
|
9
|
+
familyName: string;
|
|
10
|
+
givenName: string;
|
|
11
|
+
picture: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IAccount {
|
|
14
|
+
_id: Types.ObjectId;
|
|
15
|
+
name: string;
|
|
16
|
+
emailAccess: string;
|
|
17
|
+
passwordAccess?: string;
|
|
18
|
+
salt?: string;
|
|
19
|
+
phones: {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
active: boolean;
|
|
24
|
+
image?: IFile;
|
|
25
|
+
bornDate: Date | null;
|
|
26
|
+
createdAtDateTime: Date;
|
|
27
|
+
updatedAtDateTime: Date;
|
|
28
|
+
checked: boolean;
|
|
29
|
+
tokenConfirmChecking: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare const AccountSchema: Schema<IAccount, import("mongoose").Model<IAccount, any, any, any, import("mongoose").Document<unknown, any, IAccount, any> & IAccount & Required<{
|
|
32
|
+
_id: Types.ObjectId;
|
|
33
|
+
}> & {
|
|
34
|
+
__v: number;
|
|
35
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IAccount, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IAccount>, {}> & import("mongoose").FlatRecord<IAccount> & Required<{
|
|
36
|
+
_id: Types.ObjectId;
|
|
37
|
+
}> & {
|
|
38
|
+
__v: number;
|
|
39
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const File_1 = require("./File");
|
|
6
|
+
exports.AccountSchema = new mongoose_1.Schema({
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
emailAccess: { type: String, required: true },
|
|
9
|
+
passwordAccess: { type: String, required: false },
|
|
10
|
+
salt: { type: String, required: false },
|
|
11
|
+
phones: { type: [{ label: String, value: String }], required: false },
|
|
12
|
+
image: { type: File_1.FileSchema, required: false },
|
|
13
|
+
active: { type: Boolean, required: true, default: true },
|
|
14
|
+
checked: { type: Boolean, required: false, default: false },
|
|
15
|
+
tokenConfirmChecking: { type: String, required: false, default: null },
|
|
16
|
+
bornDate: { type: Date, required: false, default: null },
|
|
17
|
+
}, {
|
|
18
|
+
timestamps: {
|
|
19
|
+
createdAt: "createdAtDateTime",
|
|
20
|
+
updatedAt: "updatedAtDateTime"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.AccountSchema.index({ name: 1 }, { unique: false });
|
|
24
|
+
exports.AccountSchema.index({ emailAccess: 1 }, { unique: true });
|
|
25
|
+
exports.AccountSchema.index({ phones: 1 }, { unique: false });
|
|
26
|
+
exports.AccountSchema.index({ active: 1 }, { unique: false });
|
|
27
|
+
exports.AccountSchema.index({ checked: 1 }, { unique: false });
|
|
28
|
+
exports.AccountSchema.index({ tokenConfirmChecking: 1 }, { unique: false });
|
|
29
|
+
exports.AccountSchema.index({ bornDate: 1 }, { unique: false });
|
|
@@ -7,8 +7,8 @@ import { ChallengeRoundStatus } from "../types/ChallengeRoundStatus";
|
|
|
7
7
|
import { ITicket } from "./Ticket";
|
|
8
8
|
import { IAccount } from "./Account";
|
|
9
9
|
export declare enum ChallengeType {
|
|
10
|
-
SURVIVAL = "SURVIVAL",
|
|
11
|
-
|
|
10
|
+
SURVIVAL = "SURVIVAL",// desafio de sobrevivencia, os participantes indicam palpites de um vencedor para cada rodada
|
|
11
|
+
SCORE_PREDICTOR_POOL = "SCORE_PREDICTOR_POOL"
|
|
12
12
|
}
|
|
13
13
|
export declare enum ChallengeVisibility {
|
|
14
14
|
PUBLIC = "PUBLIC",
|
|
@@ -31,16 +31,6 @@ export interface IChallenge {
|
|
|
31
31
|
thumb: IFile;
|
|
32
32
|
budgetInitial: number;
|
|
33
33
|
budgetAccumulated: number;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
* Use pricing instead
|
|
37
|
-
*/
|
|
38
|
-
ticketValue: number;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated
|
|
41
|
-
* Use pricing instead
|
|
42
|
-
*/
|
|
43
|
-
ticketsLimitDateTime: Date;
|
|
44
34
|
totalTicketsPaid: number;
|
|
45
35
|
totalTicketsInGamming: number;
|
|
46
36
|
ticketsWinners: Types.ObjectId[] | ITicket[];
|
package/dist/models/Challenge.js
CHANGED
|
@@ -5,10 +5,11 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
const ChallengeStatus_1 = require("../types/ChallengeStatus");
|
|
6
6
|
const File_1 = require("./File");
|
|
7
7
|
const ChallengeRoundStatus_1 = require("../types/ChallengeRoundStatus");
|
|
8
|
+
// Determina o tipo de desafio
|
|
8
9
|
var ChallengeType;
|
|
9
10
|
(function (ChallengeType) {
|
|
10
11
|
ChallengeType["SURVIVAL"] = "SURVIVAL";
|
|
11
|
-
ChallengeType["
|
|
12
|
+
ChallengeType["SCORE_PREDICTOR_POOL"] = "SCORE_PREDICTOR_POOL";
|
|
12
13
|
})(ChallengeType || (exports.ChallengeType = ChallengeType = {}));
|
|
13
14
|
var ChallengeVisibility;
|
|
14
15
|
(function (ChallengeVisibility) {
|
|
@@ -36,8 +37,6 @@ exports.ChallengeSchema = new mongoose_1.Schema({
|
|
|
36
37
|
status: { type: String, enum: ChallengeStatus_1.ChallengeStatus, default: ChallengeStatus_1.ChallengeStatus.DRAFT },
|
|
37
38
|
budgetAccumulated: { type: Number, required: true },
|
|
38
39
|
budgetInitial: { type: Number, required: true },
|
|
39
|
-
ticketValue: { type: Number, required: true },
|
|
40
|
-
ticketsLimitDateTime: { type: Date, required: false },
|
|
41
40
|
ticketsWinners: { type: [mongoose_1.Schema.Types.ObjectId], ref: "ticket", required: false },
|
|
42
41
|
roundStartIndex: { type: Number, required: false },
|
|
43
42
|
roundCurrentIndex: { type: Number, required: false },
|
package/dist/models/Ticket.d.ts
CHANGED
package/dist/models/Ticket.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.TicketSchema = new mongoose_1.Schema({
|
|
|
22
22
|
statusFinancial: { type: String, required: true, enum: TicketStatusFinancial },
|
|
23
23
|
ticketOrder: { type: mongoose_1.Schema.Types.ObjectId, ref: "ticket-order", required: true },
|
|
24
24
|
valuePaid: { type: Number, required: true },
|
|
25
|
+
points: { type: Number, required: true, default: 0 },
|
|
25
26
|
}, {
|
|
26
27
|
timestamps: {
|
|
27
28
|
createdAt: "createdAtDateTime",
|
|
@@ -7,7 +7,8 @@ import { ITicket } from "./Ticket";
|
|
|
7
7
|
export declare enum TicketGuessStatus {
|
|
8
8
|
PENDING = "PENDING",
|
|
9
9
|
RIGHT = "RIGHT",
|
|
10
|
-
WRONG = "WRONG"
|
|
10
|
+
WRONG = "WRONG",
|
|
11
|
+
DRAW = "DRAW"
|
|
11
12
|
}
|
|
12
13
|
export interface ITicketGuess {
|
|
13
14
|
_id: Types.ObjectId;
|
|
@@ -18,6 +19,7 @@ export interface ITicketGuess {
|
|
|
18
19
|
guess: Types.ObjectId | ITeam;
|
|
19
20
|
guessStatus: TicketGuessStatus;
|
|
20
21
|
isAutomatic: boolean;
|
|
22
|
+
points: number;
|
|
21
23
|
notes: string;
|
|
22
24
|
createdAtDateTime: Date;
|
|
23
25
|
updatedAtDateTime: Date;
|
|
@@ -7,6 +7,7 @@ var TicketGuessStatus;
|
|
|
7
7
|
TicketGuessStatus["PENDING"] = "PENDING";
|
|
8
8
|
TicketGuessStatus["RIGHT"] = "RIGHT";
|
|
9
9
|
TicketGuessStatus["WRONG"] = "WRONG";
|
|
10
|
+
TicketGuessStatus["DRAW"] = "DRAW";
|
|
10
11
|
})(TicketGuessStatus || (exports.TicketGuessStatus = TicketGuessStatus = {}));
|
|
11
12
|
exports.TicketGuessSchema = new mongoose_1.Schema({
|
|
12
13
|
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
@@ -16,6 +17,7 @@ exports.TicketGuessSchema = new mongoose_1.Schema({
|
|
|
16
17
|
guess: { type: mongoose_1.Schema.Types.ObjectId, ref: "team" },
|
|
17
18
|
guessStatus: { type: String, enum: TicketGuessStatus, default: TicketGuessStatus.PENDING },
|
|
18
19
|
isAutomatic: { type: Boolean, default: false },
|
|
20
|
+
points: { type: Number, default: 0 },
|
|
19
21
|
notes: { type: String, default: "" },
|
|
20
22
|
}, {
|
|
21
23
|
timestamps: {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-desafiox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
4
4
|
"description": "Modelagem TypeScript/Mongoose para o jogo Escalada X (times, campeonatos, fases, rodadas, confrontos, desafios)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc --skipLibCheck",
|
|
9
|
-
"preversion": "
|
|
8
|
+
"build": "tsc -p tsconfig.json --skipLibCheck",
|
|
9
|
+
"preversion": "npm run build",
|
|
10
10
|
"postversion": "git push && git push --tags && npm publish",
|
|
11
11
|
"publish-patch": "npm version patch --force",
|
|
12
12
|
"publish-minor": "npm version minor",
|