@outbuild-company/schedule-core 1.15.0 → 1.15.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.
package/dist/index.d.cts CHANGED
@@ -959,7 +959,6 @@ type ActivityCreationOverrides = Omit<CreationOverrides, 'durationHours'> & {
959
959
  };
960
960
  /** One ordered input accepted by {@link ScheduleCore.dispatchMany}. */
961
961
  type DispatchManyAction = DispatchAction | ActivityBatchAction;
962
- type InternalDispatchAction = DispatchManyAction;
963
962
  /** Per-operation derived-work controls; both default to `false`. */
964
963
  interface DispatchOptions {
965
964
  /** Skips autoscheduling for this operation when `true`. */
@@ -1081,7 +1080,7 @@ interface DispatchManyChangeSetSource {
1081
1080
  readonly actions: readonly DispatchManyAction[];
1082
1081
  }
1083
1082
  /** Public command, activity batch, or lifecycle operation that produced changes. */
1084
- type ChangeSetSource = InternalDispatchAction | DispatchManyChangeSetSource | {
1083
+ type ChangeSetSource = DispatchManyAction | DispatchManyChangeSetSource | {
1085
1084
  kind: typeof CHANGE_SET_SOURCE_KIND.INIT | typeof CHANGE_SET_SOURCE_KIND.UNDO | typeof CHANGE_SET_SOURCE_KIND.REDO;
1086
1085
  };
1087
1086
  /**
package/dist/index.d.ts CHANGED
@@ -959,7 +959,6 @@ type ActivityCreationOverrides = Omit<CreationOverrides, 'durationHours'> & {
959
959
  };
960
960
  /** One ordered input accepted by {@link ScheduleCore.dispatchMany}. */
961
961
  type DispatchManyAction = DispatchAction | ActivityBatchAction;
962
- type InternalDispatchAction = DispatchManyAction;
963
962
  /** Per-operation derived-work controls; both default to `false`. */
964
963
  interface DispatchOptions {
965
964
  /** Skips autoscheduling for this operation when `true`. */
@@ -1081,7 +1080,7 @@ interface DispatchManyChangeSetSource {
1081
1080
  readonly actions: readonly DispatchManyAction[];
1082
1081
  }
1083
1082
  /** Public command, activity batch, or lifecycle operation that produced changes. */
1084
- type ChangeSetSource = InternalDispatchAction | DispatchManyChangeSetSource | {
1083
+ type ChangeSetSource = DispatchManyAction | DispatchManyChangeSetSource | {
1085
1084
  kind: typeof CHANGE_SET_SOURCE_KIND.INIT | typeof CHANGE_SET_SOURCE_KIND.UNDO | typeof CHANGE_SET_SOURCE_KIND.REDO;
1086
1085
  };
1087
1086
  /**
package/dist/index.js CHANGED
@@ -5459,24 +5459,20 @@ function buildCalendarPatch(activity, newCalendarId, ctx) {
5459
5459
  };
5460
5460
  const newCalendar = ctx.calendars.getCalendar(newCalendarId);
5461
5461
  if (newCalendar) {
5462
- const isMilestone = activity.durationHours === 0;
5463
- const snapToShiftStart = isMilestone || activity.assignedDefaultCalendar;
5464
- const snapFrom = snapToShiftStart ? startOfUtcDay2(activity.startDate) : activity.startDate;
5465
5462
  const calendarStart = newCalendar.getClosestWorkTime({
5466
- date: snapFrom,
5463
+ date: startOfUtcDay2(activity.startDate),
5467
5464
  direction: "future",
5468
5465
  unit: "hour"
5469
5466
  });
5470
- if (!activity.autoScheduling || snapToShiftStart || newCalendar.getWorkHours(activity.startDate).length === 0) {
5471
- fields.startDate = calendarStart;
5472
- }
5467
+ fields.startDate = calendarStart;
5473
5468
  if (!activity.autoScheduling) {
5474
5469
  return fields;
5475
5470
  }
5476
- const endStart = fields.startDate ?? activity.startDate;
5477
5471
  Object.assign(
5478
5472
  fields,
5479
- setEndDate(newCalendar.calculateEndDate(endStart, activity.durationHours))
5473
+ setEndDate(
5474
+ newCalendar.calculateEndDate(calendarStart, activity.durationHours)
5475
+ )
5480
5476
  );
5481
5477
  }
5482
5478
  return fields;