c2-desafiox 1.0.120 → 1.0.122

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.
@@ -5,6 +5,15 @@ import { IChampionshipRound } from "./ChampionshipRound";
5
5
  import { IFile } from "./File";
6
6
  import { ChallengeRoundStatus } from "../types/ChallengeRoundStatus";
7
7
  import { ITicket } from "./Ticket";
8
+ export declare enum ChallengeType {
9
+ SURVIVAL = "SURVIVAL",
10
+ RANKING = "RANKING"
11
+ }
12
+ export interface IChallengePricing {
13
+ initDateTime: Date;
14
+ endDateTime: Date;
15
+ value: number;
16
+ }
8
17
  export interface IChallenge {
9
18
  _id: Types.ObjectId;
10
19
  name: string;
@@ -17,7 +26,15 @@ export interface IChallenge {
17
26
  thumb: IFile;
18
27
  budgetInitial: number;
19
28
  budgetAccumulated: number;
29
+ /**
30
+ * @deprecated
31
+ * Use pricing instead
32
+ */
20
33
  ticketValue: number;
34
+ /**
35
+ * @deprecated
36
+ * Use pricing instead
37
+ */
21
38
  ticketsLimitDateTime: Date;
22
39
  totalTicketsPaid: number;
23
40
  totalTicketsInGamming: number;
@@ -29,7 +46,18 @@ export interface IChallenge {
29
46
  createdAtDateTime: Date;
30
47
  updatedAtDateTime: Date;
31
48
  status: ChallengeStatus;
49
+ type: ChallengeType;
50
+ pricing: IChallengePricing[];
32
51
  }
52
+ export declare const ChallengePricingSchema: Schema<IChallengePricing, import("mongoose").Model<IChallengePricing, any, any, any, import("mongoose").Document<unknown, any, IChallengePricing, any> & IChallengePricing & {
53
+ _id: Types.ObjectId;
54
+ } & {
55
+ __v: number;
56
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IChallengePricing, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IChallengePricing>, {}> & import("mongoose").FlatRecord<IChallengePricing> & {
57
+ _id: Types.ObjectId;
58
+ } & {
59
+ __v: number;
60
+ }>;
33
61
  export declare const ChallengeSchema: Schema<IChallenge, import("mongoose").Model<IChallenge, any, any, any, import("mongoose").Document<unknown, any, IChallenge, any> & IChallenge & Required<{
34
62
  _id: Types.ObjectId;
35
63
  }> & {
@@ -1,10 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChallengeSchema = void 0;
3
+ exports.ChallengeSchema = exports.ChallengePricingSchema = exports.ChallengeType = void 0;
4
4
  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
+ var ChallengeType;
9
+ (function (ChallengeType) {
10
+ ChallengeType["SURVIVAL"] = "SURVIVAL";
11
+ ChallengeType["RANKING"] = "RANKING";
12
+ })(ChallengeType || (exports.ChallengeType = ChallengeType = {}));
13
+ exports.ChallengePricingSchema = new mongoose_1.Schema({
14
+ initDateTime: { type: Date, required: true },
15
+ endDateTime: { type: Date, required: true },
16
+ value: { type: Number, required: true },
17
+ });
8
18
  exports.ChallengeSchema = new mongoose_1.Schema({
9
19
  name: { type: String, required: true },
10
20
  slug: { type: String, required: true },
@@ -30,6 +40,8 @@ exports.ChallengeSchema = new mongoose_1.Schema({
30
40
  roundEndIndex: { type: Number, required: false },
31
41
  totalTicketsPaid: { type: Number, required: false },
32
42
  totalTicketsInGamming: { type: Number, required: false },
43
+ type: { type: String, enum: ChallengeType, required: true, default: ChallengeType.SURVIVAL },
44
+ pricing: { type: [exports.ChallengePricingSchema], required: false },
33
45
  }, {
34
46
  timestamps: {
35
47
  createdAt: "createdAtDateTime",
@@ -0,0 +1,118 @@
1
+ import { Schema, Types } from "mongoose";
2
+ import { IAccount } from "./Account";
3
+ import { IAdminComunication } from "./AdminComunication";
4
+ export declare enum EventComunicationStatus {
5
+ CREATED = "CREATED",
6
+ RUNNING = "RUNNING",
7
+ ERROR = "ERROR",
8
+ DONE = "DONE"
9
+ }
10
+ export declare enum EventComunicationDeliveryStatus {
11
+ CREATED = "CREATED",
12
+ SENT = "SENT",
13
+ DELIVERED = "DELIVERED",
14
+ READ = "READ",
15
+ ERROR = "ERROR"
16
+ }
17
+ export declare enum EventComunicationType {
18
+ PUSH = "PUSH",
19
+ EMAIL = "EMAIL",
20
+ IN_APP = "IN_APP",
21
+ SMS = "SMS",
22
+ WHATSAPP = "WHATSAPP",
23
+ TUTORIAL = "TUTORIAL"
24
+ }
25
+ export interface IEventComunication {
26
+ _id: Types.ObjectId;
27
+ account: Types.ObjectId | IAccount;
28
+ comunication: Types.ObjectId | IAdminComunication;
29
+ content: any;
30
+ type: EventComunicationType;
31
+ statusDelivery: EventComunicationDeliveryStatus;
32
+ status: EventComunicationStatus;
33
+ message?: string;
34
+ createdAtDateTime: Date;
35
+ updatedAtDateTime: Date;
36
+ }
37
+ export declare const EventComunicationSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
38
+ timestamps: {
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ };
42
+ }, {} & {
43
+ type: string;
44
+ account: {
45
+ prototype?: Types.ObjectId | null | undefined;
46
+ cacheHexString?: unknown;
47
+ generate?: {} | null | undefined;
48
+ createFromTime?: {} | null | undefined;
49
+ createFromHexString?: {} | null | undefined;
50
+ createFromBase64?: {} | null | undefined;
51
+ isValid?: {} | null | undefined;
52
+ };
53
+ status: string;
54
+ comunication: {
55
+ prototype?: Types.ObjectId | null | undefined;
56
+ cacheHexString?: unknown;
57
+ generate?: {} | null | undefined;
58
+ createFromTime?: {} | null | undefined;
59
+ createFromHexString?: {} | null | undefined;
60
+ createFromBase64?: {} | null | undefined;
61
+ isValid?: {} | null | undefined;
62
+ };
63
+ statusDelivery: string;
64
+ content: any;
65
+ message?: string | null | undefined;
66
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
67
+ type: string;
68
+ account: {
69
+ prototype?: Types.ObjectId | null | undefined;
70
+ cacheHexString?: unknown;
71
+ generate?: {} | null | undefined;
72
+ createFromTime?: {} | null | undefined;
73
+ createFromHexString?: {} | null | undefined;
74
+ createFromBase64?: {} | null | undefined;
75
+ isValid?: {} | null | undefined;
76
+ };
77
+ status: string;
78
+ comunication: {
79
+ prototype?: Types.ObjectId | null | undefined;
80
+ cacheHexString?: unknown;
81
+ generate?: {} | null | undefined;
82
+ createFromTime?: {} | null | undefined;
83
+ createFromHexString?: {} | null | undefined;
84
+ createFromBase64?: {} | null | undefined;
85
+ isValid?: {} | null | undefined;
86
+ };
87
+ statusDelivery: string;
88
+ content: any;
89
+ message?: string | null | undefined;
90
+ }>, {}> & import("mongoose").FlatRecord<{} & {
91
+ type: string;
92
+ account: {
93
+ prototype?: Types.ObjectId | null | undefined;
94
+ cacheHexString?: unknown;
95
+ generate?: {} | null | undefined;
96
+ createFromTime?: {} | null | undefined;
97
+ createFromHexString?: {} | null | undefined;
98
+ createFromBase64?: {} | null | undefined;
99
+ isValid?: {} | null | undefined;
100
+ };
101
+ status: string;
102
+ comunication: {
103
+ prototype?: Types.ObjectId | null | undefined;
104
+ cacheHexString?: unknown;
105
+ generate?: {} | null | undefined;
106
+ createFromTime?: {} | null | undefined;
107
+ createFromHexString?: {} | null | undefined;
108
+ createFromBase64?: {} | null | undefined;
109
+ isValid?: {} | null | undefined;
110
+ };
111
+ statusDelivery: string;
112
+ content: any;
113
+ message?: string | null | undefined;
114
+ }> & {
115
+ _id: Types.ObjectId;
116
+ } & {
117
+ __v: number;
118
+ }>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventComunicationSchema = exports.EventComunicationType = exports.EventComunicationDeliveryStatus = exports.EventComunicationStatus = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ var EventComunicationStatus;
6
+ (function (EventComunicationStatus) {
7
+ EventComunicationStatus["CREATED"] = "CREATED";
8
+ EventComunicationStatus["RUNNING"] = "RUNNING";
9
+ EventComunicationStatus["ERROR"] = "ERROR";
10
+ EventComunicationStatus["DONE"] = "DONE";
11
+ })(EventComunicationStatus || (exports.EventComunicationStatus = EventComunicationStatus = {}));
12
+ var EventComunicationDeliveryStatus;
13
+ (function (EventComunicationDeliveryStatus) {
14
+ EventComunicationDeliveryStatus["CREATED"] = "CREATED";
15
+ EventComunicationDeliveryStatus["SENT"] = "SENT";
16
+ EventComunicationDeliveryStatus["DELIVERED"] = "DELIVERED";
17
+ EventComunicationDeliveryStatus["READ"] = "READ";
18
+ EventComunicationDeliveryStatus["ERROR"] = "ERROR";
19
+ })(EventComunicationDeliveryStatus || (exports.EventComunicationDeliveryStatus = EventComunicationDeliveryStatus = {}));
20
+ var EventComunicationType;
21
+ (function (EventComunicationType) {
22
+ EventComunicationType["PUSH"] = "PUSH";
23
+ EventComunicationType["EMAIL"] = "EMAIL";
24
+ EventComunicationType["IN_APP"] = "IN_APP";
25
+ EventComunicationType["SMS"] = "SMS";
26
+ EventComunicationType["WHATSAPP"] = "WHATSAPP";
27
+ EventComunicationType["TUTORIAL"] = "TUTORIAL";
28
+ })(EventComunicationType || (exports.EventComunicationType = EventComunicationType = {}));
29
+ exports.EventComunicationSchema = new mongoose_1.Schema({
30
+ account: { type: mongoose_1.Types.ObjectId, ref: "account", required: true },
31
+ comunication: { type: mongoose_1.Types.ObjectId, ref: "admin-comunication", required: true },
32
+ type: { type: String, enum: EventComunicationType, required: true },
33
+ status: { type: String, enum: EventComunicationStatus, required: true, default: EventComunicationStatus.CREATED },
34
+ statusDelivery: { type: String, enum: EventComunicationDeliveryStatus, required: true, default: EventComunicationDeliveryStatus.CREATED },
35
+ content: { type: mongoose_1.Schema.Types.Mixed, required: true },
36
+ message: { type: String, required: false },
37
+ }, {
38
+ timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
39
+ });
40
+ exports.EventComunicationSchema.index({ account: 1 }, { unique: false });
41
+ exports.EventComunicationSchema.index({ account: 1, status: 1 }, { unique: false });
@@ -2,7 +2,7 @@ export * from "./Access";
2
2
  export * from "./Account";
3
3
  export * from "./AccountDeletionRequest";
4
4
  export * from "./AdminComunication";
5
- export * from "./AdminEventComunication";
5
+ export * from "./EventComunication";
6
6
  export * from "./AdminTemplateEmail";
7
7
  export * from "./AdminTemplatePush";
8
8
  export * from "./Challenge";
@@ -18,7 +18,7 @@ __exportStar(require("./Access"), exports);
18
18
  __exportStar(require("./Account"), exports);
19
19
  __exportStar(require("./AccountDeletionRequest"), exports);
20
20
  __exportStar(require("./AdminComunication"), exports);
21
- __exportStar(require("./AdminEventComunication"), exports);
21
+ __exportStar(require("./EventComunication"), exports);
22
22
  __exportStar(require("./AdminTemplateEmail"), exports);
23
23
  __exportStar(require("./AdminTemplatePush"), exports);
24
24
  __exportStar(require("./Challenge"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-desafiox",
3
- "version": "1.0.120",
3
+ "version": "1.0.122",
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",