@outbuild-company/schedule-core 1.27.0 → 1.28.0

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/dist/index.cjs CHANGED
@@ -34157,8 +34157,8 @@ function resolveExpectedFinishDateSelection(input) {
34157
34157
  });
34158
34158
  }
34159
34159
 
34160
- // src/p6/lookahead-derived.ts
34161
- function createLookaheadDerivedFields(input) {
34160
+ // src/calendar/schedule-calendars.ts
34161
+ function createScheduleCalendars(input) {
34162
34162
  const normalized2 = normalizeCalendars(
34163
34163
  [...input.calendars],
34164
34164
  void 0,
@@ -34167,11 +34167,22 @@ function createLookaheadDerivedFields(input) {
34167
34167
  const { reader } = createCalendarSetup(
34168
34168
  serializeCalendars(normalized2.calendars, normalized2.baseCalendars)
34169
34169
  );
34170
+ return {
34171
+ defaultCalendarId: normalized2.defaultCalendarId,
34172
+ resolveCalendar(calendarId) {
34173
+ const knownCalendarId = calendarId !== null && normalized2.knownCalendarIds.has(calendarId) ? calendarId : normalized2.defaultCalendarId;
34174
+ return reader.getCalendar(knownCalendarId);
34175
+ }
34176
+ };
34177
+ }
34178
+
34179
+ // src/p6/lookahead-derived.ts
34180
+ function createLookaheadDerivedFields(input) {
34181
+ const { resolveCalendar } = createScheduleCalendars(input);
34170
34182
  return {
34171
34183
  derive({ previous, next, calendarId, dataDate, totalFloatMethod }) {
34172
34184
  if (!isP6ActivityState(next)) return null;
34173
- const knownCalendarId = calendarId !== null && normalized2.knownCalendarIds.has(calendarId) ? calendarId : normalized2.defaultCalendarId;
34174
- const calendar = reader.getCalendar(knownCalendarId);
34185
+ const calendar = resolveCalendar(calendarId);
34175
34186
  if (!calendar) return null;
34176
34187
  const { p6 } = projectDataDateLocalActivity(previous, next, {
34177
34188
  calendar,
@@ -34189,6 +34200,23 @@ function createLookaheadDerivedFields(input) {
34189
34200
  };
34190
34201
  }
34191
34202
 
34203
+ // src/calendar/reader.ts
34204
+ function createCalendarReader(input) {
34205
+ const { defaultCalendarId, resolveCalendar } = createScheduleCalendars(input);
34206
+ if (defaultCalendarId === null) {
34207
+ throw new Error("Calendar reader requires at least one calendar");
34208
+ }
34209
+ return {
34210
+ getCalendar(calendarId) {
34211
+ const calendar = resolveCalendar(calendarId);
34212
+ if (!calendar) {
34213
+ throw new Error("Resolved calendar missing after normalization");
34214
+ }
34215
+ return calendar;
34216
+ }
34217
+ };
34218
+ }
34219
+
34192
34220
  // src/p6/property-contract.ts
34193
34221
  var row = (input) => {
34194
34222
  const lifecycle = input.lifecycle ?? (input.classification === "f9_output" ? "f9" : "explicit_edit");
@@ -34900,6 +34928,7 @@ exports.appendGroupRowId = appendGroupRowId;
34900
34928
  exports.buildGroupRowId = buildGroupRowId;
34901
34929
  exports.checkNoUpdatedLinks = checkNoUpdatedLinks;
34902
34930
  exports.computeExpectedProgress = computeExpectedProgress;
34931
+ exports.createCalendarReader = createCalendarReader;
34903
34932
  exports.createLookaheadDerivedFields = createLookaheadDerivedFields;
34904
34933
  exports.createOutbuildDataDateScheduleSettings = createOutbuildP6ScheduleSettings;
34905
34934
  exports.createSchedule = createSchedule;