feat(admin): IP pool allocation, billing exports, service attachments
- IP pool: sheet import (xlsx/csv) matched by address, bulk allocate/revoke with notification email (ip_allocated/ip_revoked), ip_pool_logs history. - Orders/invoices: Excel export on branded template (BrandedReportWriter), shared billing filters, order item service info in list responses. - Web design quote Excel export; activity log export. - Service attachments with copy-to-invoice; deployment invoice attachments. - Customer email attachments stored on disk and attached by path. - Admin password change endpoint; user.fullname backfill migration; orders.user_id backfill from logs. - Disable deploy workflow until CI/CD is set up. - Ignore stored customer email and service attachment uploads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ea5697cb81
commit
46aa138eec
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Concerns;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
trait FiltersBillingRecords
|
||||
{
|
||||
/**
|
||||
* @param array<string, int> $aliases
|
||||
*/
|
||||
private function whereStatus(Builder $query, mixed $status, array $aliases): Builder
|
||||
{
|
||||
$values = collect((array) $status)
|
||||
->reject(fn ($value) => $value === null || $value === '' || $value === 'full')
|
||||
->map(fn ($value) => $aliases[$value] ?? (int) $value)
|
||||
->unique()
|
||||
->values();
|
||||
|
||||
return $values->isEmpty() ? $query : $query->whereIn('status', $values->all());
|
||||
}
|
||||
|
||||
private function whereCreatedBetween(Builder $query, ?string $from, ?string $to): Builder
|
||||
{
|
||||
return $query
|
||||
->when($from, fn (Builder $q) => $q->where('created_at', '>=', Carbon::parse($from)->startOfDay()))
|
||||
->when($to, fn (Builder $q) => $q->where('created_at', '<=', Carbon::parse($to)->endOfDay()));
|
||||
}
|
||||
|
||||
private function whereOrderItemNameLike(Builder $query, string $orderItemsRelation, string $search): Builder
|
||||
{
|
||||
return $query->orWhereHas($orderItemsRelation, fn (Builder $items) => $items
|
||||
->where('server_name', 'like', "%{$search}%")
|
||||
->orWhere('domain_name', 'like', "%{$search}%"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user