@fesmex/models 0.1.10 → 0.1.13
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/announcements/index.js +8 -1
- package/dist/announcements/models/Announcements.js +10 -8
- package/dist/carts/index.js +8 -1
- package/dist/carts/models/Carts.js +8 -6
- package/dist/clients/index.js +20 -7
- package/dist/clients/models/Clients.js +5 -3
- package/dist/clients/models/ClientsAddress.js +6 -4
- package/dist/clients/models/ClientsContact.js +6 -4
- package/dist/clients/models/ClientsPaymentMethod.js +6 -4
- package/dist/clients/models/ClientsPaymentTerm.js +6 -4
- package/dist/clients/models/ClientsPriceList.js +6 -4
- package/dist/clients/models/ClientsSalesEmployee.js +6 -4
- package/dist/customers/index.js +10 -2
- package/dist/customers/models/Customers.js +14 -8
- package/dist/customers/models/FiscalProfileType.js +6 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +24 -9
- package/dist/inventory/index.js +22 -8
- package/dist/inventory/models/Article.d.ts +1 -108
- package/dist/inventory/models/Article.js +6 -4
- package/dist/inventory/models/ArticleClasses.d.ts +1 -24
- package/dist/inventory/models/ArticleClasses.js +5 -3
- package/dist/inventory/models/ArticleGroups.d.ts +1 -24
- package/dist/inventory/models/ArticleGroups.js +5 -3
- package/dist/inventory/models/ArticlePrices.d.ts +1 -204
- package/dist/inventory/models/ArticlePrices.js +8 -6
- package/dist/inventory/models/Currencies.d.ts +1 -30
- package/dist/inventory/models/Currencies.js +5 -3
- package/dist/inventory/models/InventoryStocks.d.ts +1 -144
- package/dist/inventory/models/InventoryStocks.js +7 -5
- package/dist/inventory/models/PriceLists.d.ts +1 -36
- package/dist/inventory/models/PriceLists.js +5 -3
- package/dist/inventory/models/Warehouses.d.ts +1 -42
- package/dist/inventory/models/Warehouses.js +5 -3
- package/dist/orders/index.js +12 -3
- package/dist/orders/models/OrderStatusLogs.js +9 -7
- package/dist/orders/models/Orders.d.ts +1 -90
- package/dist/orders/models/Orders.js +11 -8
- package/dist/quotes/index.js +19 -5
- package/dist/quotes/models/Quote.d.ts +1 -191
- package/dist/quotes/models/Quote.js +19 -16
- package/dist/quotes/models/QuoteArticle.d.ts +1 -95
- package/dist/quotes/models/QuoteArticle.js +8 -6
- package/dist/quotes/models/QuoteArticleExtra.d.ts +1 -53
- package/dist/quotes/models/QuoteArticleExtra.js +6 -4
- package/dist/quotes/models/QuoteContact.d.ts +1 -48
- package/dist/quotes/models/QuoteContact.js +6 -4
- package/dist/quotes/models/QuoteTerm.d.ts +1 -53
- package/dist/quotes/models/QuoteTerm.js +5 -3
- package/dist/sap/index.js +8 -1
- package/dist/sap/models/SyncLog.js +17 -14
- package/dist/users/index.js +10 -1
- package/dist/users/models/Users.js +18 -12
- package/package.json +3 -10
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const quoteContactSchema = new mongoose_1.Schema({
|
|
5
|
+
quote_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Quote", required: true },
|
|
4
6
|
name: String,
|
|
5
7
|
email: String,
|
|
6
8
|
mobile: String,
|
|
7
9
|
pipedrive_id: String,
|
|
8
10
|
created_at: { type: Date, default: Date.now },
|
|
9
11
|
});
|
|
10
|
-
|
|
12
|
+
exports.default = mongoose_1.models.QuoteContact || (0, mongoose_1.model)("QuoteContact", quoteContactSchema, "quote_contacts");
|
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: import("mongoose").Model<{
|
|
3
|
-
content: string;
|
|
4
|
-
is_active: boolean;
|
|
5
|
-
created_by?: string;
|
|
6
|
-
updated_by?: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
category?: string;
|
|
9
|
-
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
10
|
-
content: string;
|
|
11
|
-
is_active: boolean;
|
|
12
|
-
created_by?: string;
|
|
13
|
-
updated_by?: string;
|
|
14
|
-
title?: string;
|
|
15
|
-
category?: string;
|
|
16
|
-
}> & {
|
|
17
|
-
content: string;
|
|
18
|
-
is_active: boolean;
|
|
19
|
-
created_by?: string;
|
|
20
|
-
updated_by?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
category?: string;
|
|
23
|
-
} & {
|
|
24
|
-
_id: import("mongoose").Types.ObjectId;
|
|
25
|
-
}, Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
26
|
-
timestamps: {
|
|
27
|
-
createdAt: string;
|
|
28
|
-
updatedAt: string;
|
|
29
|
-
};
|
|
30
|
-
}, {
|
|
31
|
-
content: string;
|
|
32
|
-
is_active: boolean;
|
|
33
|
-
created_by?: string;
|
|
34
|
-
updated_by?: string;
|
|
35
|
-
title?: string;
|
|
36
|
-
category?: string;
|
|
37
|
-
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
38
|
-
content: string;
|
|
39
|
-
is_active: boolean;
|
|
40
|
-
created_by?: string;
|
|
41
|
-
updated_by?: string;
|
|
42
|
-
title?: string;
|
|
43
|
-
category?: string;
|
|
44
|
-
}>> & import("mongoose").FlatRecord<{
|
|
45
|
-
content: string;
|
|
46
|
-
is_active: boolean;
|
|
47
|
-
created_by?: string;
|
|
48
|
-
updated_by?: string;
|
|
49
|
-
title?: string;
|
|
50
|
-
category?: string;
|
|
51
|
-
}> & {
|
|
52
|
-
_id: import("mongoose").Types.ObjectId;
|
|
53
|
-
}>>;
|
|
1
|
+
declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
54
2
|
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const quoteTermSchema = new mongoose_1.Schema({
|
|
3
5
|
title: String,
|
|
4
6
|
content: { type: String, required: true },
|
|
5
7
|
category: String,
|
|
@@ -7,4 +9,4 @@ const quoteTermSchema = new Schema({
|
|
|
7
9
|
created_by: String,
|
|
8
10
|
updated_by: String,
|
|
9
11
|
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
|
|
10
|
-
|
|
12
|
+
exports.default = mongoose_1.models.QuoteTerm || (0, mongoose_1.model)("QuoteTerm", quoteTermSchema, "quote_terms");
|
package/dist/sap/index.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncLogType = exports.SyncLogStatus = exports.SyncLogAction = exports.SyncLog = void 0;
|
|
4
|
+
var SyncLog_1 = require("./models/SyncLog");
|
|
5
|
+
Object.defineProperty(exports, "SyncLog", { enumerable: true, get: function () { return SyncLog_1.SyncLog; } });
|
|
6
|
+
Object.defineProperty(exports, "SyncLogAction", { enumerable: true, get: function () { return SyncLog_1.SyncLogAction; } });
|
|
7
|
+
Object.defineProperty(exports, "SyncLogStatus", { enumerable: true, get: function () { return SyncLog_1.SyncLogStatus; } });
|
|
8
|
+
Object.defineProperty(exports, "SyncLogType", { enumerable: true, get: function () { return SyncLog_1.SyncLogType; } });
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncLog = exports.SyncLogAction = exports.SyncLogStatus = exports.SyncLogType = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
2
5
|
/**
|
|
3
6
|
* Sync Log Types
|
|
4
7
|
*/
|
|
5
|
-
|
|
8
|
+
var SyncLogType;
|
|
6
9
|
(function (SyncLogType) {
|
|
7
10
|
SyncLogType["SAP_QUOTATION"] = "SAP_QUOTATION";
|
|
8
11
|
SyncLogType["SAP_SALES_ORDER"] = "SAP_SALES_ORDER";
|
|
9
12
|
SyncLogType["PIPEDRIVE"] = "PIPEDRIVE";
|
|
10
|
-
})(SyncLogType || (SyncLogType = {}));
|
|
11
|
-
|
|
13
|
+
})(SyncLogType || (exports.SyncLogType = SyncLogType = {}));
|
|
14
|
+
var SyncLogStatus;
|
|
12
15
|
(function (SyncLogStatus) {
|
|
13
16
|
SyncLogStatus["PENDING"] = "PENDING";
|
|
14
17
|
SyncLogStatus["SUCCESS"] = "SUCCESS";
|
|
15
18
|
SyncLogStatus["FAILED"] = "FAILED";
|
|
16
19
|
SyncLogStatus["RETRYING"] = "RETRYING";
|
|
17
|
-
})(SyncLogStatus || (SyncLogStatus = {}));
|
|
18
|
-
|
|
20
|
+
})(SyncLogStatus || (exports.SyncLogStatus = SyncLogStatus = {}));
|
|
21
|
+
var SyncLogAction;
|
|
19
22
|
(function (SyncLogAction) {
|
|
20
23
|
SyncLogAction["CREATE"] = "CREATE";
|
|
21
24
|
SyncLogAction["UPDATE"] = "UPDATE";
|
|
22
25
|
SyncLogAction["DELETE"] = "DELETE";
|
|
23
|
-
})(SyncLogAction || (SyncLogAction = {}));
|
|
24
|
-
const syncLogSchema = new Schema({
|
|
26
|
+
})(SyncLogAction || (exports.SyncLogAction = SyncLogAction = {}));
|
|
27
|
+
const syncLogSchema = new mongoose_1.Schema({
|
|
25
28
|
entity_type: {
|
|
26
29
|
type: String,
|
|
27
30
|
required: true,
|
|
28
31
|
index: true,
|
|
29
32
|
},
|
|
30
33
|
entity_id: {
|
|
31
|
-
type: Schema.Types.ObjectId,
|
|
34
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
32
35
|
required: true,
|
|
33
36
|
index: true,
|
|
34
37
|
},
|
|
@@ -51,17 +54,17 @@ const syncLogSchema = new Schema({
|
|
|
51
54
|
},
|
|
52
55
|
error_message: { type: String },
|
|
53
56
|
error_code: { type: String },
|
|
54
|
-
error_details: { type: Schema.Types.Mixed },
|
|
55
|
-
request_payload: { type: Schema.Types.Mixed },
|
|
56
|
-
response_payload: { type: Schema.Types.Mixed },
|
|
57
|
+
error_details: { type: mongoose_1.Schema.Types.Mixed },
|
|
58
|
+
request_payload: { type: mongoose_1.Schema.Types.Mixed },
|
|
59
|
+
response_payload: { type: mongoose_1.Schema.Types.Mixed },
|
|
57
60
|
retry_count: { type: Number, default: 0 },
|
|
58
61
|
max_retries: { type: Number, default: 3 },
|
|
59
62
|
next_retry_at: { type: Date },
|
|
60
63
|
resolved_at: { type: Date },
|
|
61
|
-
resolved_by: { type: Schema.Types.ObjectId, ref: "User" },
|
|
64
|
+
resolved_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
62
65
|
}, {
|
|
63
66
|
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
64
67
|
});
|
|
65
68
|
syncLogSchema.index({ entity_type: 1, entity_id: 1, status: 1 });
|
|
66
69
|
syncLogSchema.index({ status: 1, next_retry_at: 1 });
|
|
67
|
-
|
|
70
|
+
exports.SyncLog = (0, mongoose_1.model)("SyncLog", syncLogSchema, "sync_logs");
|
package/dist/users/index.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
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.UserStatus = exports.UserRole = exports.Users = void 0;
|
|
7
|
+
var Users_1 = require("./models/Users");
|
|
8
|
+
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return __importDefault(Users_1).default; } });
|
|
9
|
+
Object.defineProperty(exports, "UserRole", { enumerable: true, get: function () { return Users_1.UserRole; } });
|
|
10
|
+
Object.defineProperty(exports, "UserStatus", { enumerable: true, get: function () { return Users_1.UserStatus; } });
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.UserStatus = exports.UserRole = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
9
|
+
var UserRole;
|
|
4
10
|
(function (UserRole) {
|
|
5
11
|
UserRole["ADMIN"] = "admin";
|
|
6
12
|
UserRole["SALES"] = "sales";
|
|
7
13
|
UserRole["TECHNICIAN"] = "technician";
|
|
8
14
|
UserRole["WAREHOUSEMAN"] = "warehouseman";
|
|
9
|
-
})(UserRole || (UserRole = {}));
|
|
10
|
-
|
|
15
|
+
})(UserRole || (exports.UserRole = UserRole = {}));
|
|
16
|
+
var UserStatus;
|
|
11
17
|
(function (UserStatus) {
|
|
12
18
|
UserStatus["ACTIVE"] = "active";
|
|
13
19
|
UserStatus["INACTIVE"] = "inactive";
|
|
14
20
|
UserStatus["SUSPENDED"] = "suspended";
|
|
15
|
-
})(UserStatus || (UserStatus = {}));
|
|
16
|
-
const usersSchema = new Schema({
|
|
21
|
+
})(UserStatus || (exports.UserStatus = UserStatus = {}));
|
|
22
|
+
const usersSchema = new mongoose_1.Schema({
|
|
17
23
|
first_name: { type: String, required: true },
|
|
18
24
|
middle_name: { type: String },
|
|
19
25
|
last_name: { type: String, required: true },
|
|
@@ -35,16 +41,16 @@ const usersSchema = new Schema({
|
|
|
35
41
|
sap_id: { type: String },
|
|
36
42
|
sap_employee_id: { type: String },
|
|
37
43
|
created_at: { type: Date, default: Date.now },
|
|
38
|
-
created_by: { type: Schema.Types.Mixed, ref: "User" },
|
|
44
|
+
created_by: { type: mongoose_1.Schema.Types.Mixed, ref: "User" },
|
|
39
45
|
updated_at: { type: Date },
|
|
40
|
-
updated_by: { type: Schema.Types.ObjectId, ref: "User" },
|
|
46
|
+
updated_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
41
47
|
deleted_at: { type: Date },
|
|
42
|
-
deleted_by: { type: Schema.Types.ObjectId, ref: "User" },
|
|
48
|
+
deleted_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
43
49
|
});
|
|
44
50
|
usersSchema.pre("save", async function (next) {
|
|
45
51
|
if (this.isModified("password")) {
|
|
46
|
-
this.password = await
|
|
52
|
+
this.password = await bcryptjs_1.default.hash(this.password, 12);
|
|
47
53
|
}
|
|
48
54
|
next();
|
|
49
55
|
});
|
|
50
|
-
|
|
56
|
+
exports.default = (0, mongoose_1.model)("User", usersSchema, "users");
|
package/package.json
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fesmex/models",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "0.1.13",
|
|
5
4
|
"main": "dist/index.js",
|
|
6
5
|
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./dist/index.js",
|
|
10
|
-
"require": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
6
|
"files": [
|
|
15
7
|
"dist"
|
|
16
8
|
],
|
|
@@ -26,5 +18,6 @@
|
|
|
26
18
|
},
|
|
27
19
|
"dependencies": {
|
|
28
20
|
"bcryptjs": "^3.0.3"
|
|
29
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
|
|
30
23
|
}
|