@whatsveg/wv-data-model 1.0.1 → 1.0.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.
Files changed (101) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +15 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/Area.d.ts +6 -0
  6. package/dist/models/Area.d.ts.map +1 -0
  7. package/dist/models/Area.js +10 -0
  8. package/dist/models/Area.js.map +1 -0
  9. package/dist/models/Category.d.ts +6 -0
  10. package/dist/models/Category.d.ts.map +1 -0
  11. package/dist/models/Category.js +10 -0
  12. package/dist/models/Category.js.map +1 -0
  13. package/dist/models/City.d.ts +6 -0
  14. package/dist/models/City.d.ts.map +1 -0
  15. package/dist/models/City.js +10 -0
  16. package/dist/models/City.js.map +1 -0
  17. package/dist/models/Pincode.d.ts +6 -0
  18. package/dist/models/Pincode.d.ts.map +1 -0
  19. package/dist/models/Pincode.js +10 -0
  20. package/dist/models/Pincode.js.map +1 -0
  21. package/dist/models/Product.d.ts +6 -0
  22. package/dist/models/Product.d.ts.map +1 -0
  23. package/dist/models/Product.js +10 -0
  24. package/dist/models/Product.js.map +1 -0
  25. package/dist/models/Store.d.ts +6 -0
  26. package/dist/models/Store.d.ts.map +1 -0
  27. package/dist/models/Store.js +10 -0
  28. package/dist/models/Store.js.map +1 -0
  29. package/dist/models/Unit.d.ts +6 -0
  30. package/dist/models/Unit.d.ts.map +1 -0
  31. package/dist/models/Unit.js +10 -0
  32. package/dist/models/Unit.js.map +1 -0
  33. package/dist/models/index.d.ts +15 -0
  34. package/dist/models/index.d.ts.map +1 -1
  35. package/dist/models/index.js +30 -1
  36. package/dist/models/index.js.map +1 -1
  37. package/dist/models/mappings/CategoryArea.d.ts +4 -0
  38. package/dist/models/mappings/CategoryArea.d.ts.map +1 -0
  39. package/dist/models/mappings/CategoryArea.js +11 -0
  40. package/dist/models/mappings/CategoryArea.js.map +1 -0
  41. package/dist/models/mappings/ProductArea.d.ts +6 -0
  42. package/dist/models/mappings/ProductArea.d.ts.map +1 -0
  43. package/dist/models/mappings/ProductArea.js +11 -0
  44. package/dist/models/mappings/ProductArea.js.map +1 -0
  45. package/dist/models/mappings/StoreArea.d.ts +6 -0
  46. package/dist/models/mappings/StoreArea.d.ts.map +1 -0
  47. package/dist/models/mappings/StoreArea.js +11 -0
  48. package/dist/models/mappings/StoreArea.js.map +1 -0
  49. package/dist/models/mappings/index.d.ts +4 -0
  50. package/dist/models/mappings/index.d.ts.map +1 -0
  51. package/dist/models/mappings/index.js +13 -0
  52. package/dist/models/mappings/index.js.map +1 -0
  53. package/dist/schemas/AreaSchema.d.ts +95 -0
  54. package/dist/schemas/AreaSchema.d.ts.map +1 -0
  55. package/dist/schemas/AreaSchema.js +85 -0
  56. package/dist/schemas/AreaSchema.js.map +1 -0
  57. package/dist/schemas/CategoryAreaSchema.d.ts +86 -0
  58. package/dist/schemas/CategoryAreaSchema.d.ts.map +1 -0
  59. package/dist/schemas/CategoryAreaSchema.js +45 -0
  60. package/dist/schemas/CategoryAreaSchema.js.map +1 -0
  61. package/dist/schemas/CategorySchema.d.ts +125 -0
  62. package/dist/schemas/CategorySchema.d.ts.map +1 -0
  63. package/dist/schemas/CategorySchema.js +80 -0
  64. package/dist/schemas/CategorySchema.js.map +1 -0
  65. package/dist/schemas/CitySchema.d.ts +85 -0
  66. package/dist/schemas/CitySchema.d.ts.map +1 -0
  67. package/dist/schemas/CitySchema.js +35 -0
  68. package/dist/schemas/CitySchema.js.map +1 -0
  69. package/dist/schemas/PincodeSchema.d.ts +65 -0
  70. package/dist/schemas/PincodeSchema.d.ts.map +1 -0
  71. package/dist/schemas/PincodeSchema.js +26 -0
  72. package/dist/schemas/PincodeSchema.js.map +1 -0
  73. package/dist/schemas/ProductAreaSchema.d.ts +95 -0
  74. package/dist/schemas/ProductAreaSchema.d.ts.map +1 -0
  75. package/dist/schemas/ProductAreaSchema.js +35 -0
  76. package/dist/schemas/ProductAreaSchema.js.map +1 -0
  77. package/dist/schemas/ProductSchema.d.ts +145 -0
  78. package/dist/schemas/ProductSchema.d.ts.map +1 -0
  79. package/dist/schemas/ProductSchema.js +108 -0
  80. package/dist/schemas/ProductSchema.js.map +1 -0
  81. package/dist/schemas/StoreAreaSchema.d.ts +75 -0
  82. package/dist/schemas/StoreAreaSchema.d.ts.map +1 -0
  83. package/dist/schemas/StoreAreaSchema.js +25 -0
  84. package/dist/schemas/StoreAreaSchema.js.map +1 -0
  85. package/dist/schemas/StoreSchema.d.ts +145 -0
  86. package/dist/schemas/StoreSchema.d.ts.map +1 -0
  87. package/dist/schemas/StoreSchema.js +65 -0
  88. package/dist/schemas/StoreSchema.js.map +1 -0
  89. package/dist/schemas/UnitSchema.d.ts +81 -0
  90. package/dist/schemas/UnitSchema.d.ts.map +1 -0
  91. package/dist/schemas/UnitSchema.js +69 -0
  92. package/dist/schemas/UnitSchema.js.map +1 -0
  93. package/dist/schemas/UserSchema.d.ts +135 -14
  94. package/dist/schemas/UserSchema.d.ts.map +1 -1
  95. package/dist/schemas/UserSchema.js +64 -10
  96. package/dist/schemas/UserSchema.js.map +1 -1
  97. package/dist/schemas/index.d.ts +21 -1
  98. package/dist/schemas/index.d.ts.map +1 -1
  99. package/dist/schemas/index.js +21 -1
  100. package/dist/schemas/index.js.map +1 -1
  101. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { User } from "./models";
1
+ export * from "./models";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.User = void 0;
4
- var models_1 = require("./models");
5
- Object.defineProperty(exports, "User", { enumerable: true, get: function () { return models_1.User; } });
17
+ __exportStar(require("./models"), exports);
6
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAAvB,8FAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { AreaAttributes } from "../schemas/AreaSchema";
3
+ export type AreaModel = Model<AreaAttributes>;
4
+ declare const Area: AreaModel;
5
+ export default Area;
6
+ //# sourceMappingURL=Area.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Area.d.ts","sourceRoot":"","sources":["../../src/models/Area.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAE9C,QAAA,MAAM,IAAI,WAA4F,CAAC;AAEvG,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const AreaSchema_1 = __importDefault(require("../schemas/AreaSchema"));
8
+ const Area = mongoose_1.default.models.Area || mongoose_1.default.model("Area", AreaSchema_1.default);
9
+ exports.default = Area;
10
+ //# sourceMappingURL=Area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Area.js","sourceRoot":"","sources":["../../src/models/Area.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,uEAAmE;AAInE,MAAM,IAAI,GAAI,kBAAQ,CAAC,MAAM,CAAC,IAAkB,IAAI,kBAAQ,CAAC,KAAK,CAAiB,MAAM,EAAE,oBAAU,CAAC,CAAC;AAEvG,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { CategoryAttributes } from "../schemas/CategorySchema";
3
+ export type CategoryModel = Model<CategoryAttributes>;
4
+ declare const Category: CategoryModel;
5
+ export default Category;
6
+ //# sourceMappingURL=Category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../src/models/Category.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAuB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAEtD,QAAA,MAAM,QAAQ,eAAgH,CAAC;AAE/H,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const CategorySchema_1 = __importDefault(require("../schemas/CategorySchema"));
8
+ const Category = mongoose_1.default.models.Category || mongoose_1.default.model("Category", CategorySchema_1.default);
9
+ exports.default = Category;
10
+ //# sourceMappingURL=Category.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Category.js","sourceRoot":"","sources":["../../src/models/Category.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,+EAA+E;AAI/E,MAAM,QAAQ,GAAI,kBAAQ,CAAC,MAAM,CAAC,QAA0B,IAAI,kBAAQ,CAAC,KAAK,CAAqB,UAAU,EAAE,wBAAc,CAAC,CAAC;AAE/H,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { CityAttributes } from "../schemas/CitySchema";
3
+ export type CityModel = Model<CityAttributes>;
4
+ declare const City: CityModel;
5
+ export default City;
6
+ //# sourceMappingURL=City.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"City.d.ts","sourceRoot":"","sources":["../../src/models/City.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAE9C,QAAA,MAAM,IAAI,WAA4F,CAAC;AAEvG,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const CitySchema_1 = __importDefault(require("../schemas/CitySchema"));
8
+ const City = mongoose_1.default.models.City || mongoose_1.default.model("City", CitySchema_1.default);
9
+ exports.default = City;
10
+ //# sourceMappingURL=City.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"City.js","sourceRoot":"","sources":["../../src/models/City.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,uEAAmE;AAInE,MAAM,IAAI,GAAI,kBAAQ,CAAC,MAAM,CAAC,IAAkB,IAAI,kBAAQ,CAAC,KAAK,CAAiB,MAAM,EAAE,oBAAU,CAAC,CAAC;AAEvG,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { PincodeAttributes } from "../schemas/PincodeSchema";
3
+ export type PincodeModel = Model<PincodeAttributes>;
4
+ declare const Pincode: PincodeModel;
5
+ export default Pincode;
6
+ //# sourceMappingURL=Pincode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pincode.d.ts","sourceRoot":"","sources":["../../src/models/Pincode.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5E,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAEpD,QAAA,MAAM,OAAO,cAA2G,CAAC;AAEzH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const PincodeSchema_1 = __importDefault(require("../schemas/PincodeSchema"));
8
+ const Pincode = mongoose_1.default.models.Pincode || mongoose_1.default.model("Pincode", PincodeSchema_1.default);
9
+ exports.default = Pincode;
10
+ //# sourceMappingURL=Pincode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pincode.js","sourceRoot":"","sources":["../../src/models/Pincode.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,6EAA4E;AAI5E,MAAM,OAAO,GAAI,kBAAQ,CAAC,MAAM,CAAC,OAAwB,IAAI,kBAAQ,CAAC,KAAK,CAAoB,SAAS,EAAE,uBAAa,CAAC,CAAC;AAEzH,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { ProductAttributes } from "../schemas/ProductSchema";
3
+ export type ProductModel = Model<ProductAttributes>;
4
+ declare const Product: ProductModel;
5
+ export default Product;
6
+ //# sourceMappingURL=Product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../src/models/Product.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5E,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAEpD,QAAA,MAAM,OAAO,cAA2G,CAAC;AAEzH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const ProductSchema_1 = __importDefault(require("../schemas/ProductSchema"));
8
+ const Product = mongoose_1.default.models.Product || mongoose_1.default.model("Product", ProductSchema_1.default);
9
+ exports.default = Product;
10
+ //# sourceMappingURL=Product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Product.js","sourceRoot":"","sources":["../../src/models/Product.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,6EAA4E;AAI5E,MAAM,OAAO,GAAI,kBAAQ,CAAC,MAAM,CAAC,OAAwB,IAAI,kBAAQ,CAAC,KAAK,CAAoB,SAAS,EAAE,uBAAa,CAAC,CAAC;AAEzH,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { StoreAttributes } from "../schemas/StoreSchema";
3
+ export type StoreModel = Model<StoreAttributes>;
4
+ declare const Store: StoreModel;
5
+ export default Store;
6
+ //# sourceMappingURL=Store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../src/models/Store.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD,QAAA,MAAM,KAAK,YAAiG,CAAC;AAE7G,eAAe,KAAK,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const StoreSchema_1 = __importDefault(require("../schemas/StoreSchema"));
8
+ const Store = mongoose_1.default.models.Store || mongoose_1.default.model("Store", StoreSchema_1.default);
9
+ exports.default = Store;
10
+ //# sourceMappingURL=Store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Store.js","sourceRoot":"","sources":["../../src/models/Store.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,yEAAsE;AAItE,MAAM,KAAK,GAAI,kBAAQ,CAAC,MAAM,CAAC,KAAoB,IAAI,kBAAQ,CAAC,KAAK,CAAkB,OAAO,EAAE,qBAAW,CAAC,CAAC;AAE7G,kBAAe,KAAK,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { UnitAttributes } from "../schemas/UnitSchema";
3
+ export type UnitModel = Model<UnitAttributes>;
4
+ declare const Unit: UnitModel;
5
+ export default Unit;
6
+ //# sourceMappingURL=Unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../src/models/Unit.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAE9C,QAAA,MAAM,IAAI,WAA4F,CAAC;AAEvG,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const UnitSchema_1 = __importDefault(require("../schemas/UnitSchema"));
8
+ const Unit = mongoose_1.default.models.Unit || mongoose_1.default.model("Unit", UnitSchema_1.default);
9
+ exports.default = Unit;
10
+ //# sourceMappingURL=Unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Unit.js","sourceRoot":"","sources":["../../src/models/Unit.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,uEAAmE;AAInE,MAAM,IAAI,GAAI,kBAAQ,CAAC,MAAM,CAAC,IAAkB,IAAI,kBAAQ,CAAC,KAAK,CAAiB,MAAM,EAAE,oBAAU,CAAC,CAAC;AAEvG,kBAAe,IAAI,CAAC"}
@@ -1,3 +1,18 @@
1
+ export { default as Area } from "./Area";
2
+ export type { AreaModel } from "./Area";
3
+ export { default as Category } from "./Category";
4
+ export type { CategoryModel } from "./Category";
5
+ export { default as City } from "./City";
6
+ export type { CityModel } from "./City";
7
+ export { default as Pincode } from "./Pincode";
8
+ export type { PincodeModel } from "./Pincode";
9
+ export { default as Product } from "./Product";
10
+ export type { ProductModel } from "./Product";
11
+ export { default as Store } from "./Store";
12
+ export type { StoreModel } from "./Store";
13
+ export { default as Unit } from "./Unit";
14
+ export type { UnitModel } from "./Unit";
1
15
  export { default as User } from "./User";
2
16
  export type { UserModel } from "./User";
17
+ export * from "./mappings";
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,cAAc,YAAY,CAAC"}
@@ -1,9 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
18
  };
5
19
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.User = void 0;
20
+ exports.User = exports.Unit = exports.Store = exports.Product = exports.Pincode = exports.City = exports.Category = exports.Area = void 0;
21
+ var Area_1 = require("./Area");
22
+ Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return __importDefault(Area_1).default; } });
23
+ var Category_1 = require("./Category");
24
+ Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return __importDefault(Category_1).default; } });
25
+ var City_1 = require("./City");
26
+ Object.defineProperty(exports, "City", { enumerable: true, get: function () { return __importDefault(City_1).default; } });
27
+ var Pincode_1 = require("./Pincode");
28
+ Object.defineProperty(exports, "Pincode", { enumerable: true, get: function () { return __importDefault(Pincode_1).default; } });
29
+ var Product_1 = require("./Product");
30
+ Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return __importDefault(Product_1).default; } });
31
+ var Store_1 = require("./Store");
32
+ Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return __importDefault(Store_1).default; } });
33
+ var Unit_1 = require("./Unit");
34
+ Object.defineProperty(exports, "Unit", { enumerable: true, get: function () { return __importDefault(Unit_1).default; } });
7
35
  var User_1 = require("./User");
8
36
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(User_1).default; } });
37
+ __exportStar(require("./mappings"), exports);
9
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AAGxB,uCAAiD;AAAxC,qHAAA,OAAO,OAAY;AAG5B,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AAGxB,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAG3B,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAG3B,iCAA2C;AAAlC,+GAAA,OAAO,OAAS;AAGzB,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AAGxB,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AAGxB,6CAA2B"}
@@ -0,0 +1,4 @@
1
+ import { CategoryAreaModel } from "../../schemas/CategoryAreaSchema";
2
+ declare const CategoryArea: CategoryAreaModel;
3
+ export default CategoryArea;
4
+ //# sourceMappingURL=CategoryArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategoryArea.d.ts","sourceRoot":"","sources":["../../../src/models/mappings/CategoryArea.ts"],"names":[],"mappings":"AAEA,OAA2B,EAA0B,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEjH,QAAA,MAAM,YAAY,mBAE6E,CAAC;AAEhG,eAAe,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const CategoryAreaSchema_1 = __importDefault(require("../../schemas/CategoryAreaSchema"));
8
+ const CategoryArea = mongoose_1.default.models.CategoryArea ||
9
+ mongoose_1.default.model("CategoryArea", CategoryAreaSchema_1.default);
10
+ exports.default = CategoryArea;
11
+ //# sourceMappingURL=CategoryArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategoryArea.js","sourceRoot":"","sources":["../../../src/models/mappings/CategoryArea.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAEhC,0FAAiH;AAEjH,MAAM,YAAY,GACf,kBAAQ,CAAC,MAAM,CAAC,YAAkC;IACnD,kBAAQ,CAAC,KAAK,CAA4C,cAAc,EAAE,4BAAkB,CAAC,CAAC;AAEhG,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { ProductAreaAttributes } from "../../schemas/ProductAreaSchema";
3
+ export type ProductAreaModel = Model<ProductAreaAttributes>;
4
+ declare const ProductArea: ProductAreaModel;
5
+ export default ProductArea;
6
+ //# sourceMappingURL=ProductArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductArea.d.ts","sourceRoot":"","sources":["../../../src/models/mappings/ProductArea.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAA0B,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE3F,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAE5D,QAAA,MAAM,WAAW,kBAEwD,CAAC;AAE1E,eAAe,WAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const ProductAreaSchema_1 = __importDefault(require("../../schemas/ProductAreaSchema"));
8
+ const ProductArea = mongoose_1.default.models.ProductArea ||
9
+ mongoose_1.default.model("ProductArea", ProductAreaSchema_1.default);
10
+ exports.default = ProductArea;
11
+ //# sourceMappingURL=ProductArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductArea.js","sourceRoot":"","sources":["../../../src/models/mappings/ProductArea.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,wFAA2F;AAI3F,MAAM,WAAW,GACd,kBAAQ,CAAC,MAAM,CAAC,WAAgC;IACjD,kBAAQ,CAAC,KAAK,CAAwB,aAAa,EAAE,2BAAiB,CAAC,CAAC;AAE1E,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Model } from "mongoose";
2
+ import { StoreAreaAttributes } from "../../schemas/StoreAreaSchema";
3
+ export type StoreAreaModel = Model<StoreAreaAttributes>;
4
+ declare const StoreArea: StoreAreaModel;
5
+ export default StoreArea;
6
+ //# sourceMappingURL=StoreArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreArea.d.ts","sourceRoot":"","sources":["../../../src/models/mappings/StoreArea.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAwB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAExD,QAAA,MAAM,SAAS,gBAEoD,CAAC;AAEpE,eAAe,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mongoose_1 = __importDefault(require("mongoose"));
7
+ const StoreAreaSchema_1 = __importDefault(require("../../schemas/StoreAreaSchema"));
8
+ const StoreArea = mongoose_1.default.models.StoreArea ||
9
+ mongoose_1.default.model("StoreArea", StoreAreaSchema_1.default);
10
+ exports.default = StoreArea;
11
+ //# sourceMappingURL=StoreArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreArea.js","sourceRoot":"","sources":["../../../src/models/mappings/StoreArea.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,oFAAqF;AAIrF,MAAM,SAAS,GACZ,kBAAQ,CAAC,MAAM,CAAC,SAA4B;IAC7C,kBAAQ,CAAC,KAAK,CAAsB,WAAW,EAAE,yBAAe,CAAC,CAAC;AAEpE,kBAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as CategoryArea } from "./CategoryArea";
2
+ export { default as ProductArea } from "./ProductArea";
3
+ export { default as StoreArea } from "./StoreArea";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/mappings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StoreArea = exports.ProductArea = exports.CategoryArea = void 0;
7
+ var CategoryArea_1 = require("./CategoryArea");
8
+ Object.defineProperty(exports, "CategoryArea", { enumerable: true, get: function () { return __importDefault(CategoryArea_1).default; } });
9
+ var ProductArea_1 = require("./ProductArea");
10
+ Object.defineProperty(exports, "ProductArea", { enumerable: true, get: function () { return __importDefault(ProductArea_1).default; } });
11
+ var StoreArea_1 = require("./StoreArea");
12
+ Object.defineProperty(exports, "StoreArea", { enumerable: true, get: function () { return __importDefault(StoreArea_1).default; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/mappings/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,yCAAmD;AAA1C,uHAAA,OAAO,OAAa"}
@@ -0,0 +1,95 @@
1
+ import { Schema, Types } from "mongoose";
2
+ export interface AreaAttributes {
3
+ name: string;
4
+ name_local_language?: string;
5
+ name_hindi: string;
6
+ city: Types.ObjectId;
7
+ pincode: Types.ObjectId;
8
+ status?: boolean;
9
+ createdAt?: Date;
10
+ updatedAt?: Date;
11
+ }
12
+ declare const AreaSchema: Schema<AreaAttributes, import("mongoose").Model<AreaAttributes, any, any, any, any, any, AreaAttributes>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
13
+ id: string;
14
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
15
+ _id: Types.ObjectId;
16
+ } & {
17
+ __v: number;
18
+ }, "id"> & {
19
+ id: string;
20
+ }, {
21
+ name?: import("mongoose").SchemaDefinitionProperty<string, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
22
+ id: string;
23
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
24
+ _id: Types.ObjectId;
25
+ } & {
26
+ __v: number;
27
+ }, "id"> & {
28
+ id: string;
29
+ }> | undefined;
30
+ name_local_language?: import("mongoose").SchemaDefinitionProperty<string | undefined, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
31
+ id: string;
32
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
33
+ _id: Types.ObjectId;
34
+ } & {
35
+ __v: number;
36
+ }, "id"> & {
37
+ id: string;
38
+ }> | undefined;
39
+ name_hindi?: import("mongoose").SchemaDefinitionProperty<string, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
40
+ id: string;
41
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
42
+ _id: Types.ObjectId;
43
+ } & {
44
+ __v: number;
45
+ }, "id"> & {
46
+ id: string;
47
+ }> | undefined;
48
+ city?: import("mongoose").SchemaDefinitionProperty<Types.ObjectId, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
49
+ id: string;
50
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
51
+ _id: Types.ObjectId;
52
+ } & {
53
+ __v: number;
54
+ }, "id"> & {
55
+ id: string;
56
+ }> | undefined;
57
+ pincode?: import("mongoose").SchemaDefinitionProperty<Types.ObjectId, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
58
+ id: string;
59
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
60
+ _id: Types.ObjectId;
61
+ } & {
62
+ __v: number;
63
+ }, "id"> & {
64
+ id: string;
65
+ }> | undefined;
66
+ status?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
67
+ id: string;
68
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
69
+ _id: Types.ObjectId;
70
+ } & {
71
+ __v: number;
72
+ }, "id"> & {
73
+ id: string;
74
+ }> | undefined;
75
+ createdAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
76
+ id: string;
77
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
78
+ _id: Types.ObjectId;
79
+ } & {
80
+ __v: number;
81
+ }, "id"> & {
82
+ id: string;
83
+ }> | undefined;
84
+ updatedAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, AreaAttributes, import("mongoose").Document<unknown, {}, AreaAttributes, {
85
+ id: string;
86
+ }, import("mongoose").DefaultSchemaOptions> & Omit<AreaAttributes & {
87
+ _id: Types.ObjectId;
88
+ } & {
89
+ __v: number;
90
+ }, "id"> & {
91
+ id: string;
92
+ }> | undefined;
93
+ }, AreaAttributes>;
94
+ export default AreaSchema;
95
+ //# sourceMappingURL=AreaSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AreaSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/AreaSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCf,CAAC;AAyDF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const AreaSchema = new mongoose_1.Schema({
5
+ name: {
6
+ type: String,
7
+ required: true,
8
+ maxlength: 250
9
+ },
10
+ name_local_language: {
11
+ type: String,
12
+ maxlength: 250
13
+ },
14
+ name_hindi: {
15
+ type: String,
16
+ required: true,
17
+ maxlength: 250
18
+ },
19
+ city: {
20
+ type: mongoose_1.Schema.Types.ObjectId,
21
+ ref: "City",
22
+ required: true
23
+ },
24
+ pincode: {
25
+ type: mongoose_1.Schema.Types.ObjectId,
26
+ ref: "Pincode",
27
+ required: true
28
+ },
29
+ status: {
30
+ type: Boolean,
31
+ default: true
32
+ }
33
+ }, {
34
+ timestamps: true,
35
+ toJSON: { virtuals: true },
36
+ toObject: { virtuals: true }
37
+ });
38
+ AreaSchema.post("save", async function (doc) {
39
+ const [CategoryArea, Category, ProductArea, Product] = await Promise.all([
40
+ import("../models/mappings/CategoryArea.js").then((module) => module.default),
41
+ import("../models/Category.js").then((module) => module.default),
42
+ import("../models/mappings/ProductArea.js").then((module) => module.default),
43
+ import("../models/Product.js").then((module) => module.default)
44
+ ]);
45
+ const globalCategories = await Category.find({ is_global: true, status: true });
46
+ const existingCategoryMappings = await CategoryArea.find({
47
+ category: { $in: globalCategories.map((category) => category._id) },
48
+ area: doc._id
49
+ });
50
+ if (existingCategoryMappings.length === 0) {
51
+ const categoryAreaMappings = globalCategories.map((category) => ({
52
+ category: category._id,
53
+ area: doc._id,
54
+ name_local_language: category.name_hindi,
55
+ status: true
56
+ }));
57
+ await CategoryArea.insertMany(categoryAreaMappings);
58
+ }
59
+ const globalProducts = await Product.find({ is_global: true, status: true });
60
+ const existingProductMappings = await ProductArea.find({
61
+ product: { $in: globalProducts.map((product) => product._id) },
62
+ area: doc._id
63
+ });
64
+ if (existingProductMappings.length === 0) {
65
+ const productAreaMappings = globalProducts.map((product) => ({
66
+ product: product._id,
67
+ area: doc._id,
68
+ name_local_language: product.name_hindi,
69
+ mrp: product.base_price,
70
+ price: product.base_price,
71
+ status: true
72
+ }));
73
+ await ProductArea.insertMany(productAreaMappings);
74
+ }
75
+ });
76
+ AreaSchema.post("deleteOne", { document: true, query: false }, async function (doc) {
77
+ const [CategoryArea, ProductArea] = await Promise.all([
78
+ import("../models/mappings/CategoryArea.js").then((module) => module.default),
79
+ import("../models/mappings/ProductArea.js").then((module) => module.default)
80
+ ]);
81
+ await CategoryArea.deleteMany({ area: doc._id });
82
+ await ProductArea.deleteMany({ area: doc._id });
83
+ });
84
+ exports.default = AreaSchema;
85
+ //# sourceMappingURL=AreaSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AreaSchema.js","sourceRoot":"","sources":["../../src/schemas/AreaSchema.ts"],"names":[],"mappings":"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"}