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:
baodev0
2026-10-15 19:58:36 +07:00
co-authored by Claude Opus 5.5
parent ea5697cb81
commit 46aa138eec
95 changed files with 4247 additions and 454 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class BillingExportRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'filter' => 'nullable|string|max:255',
'status' => 'nullable|array',
'status.*' => 'integer|between:0,5',
'date_from' => 'nullable|date',
'date_to' => 'nullable|date|after_or_equal:date_from',
'customer_id' => 'nullable|integer',
'payment_method' => 'nullable|string|max:50',
'invoice_type' => 'nullable|integer|in:1,2,3',
];
}
}
@@ -0,0 +1,54 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;
use Illuminate\Validation\Validator;
class UpdateAdminPasswordRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'current_password' => ['required', 'string'],
'password' => [
'required',
'string',
Password::min(10),
'confirmed',
'different:current_password',
],
];
}
public function after(): array
{
return [
function (Validator $validator): void {
$user = $this->user('admin');
if ($user && ! Hash::check((string) $this->input('current_password'), $user->password)) {
$validator->errors()->add('current_password', 'Mật khẩu hiện tại không chính xác.');
}
},
];
}
public function messages(): array
{
return [
'current_password.required' => 'Vui lòng nhập mật khẩu hiện tại.',
'password.required' => 'Vui lòng nhập mật khẩu mới.',
'password.min' => 'Mật khẩu mới phải có ít nhất 10 ký tự.',
'password.confirmed' => 'Xác nhận mật khẩu mới không khớp.',
'password.different' => 'Mật khẩu mới phải khác mật khẩu hiện tại.',
];
}
}
+1 -2
View File
@@ -15,8 +15,7 @@ class UpdateProfileRequest extends FormRequest
public function rules(): array
{
return [
'firstname' => 'required|string|max:255',
'lastname' => 'required|string|max:255',
'fullname' => 'required|string|min:2|max:255',
'phone' => 'nullable|string|max:20',
'department' => ['nullable', Rule::in(['IT', 'Sale', 'Marketing', 'Customer Service', 'Accounting', 'Management'])],
'start_date' => 'nullable|date',