Skip to content

Commit 1fc4b35

Browse files
committed
Enhance technical badge seeding with comparison operators in conditions
1 parent 3048bb3 commit 1fc4b35

1 file changed

Lines changed: 36 additions & 10 deletions

File tree

β€Žapps/backend/scripts/seed-technical-badges.tsβ€Ž

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async function seedTechnicalBadgesData() {
210210
],
211211
},
212212

213-
// Line 3: Conditions (stats and variables)
213+
// Line 3: Conditions with different comparison operators
214214
{
215215
labelId,
216216
sequence: 3,
@@ -220,8 +220,10 @@ async function seedTechnicalBadgesData() {
220220
visualType: "BLACK",
221221
conditions: {
222222
stats: {
223-
strength: 5,
224-
charisma: 3,
223+
strength: { value: 5, operator: ">=" },
224+
charisma: { value: 3, operator: "<=" },
225+
intelligence: { value: 10, operator: ">" },
226+
luck: { value: 2, operator: "<" },
225227
},
226228
variables: ["has_key", "is_daytime"],
227229
},
@@ -312,7 +314,7 @@ async function seedTechnicalBadgesData() {
312314
],
313315
},
314316

315-
// Line 8: Multiple conditions with different types
317+
// Line 8: Multiple conditions with different operators
316318
{
317319
labelId,
318320
sequence: 8,
@@ -322,14 +324,34 @@ async function seedTechnicalBadgesData() {
322324
visualType: "GENERATED",
323325
conditions: {
324326
stats: {
325-
magic: 10,
326-
luck: 5,
327-
gold: 100,
327+
magic: { value: 10, operator: ">=" },
328+
luck: { value: 5, operator: "==" },
329+
gold: { value: 100, operator: "!=" },
328330
},
329331
variables: ["has_spell", "is_main_quest"],
330332
},
331333
},
332334

335+
// Line 10: All comparison operators in one place
336+
{
337+
labelId,
338+
sequence: 10,
339+
content: "Testing all comparison operators.",
340+
contentType: "NARRATION",
341+
speakerId: null,
342+
visualType: "GENERATED",
343+
conditions: {
344+
stats: {
345+
strength: { value: 10, operator: ">=" },
346+
dexterity: { value: 5, operator: "<=" },
347+
intelligence: { value: 15, operator: ">" },
348+
wisdom: { value: 3, operator: "<" },
349+
charisma: { value: 8, operator: "==" },
350+
luck: { value: 0, operator: "!=" },
351+
},
352+
},
353+
},
354+
333355
// Line 9: Complex menu with condition flags
334356
{
335357
labelId,
@@ -363,11 +385,14 @@ async function seedTechnicalBadgesData() {
363385
console.log("πŸŽ‰ Technical badges test data seeded successfully!\n");
364386
console.log("Test features included:");
365387
console.log(" βœ… Menu options (choices with condition flags)");
366-
console.log(" βœ… Conditions (stats and variables)");
388+
console.log(
389+
" βœ… Conditions with all comparison operators (>=, <=, >, <, ==, !=)"
390+
);
391+
console.log(" βœ… Variables conditions");
367392
console.log(" βœ… Visual statements (SCENE, SHOW, HIDE)");
368393
console.log(" βœ… Jump targets");
369394
console.log(" βœ… Combinations of multiple features\n");
370-
console.log("To test:");
395+
console.log("To test comparison operators:");
371396
console.log(` 1. Open the app and login with: ${TEST_EMAIL}`);
372397
console.log(` 2. Password: ${TEST_PASSWORD}`);
373398
console.log(" 3. Open the 'Technical Badges Test' project");
@@ -376,8 +401,9 @@ async function seedTechnicalBadgesData() {
376401
" 5. Click the eye icon in the top-right to toggle technical badges"
377402
);
378403
console.log(
379-
" 6. You should see badges on lines 2-9 (line 1 has no badges)\n"
404+
" 6. Click/hover on badges on lines 3, 8, and 10 to see operator symbols"
380405
);
406+
console.log(" 7. Verify symbols: β‰₯, ≀, =, β‰  are displayed correctly\n");
381407

382408
process.exit(0);
383409
}

0 commit comments

Comments
Β (0)