gambling-bot-shared 0.1.54 → 1.0.1
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/README.MD +4 -0
- package/dist/{mongoose/atmRequest.schema.d.ts → atm/atmRequest.mongoose.d.ts} +18 -28
- package/dist/atm/index.d.ts +3 -0
- package/dist/{types → atm}/index.js +5 -10
- package/dist/atm/schemas/atm.forms.d.ts +5 -0
- package/dist/atm/schemas/atm.forms.js +11 -0
- package/dist/blackjack/index.d.ts +3 -0
- package/dist/blackjack/index.js +21 -0
- package/dist/bonus/index.d.ts +7 -0
- package/dist/bonus/index.js +23 -0
- package/dist/bonus/schemas/bonus.forms.d.ts +16 -0
- package/dist/bonus/schemas/bonus.forms.js +39 -0
- package/dist/{types → bonus/types}/bonus.d.ts +1 -1
- package/dist/{utils → bonus/utils}/calculateBonusReward.d.ts +1 -1
- package/dist/{utils → bonus/utils}/generateBonusPreview.d.ts +1 -1
- package/dist/{utils → bonus/utils}/normalizeBonusSettings.d.ts +1 -1
- package/dist/{mongoose/blackjackGame.schema.d.ts → casino/blackjackGame.mongoose.d.ts} +19 -29
- package/dist/{constants → casino/constants}/index.d.ts +4 -9
- package/dist/{constants → casino/constants}/index.js +4 -9
- package/dist/{constants → casino/constants}/plinkoConfig.js +1 -1
- package/dist/casino/index.d.ts +12 -0
- package/dist/casino/index.js +30 -0
- package/dist/{schemas/forms.d.ts → casino/schemas/casino.forms.d.ts} +0 -103
- package/dist/casino/schemas/casino.forms.js +80 -0
- package/dist/casino/services/casinoBet.service.d.ts +41 -0
- package/dist/casino/services/casinoBet.service.js +146 -0
- package/dist/casino/types/casinoSettings.d.ts +2 -0
- package/dist/{utils → casino/utils}/calculateRTP.d.ts +1 -1
- package/dist/{utils → casino/utils}/calculateRTP.js +0 -2
- package/dist/{utils → casino/utils}/normalizeCasinoSettings.d.ts +1 -1
- package/dist/{utils → common}/formatters.d.ts +1 -1
- package/dist/{utils → common}/formatters.js +2 -2
- package/dist/common/index.d.ts +4 -0
- package/dist/{server.js → common/index.js} +4 -1
- package/dist/common/zod.d.ts +2 -0
- package/dist/common/zod.js +16 -0
- package/dist/{mongoose/guildConfiguration.schema.d.ts → guild/guildConfiguration.mongoose.d.ts} +16 -26
- package/dist/{mongoose/guildConfiguration.schema.js → guild/guildConfiguration.mongoose.js} +6 -5
- package/dist/guild/index.d.ts +8 -0
- package/dist/guild/index.js +26 -0
- package/dist/guild/schemas/guild.forms.d.ts +68 -0
- package/dist/guild/schemas/guild.forms.js +43 -0
- package/dist/{types → guild/types}/guildConfiguration.d.ts +2 -2
- package/dist/{utils → guild/utils}/normalizeGlobalSettings.d.ts +1 -1
- package/dist/guild/utils/normalizeGlobalSettings.js +46 -0
- package/dist/mongoose/index.d.ts +8 -8
- package/dist/mongoose/index.js +17 -22
- package/dist/predictions/index.d.ts +11 -0
- package/dist/predictions/index.js +29 -0
- package/dist/{mongoose/prediction.schema.d.ts → predictions/prediction.mongoose.d.ts} +14 -24
- package/dist/predictions/schemas/prediction.forms.d.ts +20 -0
- package/dist/predictions/schemas/prediction.forms.js +24 -0
- package/dist/predictions/services/normalizePredictionInput.d.ts +6 -0
- package/dist/predictions/services/normalizePredictionInput.js +53 -0
- package/dist/predictions/services/parsePredictionAutolock.d.ts +9 -0
- package/dist/predictions/services/parsePredictionAutolock.js +20 -0
- package/dist/predictions/services/parsePredictionChoices.d.ts +11 -0
- package/dist/predictions/services/parsePredictionChoices.js +26 -0
- package/dist/predictions/services/prediction.db.d.ts +55 -0
- package/dist/predictions/services/prediction.db.js +72 -0
- package/dist/predictions/services/predictionLifecycle.service.d.ts +25 -0
- package/dist/predictions/services/predictionLifecycle.service.js +133 -0
- package/dist/predictions/services/predictionSummary.d.ts +30 -0
- package/dist/predictions/services/predictionSummary.js +58 -0
- package/dist/predictions/services/types.d.ts +27 -0
- package/dist/raffle/index.d.ts +6 -0
- package/dist/raffle/index.js +24 -0
- package/dist/{mongoose/raffle.schema.d.ts → raffle/raffle.mongoose.d.ts} +19 -32
- package/dist/raffle/schemas/raffle.forms.d.ts +11 -0
- package/dist/raffle/schemas/raffle.forms.js +17 -0
- package/dist/raffle/services/raffle.db.d.ts +51 -0
- package/dist/raffle/services/raffle.db.js +153 -0
- package/dist/raffle/services/raffleLifecycle.service.d.ts +15 -0
- package/dist/raffle/services/raffleLifecycle.service.js +34 -0
- package/dist/raffle/services/types.d.ts +27 -0
- package/dist/{types → raffle/types}/raffle.d.ts +7 -5
- package/dist/transactions/constants/index.d.ts +2 -0
- package/dist/{schemas → transactions/constants}/index.js +2 -1
- package/dist/transactions/index.d.ts +4 -0
- package/dist/{index.js → transactions/index.js} +3 -2
- package/dist/{mongoose/transaction.schema.d.ts → transactions/transaction.mongoose.d.ts} +13 -23
- package/dist/{types → transactions/types}/transaction.d.ts +1 -1
- package/dist/transactions/types/transaction.js +2 -0
- package/dist/user/index.d.ts +2 -0
- package/dist/user/index.js +20 -0
- package/dist/user/types/user.js +2 -0
- package/dist/{mongoose/user.schema.d.ts → user/user.mongoose.d.ts} +12 -22
- package/dist/vip/index.d.ts +3 -0
- package/dist/vip/index.js +21 -0
- package/dist/vip/schemas/vip.forms.d.ts +10 -0
- package/dist/vip/schemas/vip.forms.js +16 -0
- package/dist/vip/types/vipRoom.js +2 -0
- package/dist/{mongoose/vipRoom.schema.d.ts → vip/vipRoom.mongoose.d.ts} +10 -20
- package/package.json +66 -26
- package/dist/index.d.ts +0 -3
- package/dist/schemas/forms.js +0 -173
- package/dist/schemas/index.d.ts +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/types/index.d.ts +0 -11
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/index.js +0 -31
- package/dist/utils/normalizeGlobalSettings.js +0 -45
- /package/dist/{mongoose/atmRequest.schema.js → atm/atmRequest.mongoose.js} +0 -0
- /package/dist/{types → atm/types}/atmRequest.d.ts +0 -0
- /package/dist/{types → atm/types}/atmRequest.js +0 -0
- /package/dist/{constants → bonus/constants}/bonusLimits.d.ts +0 -0
- /package/dist/{constants → bonus/constants}/bonusLimits.js +0 -0
- /package/dist/{types → bonus/types}/bonus.js +0 -0
- /package/dist/{utils → bonus/utils}/bonusStreak.d.ts +0 -0
- /package/dist/{utils → bonus/utils}/bonusStreak.js +0 -0
- /package/dist/{utils → bonus/utils}/calculateBonusReward.js +0 -0
- /package/dist/{utils → bonus/utils}/generateBonusPreview.js +0 -0
- /package/dist/{utils → bonus/utils}/normalizeBonusSettings.js +0 -0
- /package/dist/{mongoose/blackjackGame.schema.js → casino/blackjackGame.mongoose.js} +0 -0
- /package/dist/{constants → casino/constants}/blackjack.d.ts +0 -0
- /package/dist/{constants → casino/constants}/blackjack.js +0 -0
- /package/dist/{constants → casino/constants}/casinoGames.d.ts +0 -0
- /package/dist/{constants → casino/constants}/casinoGames.js +0 -0
- /package/dist/{constants → casino/constants}/defaultConfig.d.ts +0 -0
- /package/dist/{constants → casino/constants}/defaultConfig.js +0 -0
- /package/dist/{constants → casino/constants}/lotteryConfig.d.ts +0 -0
- /package/dist/{constants → casino/constants}/lotteryConfig.js +0 -0
- /package/dist/{constants → casino/constants}/maxSimulations.d.ts +0 -0
- /package/dist/{constants → casino/constants}/maxSimulations.js +0 -0
- /package/dist/{constants → casino/constants}/plinkoConfig.d.ts +0 -0
- /package/dist/{constants → casino/constants}/rouletteConfig.d.ts +0 -0
- /package/dist/{constants → casino/constants}/rouletteConfig.js +0 -0
- /package/dist/{types → casino/types}/blackjackGame.d.ts +0 -0
- /package/dist/{types → casino/types}/blackjackGame.js +0 -0
- /package/dist/{types/guildConfiguration.js → casino/types/casinoSettings.js} +0 -0
- /package/dist/{utils → casino/utils}/normalizeCasinoSettings.js +0 -0
- /package/dist/{utils → casino/utils}/validateBetAmount.d.ts +0 -0
- /package/dist/{utils → casino/utils}/validateBetAmount.js +0 -0
- /package/dist/{utils → casino/utils}/winAnnouncements.d.ts +0 -0
- /package/dist/{utils → casino/utils}/winAnnouncements.js +0 -0
- /package/dist/{utils → common}/generateId.d.ts +0 -0
- /package/dist/{utils → common}/generateId.js +0 -0
- /package/dist/{utils → common}/parseTimeToSeconds.d.ts +0 -0
- /package/dist/{utils → common}/parseTimeToSeconds.js +0 -0
- /package/dist/{constants → guild/constants}/commonTimezones.d.ts +0 -0
- /package/dist/{constants → guild/constants}/commonTimezones.js +0 -0
- /package/dist/{constants → guild/constants}/defaultGlobalSettings.d.ts +0 -0
- /package/dist/{constants → guild/constants}/defaultGlobalSettings.js +0 -0
- /package/dist/{types/prediction.js → guild/types/guildConfiguration.js} +0 -0
- /package/dist/{utils → guild/utils}/globalSettings.d.ts +0 -0
- /package/dist/{utils → guild/utils}/globalSettings.js +0 -0
- /package/dist/{utils → guild/utils}/guildTimezone.d.ts +0 -0
- /package/dist/{utils → guild/utils}/guildTimezone.js +0 -0
- /package/dist/{mongoose/prediction.schema.js → predictions/prediction.mongoose.js} +0 -0
- /package/dist/{types/raffle.js → predictions/services/types.js} +0 -0
- /package/dist/{types → predictions/types}/prediction.d.ts +0 -0
- /package/dist/{types/transaction.js → predictions/types/prediction.js} +0 -0
- /package/dist/{utils → predictions/utils}/validatePredictionBet.d.ts +0 -0
- /package/dist/{utils → predictions/utils}/validatePredictionBet.js +0 -0
- /package/dist/{mongoose/raffle.schema.js → raffle/raffle.mongoose.js} +0 -0
- /package/dist/{types/user.js → raffle/services/types.js} +0 -0
- /package/dist/{types/vipRoom.js → raffle/types/raffle.js} +0 -0
- /package/dist/{constants → transactions/constants}/gameRecordFields.d.ts +0 -0
- /package/dist/{constants → transactions/constants}/gameRecordFields.js +0 -0
- /package/dist/{constants → transactions/constants}/transaction.d.ts +0 -0
- /package/dist/{constants → transactions/constants}/transaction.js +0 -0
- /package/dist/{mongoose/transaction.schema.js → transactions/transaction.mongoose.js} +0 -0
- /package/dist/{types → user/types}/user.d.ts +0 -0
- /package/dist/{mongoose/user.schema.js → user/user.mongoose.js} +0 -0
- /package/dist/{types → vip/types}/vipRoom.d.ts +0 -0
- /package/dist/{mongoose/vipRoom.schema.js → vip/vipRoom.mongoose.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Model } from 'mongoose';
|
|
2
|
+
import type { TRaffle } from '../types/raffle';
|
|
3
|
+
import type { TAddRaffleTickets, TUpsertRaffle } from './types';
|
|
4
|
+
export declare function createRaffleDb(raffleModel: Model<TRaffle>): {
|
|
5
|
+
getRaffleById: ({ raffleId, guildId }: {
|
|
6
|
+
raffleId: string;
|
|
7
|
+
guildId: string;
|
|
8
|
+
}) => Promise<(import("mongoose").Document<unknown, {}, TRaffle, {}, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
9
|
+
_id: import("mongoose").Types.ObjectId;
|
|
10
|
+
} & {
|
|
11
|
+
__v: number;
|
|
12
|
+
} & {
|
|
13
|
+
id: string;
|
|
14
|
+
}) | null>;
|
|
15
|
+
upsertRaffle: ({ guildId, drawId, raffleId, creatorId, channelId, ticketPrice, maxTicketsPerUser, nextDrawAt, drawIntervalMs }: TUpsertRaffle) => Promise<import("mongoose").Document<unknown, {}, TRaffle, {}, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
} & {
|
|
20
|
+
id: string;
|
|
21
|
+
}>;
|
|
22
|
+
addRaffleTickets: ({ raffleId, guildId, userId, tickets, maxTicketsPerUser }: TAddRaffleTickets) => Promise<boolean>;
|
|
23
|
+
cancelRaffleAtomic: ({ raffleId, guildId }: {
|
|
24
|
+
raffleId: string;
|
|
25
|
+
guildId: string;
|
|
26
|
+
}) => Promise<(import("mongoose").Document<unknown, {}, TRaffle, {}, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
27
|
+
_id: import("mongoose").Types.ObjectId;
|
|
28
|
+
} & {
|
|
29
|
+
__v: number;
|
|
30
|
+
} & {
|
|
31
|
+
id: string;
|
|
32
|
+
}) | null>;
|
|
33
|
+
searchRafflesForAutocomplete: ({ guildId, query }: {
|
|
34
|
+
guildId: string;
|
|
35
|
+
query: string;
|
|
36
|
+
}) => Promise<any[]>;
|
|
37
|
+
getRafflesReadyToDraw: () => Promise<(import("mongoose").Document<unknown, {}, TRaffle, {}, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
38
|
+
_id: import("mongoose").Types.ObjectId;
|
|
39
|
+
} & {
|
|
40
|
+
__v: number;
|
|
41
|
+
} & {
|
|
42
|
+
id: string;
|
|
43
|
+
})[]>;
|
|
44
|
+
completeRaffleDraw: ({ raffleId, nextDrawAt, lastDrawAt, drawId }: {
|
|
45
|
+
raffleId: string;
|
|
46
|
+
nextDrawAt: Date;
|
|
47
|
+
lastDrawAt: Date;
|
|
48
|
+
drawId: string;
|
|
49
|
+
}) => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
export type RaffleDb = ReturnType<typeof createRaffleDb>;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRaffleDb = createRaffleDb;
|
|
4
|
+
function createRaffleDb(raffleModel) {
|
|
5
|
+
const getRaffleById = async ({ raffleId, guildId }) => {
|
|
6
|
+
return raffleModel.findOne({ raffleId, guildId });
|
|
7
|
+
};
|
|
8
|
+
const upsertRaffle = async ({ guildId, drawId, raffleId, creatorId, channelId, ticketPrice, maxTicketsPerUser, nextDrawAt, drawIntervalMs }) => {
|
|
9
|
+
return raffleModel.findOneAndUpdate({ raffleId, guildId }, {
|
|
10
|
+
$set: {
|
|
11
|
+
drawId,
|
|
12
|
+
creatorId,
|
|
13
|
+
channelId,
|
|
14
|
+
ticketPrice,
|
|
15
|
+
maxTicketsPerUser,
|
|
16
|
+
nextDrawAt,
|
|
17
|
+
drawIntervalMs
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
upsert: true,
|
|
21
|
+
returnDocument: 'after'
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const addRaffleTickets = async ({ raffleId, guildId, userId, tickets, maxTicketsPerUser }) => {
|
|
25
|
+
const now = new Date();
|
|
26
|
+
const updateExisting = await raffleModel.updateOne({
|
|
27
|
+
raffleId,
|
|
28
|
+
guildId,
|
|
29
|
+
status: 'active',
|
|
30
|
+
nextDrawAt: { $gt: now },
|
|
31
|
+
'participants.userId': userId,
|
|
32
|
+
$expr: {
|
|
33
|
+
$lte: [
|
|
34
|
+
{
|
|
35
|
+
$add: [
|
|
36
|
+
{
|
|
37
|
+
$ifNull: [
|
|
38
|
+
{
|
|
39
|
+
$first: {
|
|
40
|
+
$map: {
|
|
41
|
+
input: {
|
|
42
|
+
$filter: {
|
|
43
|
+
input: '$participants',
|
|
44
|
+
as: 'p',
|
|
45
|
+
cond: { $eq: ['$$p.userId', userId] }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
as: 'p',
|
|
49
|
+
in: '$$p.tickets'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
0
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
tickets
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
maxTicketsPerUser
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}, { $inc: { 'participants.$.tickets': tickets } });
|
|
63
|
+
if (updateExisting.modifiedCount > 0)
|
|
64
|
+
return true;
|
|
65
|
+
const addNew = await raffleModel.updateOne({
|
|
66
|
+
raffleId,
|
|
67
|
+
guildId,
|
|
68
|
+
status: 'active',
|
|
69
|
+
nextDrawAt: { $gt: now },
|
|
70
|
+
participants: { $not: { $elemMatch: { userId } } },
|
|
71
|
+
$expr: {
|
|
72
|
+
$lte: [
|
|
73
|
+
{
|
|
74
|
+
$cond: [{ $gte: [tickets, 0] }, tickets, maxTicketsPerUser]
|
|
75
|
+
},
|
|
76
|
+
maxTicketsPerUser
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}, { $push: { participants: { userId, tickets } } });
|
|
80
|
+
return addNew.modifiedCount > 0;
|
|
81
|
+
};
|
|
82
|
+
const cancelRaffleAtomic = async ({ raffleId, guildId }) => {
|
|
83
|
+
return raffleModel.findOneAndUpdate({ raffleId, guildId, status: { $ne: 'canceled' } }, { $set: { status: 'canceled' } }, { returnDocument: 'after' });
|
|
84
|
+
};
|
|
85
|
+
const searchRafflesForAutocomplete = async ({ guildId, query }) => {
|
|
86
|
+
return raffleModel.aggregate([
|
|
87
|
+
{
|
|
88
|
+
$match: {
|
|
89
|
+
guildId,
|
|
90
|
+
raffleId: { $regex: query, $options: 'i' },
|
|
91
|
+
status: 'active'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{ $sort: { createdAt: -1 } },
|
|
95
|
+
{ $limit: 25 },
|
|
96
|
+
{
|
|
97
|
+
$addFields: {
|
|
98
|
+
totalTickets: {
|
|
99
|
+
$sum: {
|
|
100
|
+
$map: {
|
|
101
|
+
input: '$participants',
|
|
102
|
+
as: 'p',
|
|
103
|
+
in: '$$p.tickets'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
$addFields: {
|
|
111
|
+
totalPot: { $multiply: ['$totalTickets', '$ticketPrice'] }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
$project: {
|
|
116
|
+
raffleId: 1,
|
|
117
|
+
nextDrawAt: 1,
|
|
118
|
+
ticketPrice: 1,
|
|
119
|
+
maxTicketsPerUser: 1,
|
|
120
|
+
totalPot: 1
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
]);
|
|
124
|
+
};
|
|
125
|
+
const getRafflesReadyToDraw = async () => {
|
|
126
|
+
return raffleModel.find({
|
|
127
|
+
status: 'active',
|
|
128
|
+
nextDrawAt: { $lte: new Date() }
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
const completeRaffleDraw = async ({ raffleId, nextDrawAt, lastDrawAt, drawId }) => {
|
|
132
|
+
await raffleModel.updateOne({
|
|
133
|
+
raffleId,
|
|
134
|
+
status: 'active'
|
|
135
|
+
}, {
|
|
136
|
+
$set: {
|
|
137
|
+
nextDrawAt,
|
|
138
|
+
lastDrawAt,
|
|
139
|
+
participants: [],
|
|
140
|
+
drawId
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
getRaffleById,
|
|
146
|
+
upsertRaffle,
|
|
147
|
+
addRaffleTickets,
|
|
148
|
+
cancelRaffleAtomic,
|
|
149
|
+
searchRafflesForAutocomplete,
|
|
150
|
+
getRafflesReadyToDraw,
|
|
151
|
+
completeRaffleDraw
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CasinoBetService } from '../../casino/services/casinoBet.service';
|
|
2
|
+
import type { RaffleDb } from './raffle.db';
|
|
3
|
+
import type { CancelRaffleResult } from './types';
|
|
4
|
+
type RaffleLifecycleDeps = {
|
|
5
|
+
raffleDb: RaffleDb;
|
|
6
|
+
casinoBet: Pick<CasinoBetService, 'refundRafflePurchase'>;
|
|
7
|
+
};
|
|
8
|
+
export declare function createRaffleLifecycleService({ raffleDb, casinoBet }: RaffleLifecycleDeps): {
|
|
9
|
+
cancelRaffle: ({ raffleId, guildId }: {
|
|
10
|
+
raffleId: string;
|
|
11
|
+
guildId: string;
|
|
12
|
+
}) => Promise<CancelRaffleResult>;
|
|
13
|
+
};
|
|
14
|
+
export type RaffleLifecycleService = ReturnType<typeof createRaffleLifecycleService>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRaffleLifecycleService = createRaffleLifecycleService;
|
|
4
|
+
function createRaffleLifecycleService({ raffleDb, casinoBet }) {
|
|
5
|
+
const { cancelRaffleAtomic } = raffleDb;
|
|
6
|
+
const { refundRafflePurchase } = casinoBet;
|
|
7
|
+
const cancelRaffle = async ({ raffleId, guildId }) => {
|
|
8
|
+
const raffle = await cancelRaffleAtomic({ raffleId, guildId });
|
|
9
|
+
if (!raffle)
|
|
10
|
+
return { ok: false, code: 'NOT_FOUND' };
|
|
11
|
+
const refundErrors = [];
|
|
12
|
+
for (const entry of raffle.participants) {
|
|
13
|
+
const refundAmount = entry.tickets * raffle.ticketPrice;
|
|
14
|
+
if (refundAmount <= 0)
|
|
15
|
+
continue;
|
|
16
|
+
try {
|
|
17
|
+
await refundRafflePurchase({
|
|
18
|
+
userId: entry.userId,
|
|
19
|
+
guildId,
|
|
20
|
+
amount: refundAmount,
|
|
21
|
+
raffleId: raffle.drawId,
|
|
22
|
+
game: 'raffle'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
refundErrors.push(entry.userId);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { ok: true, raffle, refundErrors };
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
cancelRaffle
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TRaffle } from '../types/raffle';
|
|
2
|
+
export type TAddRaffleTickets = {
|
|
3
|
+
raffleId: string;
|
|
4
|
+
guildId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
tickets: number;
|
|
7
|
+
maxTicketsPerUser: number;
|
|
8
|
+
};
|
|
9
|
+
export type TUpsertRaffle = {
|
|
10
|
+
raffleId: string;
|
|
11
|
+
drawId: string;
|
|
12
|
+
guildId: string;
|
|
13
|
+
creatorId: string;
|
|
14
|
+
channelId: string;
|
|
15
|
+
ticketPrice: number;
|
|
16
|
+
maxTicketsPerUser: number;
|
|
17
|
+
nextDrawAt: Date;
|
|
18
|
+
drawIntervalMs: number;
|
|
19
|
+
};
|
|
20
|
+
export type CancelRaffleResult = {
|
|
21
|
+
ok: false;
|
|
22
|
+
code: 'NOT_FOUND';
|
|
23
|
+
} | {
|
|
24
|
+
ok: true;
|
|
25
|
+
raffle: TRaffle;
|
|
26
|
+
refundErrors: string[];
|
|
27
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export type TRaffleStatus = 'active' | 'canceled';
|
|
2
|
+
export type TRaffleParticipant = {
|
|
3
|
+
userId: string;
|
|
4
|
+
tickets: number;
|
|
5
|
+
};
|
|
1
6
|
export type TRaffle = {
|
|
2
7
|
drawId: string;
|
|
3
8
|
raffleId: string;
|
|
@@ -9,11 +14,8 @@ export type TRaffle = {
|
|
|
9
14
|
nextDrawAt: Date;
|
|
10
15
|
lastDrawAt?: Date;
|
|
11
16
|
drawIntervalMs: number;
|
|
12
|
-
status:
|
|
13
|
-
participants:
|
|
14
|
-
userId: string;
|
|
15
|
-
tickets: number;
|
|
16
|
-
}[];
|
|
17
|
+
status: TRaffleStatus;
|
|
18
|
+
participants: TRaffleParticipant[];
|
|
17
19
|
createdAt: Date;
|
|
18
20
|
updatedAt: Date;
|
|
19
21
|
};
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./transaction"), exports);
|
|
18
|
+
__exportStar(require("./gameRecordFields"), exports);
|
|
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./constants/gameRecordFields"), exports);
|
|
19
|
+
__exportStar(require("./types/transaction"), exports);
|
|
20
|
+
__exportStar(require("./constants/transaction"), exports);
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
import { TTransaction } from '
|
|
3
|
-
export declare const TransactionSchema: Schema<TTransaction, import("mongoose").Model<TTransaction, any, any, any,
|
|
4
|
-
_id: import("mongoose").Types.ObjectId;
|
|
5
|
-
} & {
|
|
6
|
-
__v: number;
|
|
7
|
-
} & {
|
|
8
|
-
id: string;
|
|
9
|
-
}) | (import("mongoose").Document<unknown, any, TTransaction, any, import("mongoose").DefaultSchemaOptions> & TTransaction & {
|
|
10
|
-
_id: import("mongoose").Types.ObjectId;
|
|
11
|
-
} & {
|
|
12
|
-
__v: number;
|
|
13
|
-
}), any, TTransaction>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
2
|
+
import { TTransaction } from './types/transaction';
|
|
3
|
+
export declare const TransactionSchema: Schema<TTransaction, import("mongoose").Model<TTransaction, any, any, any, any, any, TTransaction>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
14
4
|
id: string;
|
|
15
|
-
}, import("mongoose").
|
|
5
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
16
6
|
_id: import("mongoose").Types.ObjectId;
|
|
17
7
|
} & {
|
|
18
8
|
__v: number;
|
|
@@ -21,7 +11,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
21
11
|
}, {
|
|
22
12
|
userId?: import("mongoose").SchemaDefinitionProperty<string, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
23
13
|
id: string;
|
|
24
|
-
}, import("mongoose").
|
|
14
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
25
15
|
_id: import("mongoose").Types.ObjectId;
|
|
26
16
|
} & {
|
|
27
17
|
__v: number;
|
|
@@ -30,7 +20,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
30
20
|
}> | undefined;
|
|
31
21
|
guildId?: import("mongoose").SchemaDefinitionProperty<string, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
32
22
|
id: string;
|
|
33
|
-
}, import("mongoose").
|
|
23
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
34
24
|
_id: import("mongoose").Types.ObjectId;
|
|
35
25
|
} & {
|
|
36
26
|
__v: number;
|
|
@@ -39,7 +29,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
39
29
|
}> | undefined;
|
|
40
30
|
amount?: import("mongoose").SchemaDefinitionProperty<number, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
41
31
|
id: string;
|
|
42
|
-
}, import("mongoose").
|
|
32
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
43
33
|
_id: import("mongoose").Types.ObjectId;
|
|
44
34
|
} & {
|
|
45
35
|
__v: number;
|
|
@@ -48,7 +38,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
48
38
|
}> | undefined;
|
|
49
39
|
type?: import("mongoose").SchemaDefinitionProperty<"deposit" | "withdraw" | "bet" | "win" | "refund" | "bonus" | "vip", TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
50
40
|
id: string;
|
|
51
|
-
}, import("mongoose").
|
|
41
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
52
42
|
_id: import("mongoose").Types.ObjectId;
|
|
53
43
|
} & {
|
|
54
44
|
__v: number;
|
|
@@ -57,16 +47,16 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
57
47
|
}> | undefined;
|
|
58
48
|
source?: import("mongoose").SchemaDefinitionProperty<"command" | "manual" | "web" | "system" | "casino", TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
59
49
|
id: string;
|
|
60
|
-
}, import("mongoose").
|
|
50
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
61
51
|
_id: import("mongoose").Types.ObjectId;
|
|
62
52
|
} & {
|
|
63
53
|
__v: number;
|
|
64
54
|
}, "id"> & {
|
|
65
55
|
id: string;
|
|
66
56
|
}> | undefined;
|
|
67
|
-
meta?: import("mongoose").SchemaDefinitionProperty<import("
|
|
57
|
+
meta?: import("mongoose").SchemaDefinitionProperty<import("./types/transaction").TransactionMeta | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
68
58
|
id: string;
|
|
69
|
-
}, import("mongoose").
|
|
59
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
70
60
|
_id: import("mongoose").Types.ObjectId;
|
|
71
61
|
} & {
|
|
72
62
|
__v: number;
|
|
@@ -75,7 +65,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
75
65
|
}> | undefined;
|
|
76
66
|
betId?: import("mongoose").SchemaDefinitionProperty<string | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
77
67
|
id: string;
|
|
78
|
-
}, import("mongoose").
|
|
68
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
79
69
|
_id: import("mongoose").Types.ObjectId;
|
|
80
70
|
} & {
|
|
81
71
|
__v: number;
|
|
@@ -84,7 +74,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
84
74
|
}> | undefined;
|
|
85
75
|
handledBy?: import("mongoose").SchemaDefinitionProperty<string | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
86
76
|
id: string;
|
|
87
|
-
}, import("mongoose").
|
|
77
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
88
78
|
_id: import("mongoose").Types.ObjectId;
|
|
89
79
|
} & {
|
|
90
80
|
__v: number;
|
|
@@ -93,7 +83,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
93
83
|
}> | undefined;
|
|
94
84
|
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
95
85
|
id: string;
|
|
96
|
-
}, import("mongoose").
|
|
86
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TTransaction & {
|
|
97
87
|
_id: import("mongoose").Types.ObjectId;
|
|
98
88
|
} & {
|
|
99
89
|
__v: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.UserSchema = void 0;
|
|
18
|
+
__exportStar(require("./types/user"), exports);
|
|
19
|
+
var user_mongoose_1 = require("./user.mongoose");
|
|
20
|
+
Object.defineProperty(exports, "UserSchema", { enumerable: true, get: function () { return user_mongoose_1.UserSchema; } });
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
import { TUser } from '
|
|
3
|
-
export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, any, any, any,
|
|
4
|
-
_id: import("mongoose").Types.ObjectId;
|
|
5
|
-
} & {
|
|
6
|
-
__v: number;
|
|
7
|
-
} & {
|
|
8
|
-
id: string;
|
|
9
|
-
}) | (import("mongoose").Document<unknown, any, TUser, any, import("mongoose").DefaultSchemaOptions> & TUser & {
|
|
10
|
-
_id: import("mongoose").Types.ObjectId;
|
|
11
|
-
} & {
|
|
12
|
-
__v: number;
|
|
13
|
-
}), any, TUser>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
2
|
+
import { TUser } from './types/user';
|
|
3
|
+
export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, any, any, any, any, any, TUser>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
14
4
|
id: string;
|
|
15
|
-
}, import("mongoose").
|
|
5
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
16
6
|
_id: import("mongoose").Types.ObjectId;
|
|
17
7
|
} & {
|
|
18
8
|
__v: number;
|
|
@@ -21,7 +11,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
21
11
|
}, {
|
|
22
12
|
userId?: import("mongoose").SchemaDefinitionProperty<string, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
23
13
|
id: string;
|
|
24
|
-
}, import("mongoose").
|
|
14
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
25
15
|
_id: import("mongoose").Types.ObjectId;
|
|
26
16
|
} & {
|
|
27
17
|
__v: number;
|
|
@@ -30,7 +20,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
30
20
|
}> | undefined;
|
|
31
21
|
guildId?: import("mongoose").SchemaDefinitionProperty<string, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
32
22
|
id: string;
|
|
33
|
-
}, import("mongoose").
|
|
23
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
34
24
|
_id: import("mongoose").Types.ObjectId;
|
|
35
25
|
} & {
|
|
36
26
|
__v: number;
|
|
@@ -39,7 +29,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
39
29
|
}> | undefined;
|
|
40
30
|
balance?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
41
31
|
id: string;
|
|
42
|
-
}, import("mongoose").
|
|
32
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
43
33
|
_id: import("mongoose").Types.ObjectId;
|
|
44
34
|
} & {
|
|
45
35
|
__v: number;
|
|
@@ -48,7 +38,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
48
38
|
}> | undefined;
|
|
49
39
|
bonusBalance?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
50
40
|
id: string;
|
|
51
|
-
}, import("mongoose").
|
|
41
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
52
42
|
_id: import("mongoose").Types.ObjectId;
|
|
53
43
|
} & {
|
|
54
44
|
__v: number;
|
|
@@ -57,7 +47,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
57
47
|
}> | undefined;
|
|
58
48
|
lockedBalance?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
59
49
|
id: string;
|
|
60
|
-
}, import("mongoose").
|
|
50
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
61
51
|
_id: import("mongoose").Types.ObjectId;
|
|
62
52
|
} & {
|
|
63
53
|
__v: number;
|
|
@@ -66,7 +56,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
66
56
|
}> | undefined;
|
|
67
57
|
lastDailyClaim?: import("mongoose").SchemaDefinitionProperty<Date | null, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
68
58
|
id: string;
|
|
69
|
-
}, import("mongoose").
|
|
59
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
70
60
|
_id: import("mongoose").Types.ObjectId;
|
|
71
61
|
} & {
|
|
72
62
|
__v: number;
|
|
@@ -75,7 +65,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
75
65
|
}> | undefined;
|
|
76
66
|
dailyStreak?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
77
67
|
id: string;
|
|
78
|
-
}, import("mongoose").
|
|
68
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
79
69
|
_id: import("mongoose").Types.ObjectId;
|
|
80
70
|
} & {
|
|
81
71
|
__v: number;
|
|
@@ -84,7 +74,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
84
74
|
}> | undefined;
|
|
85
75
|
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
86
76
|
id: string;
|
|
87
|
-
}, import("mongoose").
|
|
77
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
88
78
|
_id: import("mongoose").Types.ObjectId;
|
|
89
79
|
} & {
|
|
90
80
|
__v: number;
|
|
@@ -93,7 +83,7 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
93
83
|
}> | undefined;
|
|
94
84
|
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
95
85
|
id: string;
|
|
96
|
-
}, import("mongoose").
|
|
86
|
+
}, import("mongoose").DefaultSchemaOptions> & Omit<TUser & {
|
|
97
87
|
_id: import("mongoose").Types.ObjectId;
|
|
98
88
|
} & {
|
|
99
89
|
__v: number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.VipRoomSchema = void 0;
|
|
18
|
+
__exportStar(require("./types/vipRoom"), exports);
|
|
19
|
+
var vipRoom_mongoose_1 = require("./vipRoom.mongoose");
|
|
20
|
+
Object.defineProperty(exports, "VipRoomSchema", { enumerable: true, get: function () { return vipRoom_mongoose_1.VipRoomSchema; } });
|
|
21
|
+
__exportStar(require("./schemas/vip.forms"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const vipSettingsFormSchema: z.ZodObject<{
|
|
3
|
+
roleOwnerId: z.ZodString;
|
|
4
|
+
roleMemberId: z.ZodString;
|
|
5
|
+
pricePerDay: z.ZodNumber;
|
|
6
|
+
pricePerCreate: z.ZodNumber;
|
|
7
|
+
pricePerAdditionalMember: z.ZodNumber;
|
|
8
|
+
maxMembers: z.ZodNumber;
|
|
9
|
+
categoryId: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.vipSettingsFormSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.vipSettingsFormSchema = zod_1.default.object({
|
|
9
|
+
roleOwnerId: zod_1.default.string(),
|
|
10
|
+
roleMemberId: zod_1.default.string(),
|
|
11
|
+
pricePerDay: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
12
|
+
pricePerCreate: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
13
|
+
pricePerAdditionalMember: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
14
|
+
maxMembers: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
15
|
+
categoryId: zod_1.default.string()
|
|
16
|
+
});
|