Skip to content

Commit

Permalink
parking badges
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 23, 2023
1 parent db298b3 commit 582d9b7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
41 changes: 41 additions & 0 deletions app/Enums/BadgeRules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use App\Concerns\Enums\Arrayable;
use App\Concerns\Enums\Comparable;
use App\Concerns\Enums\HasLabel;

enum BadgeRules: string
{
use Arrayable;
use Comparable;
use HasLabel;

case ACTIVITY_REGISTER_AS_USER = 'activity_register_as_user';
case DONATION_FIRST_COUNTER_DONATION = 'donation_first_counter_donation';
case DONATION_THREE_COUNTER_DONATION = 'donation_three_counter_donation';
case DONATION_TEN_COUNTER_DONATION = 'donation_ten_counter_donation';
case DONATION_FIFTEEN_COUNTER_DONATION = 'donation_fifteen_counter_donation';
case DONATION_TWENTY_FIVE_COUNTER_DONATION = 'donation_twenty_five_counter_donation';
case DONATION_FIFTY_COUNTER_DONATION = 'donation_fifty_counter_donation';
case DONATION_ONE_HUNDRED_AMOUNT_DONATION = 'donation_one_hundred_amount_donation';
case DONATION_FIVE_HUNDRED_AMOUNT_DONATION = 'donation_five_hundred_amount_donation';
case DONATION_ONE_THOUSAND_AMOUNT_DONATION = 'donation_one_thousand_amount_donation';
case DONATION_ONE_THOUSAND_FIVE_HUNDRED_AMOUNT_DONATION = 'donation_one_thousand_five_hundred_amount_donation';
case DONATION_TWO_THOUSAND_AMOUNT_DONATION = 'donation_two_thousand_amount_donation';

case DONATION_THREE_TIME_SAME_ORGANIZATION = 'donation_three_time_same_organization';
case DONATION_TOP_DONOR_ON_PROJECT = 'donation_top_donor_on_project';
case SHARING_FIRST_SHARE = 'sharing_first_share';
case SHARING_FIVE_SHARES = 'sharing_five_shares';



public function labelKeyPrefix(): string
{
return 'badge.types';
}
}
1 change: 1 addition & 0 deletions app/Enums/BadgeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum BadgeType: string

case AUTOMATED = 'automated';
case MANUAL = 'manual';

public function labelKeyPrefix(): string
{
return 'badge.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function up(): void
$table->timestamps();
$table->foreignIdFor(BadgeCategory::class)->constrained()->cascadeOnDelete();
$table->string('title');
$table->string('rule')->nullable();
$table->string('type')->default(BadgeType::MANUAL->value);
$table->text('description')->nullable();
});
Expand Down
24 changes: 24 additions & 0 deletions database/migrations/2023_10_23_112317_import_automated_badges.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{

}

/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

0 comments on commit 582d9b7

Please sign in to comment.