@timardex/cluemart-server-shared 2.1.11 → 2.2.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.d.mts CHANGED
@@ -1045,9 +1045,11 @@ declare function isValidObjectId(value: string): boolean;
1045
1045
  declare function convertObjectIdsToStrings(obj: any): any;
1046
1046
 
1047
1047
  /**
1048
- * Updates the dateStatus field for a single DateTimeType object based on the current date/time
1048
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time.
1049
+ * Manual statuses (CANCELED, RE_SCHEDULED) are preserved and returned as-is.
1049
1050
  * @param dateTime The date-time object to update
1050
- * @returns A new object with updated dateStatus value
1051
+ * @returns A new object with an updated dateStatus value, or the original
1052
+ * object when the stored status is a manual override
1051
1053
  */
1052
1054
  declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
1053
1055
  /**
package/dist/index.d.ts CHANGED
@@ -1045,9 +1045,11 @@ declare function isValidObjectId(value: string): boolean;
1045
1045
  declare function convertObjectIdsToStrings(obj: any): any;
1046
1046
 
1047
1047
  /**
1048
- * Updates the dateStatus field for a single DateTimeType object based on the current date/time
1048
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time.
1049
+ * Manual statuses (CANCELED, RE_SCHEDULED) are preserved and returned as-is.
1049
1050
  * @param dateTime The date-time object to update
1050
- * @returns A new object with updated dateStatus value
1051
+ * @returns A new object with an updated dateStatus value, or the original
1052
+ * object when the stored status is a manual override
1051
1053
  */
1052
1054
  declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
1053
1055
  /**
package/dist/index.mjs CHANGED
@@ -3178,6 +3178,10 @@ async function persistArchivedEventDates(eventId, slots) {
3178
3178
  // src/service/event/updateAllEventDateTimeStatuses.ts
3179
3179
  dayjs2.extend(customParseFormat);
3180
3180
  dayjs2.extend(isoWeek);
3181
+ var MANUAL_DATE_STATUSES = /* @__PURE__ */ new Set([
3182
+ EnumEventDateStatus7.CANCELED,
3183
+ EnumEventDateStatus7.RE_SCHEDULED
3184
+ ]);
3181
3185
  function getFutureEventStatus(startDateTime, now) {
3182
3186
  const hoursUntilStart = startDateTime.diff(now, "hour", true);
3183
3187
  if (hoursUntilStart > 0 && hoursUntilStart <= 4) {
@@ -3198,6 +3202,9 @@ function getFutureEventStatus(startDateTime, now) {
3198
3202
  return EnumEventDateStatus7.UPCOMING;
3199
3203
  }
3200
3204
  function updateSingleDateTimeStatus(dateTime, now = dayjs2()) {
3205
+ if (MANUAL_DATE_STATUSES.has(dateTime.dateStatus)) {
3206
+ return dateTime;
3207
+ }
3201
3208
  const dateTimeFormat = `${dateFormat} ${timeFormat}`;
3202
3209
  const startDateTime = dayjs2(
3203
3210
  `${dateTime.startDate} ${dateTime.startTime}`,