Compare commits
No commits in common. "50eacb3974da5f8984c17dae8c8ec2fccc054054" and "e23ac3f6a3b9f8224e8a6fa17780d826ace1e94f" have entirely different histories.
50eacb3974
...
e23ac3f6a3
@ -416,34 +416,6 @@ export const listObjects = async ({
|
||||
}
|
||||
};
|
||||
|
||||
export const searchObjects = async ({ model, search, populate = [] }) => {
|
||||
try {
|
||||
const isRefOrIdSearch = search.match(/^.{3}:/);
|
||||
let query = null;
|
||||
if (isRefOrIdSearch) {
|
||||
const lookupValue = search.split(':')[1];
|
||||
if (lookupValue.length <= 12) {
|
||||
query = model.find({ _reference: lookupValue });
|
||||
} else {
|
||||
query = model.find({ _id: lookupValue });
|
||||
}
|
||||
} else {
|
||||
query = model.find({ $text: { $search: search } });
|
||||
}
|
||||
if (populate) {
|
||||
for (const pop of populate) {
|
||||
query = query.populate(pop);
|
||||
}
|
||||
}
|
||||
const queryResult = await query.lean();
|
||||
const result = queryResult.map((item) => expandObjectIds(item));
|
||||
return result;
|
||||
} catch (error) {
|
||||
logger.error('Object search error:', error);
|
||||
return { error: error, code: 500 };
|
||||
}
|
||||
};
|
||||
|
||||
// New function to list unique property values
|
||||
export const listPropertyValues = async ({ model, property, filter = {}, search = '' }) => {
|
||||
let aggregateCommand = [];
|
||||
|
||||
@ -54,8 +54,6 @@ const invoiceSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
invoiceSchema.index({ orderType: 'text', fromType: 'text', toType: 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'draft',
|
||||
|
||||
@ -24,8 +24,6 @@ const paymentSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
paymentSchema.index({ paymentMethod: 'text', notes: 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'draft',
|
||||
|
||||
@ -19,8 +19,6 @@ const taxRecordSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
taxRecordSchema.index({ transactionType: 'text' });
|
||||
|
||||
taxRecordSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -49,8 +49,6 @@ const filamentStockSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
filamentStockSchema.index({ 'state.type': 'text' });
|
||||
|
||||
filamentStockSchema.pre('validate', async function () {
|
||||
if (!this.filament && this.filamentSku) {
|
||||
const sku = await mongoose
|
||||
|
||||
@ -69,8 +69,6 @@ const orderItemSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
orderItemSchema.index({ name: 'text', itemType: 'text', orderType: 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'shipped',
|
||||
|
||||
@ -43,8 +43,6 @@ const partStockSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
partStockSchema.index({ sourceType: 'text', 'state.type': 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'totalCurrentQuantity',
|
||||
|
||||
@ -49,8 +49,6 @@ const productStockSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
productStockSchema.index({ 'state.type': 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'totalCurrentQuantity',
|
||||
|
||||
@ -25,8 +25,6 @@ const purchaseOrderSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
purchaseOrderSchema.index({ 'state.type': 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'draft',
|
||||
|
||||
@ -34,8 +34,6 @@ const shipmentSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
shipmentSchema.index({ trackingNumber: 'text', orderType: 'text' });
|
||||
|
||||
shipmentSchema.statics.recalculate = async function (shipment, user) {
|
||||
if (shipment.orderType !== 'purchaseOrder' && shipment.orderType !== 'salesOrder') {
|
||||
return;
|
||||
|
||||
@ -28,8 +28,6 @@ const stockAuditSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
stockAuditSchema.index({ type: 'text', status: 'text', notes: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
stockAuditSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -32,8 +32,6 @@ const stockEventSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
stockEventSchema.index({ parentType: 'text', ownerType: 'text', unit: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
stockEventSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -21,8 +21,6 @@ const stockLocationSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
stockLocationSchema.index({ name: 'text' });
|
||||
|
||||
stockLocationSchema.statics.stats = async function () {
|
||||
const total = await this.countDocuments({});
|
||||
return { total: { count: total } };
|
||||
|
||||
@ -48,8 +48,6 @@ const stockTransferSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
stockTransferSchema.index({ name: 'text' });
|
||||
|
||||
stockTransferSchema.statics.stats = async function () {
|
||||
const [draft, posted] = await Promise.all([
|
||||
this.countDocuments({ 'state.type': 'draft' }),
|
||||
|
||||
@ -13,8 +13,6 @@ const appPasswordSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
appPasswordSchema.index({ name: 'text' });
|
||||
|
||||
appPasswordSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -36,8 +36,6 @@ const auditLogSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
auditLogSchema.index({ operation: 'text', parentType: 'text', ownerType: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
auditLogSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -14,8 +14,6 @@ const courierSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
courierSchema.index({ name: 'text', website: 'text', email: 'text', phone: 'text', contact: 'text', country: 'text' });
|
||||
|
||||
courierSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -15,8 +15,6 @@ const courierServiceSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
courierServiceSchema.index({ name: 'text', website: 'text' });
|
||||
|
||||
courierServiceSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -39,8 +39,6 @@ const documentJobSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
documentJobSchema.index({ name: 'text', objectType: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
documentJobSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -38,8 +38,6 @@ const documentPrinterSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
documentPrinterSchema.index({ name: 'text', tags: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
documentPrinterSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -29,8 +29,6 @@ const documentSizeSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
documentSizeSchema.index({ name: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
documentSizeSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -52,8 +52,6 @@ const documentTemplateSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
documentTemplateSchema.index({ name: 'text', tags: 'text', objectType: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
documentTemplateSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -18,8 +18,6 @@ const filamentSchema = new mongoose.Schema({
|
||||
costWithTax: { type: Number, required: false },
|
||||
}, { timestamps: true });
|
||||
|
||||
filamentSchema.index({ name: 'text', barcode: 'text', url: 'text' });
|
||||
|
||||
filamentSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -19,8 +19,6 @@ const filamentSkuSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
filamentSkuSchema.index({ name: 'text', barcode: 'text', description: 'text', color: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
filamentSkuSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -13,8 +13,6 @@ const fileSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
fileSchema.index({ name: 'text', type: 'text', extension: 'text' });
|
||||
|
||||
fileSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -63,8 +63,6 @@ const hostSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
hostSchema.index({ name: 'text', tags: 'text' });
|
||||
|
||||
hostSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -11,8 +11,6 @@ const materialSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
materialSchema.index({ name: 'text', url: 'text', tags: 'text' });
|
||||
|
||||
materialSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -23,8 +23,6 @@ const noteTypeSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
noteTypeSchema.index({ name: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
noteTypeSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -21,8 +21,6 @@ const partSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
partSchema.index({ name: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
partSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -25,8 +25,6 @@ const partSkuSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
partSkuSchema.index({ name: 'text', barcode: 'text', description: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
partSkuSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -23,9 +23,6 @@ const productSchema = new Schema(
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
productSchema.index({ name: 'text', tags: 'text', version: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
productSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -9,8 +9,6 @@ const productCategorySchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
productCategorySchema.index({ name: 'text' });
|
||||
|
||||
productCategorySchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -32,8 +32,6 @@ const productSkuSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
productSkuSchema.index({ name: 'text', barcode: 'text', description: 'text' });
|
||||
|
||||
// Add virtual id getter
|
||||
productSkuSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -16,8 +16,6 @@ const taxRateSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
taxRateSchema.index({ name: 'text', description: 'text', country: 'text' });
|
||||
|
||||
taxRateSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -15,8 +15,6 @@ const userSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
userSchema.index({ username: 'text', name: 'text', firstName: 'text', lastName: 'text', email: 'text' });
|
||||
|
||||
userSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -26,8 +26,6 @@ const vendorSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
vendorSchema.index({ name: 'text', website: 'text', email: 'text', phone: 'text', contact: 'text', country: 'text' });
|
||||
|
||||
vendorSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -30,7 +30,7 @@ gcodeFileSchema.pre('validate', async function () {
|
||||
}
|
||||
});
|
||||
|
||||
gcodeFileSchema.index({ name: 'text', gcodeFileName: 'text' });
|
||||
gcodeFileSchema.index({ name: 'text', brand: 'text' });
|
||||
|
||||
gcodeFileSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
|
||||
@ -32,8 +32,6 @@ const jobSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
jobSchema.index({ 'state.type': 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'queued',
|
||||
|
||||
@ -57,8 +57,6 @@ const printerSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
printerSchema.index({ name: 'text', tags: 'text', firmware: 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'standby',
|
||||
|
||||
@ -43,8 +43,6 @@ const subJobSchema = new mongoose.Schema({
|
||||
finishedAt: { required: false, type: Date, default: null },
|
||||
});
|
||||
|
||||
subJobSchema.index({ moonrakerJobId: 'text', 'state.type': 'text' });
|
||||
|
||||
subJobSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -26,8 +26,6 @@ const clientSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
clientSchema.index({ name: 'text', email: 'text', phone: 'text', country: 'text', tags: 'text' });
|
||||
|
||||
clientSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -26,8 +26,6 @@ const listingSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
listingSchema.index({ title: 'text', url: 'text' });
|
||||
|
||||
listingSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -25,8 +25,6 @@ const listingVarientSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
listingVarientSchema.index({ currency: 'text', 'state.type': 'text' });
|
||||
|
||||
listingVarientSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -28,8 +28,6 @@ const marketplaceSchema = new mongoose.Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
marketplaceSchema.index({ name: 'text', provider: 'text' });
|
||||
|
||||
marketplaceSchema.virtual('id').get(function () {
|
||||
return this._id;
|
||||
});
|
||||
|
||||
@ -30,8 +30,6 @@ const salesOrderSchema = new Schema(
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
salesOrderSchema.index({ 'state.type': 'text' });
|
||||
|
||||
const rollupConfigs = [
|
||||
{
|
||||
name: 'draft',
|
||||
|
||||
@ -16,7 +16,6 @@ import {
|
||||
acknowledgeInvoiceRouteHandler,
|
||||
cancelInvoiceRouteHandler,
|
||||
postInvoiceRouteHandler,
|
||||
searchInvoicesRouteHandler
|
||||
} from '../../services/finance/invoices.js';
|
||||
|
||||
// list of invoices
|
||||
@ -55,11 +54,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listInvoicesByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchInvoicesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newInvoiceRouteHandler(req, res);
|
||||
|
||||
@ -17,7 +17,6 @@ import {
|
||||
authorisePaymentRouteHandler,
|
||||
declinePaymentRouteHandler,
|
||||
cancelPaymentRouteHandler,
|
||||
searchPaymentsRouteHandler
|
||||
} from '../../services/finance/payments.js';
|
||||
|
||||
// list of payments
|
||||
@ -55,11 +54,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listPaymentsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPaymentsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newPaymentRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listTaxRecordsByPropertiesRouteHandler,
|
||||
getTaxRecordStatsRouteHandler,
|
||||
getTaxRecordHistoryRouteHandler,
|
||||
searchTaxRecordsRouteHandler
|
||||
} from '../../services/finance/taxrecords.js';
|
||||
|
||||
// list of tax records
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listTaxRecordsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchTaxRecordsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newTaxRecordRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listFilamentStocksByPropertiesRouteHandler,
|
||||
getFilamentStockStatsRouteHandler,
|
||||
getFilamentStockHistoryRouteHandler,
|
||||
searchFilamentStocksRouteHandler
|
||||
} from '../../services/inventory/filamentstocks.js';
|
||||
|
||||
// list of filament stocks
|
||||
@ -50,11 +49,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listFilamentStocksByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchFilamentStocksRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newFilamentStockRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listOrderItemsByPropertiesRouteHandler,
|
||||
getOrderItemStatsRouteHandler,
|
||||
getOrderItemHistoryRouteHandler,
|
||||
searchOrderItemsRouteHandler
|
||||
} from '../../services/inventory/orderitems.js';
|
||||
|
||||
// list of order items
|
||||
@ -54,11 +53,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listOrderItemsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchOrderItemsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newOrderItemRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listPartStocksByPropertiesRouteHandler,
|
||||
getPartStockStatsRouteHandler,
|
||||
getPartStockHistoryRouteHandler,
|
||||
searchPartStocksRouteHandler
|
||||
} from '../../services/inventory/partstocks.js';
|
||||
|
||||
// list of part stocks
|
||||
@ -42,11 +41,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listPartStocksByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPartStocksRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newPartStockRouteHandler(req, res);
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
listProductStocksByPropertiesRouteHandler,
|
||||
getProductStockStatsRouteHandler,
|
||||
getProductStockHistoryRouteHandler,
|
||||
searchProductStocksRouteHandler
|
||||
} from '../../services/inventory/productstocks.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -41,11 +40,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listProductStocksByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchProductStocksRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newProductStockRouteHandler(req, res);
|
||||
|
||||
@ -16,7 +16,6 @@ import {
|
||||
postPurchaseOrderRouteHandler,
|
||||
acknowledgePurchaseOrderRouteHandler,
|
||||
cancelPurchaseOrderRouteHandler,
|
||||
searchPurchaseOrdersRouteHandler
|
||||
} from '../../services/inventory/purchaseorders.js';
|
||||
|
||||
// list of purchase orders
|
||||
@ -59,11 +58,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listPurchaseOrdersByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPurchaseOrdersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newPurchaseOrderRouteHandler(req, res);
|
||||
|
||||
@ -16,7 +16,6 @@ import {
|
||||
shipShipmentRouteHandler,
|
||||
receiveShipmentRouteHandler,
|
||||
cancelShipmentRouteHandler,
|
||||
searchShipmentsRouteHandler
|
||||
} from '../../services/inventory/shipments.js';
|
||||
|
||||
// list of shipments
|
||||
@ -44,11 +43,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listShipmentsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchShipmentsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newShipmentRouteHandler(req, res);
|
||||
|
||||
@ -11,7 +11,6 @@ import {
|
||||
deleteStockAuditRouteHandler,
|
||||
getStockAuditStatsRouteHandler,
|
||||
getStockAuditHistoryRouteHandler,
|
||||
searchStockAuditsRouteHandler
|
||||
} from '../../services/inventory/stockaudits.js';
|
||||
|
||||
// List stock audits
|
||||
@ -40,11 +39,6 @@ router.post('/', isAuthenticated, (req, res) => {
|
||||
});
|
||||
|
||||
// get stock audit stats
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchStockAuditsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
router.get('/stats', isAuthenticated, (req, res) => {
|
||||
getStockAuditStatsRouteHandler(req, res);
|
||||
});
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listStockEventsByPropertiesRouteHandler,
|
||||
getStockEventStatsRouteHandler,
|
||||
getStockEventHistoryRouteHandler,
|
||||
searchStockEventsRouteHandler
|
||||
} from '../../services/inventory/stockevents.js';
|
||||
|
||||
// list of stock events
|
||||
@ -34,11 +33,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listStockEventsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchStockEventsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newStockEventRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listStockLocationsByPropertiesRouteHandler,
|
||||
getStockLocationStatsRouteHandler,
|
||||
getStockLocationHistoryRouteHandler,
|
||||
searchStockLocationsRouteHandler
|
||||
} from '../../services/inventory/stocklocations.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -33,11 +32,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listStockLocationsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchStockLocationsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newStockLocationRouteHandler(req, res);
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
listStockTransfersByPropertiesRouteHandler,
|
||||
getStockTransferStatsRouteHandler,
|
||||
getStockTransferHistoryRouteHandler,
|
||||
searchStockTransfersRouteHandler
|
||||
} from '../../services/inventory/stocktransfers.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -34,11 +33,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listStockTransfersByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchStockTransfersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newStockTransferRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getAppPasswordStatsRouteHandler,
|
||||
getAppPasswordHistoryRouteHandler,
|
||||
regenerateSecretRouteHandler,
|
||||
searchAppPasswordsRouteHandler
|
||||
} from '../../services/management/apppasswords.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -30,11 +29,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const masterFilter = req.query.masterFilter ? JSON.parse(req.query.masterFilter) : {};
|
||||
listAppPasswordsByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchAppPasswordsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newAppPasswordRouteHandler(req, res);
|
||||
|
||||
@ -5,7 +5,6 @@ import {
|
||||
getAuditLogRouteHandler,
|
||||
getAuditLogStatsRouteHandler,
|
||||
getAuditLogHistoryRouteHandler,
|
||||
searchAuditLogsRouteHandler
|
||||
} from '../../services/management/auditlogs.js';
|
||||
import { parseFilter } from '../../utils.js';
|
||||
|
||||
@ -31,11 +30,6 @@ router.get('/', isAuthenticated, async (req, res) => {
|
||||
});
|
||||
|
||||
// get audit log stats
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchAuditLogsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
router.get('/stats', isAuthenticated, (req, res) => {
|
||||
getAuditLogStatsRouteHandler(req, res);
|
||||
});
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listCouriersByPropertiesRouteHandler,
|
||||
getCourierStatsRouteHandler,
|
||||
getCourierHistoryRouteHandler,
|
||||
searchCouriersRouteHandler
|
||||
} from '../../services/management/courier.js';
|
||||
|
||||
// list of couriers
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listCouriersByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchCouriersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newCourierRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listCourierServicesByPropertiesRouteHandler,
|
||||
getCourierServiceStatsRouteHandler,
|
||||
getCourierServiceHistoryRouteHandler,
|
||||
searchCourierServicesRouteHandler
|
||||
} from '../../services/management/courierservice.js';
|
||||
|
||||
// list of courier services
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listCourierServicesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchCourierServicesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newCourierServiceRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listDocumentJobsByPropertiesRouteHandler,
|
||||
getDocumentJobStatsRouteHandler,
|
||||
getDocumentJobHistoryRouteHandler,
|
||||
searchDocumentJobsRouteHandler
|
||||
} from '../../services/management/documentjobs.js';
|
||||
|
||||
// list of document jobs
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listDocumentJobsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchDocumentJobsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newDocumentJobRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listDocumentPrintersByPropertiesRouteHandler,
|
||||
getDocumentPrinterStatsRouteHandler,
|
||||
getDocumentPrinterHistoryRouteHandler,
|
||||
searchDocumentPrintersRouteHandler
|
||||
} from '../../services/management/documentprinters.js';
|
||||
|
||||
// list of document printers
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listDocumentPrintersByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchDocumentPrintersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newDocumentPrinterRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listDocumentSizesByPropertiesRouteHandler,
|
||||
getDocumentSizeStatsRouteHandler,
|
||||
getDocumentSizeHistoryRouteHandler,
|
||||
searchDocumentSizesRouteHandler
|
||||
} from '../../services/management/documentsizes.js';
|
||||
|
||||
// list of document sizes
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listDocumentSizesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchDocumentSizesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newDocumentSizeRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listDocumentTemplatesByPropertiesRouteHandler,
|
||||
getDocumentTemplateStatsRouteHandler,
|
||||
getDocumentTemplateHistoryRouteHandler,
|
||||
searchDocumentTemplatesRouteHandler
|
||||
} from '../../services/management/documenttemplates.js';
|
||||
|
||||
// list of document templates
|
||||
@ -33,11 +32,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listDocumentTemplatesByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchDocumentTemplatesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newDocumentTemplateRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
deleteFilamentRouteHandler,
|
||||
getFilamentStatsRouteHandler,
|
||||
getFilamentHistoryRouteHandler,
|
||||
searchFilamentsRouteHandler
|
||||
} from '../../services/management/filaments.js';
|
||||
|
||||
// list of filaments
|
||||
@ -48,11 +47,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listFilamentsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchFilamentsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newFilamentRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listFilamentSkusByPropertiesRouteHandler,
|
||||
getFilamentSkuStatsRouteHandler,
|
||||
getFilamentSkuHistoryRouteHandler,
|
||||
searchFilamentSkusRouteHandler
|
||||
} from '../../services/management/filamentskus.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -32,11 +31,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listFilamentSkusByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchFilamentSkusRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newFilamentSkuRouteHandler(req, res);
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
listFilesByPropertiesRouteHandler,
|
||||
getFileStatsRouteHandler,
|
||||
getFileHistoryRouteHandler,
|
||||
searchFilesRouteHandler
|
||||
} from '../../services/management/files.js';
|
||||
|
||||
// list of files
|
||||
@ -31,11 +30,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listFilesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchFilesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newFileRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listHostsByPropertiesRouteHandler,
|
||||
getHostStatsRouteHandler,
|
||||
getHostHistoryRouteHandler,
|
||||
searchHostsRouteHandler
|
||||
} from '../../services/management/hosts.js';
|
||||
|
||||
// list of hosts
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listHostsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchHostsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newHostRouteHandler(req, res);
|
||||
|
||||
@ -11,7 +11,6 @@ import {
|
||||
newMaterialRouteHandler,
|
||||
getMaterialStatsRouteHandler,
|
||||
getMaterialHistoryRouteHandler,
|
||||
searchMaterialsRouteHandler,
|
||||
} from '../../services/management/materials.js';
|
||||
|
||||
// list of materials
|
||||
@ -38,11 +37,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
listMaterialsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchMaterialsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newMaterialRouteHandler(req, res);
|
||||
});
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listNoteTypesByPropertiesRouteHandler,
|
||||
getNoteTypeStatsRouteHandler,
|
||||
getNoteTypeHistoryRouteHandler,
|
||||
searchNoteTypesRouteHandler
|
||||
} from '../../services/management/notetypes.js';
|
||||
|
||||
// list of note types
|
||||
@ -33,11 +32,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listNoteTypesByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchNoteTypesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newNoteTypeRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listPartsByPropertiesRouteHandler,
|
||||
getPartStatsRouteHandler,
|
||||
getPartHistoryRouteHandler,
|
||||
searchPartsRouteHandler
|
||||
} from '../../services/management/parts.js';
|
||||
|
||||
// list of parts
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listPartsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPartsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newPartRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listPartSkusByPropertiesRouteHandler,
|
||||
getPartSkuStatsRouteHandler,
|
||||
getPartSkuHistoryRouteHandler,
|
||||
searchPartSkusRouteHandler
|
||||
} from '../../services/management/partskus.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -32,11 +31,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listPartSkusByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPartSkusRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newPartSkuRouteHandler(req, res);
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
listProductCategoriesByPropertiesRouteHandler,
|
||||
listProductCategoriesRouteHandler,
|
||||
newProductCategoryRouteHandler,
|
||||
searchProductCategoriesRouteHandler
|
||||
} from '../../services/management/productcategories.js';
|
||||
|
||||
const router = express.Router();
|
||||
@ -28,11 +27,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listProductCategoriesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchProductCategoriesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newProductCategoryRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listProductsByPropertiesRouteHandler,
|
||||
getProductStatsRouteHandler,
|
||||
getProductHistoryRouteHandler,
|
||||
searchProductsRouteHandler
|
||||
} from '../../services/management/products.js';
|
||||
|
||||
// list of products
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listProductsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchProductsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newProductRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listProductSkusByPropertiesRouteHandler,
|
||||
getProductSkuStatsRouteHandler,
|
||||
getProductSkuHistoryRouteHandler,
|
||||
searchProductSkusRouteHandler
|
||||
} from '../../services/management/productskus.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -32,11 +31,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listProductSkusByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchProductSkusRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newProductSkuRouteHandler(req, res);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listTaxRatesByPropertiesRouteHandler,
|
||||
getTaxRateStatsRouteHandler,
|
||||
getTaxRateHistoryRouteHandler,
|
||||
searchTaxRatesRouteHandler
|
||||
} from '../../services/management/taxrates.js';
|
||||
|
||||
// list of tax rates
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listTaxRatesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchTaxRatesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newTaxRateRouteHandler(req, res);
|
||||
|
||||
@ -11,7 +11,6 @@ import {
|
||||
getUserStatsRouteHandler,
|
||||
getUserHistoryRouteHandler,
|
||||
setAppPasswordRouteHandler,
|
||||
searchUsersRouteHandler
|
||||
} from '../../services/management/users.js';
|
||||
|
||||
// list of document templates
|
||||
@ -32,11 +31,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listUsersByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchUsersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
// get user stats
|
||||
router.get('/stats', isAuthenticated, (req, res) => {
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listVendorsByPropertiesRouteHandler,
|
||||
getVendorStatsRouteHandler,
|
||||
getVendorHistoryRouteHandler,
|
||||
searchVendorsRouteHandler
|
||||
} from '../../services/management/vendors.js';
|
||||
|
||||
// list of vendors
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listVendorsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchVendorsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newVendorRouteHandler(req, res);
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
listGCodeFilesByPropertiesRouteHandler,
|
||||
getGCodeFileContentRouteHandler,
|
||||
getGCodeFileStatsRouteHandler,
|
||||
searchGCodeFilesRouteHandler
|
||||
} from '../../services/production/gcodefiles.js';
|
||||
import { convertPropertiesString, getFilter } from '../../utils.js';
|
||||
|
||||
@ -28,11 +27,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listGCodeFilesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchGCodeFilesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
// create new gcodeFile
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
deleteJobRouteHandler,
|
||||
getJobStatsRouteHandler,
|
||||
getJobHistoryRouteHandler,
|
||||
searchJobsRouteHandler
|
||||
} from '../../services/production/jobs.js';
|
||||
import { convertPropertiesString, getFilter } from '../../utils.js';
|
||||
|
||||
@ -28,11 +27,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listJobsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchJobsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newJobRouteHandler(req, res);
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
getPrinterStatsRouteHandler,
|
||||
listPrintersByPropertiesRouteHandler,
|
||||
getPrinterHistoryRouteHandler,
|
||||
searchPrintersRouteHandler
|
||||
} from '../../services/production/printers.js';
|
||||
import { convertPropertiesString, getFilter } from '../../utils.js';
|
||||
|
||||
@ -28,11 +27,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listPrintersByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchPrintersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
// create new printer
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
|
||||
@ -8,7 +8,6 @@ import {
|
||||
getSubJobRouteHandler,
|
||||
getSubJobStatsRouteHandler,
|
||||
getSubJobHistoryRouteHandler,
|
||||
searchSubJobsRouteHandler
|
||||
} from '../../services/production/subjobs.js';
|
||||
import { getFilter, convertPropertiesString } from '../../utils.js';
|
||||
|
||||
@ -26,11 +25,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listSubJobsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchSubJobsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
// get sub job stats
|
||||
router.get('/stats', isAuthenticated, (req, res) => {
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listClientsByPropertiesRouteHandler,
|
||||
getClientStatsRouteHandler,
|
||||
getClientHistoryRouteHandler,
|
||||
searchClientsRouteHandler
|
||||
} from '../../services/sales/clients.js';
|
||||
|
||||
// list of clients
|
||||
@ -29,11 +28,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listClientsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchClientsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newClientRouteHandler(req, res);
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
getListingHistoryRouteHandler,
|
||||
publishListingRouteHandler,
|
||||
unpublishListingRouteHandler,
|
||||
searchListingsRouteHandler
|
||||
} from '../../services/sales/listings.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -48,11 +47,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listListingsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchListingsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newListingRouteHandler(req, res);
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
getListingVarientHistoryRouteHandler,
|
||||
publishListingVarientRouteHandler,
|
||||
unpublishListingVarientRouteHandler,
|
||||
searchListingVarientsRouteHandler
|
||||
} from '../../services/sales/listingvarients.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -48,11 +47,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listListingVarientsByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchListingVarientsRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newListingVarientRouteHandler(req, res);
|
||||
|
||||
@ -18,7 +18,6 @@ import {
|
||||
syncMarketplaceItemsRouteHandler,
|
||||
syncMarketplaceOrdersRouteHandler,
|
||||
marketplaceWebhookRouteHandler,
|
||||
searchMarketplacesRouteHandler
|
||||
} from '../../services/sales/marketplaces.js';
|
||||
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -34,11 +33,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
const filter = getFilter(req.query, allowedFilters, false);
|
||||
listMarketplacesByPropertiesRouteHandler(req, res, properties, filter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchMarketplacesRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newMarketplaceRouteHandler(req, res);
|
||||
|
||||
@ -16,7 +16,6 @@ import {
|
||||
postSalesOrderRouteHandler,
|
||||
confirmSalesOrderRouteHandler,
|
||||
cancelSalesOrderRouteHandler,
|
||||
searchSalesOrdersRouteHandler
|
||||
} from '../../services/sales/salesorders.js';
|
||||
|
||||
// list of sales orders
|
||||
@ -37,11 +36,6 @@ router.get('/properties', isAuthenticated, (req, res) => {
|
||||
}
|
||||
listSalesOrdersByPropertiesRouteHandler(req, res, properties, filter, masterFilter);
|
||||
});
|
||||
router.get('/search', isAuthenticated, (req, res) => {
|
||||
const { search } = req.query;
|
||||
searchSalesOrdersRouteHandler(req, res, search);
|
||||
});
|
||||
|
||||
|
||||
router.post('/', isAuthenticated, (req, res) => {
|
||||
newSalesOrderRouteHandler(req, res);
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
import { orderItemModel } from '../../database/schemas/inventory/orderitem.schema.js';
|
||||
import { shipmentModel } from '../../database/schemas/inventory/shipment.schema.js';
|
||||
@ -83,14 +82,6 @@ export const listInvoicesByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchInvoicesRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: invoiceModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getInvoiceRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const populateFields = [
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
import { invoiceModel } from '../../database/schemas/finance/invoice.schema.js';
|
||||
|
||||
@ -80,14 +79,6 @@ export const listPaymentsByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchPaymentsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: paymentModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getPaymentRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const populateFields = [{ path: 'vendor' }, { path: 'client' }, { path: 'invoice' }];
|
||||
|
||||
@ -11,7 +11,6 @@ import {
|
||||
listObjectsByProperties,
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('TaxRecords');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -70,14 +69,6 @@ export const listTaxRecordsByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchTaxRecordsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: taxRecordModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getTaxRecordRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listObjectsByProperties,
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('Filament Stocks');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -79,14 +78,6 @@ export const listFilamentStocksByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchFilamentStocksRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: filamentStockModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getFilamentStockRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
listObjectsByProperties,
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('Order Items');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -124,14 +123,6 @@ export const listOrderItemsByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchOrderItemsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: orderItemModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getOrderItemRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listObjectsByProperties,
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('Part Stocks');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -75,14 +74,6 @@ export const listPartStocksByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchPartStocksRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: partStockModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getPartStockRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
import { productSkuModel } from '../../database/schemas/management/productsku.schema.js';
|
||||
const logger = log4js.getLogger('Product Stocks');
|
||||
@ -81,14 +80,6 @@ export const listProductStocksByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchProductStocksRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: productStockModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getProductStockRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
import { orderItemModel } from '../../database/schemas/inventory/orderitem.schema.js';
|
||||
import { shipmentModel } from '../../database/schemas/inventory/shipment.schema.js';
|
||||
@ -79,14 +78,6 @@ export const listPurchaseOrdersByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchPurchaseOrdersRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: purchaseOrderModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getPurchaseOrderRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('Shipments');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -77,14 +76,6 @@ export const listShipmentsByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchShipmentsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: shipmentModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getShipmentRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
@ -3,10 +3,7 @@ import { stockAuditModel } from '../../database/schemas/inventory/stockaudit.sch
|
||||
import log4js from 'log4js';
|
||||
import mongoose from 'mongoose';
|
||||
import { getAuditLogs } from '../../utils.js';
|
||||
import {
|
||||
getModelStats, getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
import { getModelStats, getModelHistory } from '../../database/database.js';
|
||||
|
||||
const logger = log4js.getLogger('Stock Audits');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -61,14 +58,6 @@ export const listStockAuditsRouteHandler = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const searchStockAuditsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: stockAuditModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getStockAuditRouteHandler = async (req, res) => {
|
||||
try {
|
||||
const id = new mongoose.Types.ObjectId(req.params.id);
|
||||
|
||||
@ -12,7 +12,6 @@ import {
|
||||
listObjectsByProperties,
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
searchObjects
|
||||
} from '../../database/database.js';
|
||||
const logger = log4js.getLogger('Stock Events');
|
||||
logger.level = config.server.logLevel;
|
||||
@ -77,14 +76,6 @@ export const listStockEventsByPropertiesRouteHandler = async (
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const searchStockEventsRouteHandler = async (req, res, search) => {
|
||||
const result = await searchObjects({
|
||||
model: stockEventModel,
|
||||
search,
|
||||
});
|
||||
res.send(result);
|
||||
};
|
||||
|
||||
export const getStockEventRouteHandler = async (req, res) => {
|
||||
const id = req.params.id;
|
||||
const result = await getObject({
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user