From 2034f459d416afdead72e590f870567452b2c62a Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 3 Jun 2025 22:15:43 +0200 Subject: Prepare for budgeting, move to native createdAt --- src/db/schemas/spendHistory.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/db/schemas/spendHistory.js') diff --git a/src/db/schemas/spendHistory.js b/src/db/schemas/spendHistory.js index b4c3f20..d1d6c2a 100644 --- a/src/db/schemas/spendHistory.js +++ b/src/db/schemas/spendHistory.js @@ -11,23 +11,22 @@ export const spendHistorySchema = new Schema( required: true, immutable: true }, - items: { - type: [String], + reason: { + type: String, required: true, immutable: true }, - cost: { + amount: { type: Number, required: true, immutable: true - }, - createdAt: { - type: Date, - default: Date.now, - immutable: true } }, { + timestamps: { + createdAt: true, + updatedAt: false + }, timeseries: { timeField: 'createdAt' } -- cgit 1.5.1