@gbl-uzh/platform 0.4.13 → 0.4.16
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/LICENSE.md +1 -1
- package/dist/index.d.ts +7 -1473
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -2012
- package/dist/index.js.map +1 -0
- package/dist/lib/SSELink.d.ts +9 -0
- package/dist/lib/SSELink.d.ts.map +1 -0
- package/dist/lib/SSELink.js +24 -0
- package/dist/lib/SSELink.js.map +1 -0
- package/dist/lib/apollo.d.ts +3 -4
- package/dist/lib/apollo.d.ts.map +1 -0
- package/dist/lib/apollo.js +50 -108
- package/dist/lib/apollo.js.map +1 -0
- package/dist/lib/constants.d.ts +8 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +11 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/pubsub.d.ts +5 -0
- package/dist/lib/pubsub.d.ts.map +1 -0
- package/dist/lib/pubsub.js +6 -0
- package/dist/lib/pubsub.js.map +1 -0
- package/dist/lib/util.d.ts +12 -13
- package/dist/lib/util.d.ts.map +1 -0
- package/dist/lib/util.js +63 -105
- package/dist/lib/util.js.map +1 -0
- package/dist/nexus.d.ts +11 -42
- package/dist/nexus.d.ts.map +1 -0
- package/dist/nexus.js +22 -2605
- package/dist/nexus.js.map +1 -0
- package/dist/ops/FGameData.graphql +1 -0
- package/dist/ops/FPeriodData.graphql +1 -0
- package/dist/ops/FPlayerData.graphql +0 -4
- package/dist/ops/FSegmentData.graphql +1 -0
- package/dist/ops/FStoryElementData.graphql +7 -0
- package/dist/ops/MActivateNextSegment.graphql +0 -3
- package/dist/ops/MAddGamePeriod.graphql +2 -2
- package/dist/ops/MUpdatePlayerData.graphql +1 -3
- package/dist/ops/QGame.graphql +2 -3
- package/dist/ops/QPastResults.graphql +0 -3
- package/dist/ops/QResult.graphql +4 -5
- package/dist/ops/QSpecificResults.graphql +11 -0
- package/dist/ops/QStoryElements.graphql +7 -0
- package/dist/schema.prisma +2 -3
- package/dist/services/AccountService.d.ts +65 -0
- package/dist/services/AccountService.d.ts.map +1 -0
- package/dist/services/AccountService.js +70 -0
- package/dist/services/AccountService.js.map +1 -0
- package/dist/services/EventService.d.ts +13 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/EventService.js +180 -0
- package/dist/services/EventService.js.map +1 -0
- package/dist/services/GameService.d.ts +670 -0
- package/dist/services/GameService.d.ts.map +1 -0
- package/dist/services/GameService.js +1191 -0
- package/dist/services/GameService.js.map +1 -0
- package/dist/services/PlayService.d.ts +630 -0
- package/dist/services/PlayService.d.ts.map +1 -0
- package/dist/services/PlayService.js +534 -0
- package/dist/services/PlayService.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Achievement.d.ts +4 -0
- package/dist/types/Achievement.d.ts.map +1 -0
- package/dist/types/Achievement.js +35 -0
- package/dist/types/Achievement.js.map +1 -0
- package/dist/types/Game.d.ts +5 -0
- package/dist/types/Game.d.ts.map +1 -0
- package/dist/types/Game.js +85 -0
- package/dist/types/Game.js.map +1 -0
- package/dist/types/LearningElement.d.ts +5 -0
- package/dist/types/LearningElement.d.ts.map +1 -0
- package/dist/types/LearningElement.js +55 -0
- package/dist/types/LearningElement.js.map +1 -0
- package/dist/types/Mutation.d.ts +10 -0
- package/dist/types/Mutation.d.ts.map +1 -0
- package/dist/types/Mutation.js +194 -0
- package/dist/types/Mutation.js.map +1 -0
- package/dist/types/Player.d.ts +9 -0
- package/dist/types/Player.d.ts.map +1 -0
- package/dist/types/Player.js +139 -0
- package/dist/types/Player.js.map +1 -0
- package/dist/types/Query.d.ts +3 -0
- package/dist/types/Query.d.ts.map +1 -0
- package/dist/types/Query.js +91 -0
- package/dist/types/Query.js.map +1 -0
- package/dist/types/StoryElement.d.ts +3 -0
- package/dist/types/StoryElement.d.ts.map +1 -0
- package/dist/types/StoryElement.js +27 -0
- package/dist/types/StoryElement.js.map +1 -0
- package/dist/types/Subscription.d.ts +3 -0
- package/dist/types/Subscription.d.ts.map +1 -0
- package/dist/types/Subscription.js +35 -0
- package/dist/types/Subscription.js.map +1 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -38
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import * as DB from '@prisma/client';
|
|
2
|
+
import { LearningElementState, BaseUserNotificationType } from '../types.js';
|
|
3
|
+
import { publishUserNotification, receiveEvents } from './EventService.js';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
|
|
6
|
+
async function performAction(args, ctx, { services }) {
|
|
7
|
+
const periodIx_segmentIx_playerId_type = {
|
|
8
|
+
periodIx: args.periodIx,
|
|
9
|
+
segmentIx: args.segmentIx,
|
|
10
|
+
playerId: args.playerId,
|
|
11
|
+
type: DB.PlayerResultType.SEGMENT_END,
|
|
12
|
+
};
|
|
13
|
+
const previousResult = await ctx.prisma.playerResult.findUnique({
|
|
14
|
+
where: {
|
|
15
|
+
periodIx_segmentIx_playerId_type,
|
|
16
|
+
},
|
|
17
|
+
include: {
|
|
18
|
+
game: true,
|
|
19
|
+
segment: true,
|
|
20
|
+
period: true,
|
|
21
|
+
player: true,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
if (!previousResult)
|
|
25
|
+
return null;
|
|
26
|
+
if (previousResult.game.status !== DB.GameStatus.RUNNING) {
|
|
27
|
+
throw new Error('ACTIONS_NOT_ALLOWED');
|
|
28
|
+
}
|
|
29
|
+
const { result, events, notifications, isDirty, extras } = services.Actions.apply(previousResult.facts, {
|
|
30
|
+
type: args.actionType,
|
|
31
|
+
payload: {
|
|
32
|
+
playerArgs: args.facts,
|
|
33
|
+
segmentFacts: previousResult.segment?.facts,
|
|
34
|
+
periodFacts: previousResult.period.facts,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
publishUserNotification(ctx, notifications);
|
|
38
|
+
await receiveEvents({
|
|
39
|
+
events,
|
|
40
|
+
ctx: {
|
|
41
|
+
user: ctx.user,
|
|
42
|
+
args,
|
|
43
|
+
achievements: previousResult.player.achievementKeys,
|
|
44
|
+
experience: previousResult.player.experience,
|
|
45
|
+
currentLevelIx: previousResult.player.levelIx,
|
|
46
|
+
},
|
|
47
|
+
prisma: ctx.prisma,
|
|
48
|
+
});
|
|
49
|
+
if (!isDirty) {
|
|
50
|
+
return previousResult;
|
|
51
|
+
}
|
|
52
|
+
const [updatedResult, _] = await ctx.prisma.$transaction([
|
|
53
|
+
ctx.prisma.playerResult.update({
|
|
54
|
+
where: {
|
|
55
|
+
periodIx_segmentIx_playerId_type,
|
|
56
|
+
},
|
|
57
|
+
data: {
|
|
58
|
+
facts: result,
|
|
59
|
+
},
|
|
60
|
+
include: {
|
|
61
|
+
period: true,
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
ctx.prisma.playerAction.create({
|
|
65
|
+
data: {
|
|
66
|
+
periodIx: args.periodIx,
|
|
67
|
+
period: {
|
|
68
|
+
connect: {
|
|
69
|
+
gameId_index: {
|
|
70
|
+
gameId: args.gameId,
|
|
71
|
+
index: args.periodIx,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
segmentIx: args.segmentIx,
|
|
76
|
+
segment: {
|
|
77
|
+
connect: {
|
|
78
|
+
gameId_periodIx_index: {
|
|
79
|
+
gameId: args.gameId,
|
|
80
|
+
periodIx: args.periodIx,
|
|
81
|
+
index: args.segmentIx,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
game: {
|
|
86
|
+
connect: {
|
|
87
|
+
id: args.gameId,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
player: {
|
|
91
|
+
connect: {
|
|
92
|
+
id: args.playerId,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
type: args.actionType,
|
|
96
|
+
facts: {
|
|
97
|
+
...args.facts,
|
|
98
|
+
...extras,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
]);
|
|
103
|
+
return updatedResult;
|
|
104
|
+
}
|
|
105
|
+
async function saveDecisions(args, ctx) {
|
|
106
|
+
const game = await ctx.prisma.game.findUnique({
|
|
107
|
+
where: {
|
|
108
|
+
id: ctx.user.gameId,
|
|
109
|
+
},
|
|
110
|
+
include: {
|
|
111
|
+
activePeriod: {
|
|
112
|
+
include: {
|
|
113
|
+
activeSegment: true,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
if (!game?.activePeriod)
|
|
119
|
+
return null;
|
|
120
|
+
if (args.decisionType !== game.status) {
|
|
121
|
+
throw new Error('INVALID_DECISION');
|
|
122
|
+
}
|
|
123
|
+
const periodIx = game.activePeriod.index;
|
|
124
|
+
const savedDecision = ctx.prisma.playerDecision.upsert({
|
|
125
|
+
where: {
|
|
126
|
+
playerId_periodIx_type: {
|
|
127
|
+
periodIx,
|
|
128
|
+
playerId: ctx.user.sub,
|
|
129
|
+
type: args.decisionType,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
create: {
|
|
133
|
+
facts: args.facts,
|
|
134
|
+
type: args.decisionType,
|
|
135
|
+
periodIx,
|
|
136
|
+
period: {
|
|
137
|
+
connect: {
|
|
138
|
+
gameId_index: {
|
|
139
|
+
gameId: game.id,
|
|
140
|
+
index: periodIx,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
game: {
|
|
145
|
+
connect: {
|
|
146
|
+
id: game.id,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
player: {
|
|
150
|
+
connect: {
|
|
151
|
+
id: ctx.user.sub,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
update: {
|
|
156
|
+
facts: args.facts,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
return savedDecision;
|
|
160
|
+
}
|
|
161
|
+
async function getPlayerResult(args, ctx) {
|
|
162
|
+
const currentGame = await ctx.prisma.game.findUnique({
|
|
163
|
+
where: {
|
|
164
|
+
id: args.gameId,
|
|
165
|
+
},
|
|
166
|
+
include: {
|
|
167
|
+
activePeriod: {
|
|
168
|
+
include: {
|
|
169
|
+
activeSegment: {
|
|
170
|
+
include: {
|
|
171
|
+
learningElements: true,
|
|
172
|
+
storyElements: true,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
segments: {
|
|
176
|
+
include: {
|
|
177
|
+
learningElements: true,
|
|
178
|
+
storyElements: true,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
periods: {
|
|
184
|
+
orderBy: { createdAt: 'asc' },
|
|
185
|
+
include: {
|
|
186
|
+
segments: {
|
|
187
|
+
include: {
|
|
188
|
+
learningElements: true,
|
|
189
|
+
storyElements: true,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
if (!currentGame?.activePeriod)
|
|
197
|
+
return null;
|
|
198
|
+
// The segementCount for active period is currently not needed
|
|
199
|
+
currentGame.periods = currentGame.periods.map((period) => ({
|
|
200
|
+
...period,
|
|
201
|
+
segmentCount: period.segments.length,
|
|
202
|
+
}));
|
|
203
|
+
// We filter up to the active period (and active segemnt) - future periods
|
|
204
|
+
// should not be visible to the user
|
|
205
|
+
const activePeriodIx = currentGame.activePeriodIx;
|
|
206
|
+
currentGame.periods = currentGame.periods.filter((_, ix) => ix <= activePeriodIx);
|
|
207
|
+
const activeSegmentIx = currentGame.activePeriod.activeSegmentIx;
|
|
208
|
+
currentGame.activePeriod.segments = currentGame.activePeriod.segments.filter((_, ix) => ix <= activeSegmentIx);
|
|
209
|
+
currentGame.periods[activePeriodIx].segments =
|
|
210
|
+
currentGame.activePeriod.segments;
|
|
211
|
+
const previousResults = ctx.prisma.playerResult.findMany({
|
|
212
|
+
orderBy: {
|
|
213
|
+
id: 'asc',
|
|
214
|
+
},
|
|
215
|
+
where: {
|
|
216
|
+
playerId: args.playerId,
|
|
217
|
+
periodIx: {
|
|
218
|
+
lte: currentGame.activePeriod.index,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
include: {
|
|
222
|
+
period: true,
|
|
223
|
+
segment: true,
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
const playerResult = await ctx.prisma.playerResult.findUnique({
|
|
227
|
+
where: {
|
|
228
|
+
periodIx_segmentIx_playerId_type: {
|
|
229
|
+
periodIx: currentGame.activePeriodIx,
|
|
230
|
+
segmentIx: currentGame.activePeriod.activeSegmentIx,
|
|
231
|
+
playerId: args.playerId,
|
|
232
|
+
type: DB.PlayerResultType.SEGMENT_END,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
include: {
|
|
236
|
+
period: true,
|
|
237
|
+
player: {
|
|
238
|
+
include: {
|
|
239
|
+
completedLearningElements: true,
|
|
240
|
+
visitedStoryElements: true,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
const transactions = ctx.prisma.playerAction.findMany({
|
|
246
|
+
where: {
|
|
247
|
+
player: {
|
|
248
|
+
id: args.playerId,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
orderBy: {
|
|
252
|
+
createdAt: 'asc',
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
return {
|
|
256
|
+
currentGame,
|
|
257
|
+
playerResult,
|
|
258
|
+
previousResults,
|
|
259
|
+
transactions,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
async function getPlayerData(args, ctx) {
|
|
263
|
+
return ctx.prisma.player.findUnique({
|
|
264
|
+
where: {
|
|
265
|
+
id: args.playerId,
|
|
266
|
+
},
|
|
267
|
+
include: {
|
|
268
|
+
level: true,
|
|
269
|
+
achievements: {
|
|
270
|
+
include: {
|
|
271
|
+
achievement: true,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
async function getLearningElement(args, ctx) {
|
|
278
|
+
const playerWithLearningElements = await ctx.prisma.player.findUnique({
|
|
279
|
+
where: {
|
|
280
|
+
id: ctx.user.sub,
|
|
281
|
+
},
|
|
282
|
+
include: {
|
|
283
|
+
completedLearningElements: {
|
|
284
|
+
where: {
|
|
285
|
+
id: args.id,
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
if (!playerWithLearningElements)
|
|
291
|
+
return null;
|
|
292
|
+
const elementSolved = playerWithLearningElements.completedLearningElements.length > 0;
|
|
293
|
+
const element = await ctx.prisma.learningElement.findUnique({
|
|
294
|
+
where: {
|
|
295
|
+
id: args.id,
|
|
296
|
+
},
|
|
297
|
+
include: {
|
|
298
|
+
options: true,
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
if (!element)
|
|
302
|
+
return null;
|
|
303
|
+
return {
|
|
304
|
+
id: args.id,
|
|
305
|
+
element: {
|
|
306
|
+
...element,
|
|
307
|
+
feedback: elementSolved ? element.feedback : null,
|
|
308
|
+
},
|
|
309
|
+
state: elementSolved
|
|
310
|
+
? LearningElementState.SOLVED
|
|
311
|
+
: LearningElementState.NEW,
|
|
312
|
+
solution: elementSolved
|
|
313
|
+
? JSON.stringify(element.options.flatMap((option, ix) => (option.correct ? [ix] : [])))
|
|
314
|
+
: null,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
async function attemptLearningElement(args, ctx) {
|
|
318
|
+
const learningElement = await ctx.prisma.learningElement.findUnique({
|
|
319
|
+
where: { id: args.elementId },
|
|
320
|
+
include: { options: true },
|
|
321
|
+
});
|
|
322
|
+
if (!learningElement)
|
|
323
|
+
return null;
|
|
324
|
+
try {
|
|
325
|
+
const selectedOptions = JSON.parse(args.selection);
|
|
326
|
+
const pointsAchieved = learningElement.options.reduce((acc, option, ix) => {
|
|
327
|
+
if (option.correct && selectedOptions.includes(ix)) {
|
|
328
|
+
return acc + 1;
|
|
329
|
+
}
|
|
330
|
+
if (!option.correct && !selectedOptions.includes(ix)) {
|
|
331
|
+
return acc + 1;
|
|
332
|
+
}
|
|
333
|
+
return acc;
|
|
334
|
+
}, 0);
|
|
335
|
+
const pointsMax = learningElement.options.length;
|
|
336
|
+
let updatedPlayer;
|
|
337
|
+
if (pointsAchieved === pointsMax) {
|
|
338
|
+
updatedPlayer = await ctx.prisma.player.update({
|
|
339
|
+
where: {
|
|
340
|
+
id: ctx.user.sub,
|
|
341
|
+
},
|
|
342
|
+
data: {
|
|
343
|
+
completedLearningElements: {
|
|
344
|
+
connect: {
|
|
345
|
+
id: args.elementId,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
completedLearningElementIds: {
|
|
349
|
+
push: args.elementId,
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
include: {
|
|
353
|
+
game: {
|
|
354
|
+
select: {
|
|
355
|
+
activePeriodIx: true,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
await receiveEvents({
|
|
361
|
+
events: [
|
|
362
|
+
{
|
|
363
|
+
type: BaseUserNotificationType.LEARNING_ELEMENT_SOLVED,
|
|
364
|
+
facts: {
|
|
365
|
+
elementId: args.elementId,
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
ctx: {
|
|
370
|
+
user: ctx.user,
|
|
371
|
+
args: {
|
|
372
|
+
gameId: ctx.user.gameId,
|
|
373
|
+
periodIx: updatedPlayer.game.activePeriodIx,
|
|
374
|
+
playerId: ctx.user.sub,
|
|
375
|
+
},
|
|
376
|
+
achievements: updatedPlayer.achievementKeys,
|
|
377
|
+
experience: updatedPlayer.experience,
|
|
378
|
+
currentLevelIx: updatedPlayer.levelIx,
|
|
379
|
+
},
|
|
380
|
+
prisma: ctx.prisma,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
publishUserNotification(ctx, [
|
|
385
|
+
{
|
|
386
|
+
type: BaseUserNotificationType.LEARNING_ELEMENT_INCORRECT,
|
|
387
|
+
},
|
|
388
|
+
]);
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
id: args.elementId,
|
|
392
|
+
pointsAchieved,
|
|
393
|
+
pointsMax,
|
|
394
|
+
element: {
|
|
395
|
+
id: args.elementId,
|
|
396
|
+
feedback: learningElement.feedback,
|
|
397
|
+
},
|
|
398
|
+
player: updatedPlayer,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
catch (e) {
|
|
402
|
+
console.warn(e);
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
async function markStoryElement(args, ctx) {
|
|
407
|
+
const storyElement = await ctx.prisma.storyElement.findUnique({
|
|
408
|
+
where: { id: args.elementId },
|
|
409
|
+
});
|
|
410
|
+
if (!storyElement)
|
|
411
|
+
return null;
|
|
412
|
+
return ctx.prisma.player.update({
|
|
413
|
+
where: {
|
|
414
|
+
id: ctx.user.sub,
|
|
415
|
+
},
|
|
416
|
+
data: {
|
|
417
|
+
visitedStoryElements: {
|
|
418
|
+
connect: {
|
|
419
|
+
id: args.elementId,
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
visitedStoryElementIds: {
|
|
423
|
+
push: args.elementId,
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
async function getPlayerTransactions(args, ctx) {
|
|
429
|
+
const playerActions = ctx.prisma.playerAction.findMany({
|
|
430
|
+
where: {
|
|
431
|
+
player: {
|
|
432
|
+
id: ctx.user.sub,
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
orderBy: {
|
|
436
|
+
createdAt: 'asc',
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
return playerActions;
|
|
440
|
+
}
|
|
441
|
+
async function getSpecificResults(args, ctx) {
|
|
442
|
+
const playerResults = await ctx.prisma.playerResult.findMany({
|
|
443
|
+
where: {
|
|
444
|
+
gameId: args.gameId,
|
|
445
|
+
type: args.type,
|
|
446
|
+
},
|
|
447
|
+
orderBy: [
|
|
448
|
+
{ period: { index: 'asc' } },
|
|
449
|
+
{ segment: { index: 'asc' } },
|
|
450
|
+
{ player: { name: 'asc' } },
|
|
451
|
+
],
|
|
452
|
+
include: {
|
|
453
|
+
period: true,
|
|
454
|
+
player: true,
|
|
455
|
+
},
|
|
456
|
+
});
|
|
457
|
+
return playerResults;
|
|
458
|
+
}
|
|
459
|
+
async function getPlayerResults(args, ctx) {
|
|
460
|
+
const playerResults = await ctx.prisma.playerResult.findMany({
|
|
461
|
+
where: {
|
|
462
|
+
gameId: ctx.user.gameId,
|
|
463
|
+
},
|
|
464
|
+
include: {
|
|
465
|
+
period: true,
|
|
466
|
+
player: true,
|
|
467
|
+
segment: true,
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
return playerResults;
|
|
471
|
+
}
|
|
472
|
+
async function getPastResults(args, ctx) {
|
|
473
|
+
const currentGame = await ctx.prisma.game.findUnique({
|
|
474
|
+
where: { id: ctx.user.gameId },
|
|
475
|
+
});
|
|
476
|
+
if (!currentGame)
|
|
477
|
+
return null;
|
|
478
|
+
const playerResults = await ctx.prisma.playerResult.findMany({
|
|
479
|
+
where: {
|
|
480
|
+
gameId: ctx.user.gameId,
|
|
481
|
+
periodIx: {
|
|
482
|
+
lt: currentGame.activePeriodIx,
|
|
483
|
+
},
|
|
484
|
+
type: 'PERIOD_END',
|
|
485
|
+
},
|
|
486
|
+
include: {
|
|
487
|
+
period: true,
|
|
488
|
+
player: {
|
|
489
|
+
include: {
|
|
490
|
+
level: true,
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
});
|
|
495
|
+
return playerResults;
|
|
496
|
+
}
|
|
497
|
+
async function updateReadyState(args, ctx) {
|
|
498
|
+
return ctx.prisma.player.update({
|
|
499
|
+
where: {
|
|
500
|
+
id: ctx.user.sub,
|
|
501
|
+
},
|
|
502
|
+
data: {
|
|
503
|
+
isReady: args.isReady,
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
async function addCountdown(args, ctx) {
|
|
508
|
+
const currentGame = await ctx.prisma.game.findUnique({
|
|
509
|
+
where: { id: args.gameId },
|
|
510
|
+
include: {
|
|
511
|
+
activePeriod: {
|
|
512
|
+
include: {
|
|
513
|
+
activeSegment: true,
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
if (!currentGame?.activePeriod?.activeSegment)
|
|
519
|
+
return null;
|
|
520
|
+
const countdownDurationMs = args.seconds * 1000;
|
|
521
|
+
await ctx.prisma.periodSegment.update({
|
|
522
|
+
where: {
|
|
523
|
+
id: currentGame.activePeriod.activeSegment.id,
|
|
524
|
+
},
|
|
525
|
+
data: {
|
|
526
|
+
countdownExpiresAt: dayjs().add(countdownDurationMs, 'ms').toDate(),
|
|
527
|
+
countdownDurationMs,
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export { addCountdown, attemptLearningElement, getLearningElement, getPastResults, getPlayerData, getPlayerResult, getPlayerResults, getPlayerTransactions, getSpecificResults, markStoryElement, performAction, saveDecisions, updateReadyState };
|
|
534
|
+
//# sourceMappingURL=PlayService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayService.js","sources":["../../src/services/PlayService.ts"],"sourcesContent":[null],"names":["EventService.publishUserNotification","EventService.receiveEvents","UserNotificationType"],"mappings":";;;;;AAoBO,eAAe,aAAa,CACjC,IAAoC,EACpC,GAAY,EACZ,EAAE,QAAQ,EAAO,EAAA;A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