@whatsveg/wv-data-model 1.0.0 → 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 (110) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +18 -0
  4. package/dist/index.js.map +1 -0
  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/User.d.ts +6 -0
  34. package/dist/models/User.d.ts.map +1 -0
  35. package/dist/models/User.js +10 -0
  36. package/dist/models/User.js.map +1 -0
  37. package/dist/models/index.d.ts +18 -0
  38. package/dist/models/index.d.ts.map +1 -0
  39. package/dist/models/index.js +38 -0
  40. package/dist/models/index.js.map +1 -0
  41. package/dist/models/mappings/CategoryArea.d.ts +4 -0
  42. package/dist/models/mappings/CategoryArea.d.ts.map +1 -0
  43. package/dist/models/mappings/CategoryArea.js +11 -0
  44. package/dist/models/mappings/CategoryArea.js.map +1 -0
  45. package/dist/models/mappings/ProductArea.d.ts +6 -0
  46. package/dist/models/mappings/ProductArea.d.ts.map +1 -0
  47. package/dist/models/mappings/ProductArea.js +11 -0
  48. package/dist/models/mappings/ProductArea.js.map +1 -0
  49. package/dist/models/mappings/StoreArea.d.ts +6 -0
  50. package/dist/models/mappings/StoreArea.d.ts.map +1 -0
  51. package/dist/models/mappings/StoreArea.js +11 -0
  52. package/dist/models/mappings/StoreArea.js.map +1 -0
  53. package/dist/models/mappings/index.d.ts +4 -0
  54. package/dist/models/mappings/index.d.ts.map +1 -0
  55. package/dist/models/mappings/index.js +13 -0
  56. package/dist/models/mappings/index.js.map +1 -0
  57. package/dist/schemas/AreaSchema.d.ts +95 -0
  58. package/dist/schemas/AreaSchema.d.ts.map +1 -0
  59. package/dist/schemas/AreaSchema.js +85 -0
  60. package/dist/schemas/AreaSchema.js.map +1 -0
  61. package/dist/schemas/CategoryAreaSchema.d.ts +86 -0
  62. package/dist/schemas/CategoryAreaSchema.d.ts.map +1 -0
  63. package/dist/schemas/CategoryAreaSchema.js +45 -0
  64. package/dist/schemas/CategoryAreaSchema.js.map +1 -0
  65. package/dist/schemas/CategorySchema.d.ts +125 -0
  66. package/dist/schemas/CategorySchema.d.ts.map +1 -0
  67. package/dist/schemas/CategorySchema.js +80 -0
  68. package/dist/schemas/CategorySchema.js.map +1 -0
  69. package/dist/schemas/CitySchema.d.ts +85 -0
  70. package/dist/schemas/CitySchema.d.ts.map +1 -0
  71. package/dist/schemas/CitySchema.js +35 -0
  72. package/dist/schemas/CitySchema.js.map +1 -0
  73. package/dist/schemas/PincodeSchema.d.ts +65 -0
  74. package/dist/schemas/PincodeSchema.d.ts.map +1 -0
  75. package/dist/schemas/PincodeSchema.js +26 -0
  76. package/dist/schemas/PincodeSchema.js.map +1 -0
  77. package/dist/schemas/ProductAreaSchema.d.ts +95 -0
  78. package/dist/schemas/ProductAreaSchema.d.ts.map +1 -0
  79. package/dist/schemas/ProductAreaSchema.js +35 -0
  80. package/dist/schemas/ProductAreaSchema.js.map +1 -0
  81. package/dist/schemas/ProductSchema.d.ts +145 -0
  82. package/dist/schemas/ProductSchema.d.ts.map +1 -0
  83. package/dist/schemas/ProductSchema.js +108 -0
  84. package/dist/schemas/ProductSchema.js.map +1 -0
  85. package/dist/schemas/StoreAreaSchema.d.ts +75 -0
  86. package/dist/schemas/StoreAreaSchema.d.ts.map +1 -0
  87. package/dist/schemas/StoreAreaSchema.js +25 -0
  88. package/dist/schemas/StoreAreaSchema.js.map +1 -0
  89. package/dist/schemas/StoreSchema.d.ts +145 -0
  90. package/dist/schemas/StoreSchema.d.ts.map +1 -0
  91. package/dist/schemas/StoreSchema.js +65 -0
  92. package/dist/schemas/StoreSchema.js.map +1 -0
  93. package/dist/schemas/UnitSchema.d.ts +81 -0
  94. package/dist/schemas/UnitSchema.d.ts.map +1 -0
  95. package/dist/schemas/UnitSchema.js +69 -0
  96. package/dist/schemas/UnitSchema.js.map +1 -0
  97. package/dist/schemas/UserSchema.d.ts +196 -0
  98. package/dist/schemas/UserSchema.d.ts.map +1 -0
  99. package/dist/schemas/UserSchema.js +81 -0
  100. package/dist/schemas/UserSchema.js.map +1 -0
  101. package/dist/schemas/index.d.ts +23 -0
  102. package/dist/schemas/index.d.ts.map +1 -0
  103. package/dist/schemas/index.js +29 -0
  104. package/dist/schemas/index.js.map +1 -0
  105. package/package.json +33 -11
  106. package/src/index.js +0 -1
  107. package/src/models/User.js +0 -6
  108. package/src/models/index.js +0 -3
  109. package/src/schemas/UserSchema.js +0 -32
  110. package/src/schemas/index.js +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AreaSchema.js","sourceRoot":"","sources":["../../src/schemas/AreaSchema.ts"],"names":[],"mappings":";;AAAA,uCAAyC;AAazC,MAAM,UAAU,GAAG,IAAI,iBAA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EAAE,CAAC;QACzC,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAC5C,CAAC,OAAwE,EAAE,EAAE,CAAC,CAAC;YAC7E,OAAO,EAAE,OAAO,CAAC,GAAG;YACpB,IAAI,EAAE,GAAG,CAAC,GAAG;YACb,mBAAmB,EAAE,OAAO,CAAC,UAAU;YACvC,GAAG,EAAE,OAAO,CAAC,UAAU;YACvB,KAAK,EAAE,OAAO,CAAC,UAAU;YACzB,MAAM,EAAE,IAAI;SACb,CAAC,CACH,CAAC;QACF,MAAM,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,WAAW,GAAG;IAChF,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,MAAM,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAc,CAAC;QACpF,MAAM,CAAC,mCAAmC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAc,CAAC;KACpF,CAAC,CAAC;IAEH,MAAM,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IACjD,MAAM,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { HydratedDocument, Model, Schema, Types } from "mongoose";
2
+ export interface CategoryAreaAttributes {
3
+ name_local_language?: string;
4
+ category: Types.ObjectId;
5
+ area: Types.ObjectId;
6
+ status?: boolean;
7
+ createdAt?: Date;
8
+ updatedAt?: Date;
9
+ }
10
+ export type CategoryAreaDocument = HydratedDocument<CategoryAreaAttributes, CategoryAreaMethods>;
11
+ export interface CategoryAreaMethods {
12
+ getDetails(this: CategoryAreaDocument): Promise<CategoryAreaDocument>;
13
+ getCategoryDetails(this: CategoryAreaDocument): Promise<CategoryAreaDocument>;
14
+ }
15
+ export interface CategoryAreaStatics {
16
+ getByCategoryId(categoryId: Types.ObjectId | string): Promise<CategoryAreaDocument[]>;
17
+ getByAreaId(areaId: Types.ObjectId | string): Promise<CategoryAreaDocument[]>;
18
+ getByAreaIdAll(areaId: Types.ObjectId | string): Promise<CategoryAreaDocument[]>;
19
+ }
20
+ export type CategoryAreaModel = Model<CategoryAreaAttributes, {}, CategoryAreaMethods> & CategoryAreaStatics;
21
+ declare const CategoryAreaSchema: Schema<CategoryAreaAttributes, CategoryAreaModel, CategoryAreaMethods, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
22
+ id: string;
23
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
24
+ _id: Types.ObjectId;
25
+ } & {
26
+ __v: number;
27
+ }, keyof CategoryAreaMethods | "id"> & {
28
+ id: string;
29
+ } & CategoryAreaMethods, {
30
+ name_local_language?: import("mongoose").SchemaDefinitionProperty<string | undefined, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
31
+ id: string;
32
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
33
+ _id: Types.ObjectId;
34
+ } & {
35
+ __v: number;
36
+ }, keyof CategoryAreaMethods | "id"> & {
37
+ id: string;
38
+ } & CategoryAreaMethods> | undefined;
39
+ category?: import("mongoose").SchemaDefinitionProperty<Types.ObjectId, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
40
+ id: string;
41
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
42
+ _id: Types.ObjectId;
43
+ } & {
44
+ __v: number;
45
+ }, keyof CategoryAreaMethods | "id"> & {
46
+ id: string;
47
+ } & CategoryAreaMethods> | undefined;
48
+ area?: import("mongoose").SchemaDefinitionProperty<Types.ObjectId, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
49
+ id: string;
50
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
51
+ _id: Types.ObjectId;
52
+ } & {
53
+ __v: number;
54
+ }, keyof CategoryAreaMethods | "id"> & {
55
+ id: string;
56
+ } & CategoryAreaMethods> | undefined;
57
+ status?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
58
+ id: string;
59
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
60
+ _id: Types.ObjectId;
61
+ } & {
62
+ __v: number;
63
+ }, keyof CategoryAreaMethods | "id"> & {
64
+ id: string;
65
+ } & CategoryAreaMethods> | undefined;
66
+ createdAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
67
+ id: string;
68
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
69
+ _id: Types.ObjectId;
70
+ } & {
71
+ __v: number;
72
+ }, keyof CategoryAreaMethods | "id"> & {
73
+ id: string;
74
+ } & CategoryAreaMethods> | undefined;
75
+ updatedAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CategoryAreaAttributes, import("mongoose").Document<unknown, {}, CategoryAreaAttributes, {
76
+ id: string;
77
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAreaAttributes & {
78
+ _id: Types.ObjectId;
79
+ } & {
80
+ __v: number;
81
+ }, keyof CategoryAreaMethods | "id"> & {
82
+ id: string;
83
+ } & CategoryAreaMethods> | undefined;
84
+ }, CategoryAreaAttributes>;
85
+ export default CategoryAreaSchema;
86
+ //# sourceMappingURL=CategoryAreaSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategoryAreaSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/CategoryAreaSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAC;AAEjG,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACtE,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACtF,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC9E,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;CAClF;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,sBAAsB,EAAE,EAAE,EAAE,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;AAE7G,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwBvB,CAAC;AAyBF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const CategoryAreaSchema = new mongoose_1.Schema({
5
+ name_local_language: {
6
+ type: String,
7
+ maxlength: 250
8
+ },
9
+ category: {
10
+ type: mongoose_1.Schema.Types.ObjectId,
11
+ ref: "Category",
12
+ required: true
13
+ },
14
+ area: {
15
+ type: mongoose_1.Schema.Types.ObjectId,
16
+ ref: "Area",
17
+ required: true
18
+ },
19
+ status: {
20
+ type: Boolean,
21
+ default: true
22
+ }
23
+ }, {
24
+ timestamps: true
25
+ });
26
+ CategoryAreaSchema.methods.getDetails = async function () {
27
+ await this.populate("category");
28
+ await this.populate("area");
29
+ return this;
30
+ };
31
+ CategoryAreaSchema.methods.getCategoryDetails = async function () {
32
+ await this.populate("category");
33
+ return this;
34
+ };
35
+ CategoryAreaSchema.statics.getByCategoryId = function (categoryId) {
36
+ return this.find({ category: categoryId, status: true }).populate("category").populate("area");
37
+ };
38
+ CategoryAreaSchema.statics.getByAreaId = function (areaId) {
39
+ return this.find({ area: areaId, status: true }).populate("category").populate("area");
40
+ };
41
+ CategoryAreaSchema.statics.getByAreaIdAll = function (areaId) {
42
+ return this.find({ area: areaId }).populate("category").populate("area");
43
+ };
44
+ exports.default = CategoryAreaSchema;
45
+ //# sourceMappingURL=CategoryAreaSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategoryAreaSchema.js","sourceRoot":"","sources":["../../src/schemas/CategoryAreaSchema.ts"],"names":[],"mappings":";;AAAA,uCAAkE;AA0BlE,MAAM,kBAAkB,GAAG,IAAI,iBAAM,CACnC;IACE,mBAAmB,E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C;AACzF,CAAC,CAAC;AAEF,kBAAkB,CAAC,OAAO,CAAC,cAAc,GAAG,UAAU,MAAM;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,125 @@
1
+ import { Schema, Types } from "mongoose";
2
+ export interface CategoryAttributes {
3
+ name: string;
4
+ name_hindi: string;
5
+ emoji?: string;
6
+ slug: string;
7
+ description?: string;
8
+ imageUrl?: string;
9
+ status?: boolean;
10
+ is_global?: boolean;
11
+ index?: number;
12
+ createdAt?: Date;
13
+ updatedAt?: Date;
14
+ }
15
+ declare const CategorySchema: Schema<CategoryAttributes, import("mongoose").Model<CategoryAttributes, any, any, any, any, any, CategoryAttributes>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
16
+ id: string;
17
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
18
+ _id: Types.ObjectId;
19
+ } & {
20
+ __v: number;
21
+ }, "id"> & {
22
+ id: string;
23
+ }, {
24
+ name?: import("mongoose").SchemaDefinitionProperty<string, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
25
+ id: string;
26
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
27
+ _id: Types.ObjectId;
28
+ } & {
29
+ __v: number;
30
+ }, "id"> & {
31
+ id: string;
32
+ }> | undefined;
33
+ name_hindi?: import("mongoose").SchemaDefinitionProperty<string, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
34
+ id: string;
35
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
36
+ _id: Types.ObjectId;
37
+ } & {
38
+ __v: number;
39
+ }, "id"> & {
40
+ id: string;
41
+ }> | undefined;
42
+ emoji?: import("mongoose").SchemaDefinitionProperty<string | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
43
+ id: string;
44
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
45
+ _id: Types.ObjectId;
46
+ } & {
47
+ __v: number;
48
+ }, "id"> & {
49
+ id: string;
50
+ }> | undefined;
51
+ slug?: import("mongoose").SchemaDefinitionProperty<string, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
52
+ id: string;
53
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
54
+ _id: Types.ObjectId;
55
+ } & {
56
+ __v: number;
57
+ }, "id"> & {
58
+ id: string;
59
+ }> | undefined;
60
+ description?: import("mongoose").SchemaDefinitionProperty<string | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
61
+ id: string;
62
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
63
+ _id: Types.ObjectId;
64
+ } & {
65
+ __v: number;
66
+ }, "id"> & {
67
+ id: string;
68
+ }> | undefined;
69
+ imageUrl?: import("mongoose").SchemaDefinitionProperty<string | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
70
+ id: string;
71
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
72
+ _id: Types.ObjectId;
73
+ } & {
74
+ __v: number;
75
+ }, "id"> & {
76
+ id: string;
77
+ }> | undefined;
78
+ status?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
79
+ id: string;
80
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
81
+ _id: Types.ObjectId;
82
+ } & {
83
+ __v: number;
84
+ }, "id"> & {
85
+ id: string;
86
+ }> | undefined;
87
+ is_global?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
88
+ id: string;
89
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
90
+ _id: Types.ObjectId;
91
+ } & {
92
+ __v: number;
93
+ }, "id"> & {
94
+ id: string;
95
+ }> | undefined;
96
+ index?: import("mongoose").SchemaDefinitionProperty<number | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
97
+ id: string;
98
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
99
+ _id: Types.ObjectId;
100
+ } & {
101
+ __v: number;
102
+ }, "id"> & {
103
+ id: string;
104
+ }> | undefined;
105
+ createdAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
106
+ id: string;
107
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
108
+ _id: Types.ObjectId;
109
+ } & {
110
+ __v: number;
111
+ }, "id"> & {
112
+ id: string;
113
+ }> | undefined;
114
+ updatedAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CategoryAttributes, import("mongoose").Document<unknown, {}, CategoryAttributes, {
115
+ id: string;
116
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CategoryAttributes & {
117
+ _id: Types.ObjectId;
118
+ } & {
119
+ __v: number;
120
+ }, "id"> & {
121
+ id: string;
122
+ }> | undefined;
123
+ }, CategoryAttributes>;
124
+ export default CategorySchema;
125
+ //# sourceMappingURL=CategorySchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategorySchema.d.ts","sourceRoot":"","sources":["../../src/schemas/CategorySchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgDnB,CAAC;AAuCF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const CategorySchema = new mongoose_1.Schema({
5
+ name: {
6
+ type: String,
7
+ required: true,
8
+ maxlength: 250
9
+ },
10
+ name_hindi: {
11
+ type: String,
12
+ required: true,
13
+ maxlength: 250
14
+ },
15
+ emoji: {
16
+ type: String,
17
+ maxlength: 5
18
+ },
19
+ slug: {
20
+ type: String,
21
+ required: true,
22
+ unique: true,
23
+ maxlength: 250
24
+ },
25
+ description: {
26
+ type: String,
27
+ maxlength: 2000
28
+ },
29
+ imageUrl: {
30
+ type: String,
31
+ maxlength: 500
32
+ },
33
+ status: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ is_global: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ index: {
42
+ type: Number,
43
+ default: 0
44
+ }
45
+ }, {
46
+ timestamps: true,
47
+ toJSON: { virtuals: true },
48
+ toObject: { virtuals: true }
49
+ });
50
+ CategorySchema.post("save", async function (doc) {
51
+ if (!doc.is_global) {
52
+ return;
53
+ }
54
+ const [CategoryArea, Area] = await Promise.all([
55
+ import("../models/mappings/CategoryArea.js").then((module) => module.default),
56
+ import("../models/Area.js").then((module) => module.default)
57
+ ]);
58
+ const areas = await Area.find();
59
+ const existingMappings = await CategoryArea.find({
60
+ category: doc._id,
61
+ area: { $in: areas.map((area) => area._id) }
62
+ });
63
+ if (existingMappings.length > 0) {
64
+ return;
65
+ }
66
+ const categoryAreaMappings = areas.map((area) => ({
67
+ category: doc._id,
68
+ area: area._id
69
+ }));
70
+ await CategoryArea.insertMany(categoryAreaMappings);
71
+ });
72
+ CategorySchema.post("findOneAndUpdate", async function (doc) {
73
+ if (!doc || doc.status !== false) {
74
+ return;
75
+ }
76
+ const CategoryArea = (await import("../models/mappings/CategoryArea.js")).default;
77
+ await CategoryArea.updateMany({ category: doc._id }, { status: false });
78
+ });
79
+ exports.default = CategorySchema;
80
+ //# sourceMappingURL=CategorySchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategorySchema.js","sourceRoot":"","sources":["../../src/schemas/CategorySchema.ts"],"names":[],"mappings":";;AAAA,uCAAyC;AAgBzC,MAAM,cAAc,GAAG,IAAI,iBAAM,CAC/B;IACE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,CAAC;KACb;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,GAAG;KACf;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,IAAI;KAChB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,GAAG;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KACd;IACD,SAAS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IAAI,CAAC,GAAG;KACf,CAAC,CAAC,CAAC;IAEJ,MAAM,YAAY,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,WAAW,GAAG;IACzD,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC,OAAc,CAAC;IACzF,MAAM,YAAY,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AAEH,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { Schema } from "mongoose";
2
+ export interface CityAttributes {
3
+ name: string;
4
+ name_hindi: string;
5
+ state: string;
6
+ country: string;
7
+ status?: boolean;
8
+ createdAt?: Date;
9
+ updatedAt?: Date;
10
+ }
11
+ declare const CitySchema: Schema<CityAttributes, import("mongoose").Model<CityAttributes, any, any, any, any, any, CityAttributes>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
12
+ id: string;
13
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
14
+ _id: import("mongoose").Types.ObjectId;
15
+ } & {
16
+ __v: number;
17
+ }, "id"> & {
18
+ id: string;
19
+ }, {
20
+ name?: import("mongoose").SchemaDefinitionProperty<string, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
21
+ id: string;
22
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
23
+ _id: import("mongoose").Types.ObjectId;
24
+ } & {
25
+ __v: number;
26
+ }, "id"> & {
27
+ id: string;
28
+ }> | undefined;
29
+ name_hindi?: import("mongoose").SchemaDefinitionProperty<string, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
30
+ id: string;
31
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
32
+ _id: import("mongoose").Types.ObjectId;
33
+ } & {
34
+ __v: number;
35
+ }, "id"> & {
36
+ id: string;
37
+ }> | undefined;
38
+ state?: import("mongoose").SchemaDefinitionProperty<string, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
39
+ id: string;
40
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
41
+ _id: import("mongoose").Types.ObjectId;
42
+ } & {
43
+ __v: number;
44
+ }, "id"> & {
45
+ id: string;
46
+ }> | undefined;
47
+ country?: import("mongoose").SchemaDefinitionProperty<string, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
48
+ id: string;
49
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
50
+ _id: import("mongoose").Types.ObjectId;
51
+ } & {
52
+ __v: number;
53
+ }, "id"> & {
54
+ id: string;
55
+ }> | undefined;
56
+ status?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
57
+ id: string;
58
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
59
+ _id: import("mongoose").Types.ObjectId;
60
+ } & {
61
+ __v: number;
62
+ }, "id"> & {
63
+ id: string;
64
+ }> | undefined;
65
+ createdAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
66
+ id: string;
67
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
68
+ _id: import("mongoose").Types.ObjectId;
69
+ } & {
70
+ __v: number;
71
+ }, "id"> & {
72
+ id: string;
73
+ }> | undefined;
74
+ updatedAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, CityAttributes, import("mongoose").Document<unknown, {}, CityAttributes, {
75
+ id: string;
76
+ }, import("mongoose").DefaultSchemaOptions> & Omit<CityAttributes & {
77
+ _id: import("mongoose").Types.ObjectId;
78
+ } & {
79
+ __v: number;
80
+ }, "id"> & {
81
+ id: string;
82
+ }> | undefined;
83
+ }, CityAttributes>;
84
+ export default CitySchema;
85
+ //# sourceMappingURL=CitySchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CitySchema.d.ts","sourceRoot":"","sources":["../../src/schemas/CitySchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCf,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const CitySchema = new mongoose_1.Schema({
5
+ name: {
6
+ type: String,
7
+ required: true,
8
+ maxlength: 250
9
+ },
10
+ name_hindi: {
11
+ type: String,
12
+ required: true,
13
+ maxlength: 250
14
+ },
15
+ state: {
16
+ type: String,
17
+ required: true,
18
+ maxlength: 250
19
+ },
20
+ country: {
21
+ type: String,
22
+ required: true,
23
+ maxlength: 250
24
+ },
25
+ status: {
26
+ type: Boolean,
27
+ default: true
28
+ }
29
+ }, {
30
+ timestamps: true,
31
+ toJSON: { virtuals: true },
32
+ toObject: { virtuals: true }
33
+ });
34
+ exports.default = CitySchema;
35
+ //# sourceMappingURL=CitySchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CitySchema.js","sourceRoot":"","sources":["../../src/schemas/CitySchema.ts"],"names":[],"mappings":";;AAAA,uCAAkC;AAYlC,MAAM,UAAU,GAAG,IAAI,iBAAM,CAC3B;IACE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,GAAG;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KACd;CACF,EACD;IACE,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC7B,CACF,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { Schema, Types } from "mongoose";
2
+ export interface PincodeAttributes {
3
+ pincode: string;
4
+ city: Types.ObjectId;
5
+ status?: boolean;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
+ }
9
+ declare const PincodeSchema: Schema<PincodeAttributes, import("mongoose").Model<PincodeAttributes, any, any, any, any, any, PincodeAttributes>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
10
+ id: string;
11
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
12
+ _id: Types.ObjectId;
13
+ } & {
14
+ __v: number;
15
+ }, "id"> & {
16
+ id: string;
17
+ }, {
18
+ pincode?: import("mongoose").SchemaDefinitionProperty<string, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
19
+ id: string;
20
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
21
+ _id: Types.ObjectId;
22
+ } & {
23
+ __v: number;
24
+ }, "id"> & {
25
+ id: string;
26
+ }> | undefined;
27
+ city?: import("mongoose").SchemaDefinitionProperty<Types.ObjectId, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
28
+ id: string;
29
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
30
+ _id: Types.ObjectId;
31
+ } & {
32
+ __v: number;
33
+ }, "id"> & {
34
+ id: string;
35
+ }> | undefined;
36
+ status?: import("mongoose").SchemaDefinitionProperty<boolean | undefined, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
37
+ id: string;
38
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
39
+ _id: Types.ObjectId;
40
+ } & {
41
+ __v: number;
42
+ }, "id"> & {
43
+ id: string;
44
+ }> | undefined;
45
+ createdAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
46
+ id: string;
47
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
48
+ _id: Types.ObjectId;
49
+ } & {
50
+ __v: number;
51
+ }, "id"> & {
52
+ id: string;
53
+ }> | undefined;
54
+ updatedAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, PincodeAttributes, import("mongoose").Document<unknown, {}, PincodeAttributes, {
55
+ id: string;
56
+ }, import("mongoose").DefaultSchemaOptions> & Omit<PincodeAttributes & {
57
+ _id: Types.ObjectId;
58
+ } & {
59
+ __v: number;
60
+ }, "id"> & {
61
+ id: string;
62
+ }> | undefined;
63
+ }, PincodeAttributes>;
64
+ export default PincodeSchema;
65
+ //# sourceMappingURL=PincodeSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PincodeSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/PincodeSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAuBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const PincodeSchema = new mongoose_1.Schema({
5
+ pincode: {
6
+ type: String,
7
+ required: true,
8
+ unique: true,
9
+ maxlength: 10
10
+ },
11
+ city: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "City",
14
+ required: true
15
+ },
16
+ status: {
17
+ type: Boolean,
18
+ default: true
19
+ }
20
+ }, {
21
+ timestamps: true,
22
+ toJSON: { virtuals: true },
23
+ toObject: { virtuals: true }
24
+ });
25
+ exports.default = PincodeSchema;
26
+ //# sourceMappingURL=PincodeSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PincodeSchema.js","sourceRoot":"","sources":["../../src/schemas/PincodeSchema.ts"],"names":[],"mappings":";;AAAA,uCAAyC;AAUzC,MAAM,aAAa,GAAG,IAAI,iBAAM,CAC9B;IACE,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,EAAE;KACd;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,MAAM;QACX,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KACd;CACF,EACD;IACE,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC7B,CACF,CAAC;AAEF,kBAAe,aAAa,CAAC"}