@fesmex/models 0.1.22 → 0.1.24
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.cjs +53 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -28
- package/dist/index.d.ts +33 -28
- package/dist/index.js +67 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import mongoose__default, { Types, Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Types, Model, HydratedDocument, Document } from 'mongoose';
|
|
3
2
|
|
|
4
3
|
interface ClientType {
|
|
5
4
|
sn_code?: string | null;
|
|
@@ -16,7 +15,7 @@ interface ClientType {
|
|
|
16
15
|
created_at?: Date;
|
|
17
16
|
updated_at?: Date;
|
|
18
17
|
}
|
|
19
|
-
declare const _default$
|
|
18
|
+
declare const _default$o: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
20
19
|
|
|
21
20
|
interface ClientContactType {
|
|
22
21
|
client_id: Types.ObjectId;
|
|
@@ -29,7 +28,7 @@ interface ClientContactType {
|
|
|
29
28
|
created_at?: Date;
|
|
30
29
|
updated_at?: Date;
|
|
31
30
|
}
|
|
32
|
-
declare const _default$
|
|
31
|
+
declare const _default$n: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
33
32
|
|
|
34
33
|
interface ClientAddressType {
|
|
35
34
|
client_id: Types.ObjectId;
|
|
@@ -43,7 +42,7 @@ interface ClientAddressType {
|
|
|
43
42
|
created_at?: Date;
|
|
44
43
|
updated_at?: Date;
|
|
45
44
|
}
|
|
46
|
-
declare const _default$
|
|
45
|
+
declare const _default$m: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
47
46
|
|
|
48
47
|
interface ClientPaymentMethodType {
|
|
49
48
|
client_id: Types.ObjectId;
|
|
@@ -52,7 +51,7 @@ interface ClientPaymentMethodType {
|
|
|
52
51
|
created_at?: Date;
|
|
53
52
|
updated_at?: Date;
|
|
54
53
|
}
|
|
55
|
-
declare const _default$
|
|
54
|
+
declare const _default$l: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
56
55
|
|
|
57
56
|
interface ClientPaymentTermType {
|
|
58
57
|
client_id: Types.ObjectId;
|
|
@@ -61,7 +60,7 @@ interface ClientPaymentTermType {
|
|
|
61
60
|
created_at?: Date;
|
|
62
61
|
updated_at?: Date;
|
|
63
62
|
}
|
|
64
|
-
declare const _default$
|
|
63
|
+
declare const _default$k: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
65
64
|
|
|
66
65
|
interface ClientPriceListType {
|
|
67
66
|
client_id: Types.ObjectId;
|
|
@@ -70,7 +69,7 @@ interface ClientPriceListType {
|
|
|
70
69
|
created_at?: Date;
|
|
71
70
|
updated_at?: Date;
|
|
72
71
|
}
|
|
73
|
-
declare const _default$
|
|
72
|
+
declare const _default$j: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
74
73
|
|
|
75
74
|
interface ClientSalesEmployeeType {
|
|
76
75
|
client_id: Types.ObjectId;
|
|
@@ -79,8 +78,6 @@ interface ClientSalesEmployeeType {
|
|
|
79
78
|
created_at?: Date;
|
|
80
79
|
updated_at?: Date;
|
|
81
80
|
}
|
|
82
|
-
declare const _default$j: mongoose__default.Model<any, {}, {}, {}, any, any>;
|
|
83
|
-
|
|
84
81
|
declare const _default$i: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
85
82
|
|
|
86
83
|
declare const _default$h: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
@@ -97,6 +94,8 @@ declare const _default$c: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
|
97
94
|
|
|
98
95
|
declare const _default$b: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
99
96
|
|
|
97
|
+
declare const _default$a: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
98
|
+
|
|
100
99
|
declare enum QuoteStatus {
|
|
101
100
|
OPPORTUNITY = "OPPORTUNITY",
|
|
102
101
|
QUOTE = "QUOTE",
|
|
@@ -113,8 +112,6 @@ declare enum CreatedMethod {
|
|
|
113
112
|
MANUAL = "MANUAL",
|
|
114
113
|
CSV = "CSV"
|
|
115
114
|
}
|
|
116
|
-
declare const _default$a: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
117
|
-
|
|
118
115
|
declare const _default$9: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
119
116
|
|
|
120
117
|
declare const _default$8: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
@@ -123,6 +120,8 @@ declare const _default$7: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
|
123
120
|
|
|
124
121
|
declare const _default$6: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
125
122
|
|
|
123
|
+
declare const _default$5: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
124
|
+
|
|
126
125
|
declare enum CustomerStatus {
|
|
127
126
|
ACTIVE = "active",
|
|
128
127
|
INACTIVE = "inactive",
|
|
@@ -135,15 +134,17 @@ interface CustomerType {
|
|
|
135
134
|
mobile?: string;
|
|
136
135
|
password: string;
|
|
137
136
|
status: CustomerStatus;
|
|
138
|
-
fiscal_profile_id?:
|
|
137
|
+
fiscal_profile_id?: Types.ObjectId;
|
|
139
138
|
created_at: Date;
|
|
140
139
|
updated_at?: Date;
|
|
141
140
|
deleted_at?: Date;
|
|
142
141
|
}
|
|
143
|
-
|
|
142
|
+
type CustomerDoc = HydratedDocument<CustomerType>;
|
|
143
|
+
type CustomerModel = Model<CustomerType>;
|
|
144
|
+
declare const Customer: CustomerModel;
|
|
144
145
|
|
|
145
146
|
interface FiscalProfileType {
|
|
146
|
-
customer_id:
|
|
147
|
+
customer_id: Types.ObjectId;
|
|
147
148
|
rfc: string;
|
|
148
149
|
razon_social: string;
|
|
149
150
|
uso_cfdi: string;
|
|
@@ -152,7 +153,9 @@ interface FiscalProfileType {
|
|
|
152
153
|
created_at: Date;
|
|
153
154
|
updated_at?: Date;
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
+
type FiscalProfileDoc = HydratedDocument<FiscalProfileType>;
|
|
157
|
+
type FiscalProfileModel = Model<FiscalProfileType>;
|
|
158
|
+
declare const FiscalProfile: FiscalProfileModel;
|
|
156
159
|
|
|
157
160
|
declare enum OrderStatus {
|
|
158
161
|
PENDING = "pending",
|
|
@@ -161,7 +164,7 @@ declare enum OrderStatus {
|
|
|
161
164
|
CANCELLED = "cancelled",
|
|
162
165
|
COMPLETED = "completed"
|
|
163
166
|
}
|
|
164
|
-
declare const _default$
|
|
167
|
+
declare const _default$4: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
165
168
|
|
|
166
169
|
interface OrderStatusLogType {
|
|
167
170
|
order_id: Types.ObjectId;
|
|
@@ -170,7 +173,7 @@ interface OrderStatusLogType {
|
|
|
170
173
|
changed_at: Date;
|
|
171
174
|
note?: string;
|
|
172
175
|
}
|
|
173
|
-
declare const _default$
|
|
176
|
+
declare const _default$3: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
174
177
|
|
|
175
178
|
/**
|
|
176
179
|
* Sync Log Types
|
|
@@ -211,7 +214,7 @@ interface ISyncLog extends Document {
|
|
|
211
214
|
resolved_at?: Date;
|
|
212
215
|
resolved_by?: Types.ObjectId;
|
|
213
216
|
}
|
|
214
|
-
declare const SyncLog:
|
|
217
|
+
declare const SyncLog: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
215
218
|
|
|
216
219
|
declare enum UserRole {
|
|
217
220
|
ADMIN = "admin",
|
|
@@ -238,18 +241,18 @@ interface UserType {
|
|
|
238
241
|
sap_employee_id?: string;
|
|
239
242
|
sap_id?: string;
|
|
240
243
|
created_at: Date;
|
|
241
|
-
created_by?:
|
|
244
|
+
created_by?: mongoose.Types.ObjectId | string;
|
|
242
245
|
updated_at?: Date;
|
|
243
|
-
updated_by?:
|
|
246
|
+
updated_by?: mongoose.Types.ObjectId;
|
|
244
247
|
deleted_at?: Date;
|
|
245
|
-
deleted_by?:
|
|
248
|
+
deleted_by?: mongoose.Types.ObjectId;
|
|
246
249
|
}
|
|
247
|
-
declare const _default$
|
|
250
|
+
declare const _default$2: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
248
251
|
|
|
249
252
|
interface AnnouncementType {
|
|
250
|
-
created_by:
|
|
251
|
-
updated_by?:
|
|
252
|
-
deleted_by?:
|
|
253
|
+
created_by: mongoose.Types.ObjectId;
|
|
254
|
+
updated_by?: mongoose.Types.ObjectId;
|
|
255
|
+
deleted_by?: mongoose.Types.ObjectId;
|
|
253
256
|
created_at: Date;
|
|
254
257
|
updated_at?: Date;
|
|
255
258
|
deleted_at?: Date;
|
|
@@ -257,6 +260,8 @@ interface AnnouncementType {
|
|
|
257
260
|
text: string;
|
|
258
261
|
roles: UserRole[];
|
|
259
262
|
}
|
|
260
|
-
declare const _default:
|
|
263
|
+
declare const _default$1: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
264
|
+
|
|
265
|
+
declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
261
266
|
|
|
262
|
-
export { _default as Announcement, type AnnouncementType, _default$
|
|
267
|
+
export { _default$1 as Announcement, type AnnouncementType, _default$h as Article, _default$f as ArticleClass, _default$g as ArticleGroup, _default$e as ArticlePrice, _default as Cart, _default$o as Client, _default$m as ClientAddress, type ClientAddressType, _default$n as ClientContact, type ClientContactType, _default$l as ClientPaymentMethod, type ClientPaymentMethodType, _default$k as ClientPaymentTerm, type ClientPaymentTermType, _default$j as ClientPriceList, type ClientPriceListType, _default$i as ClientSalesEmployee, type ClientSalesEmployeeType, type ClientType, CreatedMethod, _default$d as Currency, Customer, type CustomerDoc, type CustomerModel, CustomerStatus, type CustomerType, FiscalProfile, type FiscalProfileDoc, type FiscalProfileModel, type FiscalProfileType, type ISyncLog, _default$b as InventoryStock, _default$4 as Order, OrderStatus, _default$3 as OrderStatusLog, type OrderStatusLogType, _default$a as PriceList, _default$9 as Quote, _default$8 as QuoteArticle, _default$7 as QuoteArticleExtra, _default$6 as QuoteContact, QuoteStatus, _default$5 as QuoteTerm, Status, SyncLog, SyncLogAction, SyncLogStatus, SyncLogType, UserRole, UserStatus, type UserType, _default$2 as Users, _default$c as Warehouse };
|
package/dist/index.js
CHANGED
|
@@ -150,7 +150,7 @@ var ClientsSalesEmployee_default = mongoose7.models.ClientSalesEmployee || model
|
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
// src/inventory/models/Article.ts
|
|
153
|
-
import { Schema as Schema8, model as model8,
|
|
153
|
+
import mongoose8, { Schema as Schema8, model as model8, Types as Types7 } from "mongoose";
|
|
154
154
|
var articleSchema = new Schema8({
|
|
155
155
|
article_number: { type: String, required: true, unique: true },
|
|
156
156
|
// SAP ItemCode
|
|
@@ -162,26 +162,26 @@ var articleSchema = new Schema8({
|
|
|
162
162
|
created_at: { type: Date, default: Date.now },
|
|
163
163
|
updated_at: { type: Date }
|
|
164
164
|
});
|
|
165
|
-
var Article_default = models.Article || model8("Article", articleSchema, "articles");
|
|
165
|
+
var Article_default = mongoose8.models.Article || model8("Article", articleSchema, "articles");
|
|
166
166
|
|
|
167
167
|
// src/inventory/models/ArticleGroups.ts
|
|
168
|
-
import { Schema as Schema9, model as model9
|
|
168
|
+
import mongoose9, { Schema as Schema9, model as model9 } from "mongoose";
|
|
169
169
|
var articleGroupSchema = new Schema9({
|
|
170
170
|
name: { type: String, required: true },
|
|
171
171
|
description: { type: String }
|
|
172
172
|
});
|
|
173
|
-
var ArticleGroups_default =
|
|
173
|
+
var ArticleGroups_default = mongoose9.models.ArticleGroup || model9("ArticleGroup", articleGroupSchema, "article_groups");
|
|
174
174
|
|
|
175
175
|
// src/inventory/models/ArticleClasses.ts
|
|
176
|
-
import { Schema as Schema10, model as model10
|
|
176
|
+
import mongoose10, { Schema as Schema10, model as model10 } from "mongoose";
|
|
177
177
|
var articleClassSchema = new Schema10({
|
|
178
178
|
name: { type: String, required: true },
|
|
179
179
|
description: { type: String }
|
|
180
180
|
});
|
|
181
|
-
var ArticleClasses_default =
|
|
181
|
+
var ArticleClasses_default = mongoose10.models.ArticleClass || model10("ArticleClass", articleClassSchema, "article_classes");
|
|
182
182
|
|
|
183
183
|
// src/inventory/models/ArticlePrices.ts
|
|
184
|
-
import { Schema as Schema11, model as model11,
|
|
184
|
+
import mongoose11, { Schema as Schema11, model as model11, Types as Types8 } from "mongoose";
|
|
185
185
|
var articlePriceSchema = new Schema11({
|
|
186
186
|
article_id: { type: Types8.ObjectId, ref: "Article", required: true },
|
|
187
187
|
price_list_id: { type: Types8.ObjectId, ref: "PriceList", required: true },
|
|
@@ -192,19 +192,19 @@ var articlePriceSchema = new Schema11({
|
|
|
192
192
|
created_at: { type: Date, default: Date.now },
|
|
193
193
|
updated_at: { type: Date }
|
|
194
194
|
});
|
|
195
|
-
var ArticlePrices_default =
|
|
195
|
+
var ArticlePrices_default = mongoose11.models.ArticlePrice || model11("ArticlePrice", articlePriceSchema, "article_prices");
|
|
196
196
|
|
|
197
197
|
// src/inventory/models/Currencies.ts
|
|
198
|
-
import { Schema as Schema12, model as model12
|
|
198
|
+
import mongoose12, { Schema as Schema12, model as model12 } from "mongoose";
|
|
199
199
|
var currencySchema = new Schema12({
|
|
200
200
|
code: { type: String, required: true, unique: true },
|
|
201
201
|
symbol: { type: String, required: true },
|
|
202
202
|
name: { type: String, required: true }
|
|
203
203
|
});
|
|
204
|
-
var Currencies_default =
|
|
204
|
+
var Currencies_default = mongoose12.models.Currency || model12("Currency", currencySchema, "currencies");
|
|
205
205
|
|
|
206
206
|
// src/inventory/models/Warehouses.ts
|
|
207
|
-
import { Schema as Schema13, model as model13
|
|
207
|
+
import mongoose13, { Schema as Schema13, model as model13 } from "mongoose";
|
|
208
208
|
var warehouseSchema = new Schema13({
|
|
209
209
|
code: { type: String, required: true, unique: true },
|
|
210
210
|
name: { type: String, required: true },
|
|
@@ -212,10 +212,10 @@ var warehouseSchema = new Schema13({
|
|
|
212
212
|
created_at: { type: Date, default: Date.now },
|
|
213
213
|
updated_at: { type: Date }
|
|
214
214
|
});
|
|
215
|
-
var Warehouses_default =
|
|
215
|
+
var Warehouses_default = mongoose13.models.Warehouse || model13("Warehouse", warehouseSchema, "warehouses");
|
|
216
216
|
|
|
217
217
|
// src/inventory/models/InventoryStocks.ts
|
|
218
|
-
import { Schema as Schema14, model as model14,
|
|
218
|
+
import mongoose14, { Schema as Schema14, model as model14, Types as Types9 } from "mongoose";
|
|
219
219
|
var inventoryStockSchema = new Schema14({
|
|
220
220
|
article_id: { type: Types9.ObjectId, ref: "Article", required: true },
|
|
221
221
|
warehouse_id: { type: Types9.ObjectId, ref: "Warehouse", required: true },
|
|
@@ -224,20 +224,20 @@ var inventoryStockSchema = new Schema14({
|
|
|
224
224
|
max_stock: { type: Number },
|
|
225
225
|
updated_at: { type: Date, default: Date.now }
|
|
226
226
|
});
|
|
227
|
-
var InventoryStocks_default =
|
|
227
|
+
var InventoryStocks_default = mongoose14.models.InventoryStock || model14("InventoryStock", inventoryStockSchema, "inventory_stocks");
|
|
228
228
|
|
|
229
229
|
// src/inventory/models/PriceLists.ts
|
|
230
|
-
import { Schema as Schema15, model as model15
|
|
230
|
+
import mongoose15, { Schema as Schema15, model as model15 } from "mongoose";
|
|
231
231
|
var priceListSchema = new Schema15({
|
|
232
232
|
number: { type: String, required: true, unique: true },
|
|
233
233
|
name: { type: String, required: true },
|
|
234
234
|
created_at: { type: Date, default: Date.now },
|
|
235
235
|
updated_at: { type: Date }
|
|
236
236
|
});
|
|
237
|
-
var PriceLists_default =
|
|
237
|
+
var PriceLists_default = mongoose15.models.PriceList || model15("PriceList", priceListSchema, "price_lists");
|
|
238
238
|
|
|
239
239
|
// src/quotes/models/Quote.ts
|
|
240
|
-
import { Schema as Schema16, model as model16
|
|
240
|
+
import mongoose16, { Schema as Schema16, model as model16 } from "mongoose";
|
|
241
241
|
var QuoteStatus = /* @__PURE__ */ ((QuoteStatus2) => {
|
|
242
242
|
QuoteStatus2["OPPORTUNITY"] = "OPPORTUNITY";
|
|
243
243
|
QuoteStatus2["QUOTE"] = "QUOTE";
|
|
@@ -299,10 +299,10 @@ var quoteSchema = new Schema16(
|
|
|
299
299
|
},
|
|
300
300
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
301
301
|
);
|
|
302
|
-
var Quote_default =
|
|
302
|
+
var Quote_default = mongoose16.models.Quote || model16("Quote", quoteSchema, "quotes");
|
|
303
303
|
|
|
304
304
|
// src/quotes/models/QuoteArticle.ts
|
|
305
|
-
import { Schema as Schema17, model as model17
|
|
305
|
+
import mongoose17, { Schema as Schema17, model as model17 } from "mongoose";
|
|
306
306
|
var quoteArticleSchema = new Schema17(
|
|
307
307
|
{
|
|
308
308
|
quote_id: { type: Schema17.Types.ObjectId, ref: "Quote", required: true },
|
|
@@ -321,10 +321,10 @@ var quoteArticleSchema = new Schema17(
|
|
|
321
321
|
},
|
|
322
322
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
323
323
|
);
|
|
324
|
-
var QuoteArticle_default =
|
|
324
|
+
var QuoteArticle_default = mongoose17.models.QuoteArticle || model17("QuoteArticle", quoteArticleSchema, "quote_articles");
|
|
325
325
|
|
|
326
326
|
// src/quotes/models/QuoteArticleExtra.ts
|
|
327
|
-
import { Schema as Schema18, model as model18
|
|
327
|
+
import mongoose18, { Schema as Schema18, model as model18 } from "mongoose";
|
|
328
328
|
var quoteArticleExtraSchema = new Schema18(
|
|
329
329
|
{
|
|
330
330
|
quote_article_id: {
|
|
@@ -340,10 +340,10 @@ var quoteArticleExtraSchema = new Schema18(
|
|
|
340
340
|
},
|
|
341
341
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
342
342
|
);
|
|
343
|
-
var QuoteArticleExtra_default =
|
|
343
|
+
var QuoteArticleExtra_default = mongoose18.models.QuoteArticleExtra || model18("QuoteArticleExtra", quoteArticleExtraSchema, "quote_article_extras");
|
|
344
344
|
|
|
345
345
|
// src/quotes/models/QuoteContact.ts
|
|
346
|
-
import { Schema as Schema19, model as model19
|
|
346
|
+
import mongoose19, { Schema as Schema19, model as model19 } from "mongoose";
|
|
347
347
|
var quoteContactSchema = new Schema19({
|
|
348
348
|
quote_id: { type: Schema19.Types.ObjectId, ref: "Quote", required: true },
|
|
349
349
|
name: String,
|
|
@@ -352,10 +352,10 @@ var quoteContactSchema = new Schema19({
|
|
|
352
352
|
pipedrive_id: String,
|
|
353
353
|
created_at: { type: Date, default: Date.now }
|
|
354
354
|
});
|
|
355
|
-
var QuoteContact_default =
|
|
355
|
+
var QuoteContact_default = mongoose19.models.QuoteContact || model19("QuoteContact", quoteContactSchema, "quote_contacts");
|
|
356
356
|
|
|
357
357
|
// src/quotes/models/QuoteTerm.ts
|
|
358
|
-
import { Schema as Schema20, model as model20
|
|
358
|
+
import mongoose20, { Schema as Schema20, model as model20 } from "mongoose";
|
|
359
359
|
var quoteTermSchema = new Schema20(
|
|
360
360
|
{
|
|
361
361
|
title: String,
|
|
@@ -367,10 +367,13 @@ var quoteTermSchema = new Schema20(
|
|
|
367
367
|
},
|
|
368
368
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
369
369
|
);
|
|
370
|
-
var QuoteTerm_default =
|
|
370
|
+
var QuoteTerm_default = mongoose20.models.QuoteTerm || model20("QuoteTerm", quoteTermSchema, "quote_terms");
|
|
371
371
|
|
|
372
372
|
// src/customers/models/Customers.ts
|
|
373
|
-
import
|
|
373
|
+
import mongoose21, {
|
|
374
|
+
Schema as Schema21,
|
|
375
|
+
model as model21
|
|
376
|
+
} from "mongoose";
|
|
374
377
|
import bcrypt from "bcryptjs";
|
|
375
378
|
var CustomerStatus = /* @__PURE__ */ ((CustomerStatus2) => {
|
|
376
379
|
CustomerStatus2["ACTIVE"] = "active";
|
|
@@ -400,10 +403,11 @@ customerSchema.pre("save", async function(next) {
|
|
|
400
403
|
}
|
|
401
404
|
next();
|
|
402
405
|
});
|
|
403
|
-
var
|
|
406
|
+
var Customer = mongoose21.models.Customer || model21("Customer", customerSchema, "customers");
|
|
407
|
+
var Customers_default = Customer;
|
|
404
408
|
|
|
405
409
|
// src/customers/models/FiscalProfileType.ts
|
|
406
|
-
import
|
|
410
|
+
import mongoose22, { Schema as Schema22, model as model22 } from "mongoose";
|
|
407
411
|
var fiscalProfileSchema = new Schema22({
|
|
408
412
|
customer_id: { type: Schema22.Types.ObjectId, ref: "Customer", required: true },
|
|
409
413
|
rfc: { type: String, required: true },
|
|
@@ -414,10 +418,11 @@ var fiscalProfileSchema = new Schema22({
|
|
|
414
418
|
created_at: { type: Date, default: Date.now },
|
|
415
419
|
updated_at: { type: Date }
|
|
416
420
|
});
|
|
417
|
-
var
|
|
421
|
+
var FiscalProfile = mongoose22.models.FiscalProfile || model22("FiscalProfile", fiscalProfileSchema, "fiscal_profiles");
|
|
422
|
+
var FiscalProfileType_default = FiscalProfile;
|
|
418
423
|
|
|
419
424
|
// src/orders/models/Orders.ts
|
|
420
|
-
import
|
|
425
|
+
import mongoose23, { Schema as Schema23, model as model23 } from "mongoose";
|
|
421
426
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
422
427
|
OrderStatus2["PENDING"] = "pending";
|
|
423
428
|
OrderStatus2["CONFIRMED"] = "confirmed";
|
|
@@ -449,10 +454,10 @@ var orderSchema = new Schema23({
|
|
|
449
454
|
created_at: { type: Date, default: Date.now },
|
|
450
455
|
updated_at: { type: Date }
|
|
451
456
|
});
|
|
452
|
-
var Orders_default =
|
|
457
|
+
var Orders_default = mongoose23.models.Order || model23("Order", orderSchema, "orders");
|
|
453
458
|
|
|
454
459
|
// src/orders/models/OrderStatusLogs.ts
|
|
455
|
-
import
|
|
460
|
+
import mongoose24, { Schema as Schema24, model as model24 } from "mongoose";
|
|
456
461
|
var orderStatusLogSchema = new Schema24({
|
|
457
462
|
order_id: {
|
|
458
463
|
type: Schema24.Types.ObjectId,
|
|
@@ -477,10 +482,10 @@ var orderStatusLogSchema = new Schema24({
|
|
|
477
482
|
type: String
|
|
478
483
|
}
|
|
479
484
|
});
|
|
480
|
-
var OrderStatusLogs_default =
|
|
485
|
+
var OrderStatusLogs_default = mongoose24.models.OrderStatusLog || model24("OrderStatusLog", orderStatusLogSchema, "order_status_logs");
|
|
481
486
|
|
|
482
487
|
// src/sap/models/SyncLog.ts
|
|
483
|
-
import
|
|
488
|
+
import mongoose25, { Schema as Schema25, model as model25 } from "mongoose";
|
|
484
489
|
var SyncLogType = /* @__PURE__ */ ((SyncLogType2) => {
|
|
485
490
|
SyncLogType2["SAP_QUOTATION"] = "SAP_QUOTATION";
|
|
486
491
|
SyncLogType2["SAP_SALES_ORDER"] = "SAP_SALES_ORDER";
|
|
@@ -546,13 +551,13 @@ var syncLogSchema = new Schema25(
|
|
|
546
551
|
);
|
|
547
552
|
syncLogSchema.index({ entity_type: 1, entity_id: 1, status: 1 });
|
|
548
553
|
syncLogSchema.index({ status: 1, next_retry_at: 1 });
|
|
549
|
-
var SyncLog =
|
|
554
|
+
var SyncLog = mongoose25.models.SyncLog || model25("SyncLog", syncLogSchema, "sync_logs");
|
|
550
555
|
|
|
551
556
|
// src/announcements/models/Announcements.ts
|
|
552
|
-
import
|
|
557
|
+
import mongoose27, { Schema as Schema27, model as model27 } from "mongoose";
|
|
553
558
|
|
|
554
559
|
// src/users/models/Users.ts
|
|
555
|
-
import
|
|
560
|
+
import mongoose26, { Schema as Schema26, model as model26 } from "mongoose";
|
|
556
561
|
import bcrypt2 from "bcryptjs";
|
|
557
562
|
var UserRole = /* @__PURE__ */ ((UserRole2) => {
|
|
558
563
|
UserRole2["ADMIN"] = "admin";
|
|
@@ -601,7 +606,7 @@ usersSchema.pre("save", async function(next) {
|
|
|
601
606
|
}
|
|
602
607
|
next();
|
|
603
608
|
});
|
|
604
|
-
var Users_default =
|
|
609
|
+
var Users_default = mongoose26.models.User || model26("User", usersSchema, "users");
|
|
605
610
|
|
|
606
611
|
// src/announcements/models/Announcements.ts
|
|
607
612
|
var announcementSchema = new Schema27({
|
|
@@ -644,13 +649,35 @@ var announcementSchema = new Schema27({
|
|
|
644
649
|
}
|
|
645
650
|
}
|
|
646
651
|
});
|
|
647
|
-
var Announcements_default =
|
|
652
|
+
var Announcements_default = mongoose27.models.Announcement || model27("Announcement", announcementSchema, "announcements");
|
|
653
|
+
|
|
654
|
+
// src/carts/models/Carts.ts
|
|
655
|
+
import mongoose28, { Schema as Schema28, model as model28, Types as Types12 } from "mongoose";
|
|
656
|
+
var cartItemSchema = new Schema28(
|
|
657
|
+
{
|
|
658
|
+
article_id: { type: Types12.ObjectId, ref: "Article", required: true },
|
|
659
|
+
quantity: { type: Number, required: true }
|
|
660
|
+
},
|
|
661
|
+
{ _id: false }
|
|
662
|
+
);
|
|
663
|
+
var cartSchema = new Schema28({
|
|
664
|
+
customer_id: {
|
|
665
|
+
type: Types12.ObjectId,
|
|
666
|
+
ref: "Customer",
|
|
667
|
+
required: true,
|
|
668
|
+
unique: true
|
|
669
|
+
},
|
|
670
|
+
items: [cartItemSchema],
|
|
671
|
+
updated_at: { type: Date, default: Date.now }
|
|
672
|
+
});
|
|
673
|
+
var Carts_default = mongoose28.models.Cart || model28("Cart", cartSchema, "carts");
|
|
648
674
|
export {
|
|
649
675
|
Announcements_default as Announcement,
|
|
650
676
|
Article_default as Article,
|
|
651
677
|
ArticleClasses_default as ArticleClass,
|
|
652
678
|
ArticleGroups_default as ArticleGroup,
|
|
653
679
|
ArticlePrices_default as ArticlePrice,
|
|
680
|
+
Carts_default as Cart,
|
|
654
681
|
Clients_default as Client,
|
|
655
682
|
ClientsAddress_default as ClientAddress,
|
|
656
683
|
ClientsContact_default as ClientContact,
|