@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.
Files changed (81) hide show
  1. package/dist/index.cjs +757 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +262 -0
  4. package/dist/index.d.ts +262 -8
  5. package/dist/index.js +684 -22
  6. package/dist/index.js.map +1 -0
  7. package/package.json +19 -10
  8. package/dist/announcements/index.d.ts +0 -2
  9. package/dist/announcements/index.js +0 -8
  10. package/dist/announcements/models/Announcements.d.ts +0 -17
  11. package/dist/announcements/models/Announcements.js +0 -45
  12. package/dist/carts/index.d.ts +0 -1
  13. package/dist/carts/index.js +0 -8
  14. package/dist/carts/models/Carts.d.ts +0 -14
  15. package/dist/carts/models/Carts.js +0 -18
  16. package/dist/clients/index.d.ts +0 -14
  17. package/dist/clients/index.js +0 -20
  18. package/dist/clients/models/Clients.d.ts +0 -19
  19. package/dist/clients/models/Clients.js +0 -17
  20. package/dist/clients/models/ClientsAddress.d.ts +0 -17
  21. package/dist/clients/models/ClientsAddress.js +0 -19
  22. package/dist/clients/models/ClientsContact.d.ts +0 -16
  23. package/dist/clients/models/ClientsContact.js +0 -18
  24. package/dist/clients/models/ClientsPaymentMethod.d.ts +0 -12
  25. package/dist/clients/models/ClientsPaymentMethod.js +0 -14
  26. package/dist/clients/models/ClientsPaymentTerm.d.ts +0 -12
  27. package/dist/clients/models/ClientsPaymentTerm.js +0 -14
  28. package/dist/clients/models/ClientsPriceList.d.ts +0 -12
  29. package/dist/clients/models/ClientsPriceList.js +0 -14
  30. package/dist/clients/models/ClientsSalesEmployee.d.ts +0 -12
  31. package/dist/clients/models/ClientsSalesEmployee.js +0 -14
  32. package/dist/customers/index.d.ts +0 -4
  33. package/dist/customers/index.js +0 -10
  34. package/dist/customers/models/Customers.d.ts +0 -22
  35. package/dist/customers/models/Customers.js +0 -38
  36. package/dist/customers/models/FiscalProfileType.d.ts +0 -15
  37. package/dist/customers/models/FiscalProfileType.js +0 -14
  38. package/dist/inventory/index.d.ts +0 -8
  39. package/dist/inventory/index.js +0 -22
  40. package/dist/inventory/models/Article.d.ts +0 -2
  41. package/dist/inventory/models/Article.js +0 -14
  42. package/dist/inventory/models/ArticleClasses.d.ts +0 -2
  43. package/dist/inventory/models/ArticleClasses.js +0 -8
  44. package/dist/inventory/models/ArticleGroups.d.ts +0 -2
  45. package/dist/inventory/models/ArticleGroups.js +0 -8
  46. package/dist/inventory/models/ArticlePrices.d.ts +0 -2
  47. package/dist/inventory/models/ArticlePrices.js +0 -14
  48. package/dist/inventory/models/Currencies.d.ts +0 -2
  49. package/dist/inventory/models/Currencies.js +0 -9
  50. package/dist/inventory/models/InventoryStocks.d.ts +0 -2
  51. package/dist/inventory/models/InventoryStocks.js +0 -12
  52. package/dist/inventory/models/PriceLists.d.ts +0 -2
  53. package/dist/inventory/models/PriceLists.js +0 -10
  54. package/dist/inventory/models/Warehouses.d.ts +0 -2
  55. package/dist/inventory/models/Warehouses.js +0 -11
  56. package/dist/orders/index.d.ts +0 -4
  57. package/dist/orders/index.js +0 -12
  58. package/dist/orders/models/OrderStatusLogs.d.ts +0 -13
  59. package/dist/orders/models/OrderStatusLogs.js +0 -29
  60. package/dist/orders/models/Orders.d.ts +0 -9
  61. package/dist/orders/models/Orders.js +0 -33
  62. package/dist/quotes/index.d.ts +0 -5
  63. package/dist/quotes/index.js +0 -19
  64. package/dist/quotes/models/Quote.d.ts +0 -18
  65. package/dist/quotes/models/Quote.js +0 -63
  66. package/dist/quotes/models/QuoteArticle.d.ts +0 -2
  67. package/dist/quotes/models/QuoteArticle.js +0 -19
  68. package/dist/quotes/models/QuoteArticleExtra.d.ts +0 -2
  69. package/dist/quotes/models/QuoteArticleExtra.js +0 -16
  70. package/dist/quotes/models/QuoteContact.d.ts +0 -2
  71. package/dist/quotes/models/QuoteContact.js +0 -12
  72. package/dist/quotes/models/QuoteTerm.d.ts +0 -2
  73. package/dist/quotes/models/QuoteTerm.js +0 -12
  74. package/dist/sap/index.d.ts +0 -2
  75. package/dist/sap/index.js +0 -8
  76. package/dist/sap/models/SyncLog.d.ts +0 -43
  77. package/dist/sap/models/SyncLog.js +0 -70
  78. package/dist/users/index.d.ts +0 -2
  79. package/dist/users/index.js +0 -10
  80. package/dist/users/models/Users.d.ts +0 -36
  81. package/dist/users/models/Users.js +0 -56
@@ -1,15 +0,0 @@
1
- import mongoose from "mongoose";
2
- export interface FiscalProfileType {
3
- customer_id: mongoose.Types.ObjectId;
4
- rfc: string;
5
- razon_social: string;
6
- uso_cfdi: string;
7
- regimen_fiscal: string;
8
- cp: string;
9
- created_at: Date;
10
- updated_at?: Date;
11
- }
12
- declare const _default: mongoose.Model<FiscalProfileType, {}, {}, {}, mongoose.Document<unknown, {}, FiscalProfileType> & FiscalProfileType & {
13
- _id: mongoose.Types.ObjectId;
14
- }, any>;
15
- export default _default;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const fiscalProfileSchema = new mongoose_1.Schema({
5
- customer_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Customer", required: true },
6
- rfc: { type: String, required: true },
7
- razon_social: { type: String, required: true },
8
- uso_cfdi: { type: String, required: true },
9
- regimen_fiscal: { type: String, required: true },
10
- cp: { type: String, required: true },
11
- created_at: { type: Date, default: Date.now },
12
- updated_at: { type: Date },
13
- });
14
- exports.default = (0, mongoose_1.model)("FiscalProfile", fiscalProfileSchema, "fiscal_profiles");
@@ -1,8 +0,0 @@
1
- export { default as Article } from "./models/Article";
2
- export { default as ArticleGroup } from "./models/ArticleGroups";
3
- export { default as ArticleClass } from "./models/ArticleClasses";
4
- export { default as ArticlePrice } from "./models/ArticlePrices";
5
- export { default as Currency } from "./models/Currencies";
6
- export { default as Warehouse } from "./models/Warehouses";
7
- export { default as InventoryStock } from "./models/InventoryStocks";
8
- export { default as PriceList } from "./models/PriceLists";
@@ -1,22 +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.PriceList = exports.InventoryStock = exports.Warehouse = exports.Currency = exports.ArticlePrice = exports.ArticleClass = exports.ArticleGroup = exports.Article = void 0;
7
- var Article_1 = require("./models/Article");
8
- Object.defineProperty(exports, "Article", { enumerable: true, get: function () { return __importDefault(Article_1).default; } });
9
- var ArticleGroups_1 = require("./models/ArticleGroups");
10
- Object.defineProperty(exports, "ArticleGroup", { enumerable: true, get: function () { return __importDefault(ArticleGroups_1).default; } });
11
- var ArticleClasses_1 = require("./models/ArticleClasses");
12
- Object.defineProperty(exports, "ArticleClass", { enumerable: true, get: function () { return __importDefault(ArticleClasses_1).default; } });
13
- var ArticlePrices_1 = require("./models/ArticlePrices");
14
- Object.defineProperty(exports, "ArticlePrice", { enumerable: true, get: function () { return __importDefault(ArticlePrices_1).default; } });
15
- var Currencies_1 = require("./models/Currencies");
16
- Object.defineProperty(exports, "Currency", { enumerable: true, get: function () { return __importDefault(Currencies_1).default; } });
17
- var Warehouses_1 = require("./models/Warehouses");
18
- Object.defineProperty(exports, "Warehouse", { enumerable: true, get: function () { return __importDefault(Warehouses_1).default; } });
19
- var InventoryStocks_1 = require("./models/InventoryStocks");
20
- Object.defineProperty(exports, "InventoryStock", { enumerable: true, get: function () { return __importDefault(InventoryStocks_1).default; } });
21
- var PriceLists_1 = require("./models/PriceLists");
22
- Object.defineProperty(exports, "PriceList", { enumerable: true, get: function () { return __importDefault(PriceLists_1).default; } });
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const articleSchema = new mongoose_1.Schema({
5
- article_number: { type: String, required: true, unique: true }, // SAP ItemCode
6
- description: { type: String, required: true },
7
- unit: { type: String, required: true },
8
- brand: { type: String },
9
- model: { type: String },
10
- group_id: { type: mongoose_1.Types.ObjectId, ref: "ArticleGroup", required: true },
11
- created_at: { type: Date, default: Date.now },
12
- updated_at: { type: Date },
13
- });
14
- exports.default = mongoose_1.models.Article || (0, mongoose_1.model)("Article", articleSchema, "articles");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const articleClassSchema = new mongoose_1.Schema({
5
- name: { type: String, required: true },
6
- description: { type: String },
7
- });
8
- exports.default = mongoose_1.models.ArticleClass || (0, mongoose_1.model)("ArticleClass", articleClassSchema, "article_classes");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const articleGroupSchema = new mongoose_1.Schema({
5
- name: { type: String, required: true },
6
- description: { type: String },
7
- });
8
- exports.default = mongoose_1.models.ArticleGroup || (0, mongoose_1.model)("ArticleGroup", articleGroupSchema, "article_groups");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const articlePriceSchema = new mongoose_1.Schema({
5
- article_id: { type: mongoose_1.Types.ObjectId, ref: "Article", required: true },
6
- price_list_id: { type: mongoose_1.Types.ObjectId, ref: "PriceList", required: true },
7
- currency_id: { type: mongoose_1.Types.ObjectId, ref: "Currency", required: true },
8
- price: { type: Number, required: true },
9
- valid_from: { type: Date },
10
- valid_to: { type: Date },
11
- created_at: { type: Date, default: Date.now },
12
- updated_at: { type: Date },
13
- });
14
- exports.default = mongoose_1.models.ArticlePrice || (0, mongoose_1.model)("ArticlePrice", articlePriceSchema, "article_prices");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const currencySchema = new mongoose_1.Schema({
5
- code: { type: String, required: true, unique: true },
6
- symbol: { type: String, required: true },
7
- name: { type: String, required: true },
8
- });
9
- exports.default = mongoose_1.models.Currency || (0, mongoose_1.model)("Currency", currencySchema, "currencies");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const inventoryStockSchema = new mongoose_1.Schema({
5
- article_id: { type: mongoose_1.Types.ObjectId, ref: "Article", required: true },
6
- warehouse_id: { type: mongoose_1.Types.ObjectId, ref: "Warehouse", required: true },
7
- count: { type: Number, required: true },
8
- min_stock: { type: Number },
9
- max_stock: { type: Number },
10
- updated_at: { type: Date, default: Date.now },
11
- });
12
- exports.default = mongoose_1.models.InventoryStock || (0, mongoose_1.model)("InventoryStock", inventoryStockSchema, "inventory_stocks");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const priceListSchema = new mongoose_1.Schema({
5
- number: { type: String, required: true, unique: true },
6
- name: { type: String, required: true },
7
- created_at: { type: Date, default: Date.now },
8
- updated_at: { type: Date },
9
- });
10
- exports.default = mongoose_1.models.PriceList || (0, mongoose_1.model)("PriceList", priceListSchema, "price_lists");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const warehouseSchema = new mongoose_1.Schema({
5
- code: { type: String, required: true, unique: true },
6
- name: { type: String, required: true },
7
- location: { type: String },
8
- created_at: { type: Date, default: Date.now },
9
- updated_at: { type: Date },
10
- });
11
- exports.default = mongoose_1.models.Warehouse || (0, mongoose_1.model)("Warehouse", warehouseSchema, "warehouses");
@@ -1,4 +0,0 @@
1
- export { default as Order } from "./models/Orders";
2
- export { default as OrderStatusLog } from "./models/OrderStatusLogs";
3
- export { OrderStatus } from "./models/Orders";
4
- export type { OrderStatusLogType } from "./models/OrderStatusLogs";
@@ -1,12 +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.OrderStatus = exports.OrderStatusLog = exports.Order = void 0;
7
- var Orders_1 = require("./models/Orders");
8
- Object.defineProperty(exports, "Order", { enumerable: true, get: function () { return __importDefault(Orders_1).default; } });
9
- var OrderStatusLogs_1 = require("./models/OrderStatusLogs");
10
- Object.defineProperty(exports, "OrderStatusLog", { enumerable: true, get: function () { return __importDefault(OrderStatusLogs_1).default; } });
11
- var Orders_2 = require("./models/Orders");
12
- Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return Orders_2.OrderStatus; } });
@@ -1,13 +0,0 @@
1
- import { Types } from "mongoose";
2
- import { OrderStatus } from "./Orders";
3
- export interface OrderStatusLogType {
4
- order_id: Types.ObjectId;
5
- status: OrderStatus;
6
- changed_by: Types.ObjectId;
7
- changed_at: Date;
8
- note?: string;
9
- }
10
- declare const _default: import("mongoose").Model<OrderStatusLogType, {}, {}, {}, import("mongoose").Document<unknown, {}, OrderStatusLogType> & OrderStatusLogType & {
11
- _id: Types.ObjectId;
12
- }, any>;
13
- export default _default;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const Orders_1 = require("./Orders");
5
- const orderStatusLogSchema = new mongoose_1.Schema({
6
- order_id: {
7
- type: mongoose_1.Schema.Types.ObjectId,
8
- ref: "Order",
9
- required: true,
10
- },
11
- status: {
12
- type: String,
13
- enum: Object.values(Orders_1.OrderStatus),
14
- required: true,
15
- },
16
- changed_by: {
17
- type: mongoose_1.Schema.Types.ObjectId,
18
- ref: "User",
19
- required: true,
20
- },
21
- changed_at: {
22
- type: Date,
23
- default: Date.now,
24
- },
25
- note: {
26
- type: String,
27
- },
28
- });
29
- exports.default = (0, mongoose_1.model)("OrderStatusLog", orderStatusLogSchema, "order_status_logs");
@@ -1,9 +0,0 @@
1
- export declare enum OrderStatus {
2
- PENDING = "pending",
3
- CONFIRMED = "confirmed",
4
- SHIPPED = "shipped",
5
- CANCELLED = "cancelled",
6
- COMPLETED = "completed"
7
- }
8
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
9
- export default _default;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrderStatus = void 0;
4
- const mongoose_1 = require("mongoose");
5
- var OrderStatus;
6
- (function (OrderStatus) {
7
- OrderStatus["PENDING"] = "pending";
8
- OrderStatus["CONFIRMED"] = "confirmed";
9
- OrderStatus["SHIPPED"] = "shipped";
10
- OrderStatus["CANCELLED"] = "cancelled";
11
- OrderStatus["COMPLETED"] = "completed";
12
- })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
13
- const orderItemSchema = new mongoose_1.Schema({
14
- article_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Article", required: true },
15
- quantity: { type: Number, required: true },
16
- unit_price: { type: Number, required: true },
17
- total: { type: Number, required: true },
18
- }, { _id: false });
19
- const orderSchema = new mongoose_1.Schema({
20
- customer_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Customer", required: true },
21
- items: [orderItemSchema],
22
- status: {
23
- type: String,
24
- enum: Object.values(OrderStatus),
25
- default: OrderStatus.PENDING,
26
- },
27
- tracking_number: { type: String },
28
- total: { type: Number, required: true },
29
- notes: { type: String },
30
- created_at: { type: Date, default: Date.now },
31
- updated_at: { type: Date },
32
- });
33
- exports.default = mongoose_1.models.Order || (0, mongoose_1.model)("Order", orderSchema, "orders");
@@ -1,5 +0,0 @@
1
- export { default as Quote, QuoteStatus, Status, CreatedMethod } from "./models/Quote";
2
- export { default as QuoteArticle } from "./models/QuoteArticle";
3
- export { default as QuoteArticleExtra } from "./models/QuoteArticleExtra";
4
- export { default as QuoteContact } from "./models/QuoteContact";
5
- export { default as QuoteTerm } from "./models/QuoteTerm";
@@ -1,19 +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.QuoteTerm = exports.QuoteContact = exports.QuoteArticleExtra = exports.QuoteArticle = exports.CreatedMethod = exports.Status = exports.QuoteStatus = exports.Quote = void 0;
7
- var Quote_1 = require("./models/Quote");
8
- Object.defineProperty(exports, "Quote", { enumerable: true, get: function () { return __importDefault(Quote_1).default; } });
9
- Object.defineProperty(exports, "QuoteStatus", { enumerable: true, get: function () { return Quote_1.QuoteStatus; } });
10
- Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return Quote_1.Status; } });
11
- Object.defineProperty(exports, "CreatedMethod", { enumerable: true, get: function () { return Quote_1.CreatedMethod; } });
12
- var QuoteArticle_1 = require("./models/QuoteArticle");
13
- Object.defineProperty(exports, "QuoteArticle", { enumerable: true, get: function () { return __importDefault(QuoteArticle_1).default; } });
14
- var QuoteArticleExtra_1 = require("./models/QuoteArticleExtra");
15
- Object.defineProperty(exports, "QuoteArticleExtra", { enumerable: true, get: function () { return __importDefault(QuoteArticleExtra_1).default; } });
16
- var QuoteContact_1 = require("./models/QuoteContact");
17
- Object.defineProperty(exports, "QuoteContact", { enumerable: true, get: function () { return __importDefault(QuoteContact_1).default; } });
18
- var QuoteTerm_1 = require("./models/QuoteTerm");
19
- Object.defineProperty(exports, "QuoteTerm", { enumerable: true, get: function () { return __importDefault(QuoteTerm_1).default; } });
@@ -1,18 +0,0 @@
1
- export declare enum QuoteStatus {
2
- OPPORTUNITY = "OPPORTUNITY",
3
- QUOTE = "QUOTE",
4
- FOLLOWING = "FOLLOWING",
5
- NEGOTIATION = "NEGOTIATION"
6
- }
7
- export declare enum Status {
8
- OPEN = "OPEN",
9
- WIN = "WIN",
10
- LOST = "LOST",
11
- DELETE = "DELETE"
12
- }
13
- export declare enum CreatedMethod {
14
- MANUAL = "MANUAL",
15
- CSV = "CSV"
16
- }
17
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
18
- export default _default;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreatedMethod = exports.Status = exports.QuoteStatus = void 0;
4
- const mongoose_1 = require("mongoose");
5
- var QuoteStatus;
6
- (function (QuoteStatus) {
7
- QuoteStatus["OPPORTUNITY"] = "OPPORTUNITY";
8
- QuoteStatus["QUOTE"] = "QUOTE";
9
- QuoteStatus["FOLLOWING"] = "FOLLOWING";
10
- QuoteStatus["NEGOTIATION"] = "NEGOTIATION";
11
- })(QuoteStatus || (exports.QuoteStatus = QuoteStatus = {}));
12
- var Status;
13
- (function (Status) {
14
- Status["OPEN"] = "OPEN";
15
- Status["WIN"] = "WIN";
16
- Status["LOST"] = "LOST";
17
- Status["DELETE"] = "DELETE";
18
- })(Status || (exports.Status = Status = {}));
19
- var CreatedMethod;
20
- (function (CreatedMethod) {
21
- CreatedMethod["MANUAL"] = "MANUAL";
22
- CreatedMethod["CSV"] = "CSV";
23
- })(CreatedMethod || (exports.CreatedMethod = CreatedMethod = {}));
24
- const quoteSchema = new mongoose_1.Schema({
25
- quote_number: { type: Number, required: true },
26
- quote_revision: { type: Number, default: 0 },
27
- quote_ref: { type: String },
28
- company: { type: String },
29
- company_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Client", required: true },
30
- company_pipedrive_id: { type: String },
31
- contact_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "ClientContact" },
32
- project_name: { type: String },
33
- project_lab: { type: String },
34
- payment_condition: { type: String },
35
- payment_exp: { type: String },
36
- terms_ids: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "QuoteTerm" }],
37
- currency_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Currency" },
38
- iva: { type: String },
39
- date: { type: Date },
40
- status: { type: String, enum: Object.values(Status), default: Status.OPEN },
41
- quote_status: {
42
- type: String,
43
- enum: Object.values(QuoteStatus),
44
- default: QuoteStatus.OPPORTUNITY,
45
- },
46
- sap_id: { type: String },
47
- sap_quotation_entry: { type: Number },
48
- sap_order_entry: { type: Number },
49
- pipedrive_id: { type: String },
50
- should_sync: { type: Boolean, default: false },
51
- pdf_download_link: { type: String },
52
- notes: { type: String },
53
- created_method: {
54
- type: String,
55
- enum: Object.values(CreatedMethod),
56
- default: CreatedMethod.MANUAL,
57
- },
58
- created_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
59
- updated_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
60
- deleted_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
61
- deleted_at: { type: Date },
62
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
63
- exports.default = mongoose_1.models.Quote || (0, mongoose_1.model)("Quote", quoteSchema, "quotes");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const quoteArticleSchema = new mongoose_1.Schema({
5
- quote_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Quote", required: true },
6
- article_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Article" },
7
- article_number: { type: String },
8
- description: { type: String },
9
- delivery: { type: String },
10
- quantity: { type: Number },
11
- price: { type: Number },
12
- unit_price: { type: Number },
13
- original_price: { type: Number },
14
- total: { type: Number },
15
- utility: { type: Number },
16
- type: { type: String },
17
- extra_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuoteArticleExtra" },
18
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
19
- exports.default = mongoose_1.models.QuoteArticle || (0, mongoose_1.model)("QuoteArticle", quoteArticleSchema, "quote_articles");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const quoteArticleExtraSchema = new mongoose_1.Schema({
5
- quote_article_id: {
6
- type: mongoose_1.Schema.Types.ObjectId,
7
- ref: "QuoteArticle",
8
- required: true,
9
- },
10
- multiplier: Number,
11
- usa_freight: Number,
12
- usa_expenses: Number,
13
- duty: Number,
14
- mex_freight: Number,
15
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
16
- exports.default = mongoose_1.models.QuoteArticleExtra || (0, mongoose_1.model)("QuoteArticleExtra", quoteArticleExtraSchema, "quote_article_extras");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,12 +0,0 @@
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 },
6
- name: String,
7
- email: String,
8
- mobile: String,
9
- pipedrive_id: String,
10
- created_at: { type: Date, default: Date.now },
11
- });
12
- exports.default = mongoose_1.models.QuoteContact || (0, mongoose_1.model)("QuoteContact", quoteContactSchema, "quote_contacts");
@@ -1,2 +0,0 @@
1
- declare const _default: import("mongoose").Model<any, {}, {}, {}, any, any>;
2
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const quoteTermSchema = new mongoose_1.Schema({
5
- title: String,
6
- content: { type: String, required: true },
7
- category: String,
8
- is_active: { type: Boolean, default: true },
9
- created_by: String,
10
- updated_by: String,
11
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
12
- exports.default = mongoose_1.models.QuoteTerm || (0, mongoose_1.model)("QuoteTerm", quoteTermSchema, "quote_terms");
@@ -1,2 +0,0 @@
1
- export { SyncLog, SyncLogAction, SyncLogStatus, SyncLogType } from "./models/SyncLog";
2
- export type { ISyncLog } from "./models/SyncLog";
package/dist/sap/index.js DELETED
@@ -1,8 +0,0 @@
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,43 +0,0 @@
1
- import { Document, Types } from "mongoose";
2
- /**
3
- * Sync Log Types
4
- */
5
- export declare enum SyncLogType {
6
- SAP_QUOTATION = "SAP_QUOTATION",
7
- SAP_SALES_ORDER = "SAP_SALES_ORDER",
8
- PIPEDRIVE = "PIPEDRIVE"
9
- }
10
- export declare enum SyncLogStatus {
11
- PENDING = "PENDING",
12
- SUCCESS = "SUCCESS",
13
- FAILED = "FAILED",
14
- RETRYING = "RETRYING"
15
- }
16
- export declare enum SyncLogAction {
17
- CREATE = "CREATE",
18
- UPDATE = "UPDATE",
19
- DELETE = "DELETE"
20
- }
21
- export interface ISyncLog extends Document {
22
- _id: Types.ObjectId;
23
- entity_type: string;
24
- entity_id: Types.ObjectId;
25
- sync_type: SyncLogType;
26
- action: SyncLogAction;
27
- status: SyncLogStatus;
28
- error_message?: string;
29
- error_code?: string;
30
- error_details?: Record<string, any>;
31
- request_payload?: Record<string, any>;
32
- response_payload?: Record<string, any>;
33
- retry_count: number;
34
- max_retries: number;
35
- next_retry_at?: Date;
36
- created_at: Date;
37
- updated_at: Date;
38
- resolved_at?: Date;
39
- resolved_by?: Types.ObjectId;
40
- }
41
- export declare const SyncLog: import("mongoose").Model<ISyncLog, {}, {}, {}, Document<unknown, {}, ISyncLog> & ISyncLog & Required<{
42
- _id: Types.ObjectId;
43
- }>, any>;
@@ -1,70 +0,0 @@
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");
5
- /**
6
- * Sync Log Types
7
- */
8
- var SyncLogType;
9
- (function (SyncLogType) {
10
- SyncLogType["SAP_QUOTATION"] = "SAP_QUOTATION";
11
- SyncLogType["SAP_SALES_ORDER"] = "SAP_SALES_ORDER";
12
- SyncLogType["PIPEDRIVE"] = "PIPEDRIVE";
13
- })(SyncLogType || (exports.SyncLogType = SyncLogType = {}));
14
- var SyncLogStatus;
15
- (function (SyncLogStatus) {
16
- SyncLogStatus["PENDING"] = "PENDING";
17
- SyncLogStatus["SUCCESS"] = "SUCCESS";
18
- SyncLogStatus["FAILED"] = "FAILED";
19
- SyncLogStatus["RETRYING"] = "RETRYING";
20
- })(SyncLogStatus || (exports.SyncLogStatus = SyncLogStatus = {}));
21
- var SyncLogAction;
22
- (function (SyncLogAction) {
23
- SyncLogAction["CREATE"] = "CREATE";
24
- SyncLogAction["UPDATE"] = "UPDATE";
25
- SyncLogAction["DELETE"] = "DELETE";
26
- })(SyncLogAction || (exports.SyncLogAction = SyncLogAction = {}));
27
- const syncLogSchema = new mongoose_1.Schema({
28
- entity_type: {
29
- type: String,
30
- required: true,
31
- index: true,
32
- },
33
- entity_id: {
34
- type: mongoose_1.Schema.Types.ObjectId,
35
- required: true,
36
- index: true,
37
- },
38
- sync_type: {
39
- type: String,
40
- enum: Object.values(SyncLogType),
41
- required: true,
42
- index: true,
43
- },
44
- action: {
45
- type: String,
46
- enum: Object.values(SyncLogAction),
47
- required: true,
48
- },
49
- status: {
50
- type: String,
51
- enum: Object.values(SyncLogStatus),
52
- default: SyncLogStatus.PENDING,
53
- index: true,
54
- },
55
- error_message: { type: String },
56
- error_code: { type: String },
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 },
60
- retry_count: { type: Number, default: 0 },
61
- max_retries: { type: Number, default: 3 },
62
- next_retry_at: { type: Date },
63
- resolved_at: { type: Date },
64
- resolved_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
65
- }, {
66
- timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
67
- });
68
- syncLogSchema.index({ entity_type: 1, entity_id: 1, status: 1 });
69
- syncLogSchema.index({ status: 1, next_retry_at: 1 });
70
- exports.SyncLog = (0, mongoose_1.model)("SyncLog", syncLogSchema, "sync_logs");
@@ -1,2 +0,0 @@
1
- export { default as Users, UserRole, UserStatus } from "./models/Users";
2
- export type { UserType } from "./models/Users";