added prefix to source

This commit is contained in:
Denis Duliçi
2021-09-10 00:31:39 +03:00
parent 640cafb133
commit 2b680f0f8e
27 changed files with 227 additions and 29 deletions

View File

@ -31,7 +31,7 @@ class Account extends Factory
'bank_phone' => $this->faker->phoneNumber,
'bank_address' => $this->faker->address,
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -29,7 +29,7 @@ class Category extends Factory
'type' => $this->faker->randomElement($types),
'color' => $this->faker->hexColor,
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -39,7 +39,7 @@ class Contact extends Factory
'currency_code' => setting('default.currency'),
'reference' => $this->faker->text(5),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -47,7 +47,7 @@ class Currency extends Factory
'decimal_mark' => $currency['decimal_mark'],
'thousands_separator' => $currency['thousands_separator'],
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -25,7 +25,7 @@ class Dashboard extends Factory
'company_id' => $this->company->id,
'name' => $this->faker->text(15),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -45,7 +45,7 @@ class Document extends AbstractFactory
'currency_rate' => '1',
'notes' => $this->faker->text(5),
'amount' => '0',
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -29,7 +29,7 @@ class Item extends Factory
'sale_price' => $this->faker->randomFloat(2, 10, 20),
'category_id' => $this->company->categories()->item()->get()->random(1)->pluck('id')->first(),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -34,7 +34,7 @@ class Reconciliation extends Factory
'started_at' => $started_at,
'ended_at' => $ended_at,
'reconcile' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -28,7 +28,7 @@ class Role extends Factory
'name' => strtolower($name),
'display_name' => $name,
'description' => $name,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -29,7 +29,7 @@ class Tax extends Factory
'rate' => $this->faker->randomFloat(2, 10, 20),
'type' => $this->faker->randomElement($types),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -41,7 +41,7 @@ class Transaction extends Factory
'category_id' => $this->company->categories()->$category_type()->get()->random(1)->pluck('id')->first(),
'reference' => $this->faker->text(5),
'payment_method' => setting('default.payment_method'),
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -43,7 +43,7 @@ class Transfer extends Factory
'category_id' => Category::transfer(),
'description' => $this->faker->text(20),
'reference' => $this->faker->text(20),
'created_from' => 'factory',
'created_from' => 'core::factory',
];
$expense_transaction = Transaction::factory()->create(array_merge($request, [

View File

@ -34,7 +34,7 @@ class User extends Factory
'companies' => ['1'],
'roles' => ['1'],
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}

View File

@ -42,7 +42,7 @@ class Widget extends Factory
'dashboard_id' => $dashboard->id,
'name' => $this->faker->text(15),
'class' => $this->faker->randomElement($this->classes),
'created_from' => 'factory',
'created_from' => 'core::factory',
];
}
}

View File

@ -0,0 +1,134 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CoreV2125 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accounts', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('categories', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('companies', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('contacts', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('currencies', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('dashboards', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('documents', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('document_histories', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('document_items', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('document_item_taxes', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('document_totals', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('email_templates', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('items', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('item_taxes', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('media', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('mediables', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('modules', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('module_histories', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('reconciliations', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('recurring', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('reports', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('roles', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('taxes', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('transactions', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('transfers', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('users', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
Schema::table('widgets', function (Blueprint $table) {
$table->string('created_from', 100)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -36,7 +36,7 @@ class Accounts extends Seeder
'currency_code' => 'USD',
'bank_name' => trans('demo.accounts.cash'),
'enabled' => '1',
'created_from' => 'seed',
'created_from' => 'core::seed',
]));
setting()->set('default.account', $account->id);

View File

@ -70,7 +70,7 @@ class Categories extends Seeder
$income_category_id = $expense_category_id = 0;
foreach ($rows as $row) {
$row['created_from'] = 'seed';
$row['created_from'] = 'core::seed';
$category = $this->dispatch(new CreateCategory($row));

View File

@ -78,7 +78,7 @@ class Currencies extends Seeder
];
foreach ($rows as $row) {
$row['created_from'] = 'seed';
$row['created_from'] = 'core::seed';
$this->dispatch(new CreateCurrency($row));
}

View File

@ -45,7 +45,7 @@ class Dashboards extends Seeder
'App\Widgets\LatestExpenses',
],
'users' => $user_id,
'created_from' => 'seed',
'created_from' => 'core::seed',
]));
}
}

View File

@ -90,7 +90,7 @@ class EmailTemplates extends Seeder
'name' => $template['name'],
'subject' => trans('email_templates.' . $template['alias'] . '.subject'),
'body' => trans('email_templates.' . $template['alias'] . '.body'),
'created_from' => 'seed',
'created_from' => 'core::seed',
]));
}
}

View File

@ -68,7 +68,7 @@ class Reports extends Seeder
];
foreach ($rows as $row) {
$row['created_from'] = 'seed';
$row['created_from'] = 'core::seed';
$this->dispatch(new CreateReport($row));
}

View File

@ -52,6 +52,7 @@ class TestCompany extends Seeder
'wizard.completed' => '1',
'email.protocol' => 'array',
],
'created_from' => 'core::seed',
]));
$company->makeCurrent(true);