@royalschedule/maps 3.3.9 → 3.3.11

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.
@@ -72,7 +72,7 @@ var constraints_default = (schedule, options = {}) => {
72
72
  * Only add lunch if the group is a class
73
73
  */
74
74
  if (groups?.some((group) => "lunch" in group)) data.events = (data.events ?? []).concat(dynamic_locked_times_default(groups.filter((x) => x.species == "class"), settings, options, lunchSet, destructMap));
75
- if (teachers?.some((teacher) => "lunch" in teacher || "complementaryHours" in teacher)) data.events = (data.events ?? []).concat(dynamic_locked_times_default(teachers, settings, options, lunchSet));
75
+ if (teachers?.some((teacher) => "lunch" in teacher || "complementaryTimes" in teacher)) data.events = (data.events ?? []).concat(dynamic_locked_times_default(teachers, settings, options, lunchSet));
76
76
  return data;
77
77
  };
78
78
 
@@ -1 +1 @@
1
- {"version":3,"file":"constraints.js","names":["idKey: keyof CoreTypes.course","groupMap","_destructure","data: Constraint","getSettings","getDefault","getCollections","getDependencies","getGroups","getTeachers","getDynamicLockedTimes"],"sources":["../../../../src/RS/v3/to/constraints.ts"],"sourcesContent":["import { pick } from 'lodash-es';\n\nimport { Types as CoreTypes } from '../../../core/types';\nimport { Deserialized } from '../../../core/types';\n\nimport { Constraint } from '../types/constraints';\nimport { OutOptions } from '../types/out-options';\n\nimport _destructure from './destructure';\nimport getDependencies from './dependencies';\nimport getTeachers from './teachers';\nimport getGroups from './groups';\nimport getCollections from './collections';\nimport getSettings from './settings';\nimport getDefault from './default';\nimport getDynamicLockedTimes from './dynamic-locked-times';\nimport { parsePeriods } from './periods';\nimport { personsToIndividuals,\n groupsToIndividuals,\n teachersToIndividuals } from './individuals';\n\nexport default (\n schedule: Partial<Deserialized<CoreTypes.schedule> & { division: Deserialized<CoreTypes.division> }>,\n options: OutOptions = {}\n): Constraint => {\n ////\n //// for backward compatibility: add default collection to included events set\n ////\n if (options.partialScheduleOptions?.includedEvents?.size) {\n options.partialScheduleOptions.includedEvents = new Set(\n [...options.partialScheduleOptions.includedEvents]\n .map(x => {\n // should start with 'events.' or 'lockedTimes.' prefix\n if (x.startsWith('events.') || x.startsWith('lockedTimes.')) return x;\n return `events.${x}`;\n })\n );\n }\n\n\n // clone schedule to avoid mutating the original object\n schedule = structuredClone(schedule);\n\n if (schedule == null) return {};\n const idKey: keyof CoreTypes.course = options.idKey || 'id';\n\n const settings = schedule.settings;\n if (!settings) throw new Error('settings missing in schedule');\n\n const area = schedule.area;\n const groups = schedule.groups ?? [];\n const teachers = schedule.teachers ?? [];\n const locations = schedule.locations ?? [];\n const events = schedule.events ?? [];\n const overlapGroups = schedule.overlapGroups ?? [];\n const courses = schedule.courses ?? [];\n const periods = schedule.periods ?? [];\n const persons = schedule.persons ?? [];\n\n ////\n //// populate some group references to ensure that the types are correct\n ////\n {\n const groupMap = new Map(groups\n .map(x => ([x[idKey]?.toString(), x] as const))\n .filter(x => !!x[0])\n );\n // group.parentGroups\n groups?.forEach(item => {\n if (!item.parentGroups) return;\n item.parentGroups = item.parentGroups\n .map((x: Deserialized<CoreTypes.group> | string) => {\n return typeof x === 'string' ? groupMap.get(x) : groupMap.get(x[idKey]?.toString());\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n });\n // course.groups.to and event.groups.to\n courses.concat(events).forEach(item => {\n if (!item.groups) return;\n item.groups.forEach((x: { to: Deserialized<CoreTypes.group> | string }) => {\n const group = typeof x.to === 'string' ? groupMap.get(x.to) : groupMap.get(x.to[idKey]?.toString());\n if (group) x.to = group;\n });\n });\n }\n\n // unfortunately the division is set either as \"division\" or \"divisions\" so we need to handle both cases\n const division = schedule.divisions ?? schedule.division;\n\n // map periods\n const { map: periodsMap, matrix: periodsMatrix } = parsePeriods(periods, pick(division, 'start', 'end'));\n\n const destructMap = _destructure(courses, events, groups, settings, options);\n\n const data: Constraint = {\n settings: getSettings(settings),\n default: getDefault(settings, periodsMap, options),\n ...periodsMatrix && { periods: periodsMatrix },\n ...area && {\n areas: {\n breakLengthMatrix: area.breakLengthMatrix,\n list: area.list\n }\n },\n // intervals: getRootIntervals(rootIntervals, settings!),\n events: getCollections(courses, events, overlapGroups, settings, options, periodsMap, destructMap),\n dependencies: getDependencies(locations, settings, options),\n groups: getGroups(groups, settings, options)\n .concat(getTeachers(teachers, settings, options)),\n individuals: personsToIndividuals(persons, settings, options)\n .concat(groupsToIndividuals(groups, settings, options))\n .concat(teachersToIndividuals(teachers, settings, options)),\n };\n\n /*\n create map of groups if some groups are destructed\n groupMap: group id -> group\n */\n const groupMap = new Map<string, Deserialized<CoreTypes.group>>();\n if (destructMap.size) {\n groups?.forEach(x => groupMap.set(x[idKey]!.toString(), x));\n\n /*\n Find group and clone and substitute id with person id\n */\n data.individuals = data.individuals?.concat(Array.from(destructMap.values()));\n }\n\n /*\n handle groups.lunch and teachers.lunch\n append to events list\n */\n const lunchSet = new Set<string>();\n /**\n * Only add lunch if the group is a class\n */\n if (groups?.some(group => 'lunch' in group))\n data.events = (data.events ?? []).concat(getDynamicLockedTimes(groups.filter(x => x.species == 'class'), settings, options, lunchSet, destructMap));\n\n if (teachers?.some(teacher => 'lunch' in teacher || 'complementaryHours' in teacher))\n data.events = (data.events ?? []).concat(getDynamicLockedTimes(teachers, settings, options, lunchSet));\n\n return data;\n};"],"mappings":";;;;;;;;;;;;;AAqBA,2BACE,UACA,UAAuB,OACR;AAIf,KAAI,QAAQ,wBAAwB,gBAAgB,KAClD,SAAQ,uBAAuB,iBAAiB,IAAI,IAClD,CAAC,GAAG,QAAQ,uBAAuB,gBAChC,KAAI,MAAK;AAER,MAAI,EAAE,WAAW,cAAc,EAAE,WAAW,gBAAiB,QAAO;AACpE,SAAO,UAAU;;AAOzB,YAAW,gBAAgB;AAE3B,KAAI,YAAY,KAAM,QAAO;CAC7B,MAAMA,QAAgC,QAAQ,SAAS;CAEvD,MAAM,WAAW,SAAS;AAC1B,KAAI,CAAC,SAAU,OAAM,IAAI,MAAM;CAE/B,MAAM,OAAgB,SAAS;CAC/B,MAAM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F,cAAcC,qBAAgB,WAAW,UAAU;EACnD,QAAcC,eAAU,QAAQ,UAAU,SACvC,OAAOC,iBAAY,UAAU,UAAU;EAC1C,aAAa,qBAAqB,SAAS,UAAU,SAClD,OAAO,oBAAoB,QAAQ,UAAU,UAC7C,OAAO,sBAAsB,UAAU,UAAU;;CAOtD,MAAM,2BAAW,IAAI;AACrB,KAAI,YAAY,MAAM;AACpB,UAAQ,SAAQ,MAAK,SAAS,IAAI,EAAE,OAAQ,YAAY;AAKxD,OAAK,cAAc,KAAK,aAAa,OAAO,MAAM,KAAK,YAAY;;CAOrE,MAAM,2BAAW,IAAI;;;;AAIrB,KAAI,QAAQ,MAAK,UAAS,WAAW,OACnC,MAAK,UAAU,KAAK,UAAU,IAAI,OAAOC,6BAAsB,OAAO,QAAO,MAAK,EAAE,WAAW,UAAU,UAAU,SAAS,UAAU;AAExI,KAAI,UAAU,MAAK,YAAW,WAAW,WAAW,wBAAwB,SAC1E,MAAK,UAAU,KAAK,UAAU,IAAI,OAAOA,6BAAsB,UAAU,UAAU,SAAS;AAE9F,QAAO"}
1
+ {"version":3,"file":"constraints.js","names":["idKey: keyof CoreTypes.course","groupMap","_destructure","data: Constraint","getSettings","getDefault","getCollections","getDependencies","getGroups","getTeachers","getDynamicLockedTimes"],"sources":["../../../../src/RS/v3/to/constraints.ts"],"sourcesContent":["import { pick } from 'lodash-es';\n\nimport { Types as CoreTypes } from '../../../core/types';\nimport { Deserialized } from '../../../core/types';\n\nimport { Constraint } from '../types/constraints';\nimport { OutOptions } from '../types/out-options';\n\nimport _destructure from './destructure';\nimport getDependencies from './dependencies';\nimport getTeachers from './teachers';\nimport getGroups from './groups';\nimport getCollections from './collections';\nimport getSettings from './settings';\nimport getDefault from './default';\nimport getDynamicLockedTimes from './dynamic-locked-times';\nimport { parsePeriods } from './periods';\nimport { personsToIndividuals,\n groupsToIndividuals,\n teachersToIndividuals } from './individuals';\n\nexport default (\n schedule: Partial<Deserialized<CoreTypes.schedule> & { division: Deserialized<CoreTypes.division> }>,\n options: OutOptions = {}\n): Constraint => {\n ////\n //// for backward compatibility: add default collection to included events set\n ////\n if (options.partialScheduleOptions?.includedEvents?.size) {\n options.partialScheduleOptions.includedEvents = new Set(\n [...options.partialScheduleOptions.includedEvents]\n .map(x => {\n // should start with 'events.' or 'lockedTimes.' prefix\n if (x.startsWith('events.') || x.startsWith('lockedTimes.')) return x;\n return `events.${x}`;\n })\n );\n }\n\n\n // clone schedule to avoid mutating the original object\n schedule = structuredClone(schedule);\n\n if (schedule == null) return {};\n const idKey: keyof CoreTypes.course = options.idKey || 'id';\n\n const settings = schedule.settings;\n if (!settings) throw new Error('settings missing in schedule');\n\n const area = schedule.area;\n const groups = schedule.groups ?? [];\n const teachers = schedule.teachers ?? [];\n const locations = schedule.locations ?? [];\n const events = schedule.events ?? [];\n const overlapGroups = schedule.overlapGroups ?? [];\n const courses = schedule.courses ?? [];\n const periods = schedule.periods ?? [];\n const persons = schedule.persons ?? [];\n\n ////\n //// populate some group references to ensure that the types are correct\n ////\n {\n const groupMap = new Map(groups\n .map(x => ([x[idKey]?.toString(), x] as const))\n .filter(x => !!x[0])\n );\n // group.parentGroups\n groups?.forEach(item => {\n if (!item.parentGroups) return;\n item.parentGroups = item.parentGroups\n .map((x: Deserialized<CoreTypes.group> | string) => {\n return typeof x === 'string' ? groupMap.get(x) : groupMap.get(x[idKey]?.toString());\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n });\n // course.groups.to and event.groups.to\n courses.concat(events).forEach(item => {\n if (!item.groups) return;\n item.groups.forEach((x: { to: Deserialized<CoreTypes.group> | string }) => {\n const group = typeof x.to === 'string' ? groupMap.get(x.to) : groupMap.get(x.to[idKey]?.toString());\n if (group) x.to = group;\n });\n });\n }\n\n // unfortunately the division is set either as \"division\" or \"divisions\" so we need to handle both cases\n const division = schedule.divisions ?? schedule.division;\n\n // map periods\n const { map: periodsMap, matrix: periodsMatrix } = parsePeriods(periods, pick(division, 'start', 'end'));\n\n const destructMap = _destructure(courses, events, groups, settings, options);\n\n const data: Constraint = {\n settings: getSettings(settings),\n default: getDefault(settings, periodsMap, options),\n ...periodsMatrix && { periods: periodsMatrix },\n ...area && {\n areas: {\n breakLengthMatrix: area.breakLengthMatrix,\n list: area.list\n }\n },\n // intervals: getRootIntervals(rootIntervals, settings!),\n events: getCollections(courses, events, overlapGroups, settings, options, periodsMap, destructMap),\n dependencies: getDependencies(locations, settings, options),\n groups: getGroups(groups, settings, options)\n .concat(getTeachers(teachers, settings, options)),\n individuals: personsToIndividuals(persons, settings, options)\n .concat(groupsToIndividuals(groups, settings, options))\n .concat(teachersToIndividuals(teachers, settings, options)),\n };\n\n /*\n create map of groups if some groups are destructed\n groupMap: group id -> group\n */\n const groupMap = new Map<string, Deserialized<CoreTypes.group>>();\n if (destructMap.size) {\n groups?.forEach(x => groupMap.set(x[idKey]!.toString(), x));\n\n /*\n Find group and clone and substitute id with person id\n */\n data.individuals = data.individuals?.concat(Array.from(destructMap.values()));\n }\n\n /*\n handle groups.lunch and teachers.lunch\n append to events list\n */\n const lunchSet = new Set<string>();\n /**\n * Only add lunch if the group is a class\n */\n if (groups?.some(group => 'lunch' in group))\n data.events = (data.events ?? []).concat(getDynamicLockedTimes(groups.filter(x => x.species == 'class'), settings, options, lunchSet, destructMap));\n\n if (teachers?.some(teacher => 'lunch' in teacher || 'complementaryTimes' in teacher))\n data.events = (data.events ?? []).concat(getDynamicLockedTimes(teachers, settings, options, lunchSet));\n\n return data;\n};"],"mappings":";;;;;;;;;;;;;AAqBA,2BACE,UACA,UAAuB,OACR;AAIf,KAAI,QAAQ,wBAAwB,gBAAgB,KAClD,SAAQ,uBAAuB,iBAAiB,IAAI,IAClD,CAAC,GAAG,QAAQ,uBAAuB,gBAChC,KAAI,MAAK;AAER,MAAI,EAAE,WAAW,cAAc,EAAE,WAAW,gBAAiB,QAAO;AACpE,SAAO,UAAU;;AAOzB,YAAW,gBAAgB;AAE3B,KAAI,YAAY,KAAM,QAAO;CAC7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S;EAC/B,GAAG,QAAQ,EACT,OAAO;GACL,mBAAmB,KAAK;GACxB,MAAmB,KAAK;;EAI5B,QAAcC,oBAAe,SAAS,QAAQ,eAAe,UAAU,SAAS,YAAY;EAC5F,cAAcC,qBAAgB,WAAW,UAAU;EACnD,QAAcC,eAAU,QAAQ,UAAU,SACvC,OAAOC,iBAAY,UAAU,UAAU;EAC1C,aAAa,qBAAqB,SAAS,UAAU,SAClD,OAAO,oBAAoB,QAAQ,UAAU,UAC7C,OAAO,sBAAsB,UAAU,UAAU;;CAOtD,MAAM,2BAAW,IAAI;AACrB,KAAI,YAAY,MAAM;AACpB,UAAQ,SAAQ,MAAK,SAAS,IAAI,EAAE,OAAQ,YAAY;AAKxD,OAAK,cAAc,KAAK,aAAa,OAAO,MAAM,KAAK,YAAY;;CAOrE,MAAM,2BAAW,IAAI;;;;AAIrB,KAAI,QAAQ,MAAK,UAAS,WAAW,OACnC,MAAK,UAAU,KAAK,UAAU,IAAI,OAAOC,6BAAsB,OAAO,QAAO,MAAK,EAAE,WAAW,UAAU,UAAU,SAAS,UAAU;AAExI,KAAI,UAAU,MAAK,YAAW,WAAW,WAAW,wBAAwB,SAC1E,MAAK,UAAU,KAAK,UAAU,IAAI,OAAOA,6BAAsB,UAAU,UAAU,SAAS;AAE9F,QAAO"}
@@ -32,7 +32,7 @@ var dynamic_locked_times_default = (docs, settings, options, set, destructMap) =
32
32
  toModel: ""
33
33
  }]
34
34
  }));
35
- if ("complementaryHours" in group) lunch = lunch?.concat(group.complementaryHours ?? []);
35
+ if ("complementaryTimes" in group) lunch = lunch?.concat(group.complementaryTimes ?? []);
36
36
  if (lunch == null) return acc;
37
37
  return acc.concat(lunch.reduce((acc$1, lockedTime) => {
38
38
  const { _id, intervals, duration, durationVariance, coalesced } = lockedTime;
@@ -46,7 +46,7 @@ var dynamic_locked_times_default = (docs, settings, options, set, destructMap) =
46
46
  if (days) days = [...new Set(days)];
47
47
  const day = days?.length == 1 ? days[0] : void 0;
48
48
  const groups = mapCoalescedReferences(coalesced, options, destructMap);
49
- const distributionKey = lockedTime.type == "COMPLEMENTARY_HOURS" ? "COMPLEMENTARY_HOURS." + lockedTime.tags?.at(0)?.value : void 0;
49
+ const distributionKey = lockedTime.type == "COMPLEMENTARY_TIME" ? "COMPLEMENTARY_TIME." + lockedTime.tags?.at(0)?.value : void 0;
50
50
  const doc = {
51
51
  id: `${group.lunch == null ? "virtual" : "lockedTimes"}.${id}`,
52
52
  groups: [...new Set(groups.filter(Boolean))],
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-locked-times.js","names":["idKey: 'id' | '_id' | 'ids'","lunch","id: string","acc","doc: CourseEvent","_intervals"],"sources":["../../../../src/RS/v3/to/dynamic-locked-times.ts"],"sourcesContent":["import moment from 'moment';\nimport { nanoid } from 'nanoid';\nimport { pick } from 'lodash-es';\n\nimport { OutOptions } from '../types/out-options';\nimport { CourseEvent } from '../types/course-events';\nimport { Individual } from '../types/individuals';\n\nimport _intervals from './intervals';\n\nimport { Types as CoreTypes } from '../../../core/types';\nimport { Deserialized } from '../../../core/types';\nimport { toDayAndStart } from './course-events';\n\nfunction mapCoalescedReferences (\n coalesced: Deserialized<CoreTypes.lockedTime>['coalesced'],\n options: OutOptions,\n destructMap?: Map<string | null, Individual>\n) {\n const idKey = options.idKey || 'id';\n\n if (!coalesced) return [];\n\n const teachers = coalesced.filter(x => x.toModel == 'teachers');\n const groups = coalesced.filter(x => x.toModel == 'groups');\n const participants = coalesced.filter(x => x.toModel == 'persons');\n\n const teacherIds = teachers .map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => ({ individuals: ['teachers.individuals.' + x.toString()] }));\n const groupIds = groups .map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => 'groups.' + x.toString());\n const participantIds = participants.map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => ({ individuals: ['persons.' + x.toString()] }));\n\n\n const out = [...new Set(teacherIds), ...new Set(groupIds), ...new Set(participantIds)].map(x => [x]);\n return out;\n}\n\nexport default (\n docs: (Deserialized<CoreTypes.group> | Deserialized<CoreTypes.teacher>)[],\n settings: Deserialized<CoreTypes.divisionSettings>,\n options: OutOptions,\n set: Set<string>,\n destructMap?: Map<string | null, Individual>\n) => {\n //let docs: SourceLockedTime[] = (Array.isArray(lockedTimes) ? lockedTimes : [lockedTimes]);\n const idKey: 'id' | '_id' | 'ids' = (options.idKey ?? 'id');\n\n return docs\n .filter(x => !!x)\n .reduce((acc: CourseEvent[], group): CourseEvent[] => {\n let lunch = group.lunch;\n if (lunch == null) {\n lunch = settings.defaultLunch?.map(lunch => ({ ...lunch, coalesced: [{ to: pick(group, idKey), toModel: '' }] }));\n }\n\n if ('complementaryHours' in group) {\n lunch = lunch?.concat(group.complementaryHours ?? []);\n }\n\n if (lunch == null)\n return acc;\n\n return acc.concat(\n lunch.reduce((acc: CourseEvent[], lockedTime) => {\n\n const { _id, intervals, duration, durationVariance, coalesced } = lockedTime;\n\n const id: string = (lockedTime[idKey as keyof CoreTypes.lockedTime] || _id)?.toString() ?? nanoid();\n\n if (set.has(id))\n return acc;\n\n set.add(id);\n\n if (duration == null)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is null');\n\n if (duration < 5)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is less than 5 min');\n\n if (!coalesced)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is less than 5 min');\n /*\n find the day(s) the events should be placed on\n */\n\n let days = intervals?.length\n ? intervals.map(({ start }) => (moment(start).day() + 6) % 7)\n : undefined;\n if (days)\n days = [...new Set(days)];\n const day = days?.length == 1 ? days[0] : undefined;\n\n const groups = mapCoalescedReferences(coalesced, options, destructMap);\n\n const distributionKey = lockedTime.type == 'COMPLEMENTARY_HOURS'\n ? 'COMPLEMENTARY_HOURS.' + lockedTime.tags?.at(0)?.value\n : undefined;\n\n\n const doc: CourseEvent = {\n id: `${ group.lunch == null ? 'virtual' : 'lockedTimes' }.${ id }`,\n groups: [...new Set(groups.filter(Boolean))],\n dependencies: [...new Set(coalesced.filter(x => x.toModel == 'locations').map(({ to }) => to[idKey]?.toString()!)\n .filter(Boolean))].map(x => [x]),\n length: duration,\n minBreakLength: false,\n intervals: intervals?.length ? _intervals(intervals, settings) : undefined,\n ...distributionKey && { distributionKey },\n ...days && { days },\n ...day && { day },\n ...durationVariance != null && { maxLengthVariance: durationVariance },\n };\n\n\n\n ////\n //// filter events based on partialScheduleOptions\n ////\n if (options.partialScheduleOptions) {\n const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;\n if (includedEvents && !includedEvents.has(doc.id)) {\n\n if (omittedEventsHandling == 'ignore') return acc;\n\n if (omittedEventsHandling == 'freeze') {\n // must not be parked and have a start and duration to be frozen, otherwise it's ignored\n if (lockedTime.parked || !lockedTime.start || !lockedTime.duration) return acc;\n\n // fix day, start and end\n Object.assign(doc, toDayAndStart(lockedTime.start));\n doc.length = lockedTime.duration;\n doc.maxLengthVariance = 0;\n\n // override intervals and days to not cause conflicts\n const numDays = settings.numDays ?? 5;\n doc.days = Array.from({ length: numDays }, (_, i) => i);\n doc.intervals = Array.from({ length: numDays }, () => [{ beg: 0, end: 23.55 }]);\n\n // fix locations\n // > locations are always fixed for locked times\n }\n }\n }\n\n return acc.concat(doc);\n }, []));\n\n }, [])\n .flat()\n .filter(Boolean);\n};"],"mappings":";;;;;;;AAcA,SAAS,uBACP,WACA,SACA,aACA;CACA,MAAM,QAAQ,QAAQ,SAAS;AAE/B,KAAI,CAAC,UAAW,QAAO;CAEvB,MAAM,WAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CACxD,MAAM,SAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CACxD,MAAM,eAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CAExD,MAAM,aAAiB,SAAa,KAAK,EAAE,SAAS,GAAG,QAAQ,QAAQ,MAAkC,CAAC,CAAC,GACxG,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":3,"file":"dynamic-locked-times.js","names":["idKey: 'id' | '_id' | 'ids'","lunch","id: string","acc","doc: CourseEvent","_intervals"],"sources":["../../../../src/RS/v3/to/dynamic-locked-times.ts"],"sourcesContent":["import moment from 'moment';\nimport { nanoid } from 'nanoid';\nimport { pick } from 'lodash-es';\n\nimport { OutOptions } from '../types/out-options';\nimport { CourseEvent } from '../types/course-events';\nimport { Individual } from '../types/individuals';\n\nimport _intervals from './intervals';\n\nimport { Types as CoreTypes } from '../../../core/types';\nimport { Deserialized } from '../../../core/types';\nimport { toDayAndStart } from './course-events';\n\nfunction mapCoalescedReferences (\n coalesced: Deserialized<CoreTypes.lockedTime>['coalesced'],\n options: OutOptions,\n destructMap?: Map<string | null, Individual>\n) {\n const idKey = options.idKey || 'id';\n\n if (!coalesced) return [];\n\n const teachers = coalesced.filter(x => x.toModel == 'teachers');\n const groups = coalesced.filter(x => x.toModel == 'groups');\n const participants = coalesced.filter(x => x.toModel == 'persons');\n\n const teacherIds = teachers .map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => ({ individuals: ['teachers.individuals.' + x.toString()] }));\n const groupIds = groups .map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => 'groups.' + x.toString());\n const participantIds = participants.map(({ to }) => to[idKey]).filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => ({ individuals: ['persons.' + x.toString()] }));\n\n\n const out = [...new Set(teacherIds), ...new Set(groupIds), ...new Set(participantIds)].map(x => [x]);\n return out;\n}\n\nexport default (\n docs: (Deserialized<CoreTypes.group> | Deserialized<CoreTypes.teacher>)[],\n settings: Deserialized<CoreTypes.divisionSettings>,\n options: OutOptions,\n set: Set<string>,\n destructMap?: Map<string | null, Individual>\n) => {\n //let docs: SourceLockedTime[] = (Array.isArray(lockedTimes) ? lockedTimes : [lockedTimes]);\n const idKey: 'id' | '_id' | 'ids' = (options.idKey ?? 'id');\n\n return docs\n .filter(x => !!x)\n .reduce((acc: CourseEvent[], group): CourseEvent[] => {\n let lunch = group.lunch;\n if (lunch == null) {\n lunch = settings.defaultLunch?.map(lunch => ({ ...lunch, coalesced: [{ to: pick(group, idKey), toModel: '' }] }));\n }\n\n if ('complementaryTimes' in group) {\n lunch = lunch?.concat(group.complementaryTimes ?? []);\n }\n\n if (lunch == null)\n return acc;\n\n return acc.concat(\n lunch.reduce((acc: CourseEvent[], lockedTime) => {\n\n const { _id, intervals, duration, durationVariance, coalesced } = lockedTime;\n\n const id: string = (lockedTime[idKey as keyof CoreTypes.lockedTime] || _id)?.toString() ?? nanoid();\n\n if (set.has(id))\n return acc;\n\n set.add(id);\n\n if (duration == null)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is null');\n\n if (duration < 5)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is less than 5 min');\n\n if (!coalesced)\n throw new Error('(RS::V3::To::DynamicLockedTimes) Length of a locked time is less than 5 min');\n /*\n find the day(s) the events should be placed on\n */\n\n let days = intervals?.length\n ? intervals.map(({ start }) => (moment(start).day() + 6) % 7)\n : undefined;\n if (days)\n days = [...new Set(days)];\n const day = days?.length == 1 ? days[0] : undefined;\n\n const groups = mapCoalescedReferences(coalesced, options, destructMap);\n\n const distributionKey = lockedTime.type == 'COMPLEMENTARY_TIME'\n ? 'COMPLEMENTARY_TIME.' + lockedTime.tags?.at(0)?.value\n : undefined;\n\n\n const doc: CourseEvent = {\n id: `${ group.lunch == null ? 'virtual' : 'lockedTimes' }.${ id }`,\n groups: [...new Set(groups.filter(Boolean))],\n dependencies: [...new Set(coalesced.filter(x => x.toModel == 'locations').map(({ to }) => to[idKey]?.toString()!)\n .filter(Boolean))].map(x => [x]),\n length: duration,\n minBreakLength: false,\n intervals: intervals?.length ? _intervals(intervals, settings) : undefined,\n ...distributionKey && { distributionKey },\n ...days && { days },\n ...day && { day },\n ...durationVariance != null && { maxLengthVariance: durationVariance },\n };\n\n\n\n ////\n //// filter events based on partialScheduleOptions\n ////\n if (options.partialScheduleOptions) {\n const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;\n if (includedEvents && !includedEvents.has(doc.id)) {\n\n if (omittedEventsHandling == 'ignore') return acc;\n\n if (omittedEventsHandling == 'freeze') {\n // must not be parked and have a start and duration to be frozen, otherwise it's ignored\n if (lockedTime.parked || !lockedTime.start || !lockedTime.duration) return acc;\n\n // fix day, start and end\n Object.assign(doc, toDayAndStart(lockedTime.start));\n doc.length = lockedTime.duration;\n doc.maxLengthVariance = 0;\n\n // override intervals and days to not cause conflicts\n const numDays = settings.numDays ?? 5;\n doc.days = Array.from({ length: numDays }, (_, i) => i);\n doc.intervals = Array.from({ length: numDays }, () => [{ beg: 0, end: 23.55 }]);\n\n // fix locations\n // > locations are always fixed for locked times\n }\n }\n }\n\n return acc.concat(doc);\n }, []));\n\n }, [])\n .flat()\n .filter(Boolean);\n};"],"mappings":";;;;;;;AAcA,SAAS,uBACP,WACA,SACA,aACA;CACA,MAAM,QAAQ,QAAQ,SAAS;AAE/B,KAAI,CAAC,UAAW,QAAO;CAEvB,MAAM,WAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CACxD,MAAM,SAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CACxD,MAAM,eAAe,UAAU,QAAO,MAAK,EAAE,WAAW;CAExD,MAAM,aAAiB,SAAa,KAAK,EAAE,SAAS,GAAG,QAAQ,QAAQ,MAAkC,CAAC,CAAC,GACxG,KAAI,OAAM,EAAE,aAAa,CAAC,0BAA0B,EAAE;CACzD,MAAM,WAAiB,OAAa,KAAK,EAAE,SAAS,GAAG,QAAQ,QAAQ,MAAkC,CAAC,CAAC,GACxG,KAAI,MAAK,YAAY,EAAE;CAC1B,MAAM,iBAAiB,aAAa,KAAK,EAAE,SAAS,GAAG,QAAQ,QAAQ,MAAkC,CAAC,CAAC,GACxG,KAAI,OAAM,EAAE,aAAa,CAAC,aAAc,EAAE;CAG7C,MAAM,MAAM;EAAC,GAAG,IAAI,IAAI;EA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GAAG,IAAI,IAAI,UAAU,QAAO,MAAK,EAAE,WAAW,aAAa,KAAK,EAAE,SAAS,GAAG,QAAQ,YAClG,OAAO,WAAW,KAAI,MAAK,CAAC;IAC/B,QAAgB;IAChB,gBAAgB;IAChB,WAAgB,WAAW,SAASC,kBAAW,WAAW,YAAY;IACtE,GAAG,mBAAmB,EAAE;IACxB,GAAG,QAAQ,EAAE;IACb,GAAG,OAAO,EAAE;IACZ,GAAG,oBAAoB,QAAS,EAAE,mBAAmB;;AAQvD,OAAI,QAAQ,wBAAwB;IAClC,MAAM,EAAE,gBAAgB,0BAA0B,QAAQ;AAC1D,QAAI,kBAAkB,CAAC,eAAe,IAAI,IAAI,KAAK;AAEjD,SAAI,yBAAyB,SAAU,QAAOF;AAE9C,SAAI,yBAAyB,UAAU;AAErC,UAAI,WAAW,UAAU,CAAC,WAAW,SAAS,CAAC,WAAW,SAAU,QAAOA;AAG3E,aAAO,OAAO,KAAK,cAAc,WAAW;AAC5C,UAAI,SAAS,WAAW;AACxB,UAAI,oBAAoB;MAGxB,MAAM,UAAU,SAAS,WAAW;AACpC,UAAI,OAAY,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,MAAM;AAC1D,UAAI,YAAY,MAAM,KAAK,EAAE,QAAQ,iBAAiB,CAAC;OAAE,KAAK;OAAG,KAAK;;;;;AAQ5E,UAAOA,MAAI,OAAO;KACjB;IAEJ,IACF,OACA,OAAO"}
@@ -239,7 +239,7 @@ declare class export_default$3 {
239
239
  maximumScheduleSpan?: MaximumScheduleSpan | undefined;
240
240
  rootInterval?: Deserialized<RootInterval> | undefined;
241
241
  plannedScheduledDuration?: PlannedScheduledDuration | undefined;
242
- complementaryHours?: Deserialized<LockedTime>[] | undefined;
242
+ complementaryTimes?: Deserialized<LockedTime>[] | undefined;
243
243
  signature?: string | undefined;
244
244
  }[];
245
245
  locations: {
@@ -112,6 +112,7 @@ declare namespace Types {
112
112
  type ta = TA;
113
113
  type lesson = Lesson;
114
114
  type student = Student;
115
+ type errorType = ErrorType;
115
116
  type errorCode = ErrorCode;
116
117
  }
117
118
  type Options = {
@@ -209,7 +209,7 @@ declare function export_default$1(schedule: ReturnType<typeof export_default>):
209
209
  maximumScheduleSpan?: MaximumScheduleSpan | undefined;
210
210
  rootInterval?: Deserialized<RootInterval> | undefined;
211
211
  plannedScheduledDuration?: PlannedScheduledDuration | undefined;
212
- complementaryHours?: Deserialized<LockedTime>[] | undefined;
212
+ complementaryTimes?: Deserialized<LockedTime>[] | undefined;
213
213
  signature?: string | undefined;
214
214
  }[];
215
215
  locations: {
@@ -210,7 +210,7 @@ declare function export_default(schedule: Deserialized<Types$1.schedule>): {
210
210
  maximumScheduleSpan?: MaximumScheduleSpan | undefined;
211
211
  rootInterval?: Deserialized<RootInterval> | undefined;
212
212
  plannedScheduledDuration?: PlannedScheduledDuration | undefined;
213
- complementaryHours?: Deserialized<LockedTime>[] | undefined;
213
+ complementaryTimes?: Deserialized<LockedTime>[] | undefined;
214
214
  signature?: string | undefined;
215
215
  }[];
216
216
  locations: {
@@ -12,7 +12,7 @@ import moment from "moment";
12
12
  import { Types } from "mongoose";
13
13
 
14
14
  //#region src/core/v2/types/locked-times.d.ts
15
- type Type = 'ANY' | 'LUNCH' | 'COMPLEMENTARY_HOURS';
15
+ type Type = 'ANY' | 'LUNCH' | 'COMPLEMENTARY_TIME';
16
16
  interface LockedTimeBare {
17
17
  belongsTo?: Edge<Division>;
18
18
  displayName?: string;
@@ -28,7 +28,7 @@ interface TeacherBare {
28
28
  exceptions?: Edge<Exception[]>;
29
29
  lockedTimes?: Edge<LockedTime[]>;
30
30
  lunch?: Edge<LockedTime[]>;
31
- complementaryHours?: Edge<LockedTime[]>;
31
+ complementaryTimes?: Edge<LockedTime[]>;
32
32
  intervals?: Interval[];
33
33
  rootInterval?: Edge<RootInterval>;
34
34
  days?: Day[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@royalschedule/maps",
3
3
  "description": "",
4
- "version": "3.3.9",
4
+ "version": "3.3.11",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",