Commit 5bf2162d authored by Jack Stupple's avatar Jack Stupple

do not allow missing modifier categories

parent eb53246a
......@@ -80,7 +80,7 @@ class CharacterMigration extends Migration
$amount = $_modifier['amount'];
$income_outgoing = 'outgoing';
if ($_category == 'salary') {
if ($_category === 'Salary') {
$income_outgoing = 'income';
} else if (strpos($_category, 'Other') !== false) {
if ($_category == 'Other-Income') {
......@@ -212,7 +212,7 @@ class CharacterMigration extends Migration
$modifier->model_id = $roundup->id;
$income_outgoing = 'outgoing';
if ($_modifier['category'] == 'salary') {
if ($_modifier['category'] === 'Salary') {
$income_outgoing = 'income';
} else if (strpos($_modifier['category'], 'Other') !== false) {
if ($_modifier['category'] === 'Other-Income') {
......@@ -243,6 +243,8 @@ class CharacterMigration extends Migration
$category = \App\ModifierCategory::where('name', 'LIKE', $_category)->where('income_outgoing_savings', $income_outgoing)->first();
if ($category) {
static::$cache[$_category . '-' . $income_outgoing] = $category;
} else {
dd('modifier category not exist: ' . $_category);
}
}
......
......@@ -1060,13 +1060,13 @@
"modifiers": {
"eur": [
{
"category": "Credit cards/Loans",
"category": "Credit Cards / Loans",
"amount": 12
}
],
"gbp": [
{
"category": "Credit cards/Loans",
"category": "Credit Cards / Loans",
"amount": 12
}
],
......@@ -1096,13 +1096,13 @@
"modifiers": {
"eur": [
{
"category": "Credit cards/Loans",
"category": "Credit Cards / Loans",
"amount": 22
}
],
"gbp": [
{
"category": "Credit cards/Loans",
"category": "Credit Cards / Loans",
"amount": 22
}
],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment