@lyxa.ai/core 1.3.1 → 1.3.2

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.
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.1
25
+ Version: 1.3.2
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -5,7 +5,9 @@ const enum_1 = require("./enum");
5
5
  function groupRidersByLanguage(riderAssignments, assignRiders) {
6
6
  const englishRiders = [];
7
7
  const arabicRiders = [];
8
- const rejectedRiderIds = new Set(riderAssignments.filter(a => a.status === enum_1.RiderAssignmentStatus.REJECTED).map(a => a.rider.toString()));
8
+ const rejectedRiderIds = new Set(riderAssignments
9
+ .filter(a => [enum_1.RiderAssignmentStatus.REJECTED, enum_1.RiderAssignmentStatus.CANCELLED].includes(a.status))
10
+ .map(a => a.rider.toString()));
9
11
  for (const { _id, language } of assignRiders) {
10
12
  if (!_id || rejectedRiderIds.has(_id.toString()))
11
13
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"group-rider.js","sourceRoot":"/","sources":["utilities/group-rider.ts"],"names":[],"mappings":";;AAQA,sDAoBC;AA3BD,iCAAyD;AAOzD,SAAgB,qBAAqB,CACpC,gBAAqF,EACrF,YAA8B;IAE9B,MAAM,aAAa,GAA8B,EAAE,CAAC;IACpD,MAAM,YAAY,GAA8B,EAAE,CAAC;IAEnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC/B,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,4BAAqB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CACtG,CAAC;IAEF,KAAK,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC;QAE9C,IAAI,CAAC,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAAE,SAAS;QAG3D,CAAC,QAAQ,KAAK,eAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { Language, RiderAssignmentStatus } from './enum';\nimport { AssignRiderDTO } from './validation';\n\n/**\n * Groups riders by their preferred language (English / Arabic),\n * excluding those who have rejected the assignment.\n */\nexport function groupRidersByLanguage(\n\triderAssignments: { rider: mongoose.Types.ObjectId; status: RiderAssignmentStatus }[],\n\tassignRiders: AssignRiderDTO[]\n) {\n\tconst englishRiders: mongoose.Types.ObjectId[] = [];\n\tconst arabicRiders: mongoose.Types.ObjectId[] = [];\n\n\tconst rejectedRiderIds = new Set(\n\t\triderAssignments.filter(a => a.status === RiderAssignmentStatus.REJECTED).map(a => a.rider.toString())\n\t);\n\n\tfor (const { _id, language } of assignRiders) {\n\t\t// Skip riders who have rejected\n\t\tif (!_id || rejectedRiderIds.has(_id.toString())) continue;\n\n\t\t// Group by language\n\t\t(language === Language.AR ? arabicRiders : englishRiders).push(_id);\n\t}\n\n\treturn { englishRiders, arabicRiders };\n}\n"]}
1
+ {"version":3,"file":"group-rider.js","sourceRoot":"/","sources":["utilities/group-rider.ts"],"names":[],"mappings":";;AAQA,sDAsBC;AA7BD,iCAAyD;AAOzD,SAAgB,qBAAqB,CACpC,gBAAqF,EACrF,YAA8B;IAE9B,MAAM,aAAa,GAA8B,EAAE,CAAC;IACpD,MAAM,YAAY,GAA8B,EAAE,CAAC;IAEnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC/B,gBAAgB;SACd,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,4BAAqB,CAAC,QAAQ,EAAE,4BAAqB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;SACjG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAC9B,CAAC;IAEF,KAAK,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC;QAE9C,IAAI,CAAC,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAAE,SAAS;QAG3D,CAAC,QAAQ,KAAK,eAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { Language, RiderAssignmentStatus } from './enum';\nimport { AssignRiderDTO } from './validation';\n\n/**\n * Groups riders by their preferred language (English / Arabic),\n * excluding those who have rejected the assignment.\n */\nexport function groupRidersByLanguage(\n\triderAssignments: { rider: mongoose.Types.ObjectId; status: RiderAssignmentStatus }[],\n\tassignRiders: AssignRiderDTO[]\n) {\n\tconst englishRiders: mongoose.Types.ObjectId[] = [];\n\tconst arabicRiders: mongoose.Types.ObjectId[] = [];\n\n\tconst rejectedRiderIds = new Set(\n\t\triderAssignments\n\t\t\t.filter(a => [RiderAssignmentStatus.REJECTED, RiderAssignmentStatus.CANCELLED].includes(a.status))\n\t\t\t.map(a => a.rider.toString())\n\t);\n\n\tfor (const { _id, language } of assignRiders) {\n\t\t// Skip riders who have rejected\n\t\tif (!_id || rejectedRiderIds.has(_id.toString())) continue;\n\n\t\t// Group by language\n\t\t(language === Language.AR ? arabicRiders : englishRiders).push(_id);\n\t}\n\n\treturn { englishRiders, arabicRiders };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",