Fix issue with renamed field.

This commit is contained in:
James Cole
2022-05-04 05:53:47 +02:00
parent cba3590dec
commit 51e23dae21
20 changed files with 82 additions and 82 deletions

View File

@@ -50,28 +50,28 @@ class UpdateRequest extends FormRequest
public function getUpdateData(): array
{
$fields = [
'name' => ['name', 'string'],
'name' => ['name', 'convertString'],
'active' => ['active', 'boolean'],
'include_net_worth' => ['include_net_worth', 'boolean'],
'account_type_name' => ['type', 'string'],
'virtual_balance' => ['virtual_balance', 'string'],
'iban' => ['iban', 'string'],
'BIC' => ['bic', 'string'],
'account_number' => ['account_number', 'string'],
'account_role' => ['account_role', 'string'],
'liability_type' => ['liability_type', 'string'],
'opening_balance' => ['opening_balance', 'string'],
'account_type_name' => ['type', 'convertString'],
'virtual_balance' => ['virtual_balance', 'convertString'],
'iban' => ['iban', 'convertString'],
'BIC' => ['bic', 'convertString'],
'account_number' => ['account_number', 'convertString'],
'account_role' => ['account_role', 'convertString'],
'liability_type' => ['liability_type', 'convertString'],
'opening_balance' => ['opening_balance', 'convertString'],
'opening_balance_date' => ['opening_balance_date', 'date'],
'cc_type' => ['credit_card_type', 'string'],
'cc_monthly_payment_date' => ['monthly_payment_date', 'string'],
'cc_type' => ['credit_card_type', 'convertString'],
'cc_monthly_payment_date' => ['monthly_payment_date', 'convertString'],
'notes' => ['notes', 'stringWithNewlines'],
'interest' => ['interest', 'string'],
'interest_period' => ['interest_period', 'string'],
'interest' => ['interest', 'convertString'],
'interest_period' => ['interest_period', 'convertString'],
'order' => ['order', 'integer'],
'currency_id' => ['currency_id', 'integer'],
'currency_code' => ['currency_code', 'string'],
'liability_direction' => ['liability_direction', 'string'],
'liability_amount' => ['liability_amount', 'string'],
'currency_code' => ['currency_code', 'convertString'],
'liability_direction' => ['liability_direction', 'convertString'],
'liability_amount' => ['liability_amount', 'convertString'],
'liability_start_date' => ['liability_start_date', 'date'],
];
/** @var Account $account */

View File

@@ -45,10 +45,10 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
'filename' => ['filename', 'string'],
'title' => ['title', 'string'],
'filename' => ['filename', 'convertString'],
'title' => ['title', 'convertString'],
'notes' => ['notes', 'stringWithNewlines'],
'attachable_type' => ['attachable_type', 'string'],
'attachable_type' => ['attachable_type', 'convertString'],
'attachable_id' => ['attachable_id', 'integer'],
];

View File

@@ -48,8 +48,8 @@ class Request extends FormRequest
// this is the way:
$fields = [
'currency_id' => ['currency_id', 'integer'],
'currency_code' => ['currency_code', 'string'],
'amount' => ['amount', 'string'],
'currency_code' => ['currency_code', 'convertString'],
'amount' => ['amount', 'convertString'],
'start' => ['start', 'date'],
'end' => ['end', 'date'],
];

View File

@@ -49,21 +49,21 @@ class StoreRequest extends FormRequest
{
Log::debug('Raw fields in Bill StoreRequest', $this->all());
$fields = [
'name' => ['name', 'string'],
'amount_min' => ['amount_min', 'string'],
'amount_max' => ['amount_max', 'string'],
'name' => ['name', 'convertString'],
'amount_min' => ['amount_min', 'convertString'],
'amount_max' => ['amount_max', 'convertString'],
'currency_id' => ['currency_id', 'integer'],
'currency_code' => ['currency_code', 'string'],
'currency_code' => ['currency_code', 'convertString'],
'date' => ['date', 'date'],
'end_date' => ['end_date', 'date'],
'extension_date' => ['extension_date', 'date'],
'repeat_freq' => ['repeat_freq', 'string'],
'repeat_freq' => ['repeat_freq', 'convertString'],
'skip' => ['skip', 'integer'],
'active' => ['active', 'boolean'],
'order' => ['order', 'integer'],
'notes' => ['notes', 'stringWithNewlines'],
'object_group_id' => ['object_group_id', 'integer'],
'object_group_title' => ['object_group_title', 'string'],
'object_group_title' => ['object_group_title', 'convertString'],
];
return $this->getAllData($fields);

View File

@@ -47,21 +47,21 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
'name' => ['name', 'string'],
'amount_min' => ['amount_min', 'string'],
'amount_max' => ['amount_max', 'string'],
'name' => ['name', 'convertString'],
'amount_min' => ['amount_min', 'convertString'],
'amount_max' => ['amount_max', 'convertString'],
'currency_id' => ['currency_id', 'integer'],
'currency_code' => ['currency_code', 'string'],
'currency_code' => ['currency_code', 'convertString'],
'date' => ['date', 'date'],
'end_date' => ['end_date', 'date'],
'extension_date' => ['extension_date', 'date'],
'repeat_freq' => ['repeat_freq', 'string'],
'repeat_freq' => ['repeat_freq', 'convertString'],
'skip' => ['skip', 'integer'],
'active' => ['active', 'boolean'],
'order' => ['order', 'integer'],
'notes' => ['notes', 'stringWithNewlines'],
'object_group_id' => ['object_group_id', 'integer'],
'object_group_title' => ['object_group_title', 'string'],
'object_group_title' => ['object_group_title', 'convertString'],
];
return $this->getAllData($fields);

View File

@@ -47,17 +47,17 @@ class StoreRequest extends FormRequest
public function getAll(): array
{
$fields = [
'name' => ['name', 'string'],
'name' => ['name', 'convertString'],
'active' => ['active', 'boolean'],
'order' => ['active', 'integer'],
'notes' => ['notes', 'string'],
'notes' => ['notes', 'convertString'],
// auto budget currency:
'currency_id' => ['auto_budget_currency_id', 'integer'],
'currency_code' => ['auto_budget_currency_code', 'string'],
'auto_budget_type' => ['auto_budget_type', 'string'],
'auto_budget_amount' => ['auto_budget_amount', 'string'],
'auto_budget_period' => ['auto_budget_period', 'string'],
'currency_code' => ['auto_budget_currency_code', 'convertString'],
'auto_budget_type' => ['auto_budget_type', 'convertString'],
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
'auto_budget_period' => ['auto_budget_period', 'convertString'],
];
return $this->getAllData($fields);

View File

@@ -48,15 +48,15 @@ class UpdateRequest extends FormRequest
{
// this is the way:
$fields = [
'name' => ['name', 'string'],
'name' => ['name', 'convertString'],
'active' => ['active', 'boolean'],
'order' => ['order', 'integer'],
'notes' => ['notes', 'string'],
'notes' => ['notes', 'convertString'],
'currency_id' => ['auto_budget_currency_id', 'integer'],
'currency_code' => ['auto_budget_currency_code', 'string'],
'auto_budget_type' => ['auto_budget_type', 'string'],
'auto_budget_amount' => ['auto_budget_amount', 'string'],
'auto_budget_period' => ['auto_budget_period', 'string'],
'currency_code' => ['auto_budget_currency_code', 'convertString'],
'auto_budget_type' => ['auto_budget_type', 'convertString'],
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
'auto_budget_period' => ['auto_budget_period', 'convertString'],
];
$allData = $this->getAllData($fields);
if (array_key_exists('auto_budget_type', $allData)) {

View File

@@ -48,9 +48,9 @@ class UpdateRequest extends FormRequest
$fields = [
'start' => ['start', 'date'],
'end' => ['end', 'date'],
'amount' => ['amount', 'string'],
'amount' => ['amount', 'convertString'],
'currency_id' => ['currency_id', 'integer'],
'currency_code' => ['currency_code', 'string'],
'currency_code' => ['currency_code', 'convertString'],
];
return $this->getAllData($fields);

View File

@@ -44,7 +44,7 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
'name' => ['name', 'string'],
'name' => ['name', 'convertString'],
'notes' => ['notes', 'stringWithNewlines'],
];

View File

@@ -43,7 +43,7 @@ class UpdateRequest extends FormRequest
public function getUpdateData(): array
{
$fields = [
'title' => ['title', 'string'],
'title' => ['title', 'convertString'],
'order' => ['order', 'integer'],
];

View File

@@ -46,15 +46,15 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
'name' => ['name', 'string'],
'name' => ['name', 'convertString'],
'account_id' => ['account_id', 'integer'],
'targetamount' => ['target_amount', 'string'],
'current_amount' => ['current_amount', 'string'],
'targetamount' => ['target_amount', 'convertString'],
'current_amount' => ['current_amount', 'convertString'],
'startdate' => ['start_date', 'date'],
'targetdate' => ['target_date', 'string'],
'targetdate' => ['target_date', 'convertString'],
'notes' => ['notes', 'stringWithNewlines'],
'order' => ['order', 'integer'],
'object_group_title' => ['object_group_title', 'string'],
'object_group_title' => ['object_group_title', 'convertString'],
'object_group_id' => ['object_group_id', 'integer'],
];

View File

@@ -49,9 +49,9 @@ class StoreRequest extends FormRequest
public function getAll(): array
{
$fields = [
'type' => ['type', 'string'],
'title' => ['title', 'string'],
'description' => ['description', 'string'],
'type' => ['type', 'convertString'],
'title' => ['title', 'convertString'],
'description' => ['description', 'convertString'],
'first_date' => ['first_date', 'date'],
'repeat_until' => ['repeat_until', 'date'],
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],

View File

@@ -51,14 +51,14 @@ class UpdateRequest extends FormRequest
{
// this is the way:
$fields = [
'title' => ['title', 'string'],
'description' => ['description', 'string'],
'title' => ['title', 'convertString'],
'description' => ['description', 'convertString'],
'first_date' => ['first_date', 'date'],
'repeat_until' => ['repeat_until', 'date'],
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],
'apply_rules' => ['apply_rules', 'boolean'],
'active' => ['active', 'boolean'],
'notes' => ['notes', 'string'],
'notes' => ['notes', 'convertString'],
];
$reps = $this->getRepetitionData();
$transactions = $this->getTransactionData();

View File

@@ -46,12 +46,12 @@ class StoreRequest extends FormRequest
public function getAll(): array
{
$fields = [
'title' => ['title', 'string'],
'description' => ['description', 'string'],
'title' => ['title', 'convertString'],
'description' => ['description', 'convertString'],
'rule_group_id' => ['rule_group_id', 'integer'],
'order' => ['order', 'integer'],
'rule_group_title' => ['rule_group_title', 'string'],
'trigger' => ['trigger', 'string'],
'rule_group_title' => ['rule_group_title', 'convertString'],
'trigger' => ['trigger', 'convertString'],
'strict' => ['strict', 'boolean'],
'stop_processing' => ['stop_processing', 'boolean'],
'active' => ['active', 'boolean'],

View File

@@ -46,10 +46,10 @@ class UpdateRequest extends FormRequest
public function getAll(): array
{
$fields = [
'title' => ['title', 'string'],
'title' => ['title', 'convertString'],
'description' => ['description', 'stringWithNewlines'],
'rule_group_id' => ['rule_group_id', 'integer'],
'trigger' => ['trigger', 'string'],
'trigger' => ['trigger', 'convertString'],
'strict' => ['strict', 'boolean'],
'stop_processing' => ['stop_processing', 'boolean'],
'active' => ['active', 'boolean'],

View File

@@ -45,7 +45,7 @@ class UpdateRequest extends FormRequest
{
// This is the way.
$fields = [
'title' => ['title', 'string'],
'title' => ['title', 'convertString'],
'description' => ['description', 'stringWithNewlines'],
'active' => ['active', 'boolean'],
'order' => ['order', 'integer'],

View File

@@ -48,9 +48,9 @@ class UpdateRequest extends FormRequest
{
// This is the way.
$fields = [
'tag' => ['tag', 'string'],
'tag' => ['tag', 'convertString'],
'date' => ['date', 'date'],
'description' => ['description', 'string'],
'description' => ['description', 'convertString'],
];
$data = $this->getAllData($fields);

View File

@@ -46,9 +46,9 @@ class UpdateRequest extends FormRequest
{
// return nothing that isn't explicitely in the array:
$fields = [
'name' => ['name', 'string'],
'code' => ['code', 'string'],
'symbol' => ['symbol', 'string'],
'name' => ['name', 'convertString'],
'code' => ['code', 'convertString'],
'symbol' => ['symbol', 'convertString'],
'decimal_places' => ['decimal_places', 'integer'],
'default' => ['default', 'boolean'],
'enabled' => ['enabled', 'boolean'],

View File

@@ -45,12 +45,12 @@ class CreateRequest extends FormRequest
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
$fields = [
'title' => ['title', 'string'],
'title' => ['title', 'convertString'],
'active' => ['active', 'boolean'],
'trigger' => ['trigger', 'string'],
'response' => ['response', 'string'],
'delivery' => ['delivery', 'string'],
'url' => ['url', 'string'],
'trigger' => ['trigger', 'convertString'],
'response' => ['response', 'convertString'],
'delivery' => ['delivery', 'convertString'],
'url' => ['url', 'convertString'],
];
// this is the way.

View File

@@ -45,12 +45,12 @@ class UpdateRequest extends FormRequest
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
$fields = [
'title' => ['title', 'string'],
'title' => ['title', 'convertString'],
'active' => ['active', 'boolean'],
'trigger' => ['trigger', 'string'],
'response' => ['response', 'string'],
'delivery' => ['delivery', 'string'],
'url' => ['url', 'string'],
'trigger' => ['trigger', 'convertString'],
'response' => ['response', 'convertString'],
'delivery' => ['delivery', 'convertString'],
'url' => ['url', 'convertString'],
];
// this is the way.