feat(budget): gelir planı ve günlük plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 01:22:38 +03:00
parent 21b3715d35
commit 39aa19d168
8 changed files with 698 additions and 2 deletions
+10
View File
@@ -12,11 +12,21 @@ const limitSchema = new Schema(
{ _id: false },
);
/** Gelir planına elle eklenen beklenen gelir (planlı işlemi olmayan, ör. prim). */
const incomeItemSchema = new Schema(
{
name: { type: String, required: true, trim: true, maxlength: 80 },
amountMinor: { type: Number, required: true, min: 1 },
},
{ _id: true },
);
const budgetSchema = new Schema(
{
householdId: { type: Schema.Types.ObjectId, required: true },
month: { type: String, required: true, match: /^\d{4}-(0[1-9]|1[0-2])$/ },
limits: { type: [limitSchema], default: [] },
incomeItems: { type: [incomeItemSchema], default: [] },
seedRef: { type: String, default: null },
createdBy: { type: Schema.Types.ObjectId, required: true },
updatedBy: { type: Schema.Types.ObjectId, required: true },