mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-28 07:43:18 +00:00
feat: add payment tracking to user profiles
- Added a check to update the 'paid' status of a user's paymentEvents if the current year's payment has been made - Updated the user profile view to display past payments - Added 'paymentEvents' to the query in EinundzwanzigPlebTable.php to fetch the current year's payments - Added a 'payment' column to the table in EinundzwanzigPlebTable.php to display the amount of the user's current year's payment
This commit is contained in:
@@ -49,6 +49,7 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
||||
return EinundzwanzigPleb::query()
|
||||
->with([
|
||||
'profile',
|
||||
'paymentEvents' => fn($query) => $query->where('year', date('Y')),
|
||||
])
|
||||
->where('association_status', '>', 1)
|
||||
->orWhereNotNull('application_for');
|
||||
@@ -74,6 +75,11 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
||||
$model->application_for,
|
||||
)->label() . '</div></div>' : '',
|
||||
)
|
||||
->add(
|
||||
'payment',
|
||||
fn(EinundzwanzigPleb $model)
|
||||
=> $model->paymentEvents->count() > 0 ? $model->paymentEvents->first()->amount : 'keine Zahlung vorhanden',
|
||||
)
|
||||
->add(
|
||||
'npub',
|
||||
fn(EinundzwanzigPleb $model)
|
||||
@@ -112,6 +118,9 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
||||
->visibleInExport( visible: true)
|
||||
->sortable(),
|
||||
|
||||
Column::make('Beitrag ' . date('Y'), 'payment')
|
||||
->visibleInExport( visible: true),
|
||||
|
||||
Column::make('Bewirbt sich für', 'for', 'application_for')
|
||||
->visibleInExport( visible: false)
|
||||
->sortable(),
|
||||
|
||||
Reference in New Issue
Block a user