feat(budget): gelir planı ve günlük plan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user