Removed paymentDate field from payment schema and updated related route handlers to reflect this change, streamlining payment data management.
This commit is contained in:
parent
e192c04000
commit
9bba139998
@ -13,7 +13,6 @@ const paymentSchema = new Schema(
|
|||||||
state: {
|
state: {
|
||||||
type: { type: String, required: true, default: 'draft' },
|
type: { type: String, required: true, default: 'draft' },
|
||||||
},
|
},
|
||||||
paymentDate: { type: Date, required: false },
|
|
||||||
postedAt: { type: Date, required: false },
|
postedAt: { type: Date, required: false },
|
||||||
authorisedAt: { type: Date, required: false },
|
authorisedAt: { type: Date, required: false },
|
||||||
declinedAt: { type: Date, required: false },
|
declinedAt: { type: Date, required: false },
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import {
|
|||||||
getModelStats,
|
getModelStats,
|
||||||
getModelHistory,
|
getModelHistory,
|
||||||
checkStates,
|
checkStates,
|
||||||
searchObjects
|
searchObjects,
|
||||||
} from '../../database/database.js';
|
} from '../../database/database.js';
|
||||||
import { invoiceModel } from '../../database/schemas/finance/invoice.schema.js';
|
import { invoiceModel } from '../../database/schemas/finance/invoice.schema.js';
|
||||||
|
|
||||||
@ -131,7 +131,6 @@ export const editPaymentRouteHandler = async (req, res) => {
|
|||||||
client: req.body.client,
|
client: req.body.client,
|
||||||
invoice: req.body.invoice,
|
invoice: req.body.invoice,
|
||||||
amount: req.body.amount,
|
amount: req.body.amount,
|
||||||
paymentDate: req.body.paymentDate,
|
|
||||||
paymentMethod: req.body.paymentMethod,
|
paymentMethod: req.body.paymentMethod,
|
||||||
notes: req.body.notes,
|
notes: req.body.notes,
|
||||||
};
|
};
|
||||||
@ -206,7 +205,6 @@ export const newPaymentRouteHandler = async (req, res) => {
|
|||||||
client: invoice.client?._id || req.body.client,
|
client: invoice.client?._id || req.body.client,
|
||||||
invoice: req.body.invoice,
|
invoice: req.body.invoice,
|
||||||
amount: req.body.amount || 0,
|
amount: req.body.amount || 0,
|
||||||
paymentDate: req.body.paymentDate || new Date(),
|
|
||||||
paymentMethod: req.body.paymentMethod,
|
paymentMethod: req.body.paymentMethod,
|
||||||
notes: req.body.notes,
|
notes: req.body.notes,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user