Refactored tax record management by moving tax record schema and routes to the finance directory, enhancing organization. Implemented CRUD operations for tax records in the new service and added corresponding tests for route handlers.
This commit is contained in:
parent
a2bfd707e2
commit
2996b1670f
@ -36,7 +36,7 @@ import { fileModel } from './management/file.schema.js';
|
||||
import { courierServiceModel } from './management/courierservice.schema.js';
|
||||
import { courierModel } from './management/courier.schema.js';
|
||||
import { taxRateModel } from './management/taxrate.schema.js';
|
||||
import { taxRecordModel } from './management/taxrecord.schema.js';
|
||||
import { taxRecordModel } from './finance/taxrecord.schema.js';
|
||||
import { shipmentModel } from './inventory/shipment.schema.js';
|
||||
import { invoiceModel } from './finance/invoice.schema.js';
|
||||
import { clientModel } from './sales/client.schema.js';
|
||||
|
||||
@ -12,7 +12,7 @@ import {
|
||||
listTaxRecordsByPropertiesRouteHandler,
|
||||
getTaxRecordStatsRouteHandler,
|
||||
getTaxRecordHistoryRouteHandler,
|
||||
} from '../../services/management/taxrecords.js';
|
||||
} from '../../services/finance/taxrecords.js';
|
||||
|
||||
// list of tax records
|
||||
router.get('/', isAuthenticated, (req, res) => {
|
||||
@ -36,7 +36,7 @@ import documentJobsRoutes from './management/documentjobs.js';
|
||||
import courierRoutes from './management/courier.js';
|
||||
import courierServiceRoutes from './management/courierservice.js';
|
||||
import taxRateRoutes from './management/taxrates.js';
|
||||
import taxRecordRoutes from './management/taxrecords.js';
|
||||
import taxRecordRoutes from './finance/taxrecords.js';
|
||||
import invoiceRoutes from './finance/invoices.js';
|
||||
import paymentRoutes from './finance/payments.js';
|
||||
import clientRoutes from './sales/clients.js';
|
||||
|
||||
@ -11,7 +11,7 @@ jest.unstable_mockModule('../../../database/database.js', () => ({
|
||||
getModelHistory: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('../../../database/schemas/management/taxrecord.schema.js', () => ({
|
||||
jest.unstable_mockModule('../../../database/schemas/finance/taxrecord.schema.js', () => ({
|
||||
taxRecordModel: { modelName: 'TaxRecord' },
|
||||
}));
|
||||
|
||||
@ -37,7 +37,7 @@ const {
|
||||
const { listObjects, getObject, editObject, newObject } = await import(
|
||||
'../../../database/database.js'
|
||||
);
|
||||
const { taxRecordModel } = await import('../../../database/schemas/management/taxrecord.schema.js');
|
||||
const { taxRecordModel } = await import('../../../database/schemas/finance/taxrecord.schema.js');
|
||||
|
||||
describe('Tax Record Service Route Handlers', () => {
|
||||
let req, res;
|
||||
@ -1,5 +1,5 @@
|
||||
import config from '../../config.js';
|
||||
import { taxRecordModel } from '../../database/schemas/management/taxrecord.schema.js';
|
||||
import { taxRecordModel } from '../../database/schemas/finance/taxrecord.schema.js';
|
||||
import log4js from 'log4js';
|
||||
import mongoose from 'mongoose';
|
||||
import {
|
||||
Loading…
x
Reference in New Issue
Block a user