summary refs log tree commit diff
path: root/src/db/schemas/spendHistory.js
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-06-03 22:15:43 +0200
committerRory& <root@rory.gay>2025-06-03 22:15:43 +0200
commit2034f459d416afdead72e590f870567452b2c62a (patch)
tree167d52739a058498a5c5877e64f806553543973c /src/db/schemas/spendHistory.js
parentRemove admin account routes, fix multiple routes (diff)
downloadnodejs-final-assignment-2034f459d416afdead72e590f870567452b2c62a.tar.xz
Prepare for budgeting, move to native createdAt
Diffstat (limited to 'src/db/schemas/spendHistory.js')
-rw-r--r--src/db/schemas/spendHistory.js15
1 files changed, 7 insertions, 8 deletions
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' }