feat(recurring): düzenli işlem kuralları, planlı kayıt üretimi, onay/atla/ertele ve seri düzenleme
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,12 @@ const transactionSchema = new Schema(
|
||||
attachmentCount: { type: Number, default: 0 },
|
||||
// İleri fazlar: planlı işlem kuralı (7), taksit (7), kart dönemi (7), cari (8).
|
||||
recurringRuleId: { type: Schema.Types.ObjectId, default: null },
|
||||
/** Serideki sıra (0'dan); kuralla birlikte benzersiz (tekrar üretimi idempotent). */
|
||||
occurrenceIndex: { type: Number, default: null },
|
||||
/** Tek başına düzenlendi/ertelendi: "tümü" güncellemesinde korunur. */
|
||||
detached: { type: Boolean, default: false },
|
||||
/** Planlı tutar tahmini (ör. fatura); onaylarken kesinleşir. */
|
||||
isEstimate: { type: Boolean, default: false },
|
||||
installment: {
|
||||
type: new Schema(
|
||||
{ planId: Schema.Types.ObjectId, index: Number, count: Number },
|
||||
@@ -70,6 +76,10 @@ transactionSchema.index({ householdId: 1, accountId: 1, date: -1 });
|
||||
transactionSchema.index({ householdId: 1, toAccountId: 1, date: -1 });
|
||||
transactionSchema.index({ householdId: 1, effectiveCategoryIds: 1, date: -1 });
|
||||
transactionSchema.index({ householdId: 1, tags: 1 });
|
||||
transactionSchema.index(
|
||||
{ recurringRuleId: 1, occurrenceIndex: 1 },
|
||||
{ unique: true, partialFilterExpression: { recurringRuleId: { $type: "objectId" } } },
|
||||
);
|
||||
transactionSchema.index(
|
||||
{ householdId: 1, seedRef: 1 },
|
||||
{ unique: true, partialFilterExpression: { seedRef: { $type: "string" } } },
|
||||
|
||||
Reference in New Issue
Block a user