c2-climbing-x 1.0.21 → 1.0.23

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.
@@ -1,6 +1,7 @@
1
1
  import { Schema, Types } from "mongoose";
2
2
  import { IChampionship } from "./Championship";
3
3
  import { IChampionshipRound } from "./ChampionshipRound";
4
+ import { ChallengeStatus } from "../types/ChallengeStatus";
4
5
  export interface IChallenge {
5
6
  _id: Types.ObjectId;
6
7
  name: string;
@@ -11,6 +12,7 @@ export interface IChallenge {
11
12
  roundEnd: IChampionshipRound;
12
13
  createdAtDateTime: Date;
13
14
  updatedAtDateTime: Date;
15
+ status: ChallengeStatus;
14
16
  }
15
17
  export declare const ChallengeSchema: Schema<IChallenge, import("mongoose").Model<IChallenge, any, any, any, import("mongoose").Document<unknown, any, IChallenge, any> & IChallenge & Required<{
16
18
  _id: Types.ObjectId;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChallengeSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
+ const ChallengeStatus_1 = require("../types/ChallengeStatus");
5
6
  exports.ChallengeSchema = new mongoose_1.Schema({
6
7
  name: { type: String, required: true },
7
8
  slug: { type: String, required: true },
@@ -12,7 +13,8 @@ exports.ChallengeSchema = new mongoose_1.Schema({
12
13
  required: true
13
14
  },
14
15
  roundStart: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-round", required: true },
15
- roundEnd: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-round", required: true }
16
+ roundEnd: { type: mongoose_1.Schema.Types.ObjectId, ref: "championship-round", required: true },
17
+ status: { type: String, enum: ChallengeStatus_1.ChallengeStatus, default: ChallengeStatus_1.ChallengeStatus.PENDING }
16
18
  }, {
17
19
  timestamps: {
18
20
  createdAt: "createdAtDateTime",
@@ -2,9 +2,11 @@ import { Schema, Types } from "mongoose";
2
2
  import { IChallenge } from "./Challenge";
3
3
  import { IChampionshipMatch } from "./ChampionshipMatch";
4
4
  import { IChampionshipRound } from "./ChampionshipRound";
5
+ import { ITeam } from "./Team";
5
6
  export interface IChallengeMatch {
6
7
  match: Types.ObjectId | IChampionshipMatch;
7
8
  enabled: boolean;
9
+ teamWinner?: Types.ObjectId | ITeam;
8
10
  }
9
11
  export interface IChallengeRound {
10
12
  _id: Types.ObjectId;
@@ -5,6 +5,7 @@ const mongoose_1 = require("mongoose");
5
5
  exports.ChallengeMatchSchema = new mongoose_1.Schema({
6
6
  match: { type: mongoose_1.Schema.Types.ObjectId, ref: "match", required: true },
7
7
  enabled: { type: Boolean, required: true, default: true },
8
+ teamWinner: { type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: false }
8
9
  }, { _id: false });
9
10
  exports.ChallengeRoundSchema = new mongoose_1.Schema({
10
11
  challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
@@ -12,4 +13,9 @@ exports.ChallengeRoundSchema = new mongoose_1.Schema({
12
13
  matches: [{ type: exports.ChallengeMatchSchema }],
13
14
  enabled: { type: Boolean, required: true, default: true },
14
15
  sequenceOrder: { type: Number, required: false }
15
- }, { _id: false });
16
+ }, {
17
+ timestamps: {
18
+ createdAt: "createdAtDateTime",
19
+ updatedAt: "updatedAtDateTime"
20
+ }
21
+ });
@@ -0,0 +1,5 @@
1
+ export declare enum ChallengeStatus {
2
+ PENDING = "PENDING",
3
+ ACTIVE = "ACTIVE",
4
+ COMPLETED = "COMPLETED"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChallengeStatus = void 0;
4
+ var ChallengeStatus;
5
+ (function (ChallengeStatus) {
6
+ ChallengeStatus["PENDING"] = "PENDING";
7
+ ChallengeStatus["ACTIVE"] = "ACTIVE";
8
+ ChallengeStatus["COMPLETED"] = "COMPLETED";
9
+ })(ChallengeStatus || (exports.ChallengeStatus = ChallengeStatus = {}));
@@ -4,3 +4,4 @@ export { MatchStatus } from "./MatchStatus";
4
4
  export { Modality } from "./Modality";
5
5
  export { GroupMatchMode } from "./GroupMatchMode";
6
6
  export { QualificationMode } from "./QualificationMode";
7
+ export { ChallengeStatus } from "./ChallengeStatus";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QualificationMode = exports.GroupMatchMode = exports.Modality = exports.MatchStatus = exports.RoundStatus = exports.PhaseType = void 0;
3
+ exports.ChallengeStatus = exports.QualificationMode = exports.GroupMatchMode = exports.Modality = exports.MatchStatus = exports.RoundStatus = exports.PhaseType = void 0;
4
4
  var PhaseType_1 = require("./PhaseType");
5
5
  Object.defineProperty(exports, "PhaseType", { enumerable: true, get: function () { return PhaseType_1.PhaseType; } });
6
6
  var RoundStatus_1 = require("./RoundStatus");
@@ -13,3 +13,5 @@ var GroupMatchMode_1 = require("./GroupMatchMode");
13
13
  Object.defineProperty(exports, "GroupMatchMode", { enumerable: true, get: function () { return GroupMatchMode_1.GroupMatchMode; } });
14
14
  var QualificationMode_1 = require("./QualificationMode");
15
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; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-climbing-x",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
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",