@timardex/cluemart-server-shared 1.0.210 → 1.0.211

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.
@@ -1,6 +1,7 @@
1
1
  import { f as SchemaCreateBulkNotificationInput, O as ObjectId } from '../Chat-DYkhie3G.mjs';
2
- import { EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
- import { DateTimeType } from '@timardex/cluemart-shared/types';
2
+ import { EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
+ import dayjs from 'dayjs';
4
+ import { DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
4
5
  import { S as SchemaRelationType } from '../Relation-BjYghDE9.mjs';
5
6
  import 'mongoose';
6
7
  import 'express';
@@ -38,6 +39,12 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
38
39
  */
39
40
  declare function convertObjectIdsToStrings(obj: any): any;
40
41
 
42
+ /**
43
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time
44
+ * @param dateTime The date-time object to update
45
+ * @returns A new object with updated dateStatus value
46
+ */
47
+ declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
41
48
  /**
42
49
  * Recomputes dateStatus for every dateTime slot on events and google imported markets.
43
50
  */
@@ -54,7 +61,7 @@ type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
54
61
  */
55
62
  declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
56
63
 
57
- type EventDateSlot = Pick<DateTimeType, "startDate" | "startTime">;
64
+ type EventDateSlot = Pick<DateTimeType$1, "startDate" | "startTime">;
58
65
  /**
59
66
  * Returns true when at least one startDate/startTime slot from the previous
60
67
  * schedule is absent from the next schedule (i.e. a date was removed).
@@ -66,4 +73,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
66
73
  */
67
74
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
68
75
 
69
- export { connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findEventOrImportedMarketById, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense };
76
+ export { connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findEventOrImportedMarketById, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
@@ -1,6 +1,7 @@
1
1
  import { f as SchemaCreateBulkNotificationInput, O as ObjectId } from '../Chat-DYkhie3G.js';
2
- import { EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
- import { DateTimeType } from '@timardex/cluemart-shared/types';
2
+ import { EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
+ import dayjs from 'dayjs';
4
+ import { DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
4
5
  import { S as SchemaRelationType } from '../Relation-6t3Gn4pM.js';
5
6
  import 'mongoose';
6
7
  import 'express';
@@ -38,6 +39,12 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
38
39
  */
39
40
  declare function convertObjectIdsToStrings(obj: any): any;
40
41
 
42
+ /**
43
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time
44
+ * @param dateTime The date-time object to update
45
+ * @returns A new object with updated dateStatus value
46
+ */
47
+ declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
41
48
  /**
42
49
  * Recomputes dateStatus for every dateTime slot on events and google imported markets.
43
50
  */
@@ -54,7 +61,7 @@ type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
54
61
  */
55
62
  declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
56
63
 
57
- type EventDateSlot = Pick<DateTimeType, "startDate" | "startTime">;
64
+ type EventDateSlot = Pick<DateTimeType$1, "startDate" | "startTime">;
58
65
  /**
59
66
  * Returns true when at least one startDate/startTime slot from the previous
60
67
  * schedule is absent from the next schedule (i.e. a date was removed).
@@ -66,4 +73,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
66
73
  */
67
74
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
68
75
 
69
- export { connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findEventOrImportedMarketById, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense };
76
+ export { connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findEventOrImportedMarketById, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
@@ -558,6 +558,7 @@ export {
558
558
  updateAdStatuses,
559
559
  updateAllEventDateTimeStatuses,
560
560
  updateRelationDatesToUnavailable,
561
+ updateSingleDateTimeStatus,
561
562
  updateVendorBasedOnUserLicense
562
563
  };
563
564
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timardex/cluemart-server-shared",
3
- "version": "1.0.210",
3
+ "version": "1.0.211",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",