@fesmex/models 0.1.13 → 0.1.17
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 +757 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +262 -0
- package/dist/index.d.ts +262 -8
- package/dist/index.js +684 -22
- package/dist/index.js.map +1 -0
- package/package.json +19 -10
- package/dist/announcements/index.d.ts +0 -2
- package/dist/announcements/index.js +0 -8
- package/dist/announcements/models/Announcements.d.ts +0 -17
- package/dist/announcements/models/Announcements.js +0 -45
- package/dist/carts/index.d.ts +0 -1
- package/dist/carts/index.js +0 -8
- package/dist/carts/models/Carts.d.ts +0 -14
- package/dist/carts/models/Carts.js +0 -18
- package/dist/clients/index.d.ts +0 -14
- package/dist/clients/index.js +0 -20
- package/dist/clients/models/Clients.d.ts +0 -19
- package/dist/clients/models/Clients.js +0 -17
- package/dist/clients/models/ClientsAddress.d.ts +0 -17
- package/dist/clients/models/ClientsAddress.js +0 -19
- package/dist/clients/models/ClientsContact.d.ts +0 -16
- package/dist/clients/models/ClientsContact.js +0 -18
- package/dist/clients/models/ClientsPaymentMethod.d.ts +0 -12
- package/dist/clients/models/ClientsPaymentMethod.js +0 -14
- package/dist/clients/models/ClientsPaymentTerm.d.ts +0 -12
- package/dist/clients/models/ClientsPaymentTerm.js +0 -14
- package/dist/clients/models/ClientsPriceList.d.ts +0 -12
- package/dist/clients/models/ClientsPriceList.js +0 -14
- package/dist/clients/models/ClientsSalesEmployee.d.ts +0 -12
- package/dist/clients/models/ClientsSalesEmployee.js +0 -14
- package/dist/customers/index.d.ts +0 -4
- package/dist/customers/index.js +0 -10
- package/dist/customers/models/Customers.d.ts +0 -22
- package/dist/customers/models/Customers.js +0 -38
- package/dist/customers/models/FiscalProfileType.d.ts +0 -15
- package/dist/customers/models/FiscalProfileType.js +0 -14
- package/dist/inventory/index.d.ts +0 -8
- package/dist/inventory/index.js +0 -22
- package/dist/inventory/models/Article.d.ts +0 -2
- package/dist/inventory/models/Article.js +0 -14
- package/dist/inventory/models/ArticleClasses.d.ts +0 -2
- package/dist/inventory/models/ArticleClasses.js +0 -8
- package/dist/inventory/models/ArticleGroups.d.ts +0 -2
- package/dist/inventory/models/ArticleGroups.js +0 -8
- package/dist/inventory/models/ArticlePrices.d.ts +0 -2
- package/dist/inventory/models/ArticlePrices.js +0 -14
- package/dist/inventory/models/Currencies.d.ts +0 -2
- package/dist/inventory/models/Currencies.js +0 -9
- package/dist/inventory/models/InventoryStocks.d.ts +0 -2
- package/dist/inventory/models/InventoryStocks.js +0 -12
- package/dist/inventory/models/PriceLists.d.ts +0 -2
- package/dist/inventory/models/PriceLists.js +0 -10
- package/dist/inventory/models/Warehouses.d.ts +0 -2
- package/dist/inventory/models/Warehouses.js +0 -11
- package/dist/orders/index.d.ts +0 -4
- package/dist/orders/index.js +0 -12
- package/dist/orders/models/OrderStatusLogs.d.ts +0 -13
- package/dist/orders/models/OrderStatusLogs.js +0 -29
- package/dist/orders/models/Orders.d.ts +0 -9
- package/dist/orders/models/Orders.js +0 -33
- package/dist/quotes/index.d.ts +0 -5
- package/dist/quotes/index.js +0 -19
- package/dist/quotes/models/Quote.d.ts +0 -18
- package/dist/quotes/models/Quote.js +0 -63
- package/dist/quotes/models/QuoteArticle.d.ts +0 -2
- package/dist/quotes/models/QuoteArticle.js +0 -19
- package/dist/quotes/models/QuoteArticleExtra.d.ts +0 -2
- package/dist/quotes/models/QuoteArticleExtra.js +0 -16
- package/dist/quotes/models/QuoteContact.d.ts +0 -2
- package/dist/quotes/models/QuoteContact.js +0 -12
- package/dist/quotes/models/QuoteTerm.d.ts +0 -2
- package/dist/quotes/models/QuoteTerm.js +0 -12
- package/dist/sap/index.d.ts +0 -2
- package/dist/sap/index.js +0 -8
- package/dist/sap/models/SyncLog.d.ts +0 -43
- package/dist/sap/models/SyncLog.js +0 -70
- package/dist/users/index.d.ts +0 -2
- package/dist/users/index.js +0 -10
- package/dist/users/models/Users.d.ts +0 -36
- package/dist/users/models/Users.js +0 -56
package/dist/users/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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,36 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
export declare enum UserRole {
|
|
3
|
-
ADMIN = "admin",
|
|
4
|
-
SALES = "sales",
|
|
5
|
-
TECHNICIAN = "technician",
|
|
6
|
-
WAREHOUSEMAN = "warehouseman"
|
|
7
|
-
}
|
|
8
|
-
export declare enum UserStatus {
|
|
9
|
-
ACTIVE = "active",
|
|
10
|
-
INACTIVE = "inactive",
|
|
11
|
-
SUSPENDED = "suspended"
|
|
12
|
-
}
|
|
13
|
-
export interface UserType {
|
|
14
|
-
first_name: string;
|
|
15
|
-
middle_name?: string;
|
|
16
|
-
last_name: string;
|
|
17
|
-
username: string;
|
|
18
|
-
password: string;
|
|
19
|
-
role: UserRole;
|
|
20
|
-
status: UserStatus;
|
|
21
|
-
email?: string;
|
|
22
|
-
mobile?: string;
|
|
23
|
-
pipedrive_id?: string;
|
|
24
|
-
sap_employee_id?: string;
|
|
25
|
-
sap_id?: string;
|
|
26
|
-
created_at: Date;
|
|
27
|
-
created_by?: mongoose.Types.ObjectId | string;
|
|
28
|
-
updated_at?: Date;
|
|
29
|
-
updated_by?: mongoose.Types.ObjectId;
|
|
30
|
-
deleted_at?: Date;
|
|
31
|
-
deleted_by?: mongoose.Types.ObjectId;
|
|
32
|
-
}
|
|
33
|
-
declare const _default: mongoose.Model<UserType, {}, {}, {}, mongoose.Document<unknown, {}, UserType> & UserType & {
|
|
34
|
-
_id: mongoose.Types.ObjectId;
|
|
35
|
-
}, any>;
|
|
36
|
-
export default _default;
|
|
@@ -1,56 +0,0 @@
|
|
|
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;
|
|
10
|
-
(function (UserRole) {
|
|
11
|
-
UserRole["ADMIN"] = "admin";
|
|
12
|
-
UserRole["SALES"] = "sales";
|
|
13
|
-
UserRole["TECHNICIAN"] = "technician";
|
|
14
|
-
UserRole["WAREHOUSEMAN"] = "warehouseman";
|
|
15
|
-
})(UserRole || (exports.UserRole = UserRole = {}));
|
|
16
|
-
var UserStatus;
|
|
17
|
-
(function (UserStatus) {
|
|
18
|
-
UserStatus["ACTIVE"] = "active";
|
|
19
|
-
UserStatus["INACTIVE"] = "inactive";
|
|
20
|
-
UserStatus["SUSPENDED"] = "suspended";
|
|
21
|
-
})(UserStatus || (exports.UserStatus = UserStatus = {}));
|
|
22
|
-
const usersSchema = new mongoose_1.Schema({
|
|
23
|
-
first_name: { type: String, required: true },
|
|
24
|
-
middle_name: { type: String },
|
|
25
|
-
last_name: { type: String, required: true },
|
|
26
|
-
username: { type: String, required: true, unique: true },
|
|
27
|
-
password: { type: String, required: true, select: false },
|
|
28
|
-
role: {
|
|
29
|
-
type: String,
|
|
30
|
-
enum: Object.values(UserRole),
|
|
31
|
-
default: UserRole.SALES,
|
|
32
|
-
},
|
|
33
|
-
status: {
|
|
34
|
-
type: String,
|
|
35
|
-
enum: Object.values(UserStatus),
|
|
36
|
-
default: UserStatus.ACTIVE,
|
|
37
|
-
},
|
|
38
|
-
email: { type: String },
|
|
39
|
-
mobile: { type: String },
|
|
40
|
-
pipedrive_id: { type: String },
|
|
41
|
-
sap_id: { type: String },
|
|
42
|
-
sap_employee_id: { type: String },
|
|
43
|
-
created_at: { type: Date, default: Date.now },
|
|
44
|
-
created_by: { type: mongoose_1.Schema.Types.Mixed, ref: "User" },
|
|
45
|
-
updated_at: { type: Date },
|
|
46
|
-
updated_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
47
|
-
deleted_at: { type: Date },
|
|
48
|
-
deleted_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
|
|
49
|
-
});
|
|
50
|
-
usersSchema.pre("save", async function (next) {
|
|
51
|
-
if (this.isModified("password")) {
|
|
52
|
-
this.password = await bcryptjs_1.default.hash(this.password, 12);
|
|
53
|
-
}
|
|
54
|
-
next();
|
|
55
|
-
});
|
|
56
|
-
exports.default = (0, mongoose_1.model)("User", usersSchema, "users");
|