feat(overview): menambahkan point record ketika daftar di overview
This commit is contained in:
parent
c63144e412
commit
2f0a8fe2c6
@ -2,8 +2,10 @@
|
||||
|
||||
namespace App\Livewire\Member;
|
||||
|
||||
use App\Enums\PointRecordType;
|
||||
use App\Livewire\Forms\Studio\Loyalty\CustomerForm;
|
||||
use App\Models\Membership;
|
||||
use App\Models\PointRecord;
|
||||
use App\Models\Tier;
|
||||
use App\Traits\WithToast;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@ -52,6 +54,14 @@ public function save()
|
||||
'tier_id' => Tier::orderBy('min_points')->first()->id,
|
||||
'tier_points' => 10,
|
||||
]);
|
||||
|
||||
PointRecord::create([
|
||||
'user_id' => auth()->id(),
|
||||
'description' => 'Pendaftaran',
|
||||
'change' => 10,
|
||||
'is_addition' => true,
|
||||
'type' => PointRecordType::TIER,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user