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: {
|
||||
type: { type: String, required: true, default: 'draft' },
|
||||
},
|
||||
paymentDate: { type: Date, required: false },
|
||||
postedAt: { type: Date, required: false },
|
||||
authorisedAt: { type: Date, required: false },
|
||||
declinedAt: { type: Date, required: false },
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
getModelStats,
|
||||
getModelHistory,
|
||||
checkStates,
|
||||
searchObjects
|
||||
searchObjects,
|
||||
} from '../../database/database.js';
|
||||
import { invoiceModel } from '../../database/schemas/finance/invoice.schema.js';
|
||||
|
||||
@ -131,7 +131,6 @@ export const editPaymentRouteHandler = async (req, res) => {
|
||||
client: req.body.client,
|
||||
invoice: req.body.invoice,
|
||||
amount: req.body.amount,
|
||||
paymentDate: req.body.paymentDate,
|
||||
paymentMethod: req.body.paymentMethod,
|
||||
notes: req.body.notes,
|
||||
};
|
||||
@ -206,7 +205,6 @@ export const newPaymentRouteHandler = async (req, res) => {
|
||||
client: invoice.client?._id || req.body.client,
|
||||
invoice: req.body.invoice,
|
||||
amount: req.body.amount || 0,
|
||||
paymentDate: req.body.paymentDate || new Date(),
|
||||
paymentMethod: req.body.paymentMethod,
|
||||
notes: req.body.notes,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user