c2-climbing-x 1.0.37 → 1.0.39

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.
@@ -0,0 +1,31 @@
1
+ import { Schema, Types } from "mongoose";
2
+ import { IChampionship } from "./Championship";
3
+ import { IChampionshipPhase, IQualifiedsSlots } from "./ChampionshipPhase";
4
+ import { ITeam } from "./Team";
5
+ export interface IChampionshipClassification {
6
+ _id: Types.ObjectId;
7
+ slot: Types.ObjectId | IQualifiedsSlots;
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: true },
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, team: 1 }, { unique: true });
@@ -25,6 +25,7 @@ export interface IChampionshipPhase {
25
25
  updatedAtDateTime: Date;
26
26
  }
27
27
  export interface IQualifiedsSlots {
28
+ _id: Types.ObjectId;
28
29
  label: string;
29
30
  team: Types.ObjectId | ITeam;
30
31
  }
@@ -39,13 +40,13 @@ export interface IQualifiedRule {
39
40
  limit: number;
40
41
  label: string;
41
42
  }
42
- export declare const QualifiedsSlotsSchema: Schema<IQualifiedsSlots, import("mongoose").Model<IQualifiedsSlots, any, any, any, import("mongoose").Document<unknown, any, IQualifiedsSlots, any> & IQualifiedsSlots & {
43
+ export declare const QualifiedsSlotsSchema: Schema<IQualifiedsSlots, import("mongoose").Model<IQualifiedsSlots, any, any, any, import("mongoose").Document<unknown, any, IQualifiedsSlots, any> & IQualifiedsSlots & Required<{
43
44
  _id: Types.ObjectId;
44
- } & {
45
+ }> & {
45
46
  __v: number;
46
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IQualifiedsSlots, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IQualifiedsSlots>, {}> & import("mongoose").FlatRecord<IQualifiedsSlots> & {
47
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IQualifiedsSlots, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IQualifiedsSlots>, {}> & import("mongoose").FlatRecord<IQualifiedsSlots> & Required<{
47
48
  _id: Types.ObjectId;
48
- } & {
49
+ }> & {
49
50
  __v: number;
50
51
  }>;
51
52
  export declare const GroupSchema: Schema<IGroup, import("mongoose").Model<IGroup, any, any, any, import("mongoose").Document<unknown, any, IGroup, any> & IGroup & {
@@ -5,9 +5,10 @@ const mongoose_1 = require("mongoose");
5
5
  const GroupMatchMode_1 = require("../types/GroupMatchMode");
6
6
  const QualificationMode_1 = require("../types/QualificationMode");
7
7
  exports.QualifiedsSlotsSchema = new mongoose_1.Schema({
8
+ _id: { type: mongoose_1.Schema.Types.ObjectId, default: () => new mongoose_1.Types.ObjectId() },
8
9
  label: { type: String, required: true },
9
10
  team: { type: mongoose_1.Schema.Types.ObjectId, ref: "team" },
10
- }, { _id: false });
11
+ });
11
12
  exports.GroupSchema = new mongoose_1.Schema({
12
13
  name: { type: String, required: true },
13
14
  slots: { type: [exports.QualifiedsSlotsSchema], required: true, default: [] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-climbing-x",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
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",