c2-climbing-x 1.0.23 → 1.0.25
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/Account.d.ts +18 -0
- package/dist/models/Account.js +26 -0
- package/dist/models/Ticket.d.ts +25 -0
- package/dist/models/Ticket.js +18 -0
- package/dist/models/TicketGuess.d.ts +25 -0
- package/dist/models/TicketGuess.js +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Model, Types } from "mongoose";
|
|
2
|
+
export interface IAccount {
|
|
3
|
+
_id: Types.ObjectId;
|
|
4
|
+
name: string;
|
|
5
|
+
nickName: string;
|
|
6
|
+
socialId: string;
|
|
7
|
+
emailAccess: string;
|
|
8
|
+
passwordAccess: string;
|
|
9
|
+
salt: string;
|
|
10
|
+
phones: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
active: boolean;
|
|
15
|
+
createdAtDateTime: Date;
|
|
16
|
+
updatedAtDateTime: Date;
|
|
17
|
+
}
|
|
18
|
+
export declare const AccountModel: Model<any>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const AccountSchema = new mongoose_1.Schema({
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
nickName: { type: String, required: true },
|
|
8
|
+
socialId: { type: String, required: true },
|
|
9
|
+
emailAccess: { type: String, required: true },
|
|
10
|
+
passwordAccess: { type: String, required: true },
|
|
11
|
+
salt: { type: String, required: true },
|
|
12
|
+
phones: { type: [{ label: String, value: String }], required: true },
|
|
13
|
+
active: { type: Boolean, required: true, default: true }
|
|
14
|
+
}, {
|
|
15
|
+
timestamps: {
|
|
16
|
+
createdAt: "createdAtDateTime",
|
|
17
|
+
updatedAt: "updatedAtDateTime"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
AccountSchema.index({ name: 1 }, { unique: false });
|
|
21
|
+
AccountSchema.index({ nickName: 1 }, { unique: true });
|
|
22
|
+
AccountSchema.index({ socialId: 1 }, { unique: false });
|
|
23
|
+
AccountSchema.index({ emailAccess: 1 }, { unique: true });
|
|
24
|
+
AccountSchema.index({ phones: 1 }, { unique: false });
|
|
25
|
+
AccountSchema.index({ active: 1 }, { unique: false });
|
|
26
|
+
exports.AccountModel = (0, mongoose_1.model)("account", AccountSchema);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IChallenge } from "./Challenge";
|
|
4
|
+
export declare enum TicketStatus {
|
|
5
|
+
READY = "READY",
|
|
6
|
+
SCALLING = "SCALLING",
|
|
7
|
+
DROPPED = "DROPPED"
|
|
8
|
+
}
|
|
9
|
+
export interface ITicket {
|
|
10
|
+
_id: Types.ObjectId;
|
|
11
|
+
account: Types.ObjectId | IAccount;
|
|
12
|
+
challenge: Types.ObjectId | IChallenge;
|
|
13
|
+
status: TicketStatus;
|
|
14
|
+
createdAtDateTime: Date;
|
|
15
|
+
updatedAtDateTime: Date;
|
|
16
|
+
}
|
|
17
|
+
export declare const TicketSchema: Schema<ITicket, import("mongoose").Model<ITicket, any, any, any, import("mongoose").Document<unknown, any, ITicket, any> & ITicket & Required<{
|
|
18
|
+
_id: Types.ObjectId;
|
|
19
|
+
}> & {
|
|
20
|
+
__v: number;
|
|
21
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITicket, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITicket>, {}> & import("mongoose").FlatRecord<ITicket> & Required<{
|
|
22
|
+
_id: Types.ObjectId;
|
|
23
|
+
}> & {
|
|
24
|
+
__v: number;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketSchema = exports.TicketStatus = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
var TicketStatus;
|
|
6
|
+
(function (TicketStatus) {
|
|
7
|
+
TicketStatus["READY"] = "READY";
|
|
8
|
+
TicketStatus["SCALLING"] = "SCALLING";
|
|
9
|
+
TicketStatus["DROPPED"] = "DROPPED";
|
|
10
|
+
})(TicketStatus || (exports.TicketStatus = TicketStatus = {}));
|
|
11
|
+
exports.TicketSchema = new mongoose_1.Schema({
|
|
12
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
13
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
14
|
+
status: { type: String, required: true, enum: TicketStatus },
|
|
15
|
+
});
|
|
16
|
+
exports.TicketSchema.index({ account: 1 });
|
|
17
|
+
exports.TicketSchema.index({ challenge: 1 });
|
|
18
|
+
exports.TicketSchema.index({ status: 1 });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IAccount } from "./Account";
|
|
3
|
+
import { IChallenge } from "./Challenge";
|
|
4
|
+
import { ITeam } from "./Team";
|
|
5
|
+
import { IChallengeRound } from "./ChallengeRound";
|
|
6
|
+
import { ITicket } from "./Ticket";
|
|
7
|
+
export interface ITicketGuess {
|
|
8
|
+
_id: Types.ObjectId;
|
|
9
|
+
account: Types.ObjectId | IAccount;
|
|
10
|
+
challenge: Types.ObjectId | IChallenge;
|
|
11
|
+
challengeRound: Types.ObjectId | IChallengeRound;
|
|
12
|
+
ticket: Types.ObjectId | ITicket;
|
|
13
|
+
guess: Types.ObjectId | ITeam;
|
|
14
|
+
createdAtDateTime: Date;
|
|
15
|
+
updatedAtDateTime: Date;
|
|
16
|
+
}
|
|
17
|
+
export declare const TicketGuessSchema: Schema<ITicketGuess, import("mongoose").Model<ITicketGuess, any, any, any, import("mongoose").Document<unknown, any, ITicketGuess, any> & ITicketGuess & Required<{
|
|
18
|
+
_id: Types.ObjectId;
|
|
19
|
+
}> & {
|
|
20
|
+
__v: number;
|
|
21
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ITicketGuess, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ITicketGuess>, {}> & import("mongoose").FlatRecord<ITicketGuess> & Required<{
|
|
22
|
+
_id: Types.ObjectId;
|
|
23
|
+
}> & {
|
|
24
|
+
__v: number;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketGuessSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.TicketGuessSchema = new mongoose_1.Schema({
|
|
6
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
|
|
7
|
+
challenge: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge", required: true },
|
|
8
|
+
challengeRound: { type: mongoose_1.Schema.Types.ObjectId, ref: "challenge-round", required: true },
|
|
9
|
+
ticket: { type: mongoose_1.Schema.Types.ObjectId, ref: "ticket", required: true },
|
|
10
|
+
guess: { type: mongoose_1.Schema.Types.ObjectId, ref: "team", required: true },
|
|
11
|
+
}, {
|
|
12
|
+
timestamps: {
|
|
13
|
+
createdAt: "createdAtDateTime",
|
|
14
|
+
updatedAt: "updatedAtDateTime"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
exports.TicketGuessSchema.index({ account: 1 });
|
|
18
|
+
exports.TicketGuessSchema.index({ challenge: 1 });
|
|
19
|
+
exports.TicketGuessSchema.index({ challengeRound: 1 });
|
|
20
|
+
exports.TicketGuessSchema.index({ ticket: 1 });
|
|
21
|
+
exports.TicketGuessSchema.index({ team: 1 });
|
package/package.json
CHANGED