@fesmex/models 0.1.3 → 0.1.5
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.d.ts +2 -0
- package/dist/announcements/index.js +8 -0
- package/dist/announcements/models/Announcements.d.ts +17 -0
- package/dist/announcements/models/Announcements.js +45 -0
- package/dist/customers/index.d.ts +4 -0
- package/dist/customers/index.js +10 -0
- package/dist/customers/models/Customers.d.ts +22 -0
- package/dist/customers/models/Customers.js +38 -0
- package/dist/customers/models/FiscalProfileType.d.ts +15 -0
- package/dist/customers/models/FiscalProfileType.js +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/inventory/index.d.ts +8 -0
- package/dist/inventory/index.js +22 -0
- package/dist/inventory/models/Article.d.ts +109 -0
- package/dist/inventory/models/Article.js +14 -0
- package/dist/inventory/models/ArticleClasses.d.ts +25 -0
- package/dist/inventory/models/ArticleClasses.js +8 -0
- package/dist/inventory/models/ArticleGroups.d.ts +25 -0
- package/dist/inventory/models/ArticleGroups.js +8 -0
- package/dist/inventory/models/ArticlePrices.d.ts +205 -0
- package/dist/inventory/models/ArticlePrices.js +14 -0
- package/dist/inventory/models/Currencies.d.ts +31 -0
- package/dist/inventory/models/Currencies.js +9 -0
- package/dist/inventory/models/InventoryStocks.d.ts +145 -0
- package/dist/inventory/models/InventoryStocks.js +12 -0
- package/dist/inventory/models/PriceLists.d.ts +37 -0
- package/dist/inventory/models/PriceLists.js +10 -0
- package/dist/inventory/models/Warehouses.d.ts +43 -0
- package/dist/inventory/models/Warehouses.js +11 -0
- package/dist/orders/index.d.ts +4 -0
- package/dist/orders/index.js +12 -0
- package/dist/orders/models/OrderStatusLogs.d.ts +13 -0
- package/dist/orders/models/OrderStatusLogs.js +29 -0
- package/dist/orders/models/Orders.d.ts +98 -0
- package/dist/orders/models/Orders.js +33 -0
- package/dist/quotes/index.d.ts +4 -0
- package/dist/quotes/index.js +14 -0
- package/dist/quotes/models/Quote.d.ts +208 -0
- package/dist/quotes/models/Quote.js +63 -0
- package/dist/quotes/models/QuoteArticle.d.ts +96 -0
- package/dist/quotes/models/QuoteArticle.js +19 -0
- package/dist/quotes/models/QuoteArticleExtra.d.ts +54 -0
- package/dist/quotes/models/QuoteArticleExtra.js +16 -0
- package/dist/quotes/models/QuoteContact.d.ts +49 -0
- package/dist/quotes/models/QuoteContact.js +12 -0
- package/dist/sap/index.d.ts +1 -0
- package/dist/sap/index.js +8 -0
- package/dist/sap/models/SyncLog.d.ts +43 -0
- package/dist/sap/models/SyncLog.js +70 -0
- package/dist/users/index.d.ts +1 -0
- package/dist/users/index.js +8 -0
- package/dist/users/models/Users.d.ts +36 -0
- package/dist/users/models/Users.js +56 -0
- package/package.json +6 -3
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
export declare enum QuoteStatus {
|
|
3
|
+
OPPORTUNITY = "OPPORTUNITY",
|
|
4
|
+
QUOTE = "QUOTE",
|
|
5
|
+
FOLLOWING = "FOLLOWING",
|
|
6
|
+
NEGOTIATION = "NEGOTIATION"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Status {
|
|
9
|
+
OPEN = "OPEN",
|
|
10
|
+
WIN = "WIN",
|
|
11
|
+
LOST = "LOST",
|
|
12
|
+
DELETE = "DELETE"
|
|
13
|
+
}
|
|
14
|
+
export declare enum CreatedMethod {
|
|
15
|
+
MANUAL = "MANUAL",
|
|
16
|
+
CSV = "CSV"
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("mongoose").Model<{
|
|
19
|
+
quote_number: number;
|
|
20
|
+
quote_revision: number;
|
|
21
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
22
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
23
|
+
status: Status;
|
|
24
|
+
quote_status: QuoteStatus;
|
|
25
|
+
should_sync: boolean;
|
|
26
|
+
created_method: CreatedMethod;
|
|
27
|
+
pipedrive_id?: string;
|
|
28
|
+
sap_id?: string;
|
|
29
|
+
deleted_at?: Date;
|
|
30
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
31
|
+
date?: Date;
|
|
32
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
33
|
+
quote_ref?: string;
|
|
34
|
+
company?: string;
|
|
35
|
+
company_pipedrive_id?: string;
|
|
36
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
37
|
+
project_name?: string;
|
|
38
|
+
project_lab?: string;
|
|
39
|
+
payment_condition?: string;
|
|
40
|
+
payment_exp?: string;
|
|
41
|
+
iva?: string;
|
|
42
|
+
sap_quotation_entry?: number;
|
|
43
|
+
sap_order_entry?: number;
|
|
44
|
+
pdf_download_link?: string;
|
|
45
|
+
notes?: string;
|
|
46
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
47
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
48
|
+
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
49
|
+
quote_number: number;
|
|
50
|
+
quote_revision: number;
|
|
51
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
52
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
53
|
+
status: Status;
|
|
54
|
+
quote_status: QuoteStatus;
|
|
55
|
+
should_sync: boolean;
|
|
56
|
+
created_method: CreatedMethod;
|
|
57
|
+
pipedrive_id?: string;
|
|
58
|
+
sap_id?: string;
|
|
59
|
+
deleted_at?: Date;
|
|
60
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
61
|
+
date?: Date;
|
|
62
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
63
|
+
quote_ref?: string;
|
|
64
|
+
company?: string;
|
|
65
|
+
company_pipedrive_id?: string;
|
|
66
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
67
|
+
project_name?: string;
|
|
68
|
+
project_lab?: string;
|
|
69
|
+
payment_condition?: string;
|
|
70
|
+
payment_exp?: string;
|
|
71
|
+
iva?: string;
|
|
72
|
+
sap_quotation_entry?: number;
|
|
73
|
+
sap_order_entry?: number;
|
|
74
|
+
pdf_download_link?: string;
|
|
75
|
+
notes?: string;
|
|
76
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
77
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
78
|
+
}> & {
|
|
79
|
+
quote_number: number;
|
|
80
|
+
quote_revision: number;
|
|
81
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
82
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
83
|
+
status: Status;
|
|
84
|
+
quote_status: QuoteStatus;
|
|
85
|
+
should_sync: boolean;
|
|
86
|
+
created_method: CreatedMethod;
|
|
87
|
+
pipedrive_id?: string;
|
|
88
|
+
sap_id?: string;
|
|
89
|
+
deleted_at?: Date;
|
|
90
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
91
|
+
date?: Date;
|
|
92
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
93
|
+
quote_ref?: string;
|
|
94
|
+
company?: string;
|
|
95
|
+
company_pipedrive_id?: string;
|
|
96
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
97
|
+
project_name?: string;
|
|
98
|
+
project_lab?: string;
|
|
99
|
+
payment_condition?: string;
|
|
100
|
+
payment_exp?: string;
|
|
101
|
+
iva?: string;
|
|
102
|
+
sap_quotation_entry?: number;
|
|
103
|
+
sap_order_entry?: number;
|
|
104
|
+
pdf_download_link?: string;
|
|
105
|
+
notes?: string;
|
|
106
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
107
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
108
|
+
} & {
|
|
109
|
+
_id: import("mongoose").Types.ObjectId;
|
|
110
|
+
}, Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
111
|
+
timestamps: {
|
|
112
|
+
createdAt: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
};
|
|
115
|
+
}, {
|
|
116
|
+
quote_number: number;
|
|
117
|
+
quote_revision: number;
|
|
118
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
119
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
120
|
+
status: Status;
|
|
121
|
+
quote_status: QuoteStatus;
|
|
122
|
+
should_sync: boolean;
|
|
123
|
+
created_method: CreatedMethod;
|
|
124
|
+
pipedrive_id?: string;
|
|
125
|
+
sap_id?: string;
|
|
126
|
+
deleted_at?: Date;
|
|
127
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
128
|
+
date?: Date;
|
|
129
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
130
|
+
quote_ref?: string;
|
|
131
|
+
company?: string;
|
|
132
|
+
company_pipedrive_id?: string;
|
|
133
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
134
|
+
project_name?: string;
|
|
135
|
+
project_lab?: string;
|
|
136
|
+
payment_condition?: string;
|
|
137
|
+
payment_exp?: string;
|
|
138
|
+
iva?: string;
|
|
139
|
+
sap_quotation_entry?: number;
|
|
140
|
+
sap_order_entry?: number;
|
|
141
|
+
pdf_download_link?: string;
|
|
142
|
+
notes?: string;
|
|
143
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
144
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
145
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
146
|
+
quote_number: number;
|
|
147
|
+
quote_revision: number;
|
|
148
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
149
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
150
|
+
status: Status;
|
|
151
|
+
quote_status: QuoteStatus;
|
|
152
|
+
should_sync: boolean;
|
|
153
|
+
created_method: CreatedMethod;
|
|
154
|
+
pipedrive_id?: string;
|
|
155
|
+
sap_id?: string;
|
|
156
|
+
deleted_at?: Date;
|
|
157
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
158
|
+
date?: Date;
|
|
159
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
160
|
+
quote_ref?: string;
|
|
161
|
+
company?: string;
|
|
162
|
+
company_pipedrive_id?: string;
|
|
163
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
164
|
+
project_name?: string;
|
|
165
|
+
project_lab?: string;
|
|
166
|
+
payment_condition?: string;
|
|
167
|
+
payment_exp?: string;
|
|
168
|
+
iva?: string;
|
|
169
|
+
sap_quotation_entry?: number;
|
|
170
|
+
sap_order_entry?: number;
|
|
171
|
+
pdf_download_link?: string;
|
|
172
|
+
notes?: string;
|
|
173
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
174
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
175
|
+
}>> & import("mongoose").FlatRecord<{
|
|
176
|
+
quote_number: number;
|
|
177
|
+
quote_revision: number;
|
|
178
|
+
company_id: import("mongoose").Types.ObjectId;
|
|
179
|
+
terms_ids: import("mongoose").Types.ObjectId[];
|
|
180
|
+
status: Status;
|
|
181
|
+
quote_status: QuoteStatus;
|
|
182
|
+
should_sync: boolean;
|
|
183
|
+
created_method: CreatedMethod;
|
|
184
|
+
pipedrive_id?: string;
|
|
185
|
+
sap_id?: string;
|
|
186
|
+
deleted_at?: Date;
|
|
187
|
+
deleted_by?: import("mongoose").Types.ObjectId;
|
|
188
|
+
date?: Date;
|
|
189
|
+
currency_id?: import("mongoose").Types.ObjectId;
|
|
190
|
+
quote_ref?: string;
|
|
191
|
+
company?: string;
|
|
192
|
+
company_pipedrive_id?: string;
|
|
193
|
+
contact_id?: import("mongoose").Types.ObjectId;
|
|
194
|
+
project_name?: string;
|
|
195
|
+
project_lab?: string;
|
|
196
|
+
payment_condition?: string;
|
|
197
|
+
payment_exp?: string;
|
|
198
|
+
iva?: string;
|
|
199
|
+
sap_quotation_entry?: number;
|
|
200
|
+
sap_order_entry?: number;
|
|
201
|
+
pdf_download_link?: string;
|
|
202
|
+
notes?: string;
|
|
203
|
+
created_by?: import("mongoose").Types.ObjectId;
|
|
204
|
+
updated_by?: import("mongoose").Types.ObjectId;
|
|
205
|
+
}> & {
|
|
206
|
+
_id: import("mongoose").Types.ObjectId;
|
|
207
|
+
}>>;
|
|
208
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
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 = (0, mongoose_1.model)("Quote", quoteSchema, "quotes");
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
declare const _default: import("mongoose").Model<{
|
|
3
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
type?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
article_number?: string;
|
|
7
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
8
|
+
price?: number;
|
|
9
|
+
delivery?: string;
|
|
10
|
+
quantity?: number;
|
|
11
|
+
unit_price?: number;
|
|
12
|
+
original_price?: number;
|
|
13
|
+
total?: number;
|
|
14
|
+
utility?: number;
|
|
15
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
16
|
+
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
17
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
18
|
+
type?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
article_number?: string;
|
|
21
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
22
|
+
price?: number;
|
|
23
|
+
delivery?: string;
|
|
24
|
+
quantity?: number;
|
|
25
|
+
unit_price?: number;
|
|
26
|
+
original_price?: number;
|
|
27
|
+
total?: number;
|
|
28
|
+
utility?: number;
|
|
29
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
30
|
+
}> & {
|
|
31
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
32
|
+
type?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
article_number?: string;
|
|
35
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
36
|
+
price?: number;
|
|
37
|
+
delivery?: string;
|
|
38
|
+
quantity?: number;
|
|
39
|
+
unit_price?: number;
|
|
40
|
+
original_price?: number;
|
|
41
|
+
total?: number;
|
|
42
|
+
utility?: number;
|
|
43
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
_id: import("mongoose").Types.ObjectId;
|
|
46
|
+
}, Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
47
|
+
timestamps: {
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
type?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
article_number?: string;
|
|
56
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
57
|
+
price?: number;
|
|
58
|
+
delivery?: string;
|
|
59
|
+
quantity?: number;
|
|
60
|
+
unit_price?: number;
|
|
61
|
+
original_price?: number;
|
|
62
|
+
total?: number;
|
|
63
|
+
utility?: number;
|
|
64
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
65
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
66
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
67
|
+
type?: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
article_number?: string;
|
|
70
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
71
|
+
price?: number;
|
|
72
|
+
delivery?: string;
|
|
73
|
+
quantity?: number;
|
|
74
|
+
unit_price?: number;
|
|
75
|
+
original_price?: number;
|
|
76
|
+
total?: number;
|
|
77
|
+
utility?: number;
|
|
78
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
79
|
+
}>> & import("mongoose").FlatRecord<{
|
|
80
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
81
|
+
type?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
article_number?: string;
|
|
84
|
+
article_id?: import("mongoose").Types.ObjectId;
|
|
85
|
+
price?: number;
|
|
86
|
+
delivery?: string;
|
|
87
|
+
quantity?: number;
|
|
88
|
+
unit_price?: number;
|
|
89
|
+
original_price?: number;
|
|
90
|
+
total?: number;
|
|
91
|
+
utility?: number;
|
|
92
|
+
extra_id?: import("mongoose").Types.ObjectId;
|
|
93
|
+
}> & {
|
|
94
|
+
_id: import("mongoose").Types.ObjectId;
|
|
95
|
+
}>>;
|
|
96
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 = (0, mongoose_1.model)("QuoteArticle", quoteArticleSchema, "quote_articles");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
declare const _default: import("mongoose").Model<{
|
|
3
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
multiplier?: number;
|
|
5
|
+
usa_freight?: number;
|
|
6
|
+
usa_expenses?: number;
|
|
7
|
+
duty?: number;
|
|
8
|
+
mex_freight?: number;
|
|
9
|
+
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
10
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
multiplier?: number;
|
|
12
|
+
usa_freight?: number;
|
|
13
|
+
usa_expenses?: number;
|
|
14
|
+
duty?: number;
|
|
15
|
+
mex_freight?: number;
|
|
16
|
+
}> & {
|
|
17
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
18
|
+
multiplier?: number;
|
|
19
|
+
usa_freight?: number;
|
|
20
|
+
usa_expenses?: number;
|
|
21
|
+
duty?: number;
|
|
22
|
+
mex_freight?: number;
|
|
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
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
32
|
+
multiplier?: number;
|
|
33
|
+
usa_freight?: number;
|
|
34
|
+
usa_expenses?: number;
|
|
35
|
+
duty?: number;
|
|
36
|
+
mex_freight?: number;
|
|
37
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
38
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
39
|
+
multiplier?: number;
|
|
40
|
+
usa_freight?: number;
|
|
41
|
+
usa_expenses?: number;
|
|
42
|
+
duty?: number;
|
|
43
|
+
mex_freight?: number;
|
|
44
|
+
}>> & import("mongoose").FlatRecord<{
|
|
45
|
+
quote_article_id: import("mongoose").Types.ObjectId;
|
|
46
|
+
multiplier?: number;
|
|
47
|
+
usa_freight?: number;
|
|
48
|
+
usa_expenses?: number;
|
|
49
|
+
duty?: number;
|
|
50
|
+
mex_freight?: number;
|
|
51
|
+
}> & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
}>>;
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 = (0, mongoose_1.model)("QuoteArticleExtra", quoteArticleExtraSchema, "quote_article_extras");
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
declare const _default: import("mongoose").Model<{
|
|
3
|
+
created_at: Date;
|
|
4
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
email?: string;
|
|
6
|
+
pipedrive_id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
mobile?: string;
|
|
9
|
+
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
10
|
+
created_at: Date;
|
|
11
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
email?: string;
|
|
13
|
+
pipedrive_id?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
mobile?: string;
|
|
16
|
+
}> & {
|
|
17
|
+
created_at: Date;
|
|
18
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
19
|
+
email?: string;
|
|
20
|
+
pipedrive_id?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
mobile?: string;
|
|
23
|
+
} & {
|
|
24
|
+
_id: import("mongoose").Types.ObjectId;
|
|
25
|
+
}, Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
26
|
+
created_at: Date;
|
|
27
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
28
|
+
email?: string;
|
|
29
|
+
pipedrive_id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
mobile?: string;
|
|
32
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
33
|
+
created_at: Date;
|
|
34
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
email?: string;
|
|
36
|
+
pipedrive_id?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
mobile?: string;
|
|
39
|
+
}>> & import("mongoose").FlatRecord<{
|
|
40
|
+
created_at: Date;
|
|
41
|
+
quote_id: import("mongoose").Types.ObjectId;
|
|
42
|
+
email?: string;
|
|
43
|
+
pipedrive_id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
mobile?: string;
|
|
46
|
+
}> & {
|
|
47
|
+
_id: import("mongoose").Types.ObjectId;
|
|
48
|
+
}>>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 = (0, mongoose_1.model)("QuoteContact", quoteContactSchema, "quote_contacts");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SyncLog, SyncLogAction, SyncLogStatus, SyncLogType } from "./models/SyncLog";
|
|
@@ -0,0 +1,8 @@
|
|
|
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; } });
|
|
@@ -0,0 +1,43 @@
|
|
|
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>;
|
|
@@ -0,0 +1,70 @@
|
|
|
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");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Users } from "./models/Users";
|
|
@@ -0,0 +1,8 @@
|
|
|
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.Users = void 0;
|
|
7
|
+
var Users_1 = require("./models/Users");
|
|
8
|
+
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return __importDefault(Users_1).default; } });
|