@timardex/cluemart-server-shared 1.0.99 → 1.0.101

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.
@@ -33,7 +33,7 @@ import {
33
33
  resourceRelationsSchema,
34
34
  termsAgreementSchema,
35
35
  userLicenseSchema
36
- } from "../chunk-ZB6VYDYP.mjs";
36
+ } from "../chunk-UXSMDLHK.mjs";
37
37
  import "../chunk-3QS3WKRC.mjs";
38
38
  export {
39
39
  APP_SETTINGS_ID,
@@ -1675,6 +1675,7 @@ var service_exports = {};
1675
1675
  __export(service_exports, {
1676
1676
  connectToDatabase: () => connectToDatabase,
1677
1677
  convertObjectIdsToStrings: () => convertObjectIdsToStrings,
1678
+ findEventOrImportedMarketById: () => findEventOrImportedMarketById,
1678
1679
  saveNotificationsInDb: () => saveNotificationsInDb,
1679
1680
  sendPushNotifications: () => sendPushNotifications,
1680
1681
  updateAdStatuses: () => updateAdStatuses,
@@ -8601,6 +8602,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
8601
8602
  description
8602
8603
  name
8603
8604
  price
8605
+ priceUnit
8604
8606
  productGroups
8605
8607
  }
8606
8608
  `;
@@ -8993,6 +8995,14 @@ var GET_REPORTED_CHAT_USERS = gql`
8993
8995
  }
8994
8996
  ${CHAT_REPORT_FIELDS_FRAGMENT}
8995
8997
  `;
8998
+ var CREATE_PRIVATE_CHAT_MUTATION = gql`
8999
+ mutation createPrivateChat($userId: ID!) {
9000
+ createPrivateChat(userId: $userId) {
9001
+ ...ChatFields
9002
+ }
9003
+ }
9004
+ ${CHAT_FIELDS_FRAGMENT}
9005
+ `;
8996
9006
  var SEND_CHAT_MESSAGE_MUTATION = gql`
8997
9007
  mutation sendChatMessage($_id: ID!, $input: ChatMessageInputType!) {
8998
9008
  sendChatMessage(_id: $_id, input: $input) {
@@ -10277,19 +10287,16 @@ var eventInfoSchema = create$3().shape({
10277
10287
  ).required("Refund policy is required")
10278
10288
  });
10279
10289
  var vendroMenuSchema = create$3().shape({
10280
- description: create$6().trim().nullable().defined().test(
10281
- "description-required",
10282
- "Product description is required",
10283
- function(value) {
10284
- return value !== null && value !== void 0 && value.trim().length > 0;
10285
- }
10286
- ),
10290
+ description: create$6().trim().nullable(),
10287
10291
  name: create$6().trim().nullable().defined().test("name-required", "Product name is required", function(value) {
10288
10292
  return value !== null && value !== void 0 && value.trim().length > 0;
10289
10293
  }),
10290
10294
  price: create$5().transform((value, originalValue) => originalValue === "" ? null : value).min(0).nullable().defined().test("price-required", "Product price is required", function(value) {
10291
10295
  return value !== null && value !== void 0;
10292
10296
  }),
10297
+ priceUnit: create$6().trim().nullable().defined().test("unit-required", "Product unit is required", function(value) {
10298
+ return value !== null && value !== void 0 && value.trim().length > 0;
10299
+ }),
10293
10300
  productGroups: create$2().of(create$6().defined()).transform(
10294
10301
  (value, originalValue) => originalValue === void 0 ? null : value
10295
10302
  ).nullable().test(
@@ -11737,6 +11744,7 @@ var productTypeSchema = new MongooseSchema13(
11737
11744
  description: { required: false, type: String },
11738
11745
  name: { required: false, type: String },
11739
11746
  price: { required: false, type: Number },
11747
+ priceUnit: { required: false, type: String },
11740
11748
  productGroups: { required: false, type: [String] }
11741
11749
  },
11742
11750
  { _id: false }
@@ -12130,10 +12138,24 @@ function convertObjectIdsToStrings(obj) {
12130
12138
  }
12131
12139
  return obj;
12132
12140
  }
12141
+
12142
+ // src/service/event.ts
12143
+ async function findEventOrImportedMarketById(resourceId) {
12144
+ if (!resourceId) {
12145
+ return null;
12146
+ }
12147
+ const normalizedId = convertObjectIdsToStrings(resourceId);
12148
+ const [eventDoc, googleImportedDoc] = await Promise.all([
12149
+ EventModel.findById(normalizedId).select("_id name").lean().exec(),
12150
+ GoogleImportedMarketModel.findById(normalizedId).select("_id name").lean().exec()
12151
+ ]);
12152
+ return eventDoc ?? googleImportedDoc;
12153
+ }
12133
12154
  // Annotate the CommonJS export names for ESM import in node:
12134
12155
  0 && (module.exports = {
12135
12156
  connectToDatabase,
12136
12157
  convertObjectIdsToStrings,
12158
+ findEventOrImportedMarketById,
12137
12159
  saveNotificationsInDb,
12138
12160
  sendPushNotifications,
12139
12161
  updateAdStatuses,