@goweekdays/core 2.15.8 → 2.15.9

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.mjs CHANGED
@@ -22632,10 +22632,12 @@ function modelAssetItem(data) {
22632
22632
  "Marketplace price is required for items marked as public."
22633
22633
  );
22634
22634
  }
22635
+ data.normalizedName = data.name.trim().toLowerCase();
22635
22636
  return {
22636
22637
  _id: data._id,
22637
22638
  orgId: data.orgId,
22638
22639
  name: data.name,
22640
+ normalizedName: data.normalizedName,
22639
22641
  description: data.description ?? "",
22640
22642
  assetCategory: data.assetCategory,
22641
22643
  assetClass: data.assetClass,
@@ -22692,7 +22694,16 @@ function useAssetItemRepo() {
22692
22694
  { key: { purpose: 1 } },
22693
22695
  { key: { trackingType: 1 } },
22694
22696
  { key: { status: 1 } },
22695
- { key: { name: "text" } }
22697
+ { key: { name: "text" } },
22698
+ {
22699
+ key: {
22700
+ orgId: 1,
22701
+ normalizedName: 1,
22702
+ purpose: 1,
22703
+ itemRefId: 1
22704
+ },
22705
+ unique: true
22706
+ }
22696
22707
  ]);
22697
22708
  } catch (error) {
22698
22709
  throw new BadRequestError109("Failed to create asset item indexes.");