@fesmex/models 0.1.55 → 0.1.56
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 +90 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -24
- package/dist/index.d.ts +41 -24
- package/dist/index.js +92 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ interface ClientType {
|
|
|
15
15
|
created_at?: Date;
|
|
16
16
|
updated_at?: Date;
|
|
17
17
|
}
|
|
18
|
-
declare const _default$
|
|
18
|
+
declare const _default$t: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientType, {}, {}, {}, mongoose.Document<unknown, {}, ClientType, {}, mongoose.DefaultSchemaOptions> & ClientType & {
|
|
19
19
|
_id: mongoose.Types.ObjectId;
|
|
20
20
|
} & {
|
|
21
21
|
__v: number;
|
|
@@ -34,7 +34,7 @@ interface ClientContactType {
|
|
|
34
34
|
created_at?: Date;
|
|
35
35
|
updated_at?: Date;
|
|
36
36
|
}
|
|
37
|
-
declare const _default$
|
|
37
|
+
declare const _default$s: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientContactType, {}, {}, {}, mongoose.Document<unknown, {}, ClientContactType, {}, mongoose.DefaultSchemaOptions> & ClientContactType & {
|
|
38
38
|
_id: Types.ObjectId;
|
|
39
39
|
} & {
|
|
40
40
|
__v: number;
|
|
@@ -54,7 +54,7 @@ interface ClientAddressType {
|
|
|
54
54
|
created_at?: Date;
|
|
55
55
|
updated_at?: Date;
|
|
56
56
|
}
|
|
57
|
-
declare const _default$
|
|
57
|
+
declare const _default$r: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientAddressType, {}, {}, {}, mongoose.Document<unknown, {}, ClientAddressType, {}, mongoose.DefaultSchemaOptions> & ClientAddressType & {
|
|
58
58
|
_id: Types.ObjectId;
|
|
59
59
|
} & {
|
|
60
60
|
__v: number;
|
|
@@ -69,7 +69,7 @@ interface ClientPaymentMethodType {
|
|
|
69
69
|
created_at?: Date;
|
|
70
70
|
updated_at?: Date;
|
|
71
71
|
}
|
|
72
|
-
declare const _default$
|
|
72
|
+
declare const _default$q: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientPaymentMethodType, {}, {}, {}, mongoose.Document<unknown, {}, ClientPaymentMethodType, {}, mongoose.DefaultSchemaOptions> & ClientPaymentMethodType & {
|
|
73
73
|
_id: Types.ObjectId;
|
|
74
74
|
} & {
|
|
75
75
|
__v: number;
|
|
@@ -84,7 +84,7 @@ interface ClientPaymentTermType {
|
|
|
84
84
|
created_at?: Date;
|
|
85
85
|
updated_at?: Date;
|
|
86
86
|
}
|
|
87
|
-
declare const _default$
|
|
87
|
+
declare const _default$p: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientPaymentTermType, {}, {}, {}, mongoose.Document<unknown, {}, ClientPaymentTermType, {}, mongoose.DefaultSchemaOptions> & ClientPaymentTermType & {
|
|
88
88
|
_id: Types.ObjectId;
|
|
89
89
|
} & {
|
|
90
90
|
__v: number;
|
|
@@ -99,7 +99,7 @@ interface ClientPriceListType {
|
|
|
99
99
|
created_at?: Date;
|
|
100
100
|
updated_at?: Date;
|
|
101
101
|
}
|
|
102
|
-
declare const _default$
|
|
102
|
+
declare const _default$o: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientPriceListType, {}, {}, {}, mongoose.Document<unknown, {}, ClientPriceListType, {}, mongoose.DefaultSchemaOptions> & ClientPriceListType & {
|
|
103
103
|
_id: Types.ObjectId;
|
|
104
104
|
} & {
|
|
105
105
|
__v: number;
|
|
@@ -114,7 +114,7 @@ interface ClientSalesEmployeeType {
|
|
|
114
114
|
created_at?: Date;
|
|
115
115
|
updated_at?: Date;
|
|
116
116
|
}
|
|
117
|
-
declare const _default$
|
|
117
|
+
declare const _default$n: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<ClientSalesEmployeeType, {}, {}, {}, mongoose.Document<unknown, {}, ClientSalesEmployeeType, {}, mongoose.DefaultSchemaOptions> & ClientSalesEmployeeType & {
|
|
118
118
|
_id: Types.ObjectId;
|
|
119
119
|
} & {
|
|
120
120
|
__v: number;
|
|
@@ -122,7 +122,7 @@ declare const _default$m: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
122
122
|
id: string;
|
|
123
123
|
}, any, ClientSalesEmployeeType>;
|
|
124
124
|
|
|
125
|
-
declare const _default$
|
|
125
|
+
declare const _default$m: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
126
126
|
created_at: NativeDate;
|
|
127
127
|
description: string;
|
|
128
128
|
article_number: string;
|
|
@@ -1062,7 +1062,7 @@ declare const _default$l: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1062
1062
|
__v: number;
|
|
1063
1063
|
}>;
|
|
1064
1064
|
|
|
1065
|
-
declare const _default$
|
|
1065
|
+
declare const _default$l: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1066
1066
|
name: string;
|
|
1067
1067
|
description?: string;
|
|
1068
1068
|
}, {}, {}, {
|
|
@@ -1132,7 +1132,7 @@ declare const _default$k: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1132
1132
|
__v: number;
|
|
1133
1133
|
}>;
|
|
1134
1134
|
|
|
1135
|
-
declare const _default$
|
|
1135
|
+
declare const _default$k: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1136
1136
|
name: string;
|
|
1137
1137
|
description?: string;
|
|
1138
1138
|
}, {}, {}, {
|
|
@@ -1202,7 +1202,7 @@ declare const _default$j: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1202
1202
|
__v: number;
|
|
1203
1203
|
}>;
|
|
1204
1204
|
|
|
1205
|
-
declare const _default$
|
|
1205
|
+
declare const _default$j: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1206
1206
|
created_at: NativeDate;
|
|
1207
1207
|
article_id: Types.ObjectId;
|
|
1208
1208
|
price_list_id: Types.ObjectId;
|
|
@@ -1332,7 +1332,7 @@ declare const _default$i: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1332
1332
|
__v: number;
|
|
1333
1333
|
}>;
|
|
1334
1334
|
|
|
1335
|
-
declare const _default$
|
|
1335
|
+
declare const _default$i: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1336
1336
|
symbol: string;
|
|
1337
1337
|
name: string;
|
|
1338
1338
|
code: string;
|
|
@@ -1412,7 +1412,7 @@ declare const _default$h: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1412
1412
|
__v: number;
|
|
1413
1413
|
}>;
|
|
1414
1414
|
|
|
1415
|
-
declare const _default$
|
|
1415
|
+
declare const _default$h: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1416
1416
|
created_at: NativeDate;
|
|
1417
1417
|
name: string;
|
|
1418
1418
|
code: string;
|
|
@@ -1512,7 +1512,7 @@ declare const _default$g: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1512
1512
|
__v: number;
|
|
1513
1513
|
}>;
|
|
1514
1514
|
|
|
1515
|
-
declare const _default$
|
|
1515
|
+
declare const _default$g: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1516
1516
|
updated_at: NativeDate;
|
|
1517
1517
|
article_id: Types.ObjectId;
|
|
1518
1518
|
warehouse_id: Types.ObjectId;
|
|
@@ -1632,7 +1632,7 @@ declare const _default$f: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1632
1632
|
__v: number;
|
|
1633
1633
|
}>;
|
|
1634
1634
|
|
|
1635
|
-
declare const _default$
|
|
1635
|
+
declare const _default$f: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1636
1636
|
number: string;
|
|
1637
1637
|
created_at: NativeDate;
|
|
1638
1638
|
name: string;
|
|
@@ -1722,7 +1722,7 @@ declare const _default$e: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1722
1722
|
__v: number;
|
|
1723
1723
|
}>;
|
|
1724
1724
|
|
|
1725
|
-
declare const _default$
|
|
1725
|
+
declare const _default$e: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1726
1726
|
created_at: NativeDate;
|
|
1727
1727
|
updated_at: NativeDate;
|
|
1728
1728
|
name: string;
|
|
@@ -1842,7 +1842,7 @@ declare const _default$d: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
1842
1842
|
__v: number;
|
|
1843
1843
|
}>;
|
|
1844
1844
|
|
|
1845
|
-
declare const _default$
|
|
1845
|
+
declare const _default$d: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1846
1846
|
created_at: NativeDate;
|
|
1847
1847
|
updated_at: NativeDate;
|
|
1848
1848
|
type: "filter" | "sidebar";
|
|
@@ -1975,13 +1975,13 @@ declare enum CreatedMethod {
|
|
|
1975
1975
|
MANUAL = "MANUAL",
|
|
1976
1976
|
CSV = "CSV"
|
|
1977
1977
|
}
|
|
1978
|
+
declare const _default$c: mongoose.Model<any, {}, {}, {}, any, any, any>;
|
|
1979
|
+
|
|
1978
1980
|
declare const _default$b: mongoose.Model<any, {}, {}, {}, any, any, any>;
|
|
1979
1981
|
|
|
1980
1982
|
declare const _default$a: mongoose.Model<any, {}, {}, {}, any, any, any>;
|
|
1981
1983
|
|
|
1982
|
-
declare const _default$9: mongoose.Model<any, {}, {}, {}, any, any, any
|
|
1983
|
-
|
|
1984
|
-
declare const _default$8: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1984
|
+
declare const _default$9: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<{
|
|
1985
1985
|
created_at: NativeDate;
|
|
1986
1986
|
quote_id: mongoose.Types.ObjectId;
|
|
1987
1987
|
email?: string;
|
|
@@ -2091,7 +2091,7 @@ declare const _default$8: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
2091
2091
|
__v: number;
|
|
2092
2092
|
}>;
|
|
2093
2093
|
|
|
2094
|
-
declare const _default$
|
|
2094
|
+
declare const _default$8: mongoose.Model<any, {}, {}, {}, any, any, any>;
|
|
2095
2095
|
|
|
2096
2096
|
declare enum CustomerStatus {
|
|
2097
2097
|
ACTIVE = "active",
|
|
@@ -2145,7 +2145,7 @@ declare enum PaymentStatus {
|
|
|
2145
2145
|
PAID = "PAID",
|
|
2146
2146
|
REFUNDED = "REFUNDED"
|
|
2147
2147
|
}
|
|
2148
|
-
declare const _default$
|
|
2148
|
+
declare const _default$7: mongoose.Model<any, {}, {}, {}, any, any, any>;
|
|
2149
2149
|
|
|
2150
2150
|
interface OrderStatusLogType {
|
|
2151
2151
|
order_id: Types.ObjectId;
|
|
@@ -2154,7 +2154,7 @@ interface OrderStatusLogType {
|
|
|
2154
2154
|
changed_at?: Date;
|
|
2155
2155
|
note?: string;
|
|
2156
2156
|
}
|
|
2157
|
-
declare const _default$
|
|
2157
|
+
declare const _default$6: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<OrderStatusLogType, {}, {}, {}, mongoose.Document<unknown, {}, OrderStatusLogType, {}, mongoose.DefaultSchemaOptions> & OrderStatusLogType & {
|
|
2158
2158
|
_id: Types.ObjectId;
|
|
2159
2159
|
} & {
|
|
2160
2160
|
__v: number;
|
|
@@ -2162,6 +2162,23 @@ declare const _default$5: mongoose.Model<any, {}, {}, {}, any, any, any> | mongo
|
|
|
2162
2162
|
id: string;
|
|
2163
2163
|
}, any, OrderStatusLogType>;
|
|
2164
2164
|
|
|
2165
|
+
interface StateType {
|
|
2166
|
+
_id?: mongoose.Types.ObjectId;
|
|
2167
|
+
name: string;
|
|
2168
|
+
code?: string;
|
|
2169
|
+
percentage: number;
|
|
2170
|
+
is_active: boolean;
|
|
2171
|
+
created_at?: Date;
|
|
2172
|
+
updated_at?: Date;
|
|
2173
|
+
}
|
|
2174
|
+
declare const _default$5: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoose.Model<StateType, {}, {}, {}, mongoose.Document<unknown, {}, StateType, {}, mongoose.DefaultSchemaOptions> & StateType & Required<{
|
|
2175
|
+
_id: mongoose.Types.ObjectId;
|
|
2176
|
+
}> & {
|
|
2177
|
+
__v: number;
|
|
2178
|
+
} & {
|
|
2179
|
+
id: string;
|
|
2180
|
+
}, any, StateType>;
|
|
2181
|
+
|
|
2165
2182
|
/**
|
|
2166
2183
|
* Sync Log Types
|
|
2167
2184
|
*/
|
|
@@ -2405,4 +2422,4 @@ declare const _default: mongoose.Model<any, {}, {}, {}, any, any, any> | mongoos
|
|
|
2405
2422
|
id: string;
|
|
2406
2423
|
}, any, OrderPaymentDocument>;
|
|
2407
2424
|
|
|
2408
|
-
export { _default$3 as Announcement, type AnnouncementType, _default$
|
|
2425
|
+
export { _default$3 as Announcement, type AnnouncementType, _default$m as Article, _default$k as ArticleClass, _default$l as ArticleGroup, _default$j as ArticlePrice, ArticleView, _default$2 as Cart, type CartItem, type CartType, _default$e as Category, _default$t as Client, _default$r as ClientAddress, type ClientAddressType, _default$s as ClientContact, type ClientContactType, _default$q as ClientPaymentMethod, type ClientPaymentMethodType, _default$p as ClientPaymentTerm, type ClientPaymentTermType, _default$o as ClientPriceList, type ClientPriceListType, _default$n as ClientSalesEmployee, type ClientSalesEmployeeType, type ClientType, CreatedMethod, _default$i as Currency, Customer, type CustomerDoc, type CustomerModel, _default$1 as CustomerPaymentMethod, CustomerStatus, type CustomerType, EmailVerificationToken, type EmailVerificationTokenDoc, type EmailVerificationTokenModel, type EmailVerificationTokenType, FiscalProfile, type FiscalProfileDoc, type FiscalProfileModel, type FiscalProfileType, type ISyncLog, _default$g as InventoryStock, _default$7 as Order, _default as OrderPayment, OrderStatus, _default$6 as OrderStatusLog, type OrderStatusLogType, PasswordResetToken, type PasswordResetTokenDoc, type PasswordResetTokenModel, type PasswordResetTokenType, PaymentMethod, PaymentMethodType, type PaymentMethodWallet, PaymentProvider$1 as PaymentProvider, PaymentStatus, _default$f as PriceList, _default$c as Quote, _default$b as QuoteArticle, _default$a as QuoteArticleExtra, _default$9 as QuoteContact, QuoteStatus, _default$8 as QuoteTerm, RefreshToken, type RefreshTokenDoc, type RefreshTokenModel, type RefreshTokenType, _default$5 as State, type StateType, Status, SyncLog, SyncLogAction, SyncLogStatus, SyncLogType, _default$d as Tag, TransactionMethod, TransactionStatus, UserRole, UserStatus, type UserType, _default$4 as Users, _default$h as Warehouse };
|
package/dist/index.js
CHANGED
|
@@ -631,8 +631,45 @@ orderStatusLogSchema.index(
|
|
|
631
631
|
);
|
|
632
632
|
var OrderStatusLogs_default = mongoose27.models.OrderStatusLog || model27("OrderStatusLog", orderStatusLogSchema);
|
|
633
633
|
|
|
634
|
-
// src/
|
|
634
|
+
// src/orders/models/State.ts
|
|
635
635
|
import mongoose28, { Schema as Schema28, model as model28 } from "mongoose";
|
|
636
|
+
var stateSchema = new Schema28(
|
|
637
|
+
{
|
|
638
|
+
name: {
|
|
639
|
+
type: String,
|
|
640
|
+
required: true,
|
|
641
|
+
trim: true,
|
|
642
|
+
lowercase: true,
|
|
643
|
+
index: true
|
|
644
|
+
},
|
|
645
|
+
code: {
|
|
646
|
+
type: String,
|
|
647
|
+
trim: true,
|
|
648
|
+
uppercase: true,
|
|
649
|
+
sparse: true
|
|
650
|
+
},
|
|
651
|
+
percentage: {
|
|
652
|
+
type: Number,
|
|
653
|
+
required: true,
|
|
654
|
+
default: 0.1,
|
|
655
|
+
min: 0,
|
|
656
|
+
max: 1
|
|
657
|
+
},
|
|
658
|
+
is_active: {
|
|
659
|
+
type: Boolean,
|
|
660
|
+
default: true,
|
|
661
|
+
index: true
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" }
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
stateSchema.index({ name: 1, is_active: 1 }, { name: "states_name_active" });
|
|
669
|
+
var State_default = mongoose28.models.State || model28("State", stateSchema, "states");
|
|
670
|
+
|
|
671
|
+
// src/sap/models/SyncLog.ts
|
|
672
|
+
import mongoose29, { Schema as Schema29, model as model29 } from "mongoose";
|
|
636
673
|
var SyncLogType = /* @__PURE__ */ ((SyncLogType2) => {
|
|
637
674
|
SyncLogType2["SAP_QUOTATION"] = "SAP_QUOTATION";
|
|
638
675
|
SyncLogType2["SAP_SALES_ORDER"] = "SAP_SALES_ORDER";
|
|
@@ -652,7 +689,7 @@ var SyncLogAction = /* @__PURE__ */ ((SyncLogAction2) => {
|
|
|
652
689
|
SyncLogAction2["DELETE"] = "DELETE";
|
|
653
690
|
return SyncLogAction2;
|
|
654
691
|
})(SyncLogAction || {});
|
|
655
|
-
var syncLogSchema = new
|
|
692
|
+
var syncLogSchema = new Schema29(
|
|
656
693
|
{
|
|
657
694
|
entity_type: {
|
|
658
695
|
type: String,
|
|
@@ -660,7 +697,7 @@ var syncLogSchema = new Schema28(
|
|
|
660
697
|
index: true
|
|
661
698
|
},
|
|
662
699
|
entity_id: {
|
|
663
|
-
type:
|
|
700
|
+
type: Schema29.Types.ObjectId,
|
|
664
701
|
required: true,
|
|
665
702
|
index: true
|
|
666
703
|
},
|
|
@@ -683,14 +720,14 @@ var syncLogSchema = new Schema28(
|
|
|
683
720
|
},
|
|
684
721
|
error_message: { type: String },
|
|
685
722
|
error_code: { type: String },
|
|
686
|
-
error_details: { type:
|
|
687
|
-
request_payload: { type:
|
|
688
|
-
response_payload: { type:
|
|
723
|
+
error_details: { type: Schema29.Types.Mixed },
|
|
724
|
+
request_payload: { type: Schema29.Types.Mixed },
|
|
725
|
+
response_payload: { type: Schema29.Types.Mixed },
|
|
689
726
|
retry_count: { type: Number, default: 0 },
|
|
690
727
|
max_retries: { type: Number, default: 3 },
|
|
691
728
|
next_retry_at: { type: Date },
|
|
692
729
|
resolved_at: { type: Date },
|
|
693
|
-
resolved_by: { type:
|
|
730
|
+
resolved_by: { type: Schema29.Types.ObjectId, ref: "User" }
|
|
694
731
|
},
|
|
695
732
|
{
|
|
696
733
|
timestamps: { createdAt: "created_at", updatedAt: "updated_at" }
|
|
@@ -698,13 +735,13 @@ var syncLogSchema = new Schema28(
|
|
|
698
735
|
);
|
|
699
736
|
syncLogSchema.index({ entity_type: 1, entity_id: 1, status: 1 });
|
|
700
737
|
syncLogSchema.index({ status: 1, next_retry_at: 1 });
|
|
701
|
-
var SyncLog =
|
|
738
|
+
var SyncLog = mongoose29.models.SyncLog || model29("SyncLog", syncLogSchema, "sync_logs");
|
|
702
739
|
|
|
703
740
|
// src/announcements/models/Announcements.ts
|
|
704
|
-
import
|
|
741
|
+
import mongoose31, { Schema as Schema31, model as model31 } from "mongoose";
|
|
705
742
|
|
|
706
743
|
// src/users/models/Users.ts
|
|
707
|
-
import
|
|
744
|
+
import mongoose30, { Schema as Schema30, model as model30 } from "mongoose";
|
|
708
745
|
import bcrypt2 from "bcryptjs";
|
|
709
746
|
var UserRole = /* @__PURE__ */ ((UserRole2) => {
|
|
710
747
|
UserRole2["ADMIN"] = "admin";
|
|
@@ -719,7 +756,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
719
756
|
UserStatus2["SUSPENDED"] = "suspended";
|
|
720
757
|
return UserStatus2;
|
|
721
758
|
})(UserStatus || {});
|
|
722
|
-
var usersSchema = new
|
|
759
|
+
var usersSchema = new Schema30({
|
|
723
760
|
first_name: { type: String, required: true },
|
|
724
761
|
middle_name: { type: String },
|
|
725
762
|
last_name: { type: String, required: true },
|
|
@@ -741,32 +778,32 @@ var usersSchema = new Schema29({
|
|
|
741
778
|
sap_id: { type: String },
|
|
742
779
|
sap_employee_id: { type: String },
|
|
743
780
|
created_at: { type: Date, default: Date.now },
|
|
744
|
-
created_by: { type:
|
|
781
|
+
created_by: { type: Schema30.Types.Mixed, ref: "User" },
|
|
745
782
|
updated_at: { type: Date },
|
|
746
|
-
updated_by: { type:
|
|
783
|
+
updated_by: { type: Schema30.Types.ObjectId, ref: "User" },
|
|
747
784
|
deleted_at: { type: Date },
|
|
748
|
-
deleted_by: { type:
|
|
785
|
+
deleted_by: { type: Schema30.Types.ObjectId, ref: "User" }
|
|
749
786
|
});
|
|
750
787
|
usersSchema.pre("save", async function() {
|
|
751
788
|
if (this.isModified("password")) {
|
|
752
789
|
this.password = await bcrypt2.hash(this.password, 12);
|
|
753
790
|
}
|
|
754
791
|
});
|
|
755
|
-
var Users_default =
|
|
792
|
+
var Users_default = mongoose30.models.User || model30("User", usersSchema, "users");
|
|
756
793
|
|
|
757
794
|
// src/announcements/models/Announcements.ts
|
|
758
|
-
var announcementSchema = new
|
|
795
|
+
var announcementSchema = new Schema31({
|
|
759
796
|
created_by: {
|
|
760
|
-
type:
|
|
797
|
+
type: Schema31.Types.ObjectId,
|
|
761
798
|
ref: "User",
|
|
762
799
|
required: true
|
|
763
800
|
},
|
|
764
801
|
updated_by: {
|
|
765
|
-
type:
|
|
802
|
+
type: Schema31.Types.ObjectId,
|
|
766
803
|
ref: "User"
|
|
767
804
|
},
|
|
768
805
|
deleted_by: {
|
|
769
|
-
type:
|
|
806
|
+
type: Schema31.Types.ObjectId,
|
|
770
807
|
ref: "User"
|
|
771
808
|
},
|
|
772
809
|
created_at: {
|
|
@@ -795,11 +832,11 @@ var announcementSchema = new Schema30({
|
|
|
795
832
|
}
|
|
796
833
|
}
|
|
797
834
|
});
|
|
798
|
-
var Announcements_default =
|
|
835
|
+
var Announcements_default = mongoose31.models.Announcement || model31("Announcement", announcementSchema, "announcements");
|
|
799
836
|
|
|
800
837
|
// src/carts/models/Carts.ts
|
|
801
|
-
import
|
|
802
|
-
var cartItemSchema = new
|
|
838
|
+
import mongoose32, { Schema as Schema32, model as model32, Types as Types13 } from "mongoose";
|
|
839
|
+
var cartItemSchema = new Schema32(
|
|
803
840
|
{
|
|
804
841
|
article_id: { type: Types13.ObjectId, ref: "Article", required: true },
|
|
805
842
|
quantity: { type: Number, required: true, min: 1 },
|
|
@@ -809,7 +846,7 @@ var cartItemSchema = new Schema31(
|
|
|
809
846
|
},
|
|
810
847
|
{ _id: false }
|
|
811
848
|
);
|
|
812
|
-
var cartSchema = new
|
|
849
|
+
var cartSchema = new Schema32(
|
|
813
850
|
{
|
|
814
851
|
customer_id: {
|
|
815
852
|
type: Types13.ObjectId,
|
|
@@ -833,15 +870,15 @@ var cartSchema = new Schema31(
|
|
|
833
870
|
);
|
|
834
871
|
cartSchema.index({ customer_id: 1 }, { unique: true, name: "carts_customer_unique" });
|
|
835
872
|
cartSchema.index({ updated_at: -1 }, { name: "carts_updated_at" });
|
|
836
|
-
var Carts_default =
|
|
873
|
+
var Carts_default = mongoose32.models.Cart || model32("Cart", cartSchema, "carts");
|
|
837
874
|
|
|
838
875
|
// src/auth/models/RefreshTokens.ts
|
|
839
|
-
import
|
|
840
|
-
Schema as
|
|
841
|
-
model as
|
|
876
|
+
import mongoose33, {
|
|
877
|
+
Schema as Schema33,
|
|
878
|
+
model as model33
|
|
842
879
|
} from "mongoose";
|
|
843
|
-
var refreshTokenSchema = new
|
|
844
|
-
customer_id: { type:
|
|
880
|
+
var refreshTokenSchema = new Schema33({
|
|
881
|
+
customer_id: { type: Schema33.Types.ObjectId, ref: "Customer", required: true },
|
|
845
882
|
// Store only SHA-256 hash of the opaque refresh token (base64url). Never store the raw token.
|
|
846
883
|
token_hash: { type: String, required: true },
|
|
847
884
|
expires_at: { type: Date, required: true },
|
|
@@ -856,16 +893,16 @@ refreshTokenSchema.index({ customer_id: 1, expires_at: 1 });
|
|
|
856
893
|
refreshTokenSchema.pre("save", function() {
|
|
857
894
|
this.updated_at = /* @__PURE__ */ new Date();
|
|
858
895
|
});
|
|
859
|
-
var RefreshToken =
|
|
896
|
+
var RefreshToken = mongoose33.models.RefreshToken || model33("RefreshToken", refreshTokenSchema, "refresh_tokens");
|
|
860
897
|
var RefreshTokens_default = RefreshToken;
|
|
861
898
|
|
|
862
899
|
// src/auth/models/PasswordResetTokens.ts
|
|
863
|
-
import
|
|
864
|
-
Schema as
|
|
865
|
-
model as
|
|
900
|
+
import mongoose34, {
|
|
901
|
+
Schema as Schema34,
|
|
902
|
+
model as model34
|
|
866
903
|
} from "mongoose";
|
|
867
|
-
var passwordResetTokenSchema = new
|
|
868
|
-
customer_id: { type:
|
|
904
|
+
var passwordResetTokenSchema = new Schema34({
|
|
905
|
+
customer_id: { type: Schema34.Types.ObjectId, ref: "Customer", required: true },
|
|
869
906
|
// Store only SHA-256 hash of the opaque reset token (base64url). Never store the raw token.
|
|
870
907
|
token_hash: { type: String, required: true },
|
|
871
908
|
expires_at: { type: Date, required: true },
|
|
@@ -879,16 +916,16 @@ passwordResetTokenSchema.index({ customer_id: 1, expires_at: 1 });
|
|
|
879
916
|
passwordResetTokenSchema.pre("save", function(next) {
|
|
880
917
|
this.updated_at = /* @__PURE__ */ new Date();
|
|
881
918
|
});
|
|
882
|
-
var PasswordResetToken =
|
|
919
|
+
var PasswordResetToken = mongoose34.models.PasswordResetToken || model34("PasswordResetToken", passwordResetTokenSchema, "password_reset_tokens");
|
|
883
920
|
var PasswordResetTokens_default = PasswordResetToken;
|
|
884
921
|
|
|
885
922
|
// src/auth/models/EmailVerificationTokens.ts
|
|
886
|
-
import
|
|
887
|
-
Schema as
|
|
888
|
-
model as
|
|
923
|
+
import mongoose35, {
|
|
924
|
+
Schema as Schema35,
|
|
925
|
+
model as model35
|
|
889
926
|
} from "mongoose";
|
|
890
|
-
var emailVerificationTokenSchema = new
|
|
891
|
-
customer_id: { type:
|
|
927
|
+
var emailVerificationTokenSchema = new Schema35({
|
|
928
|
+
customer_id: { type: Schema35.Types.ObjectId, ref: "Customer", required: true },
|
|
892
929
|
// Store only SHA-256 hash of the opaque email verification token. Never store the raw token.
|
|
893
930
|
token_hash: { type: String, required: true },
|
|
894
931
|
expires_at: { type: Date, required: true },
|
|
@@ -899,7 +936,7 @@ var emailVerificationTokenSchema = new Schema34({
|
|
|
899
936
|
emailVerificationTokenSchema.index({ token_hash: 1 }, { unique: true });
|
|
900
937
|
emailVerificationTokenSchema.index({ expires_at: 1 }, { expireAfterSeconds: 0 });
|
|
901
938
|
emailVerificationTokenSchema.index({ customer_id: 1, expires_at: 1 });
|
|
902
|
-
var EmailVerificationToken =
|
|
939
|
+
var EmailVerificationToken = mongoose35.models.EmailVerificationToken || model35(
|
|
903
940
|
"EmailVerificationToken",
|
|
904
941
|
emailVerificationTokenSchema,
|
|
905
942
|
"email_verification_tokens"
|
|
@@ -907,7 +944,7 @@ var EmailVerificationToken = mongoose34.models.EmailVerificationToken || model34
|
|
|
907
944
|
var EmailVerificationTokens_default = EmailVerificationToken;
|
|
908
945
|
|
|
909
946
|
// src/payments/models/PaymentMethods.ts
|
|
910
|
-
import
|
|
947
|
+
import mongoose36, { Schema as Schema36, model as model36 } from "mongoose";
|
|
911
948
|
var PaymentProvider = /* @__PURE__ */ ((PaymentProvider3) => {
|
|
912
949
|
PaymentProvider3["STRIPE"] = "stripe";
|
|
913
950
|
return PaymentProvider3;
|
|
@@ -919,9 +956,9 @@ var PaymentMethodType = /* @__PURE__ */ ((PaymentMethodType2) => {
|
|
|
919
956
|
PaymentMethodType2["BANK_TRANSFER"] = "bank_transfer";
|
|
920
957
|
return PaymentMethodType2;
|
|
921
958
|
})(PaymentMethodType || {});
|
|
922
|
-
var paymentMethodSchema = new
|
|
959
|
+
var paymentMethodSchema = new Schema36(
|
|
923
960
|
{
|
|
924
|
-
customer_id: { type:
|
|
961
|
+
customer_id: { type: Schema36.Types.ObjectId, ref: "Customer", required: true },
|
|
925
962
|
provider: {
|
|
926
963
|
type: String,
|
|
927
964
|
enum: Object.values(PaymentProvider),
|
|
@@ -947,7 +984,7 @@ var paymentMethodSchema = new Schema35(
|
|
|
947
984
|
},
|
|
948
985
|
is_default: { type: Boolean, default: false },
|
|
949
986
|
deleted_at: { type: Date },
|
|
950
|
-
deleted_by: { type:
|
|
987
|
+
deleted_by: { type: Schema36.Types.ObjectId, ref: "User" }
|
|
951
988
|
},
|
|
952
989
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
953
990
|
);
|
|
@@ -963,10 +1000,10 @@ paymentMethodSchema.index(
|
|
|
963
1000
|
{ customer_id: 1, is_default: 1 },
|
|
964
1001
|
{ name: "payment_methods_default_lookup" }
|
|
965
1002
|
);
|
|
966
|
-
var PaymentMethods_default =
|
|
1003
|
+
var PaymentMethods_default = mongoose36.models.CustomerPaymentMethod || model36("CustomerPaymentMethod", paymentMethodSchema, "customer_payment_methods");
|
|
967
1004
|
|
|
968
1005
|
// src/payments/models/Payments.ts
|
|
969
|
-
import
|
|
1006
|
+
import mongoose37, { Schema as Schema37, model as model37 } from "mongoose";
|
|
970
1007
|
var PaymentProvider2 = /* @__PURE__ */ ((PaymentProvider3) => {
|
|
971
1008
|
PaymentProvider3["STRIPE"] = "stripe";
|
|
972
1009
|
return PaymentProvider3;
|
|
@@ -986,11 +1023,11 @@ var TransactionMethod = /* @__PURE__ */ ((TransactionMethod2) => {
|
|
|
986
1023
|
TransactionMethod2["BANK_TRANSFER"] = "bank_transfer";
|
|
987
1024
|
return TransactionMethod2;
|
|
988
1025
|
})(TransactionMethod || {});
|
|
989
|
-
var orderPaymentSchema = new
|
|
1026
|
+
var orderPaymentSchema = new Schema37(
|
|
990
1027
|
{
|
|
991
|
-
order_id: { type:
|
|
992
|
-
customer_id: { type:
|
|
993
|
-
payment_method_id: { type:
|
|
1028
|
+
order_id: { type: Schema37.Types.ObjectId, ref: "Order", required: true },
|
|
1029
|
+
customer_id: { type: Schema37.Types.ObjectId, ref: "Customer", required: true },
|
|
1030
|
+
payment_method_id: { type: Schema37.Types.ObjectId, ref: "ClientPaymentMethod" },
|
|
994
1031
|
provider: {
|
|
995
1032
|
type: String,
|
|
996
1033
|
enum: Object.values(PaymentProvider2),
|
|
@@ -1013,7 +1050,7 @@ var orderPaymentSchema = new Schema36(
|
|
|
1013
1050
|
amount: { type: Number, required: true, min: 0 },
|
|
1014
1051
|
currency: { type: String, required: true, default: "MXN" },
|
|
1015
1052
|
deleted_at: { type: Date },
|
|
1016
|
-
deleted_by: { type:
|
|
1053
|
+
deleted_by: { type: Schema37.Types.ObjectId, ref: "User" }
|
|
1017
1054
|
},
|
|
1018
1055
|
{ timestamps: { createdAt: "created_at", updatedAt: "updated_at" } }
|
|
1019
1056
|
);
|
|
@@ -1037,7 +1074,7 @@ orderPaymentSchema.index(
|
|
|
1037
1074
|
{ provider_payment_id: 1 },
|
|
1038
1075
|
{ name: "order_payments_provider_payment_id" }
|
|
1039
1076
|
);
|
|
1040
|
-
var Payments_default =
|
|
1077
|
+
var Payments_default = mongoose37.models.OrderPayment || model37("OrderPayment", orderPaymentSchema, "order_payments");
|
|
1041
1078
|
export {
|
|
1042
1079
|
Announcements_default as Announcement,
|
|
1043
1080
|
Article_default as Article,
|
|
@@ -1078,6 +1115,7 @@ export {
|
|
|
1078
1115
|
QuoteStatus,
|
|
1079
1116
|
QuoteTerm_default as QuoteTerm,
|
|
1080
1117
|
RefreshTokens_default as RefreshToken,
|
|
1118
|
+
State_default as State,
|
|
1081
1119
|
Status,
|
|
1082
1120
|
SyncLog,
|
|
1083
1121
|
SyncLogAction,
|