Skip to content

Firefly III: a personal finances manager

Update mandatory fields.

James Coleb733fa296146
diff --git a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php
index 1d0c7f3aa1..e701771e12 100644
--- a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php
+++ b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php
@@ -141,32 +141,32 @@ class StoreRequest extends FormRequest
'first_date' => 'required|date',
'apply_rules' => [new IsBoolean],
'active' => [new IsBoolean],
- 'repeat_until' => 'date',
- 'nr_of_repetitions' => 'numeric|between:1,31',
+ 'repeat_until' => 'nullable|date',
+ 'nr_of_repetitions' => 'nullable|numeric|between:1,31',
'repetitions.*.type' => 'required|in:daily,weekly,ndom,monthly,yearly',
'repetitions.*.moment' => 'between:0,10',
- 'repetitions.*.skip' => 'numeric|between:0,31',
+ 'repetitions.*.skip' => 'nullable|numeric|between:0,31',
'repetitions.*.weekend' => 'numeric|min:1|max:4',
'transactions.*.description' => 'required|between:1,255',
'transactions.*.amount' => 'required|numeric|gt:0',
- 'transactions.*.foreign_amount' => 'numeric|gt:0',
+ 'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
- 'transactions.*.foreign_currency_id' => 'numeric|exists:transaction_currencies,id',
- 'transactions.*.foreign_currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
+ 'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
+ 'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser],
'transactions.*.source_name' => 'between:1,255|nullable',
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser],
'transactions.*.destination_name' => 'between:1,255|nullable',
// new and updated fields:
- 'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser],
+ 'transactions.*.budget_id' => ['nullable','mustExist:budgets,id', new BelongsUser],
'transactions.*.budget_name' => ['between:1,255', 'nullable', new BelongsUser],
- 'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser],
+ 'transactions.*.category_id' => ['nullable','mustExist:categories,id', new BelongsUser],
'transactions.*.category_name' => 'between:1,255|nullable',
- 'transactions.*.piggy_bank_id' => ['numeric', 'mustExist:piggy_banks,id', new BelongsUser],
+ 'transactions.*.piggy_bank_id' => ['nullable','numeric', 'mustExist:piggy_banks,id', new BelongsUser],
'transactions.*.piggy_bank_name' => ['between:1,255', 'nullable', new BelongsUser],
- 'transactions.*.tags' => 'between:1,64000',
+ 'transactions.*.tags' => 'nullable|between:1,64000',
];
}