Compare commits
No commits in common. "9b2364bc3409fdc9406dd69444e0c48f292d3923" and "6fd16a7dfe7e312b55d534d776954358170492c9" have entirely different histories.
9b2364bc34
...
6fd16a7dfe
|
@ -48,7 +48,6 @@ class FilterScope extends Filter
|
||||||
*/
|
*/
|
||||||
public function apply(Builder $query): Builder
|
public function apply(Builder $query): Builder
|
||||||
{
|
{
|
||||||
return $query->where(function ($query) {
|
|
||||||
$query->orWhere(function ($query) {
|
$query->orWhere(function ($query) {
|
||||||
if ($this->ausstand) {
|
if ($this->ausstand) {
|
||||||
$query->whereAusstand();
|
$query->whereAusstand();
|
||||||
|
@ -78,6 +77,7 @@ class FilterScope extends Filter
|
||||||
$query->whereIn('id', $this->additional);
|
$query->whereIn('id', $this->additional);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
return $query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,6 @@ class CreateActivitiesTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('activity_subactivity');
|
|
||||||
Schema::dropIfExists('subactivities');
|
|
||||||
Schema::dropIfExists('activities');
|
Schema::dropIfExists('activities');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,5 @@ class CreatePaymentsTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('payments');
|
Schema::dropIfExists('payments');
|
||||||
Schema::dropIfExists('statuses');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ class CreateCoursesTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('course_members');
|
|
||||||
Schema::dropIfExists('courses');
|
Schema::dropIfExists('courses');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,4 @@ class CreateSettingsTable extends Migration
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('settings');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@ class CreateGroupsParentIdColumn extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('groups', function (Blueprint $table) {
|
Schema::table('groups', function (Blueprint $table) {
|
||||||
$table->dropForeign(['parent_id']);
|
$table->dropForeign(['group_id']);
|
||||||
$table->dropColumn('parent_id');
|
$table->dropColumn('group_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,6 @@ return new class() extends Migration {
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('members', function (Blueprint $table) {
|
Schema::table('members', function (Blueprint $table) {
|
||||||
$table->dropColumn('ps_at');
|
|
||||||
$table->dropColumn('more_ps_at');
|
|
||||||
$table->dropColumn('without_education_at');
|
|
||||||
$table->dropColumn('without_efz_at');
|
|
||||||
$table->dropColumn('has_svk');
|
|
||||||
$table->dropColumn('has_vk');
|
|
||||||
$table->dropColumn('multiply_pv');
|
|
||||||
$table->dropColumn('multiply_more_pv');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,9 +27,6 @@ return new class() extends Migration {
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->dropUnique(['email']);
|
|
||||||
$table->dropColumn('email_verified_at');
|
|
||||||
$table->dropColumn('remember_token');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,8 +24,5 @@ return new class() extends Migration {
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('members', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('slug');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,8 +24,5 @@ return new class() extends Migration {
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('memberships', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('promised_at');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Payment\SubscriptionChild;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
@ -12,6 +13,8 @@ return new class() extends Migration {
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
$subscriptions = DB::table('subscriptions')->get();
|
||||||
|
|
||||||
Schema::table('subscriptions', function (Blueprint $table) {
|
Schema::table('subscriptions', function (Blueprint $table) {
|
||||||
$table->dropColumn('amount');
|
$table->dropColumn('amount');
|
||||||
$table->boolean('split')->default(false);
|
$table->boolean('split')->default(false);
|
||||||
|
@ -24,6 +27,14 @@ return new class() extends Migration {
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->unsignedInteger('amount');
|
$table->unsignedInteger('amount');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
foreach ($subscriptions as $subscription) {
|
||||||
|
SubscriptionChild::create([
|
||||||
|
'parent_id' => $subscription->id,
|
||||||
|
'name' => 'name',
|
||||||
|
'amount' => $subscription->amount,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,11 +44,5 @@ return new class() extends Migration {
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('subscription_children');
|
|
||||||
Schema::table('subscriptions', function (Blueprint $table) {
|
|
||||||
$table->unsignedInteger('amount');
|
|
||||||
$table->dropColumn('split');
|
|
||||||
$table->dropColumn('for_promise');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,9 +13,6 @@
|
||||||
<testsuite name="NamiUnit">
|
<testsuite name="NamiUnit">
|
||||||
<directory suffix="Test.php">./packages/laravel-nami/tests/Unit</directory>
|
<directory suffix="Test.php">./packages/laravel-nami/tests/Unit</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="EndToEnd">
|
|
||||||
<directory suffix="Test.php">./tests/EndToEnd</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\EndToEnd;
|
|
||||||
|
|
||||||
use App\Group;
|
|
||||||
use App\Member\Member;
|
|
||||||
use App\Payment\Payment;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
use Tests\RequestFactories\Child;
|
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class MemberIndexTest extends TestCase
|
|
||||||
{
|
|
||||||
use DatabaseMigrations;
|
|
||||||
|
|
||||||
public function testItHandlesFullTextSearch(): void
|
|
||||||
{
|
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
|
||||||
$group = Group::factory()->create();
|
|
||||||
Member::factory()->defaults()->for($group)->create(['firstname' => '::firstname::']);
|
|
||||||
Member::factory()->defaults()->for($group)->create(['firstname' => '::gggname::']);
|
|
||||||
|
|
||||||
$response = $this->callFilter('member.index', ['search' => '::firstname::']);
|
|
||||||
|
|
||||||
$this->assertCount(1, $this->inertia($response, 'data.data'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItFiltersForSearchButNotForPayments(): void
|
|
||||||
{
|
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
|
||||||
$group = Group::factory()->create();
|
|
||||||
Member::factory()->defaults()->for($group)
|
|
||||||
->has(Payment::factory()->notPaid()->subscription('tollerbeitrag', [
|
|
||||||
new Child('a', 5400),
|
|
||||||
]))
|
|
||||||
->create(['firstname' => '::firstname::']);
|
|
||||||
Member::factory()->defaults()->for($group)->create(['firstname' => '::firstname::']);
|
|
||||||
|
|
||||||
$response = $this->callFilter('member.index', ['search' => '::firstname::', 'ausstand' => true]);
|
|
||||||
|
|
||||||
$this->assertCount(1, $this->inertia($response, 'data.data'));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue