c2-desafiox 1.0.123 → 1.0.125

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.
@@ -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
- RANKING = "RANKING"
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[];
@@ -55,6 +45,7 @@ export interface IChallenge {
55
45
  visibility: ChallengeVisibility;
56
46
  owner: Types.ObjectId | IAccount;
57
47
  pricing: IChallengePricing[];
48
+ accountsInvited: Types.ObjectId[] | IAccount[];
58
49
  }
59
50
  export declare const ChallengePricingSchema: Schema<IChallengePricing, import("mongoose").Model<IChallengePricing, any, any, any, import("mongoose").Document<unknown, any, IChallengePricing, any> & IChallengePricing & {
60
51
  _id: Types.ObjectId;
@@ -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["RANKING"] = "RANKING";
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 },
@@ -49,6 +48,7 @@ exports.ChallengeSchema = new mongoose_1.Schema({
49
48
  pricing: { type: [exports.ChallengePricingSchema], required: false },
50
49
  visibility: { type: String, enum: ChallengeVisibility, required: true, default: ChallengeVisibility.PUBLIC },
51
50
  owner: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: false },
51
+ accountsInvited: { type: [mongoose_1.Schema.Types.ObjectId], ref: "account", required: false },
52
52
  }, {
53
53
  timestamps: {
54
54
  createdAt: "createdAtDateTime",
@@ -21,6 +21,7 @@ export interface ITicket {
21
21
  statusFinancial: TicketStatusFinancial;
22
22
  ticketOrder: Types.ObjectId | ITicketOrder;
23
23
  valuePaid: number;
24
+ points: number;
24
25
  createdAtDateTime: Date;
25
26
  updatedAtDateTime: Date;
26
27
  }
@@ -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.123",
3
+ "version": "1.0.125",
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": "tsc --skipLibCheck",
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",