'array', 'is_active' => 'boolean', ]; /** Default blocks by template type */ public static function defaultBlocks(string $type = 'invoice_notification'): array { if ($type === 'vm_credentials') { return [ ['id' => 'greeting', 'type' => 'greeting', 'label' => 'Lời chào', 'enabled' => true, 'order' => 1, 'config' => []], ['id' => 'vm_credentials', 'type' => 'vm_credentials', 'label' => 'Thông tin truy cập VPS','enabled' => true, 'order' => 2, 'config' => [ 'fields' => ['service_host', 'service_username', 'service_port', 'service_password', 'os_name'], ]], ['id' => 'product_info', 'type' => 'product_info', 'label' => 'Thông tin sản phẩm', 'enabled' => true, 'order' => 3, 'config' => [ 'fields' => ['product_name', 'product_billing', 'product_price', 'service_due_exp'], ]], ['id' => 'custom_text', 'type' => 'custom_text', 'label' => 'Lời nhắn', 'enabled' => true, 'order' => 4, 'config' => [ 'content' => 'Nếu bạn có bất kỳ thắc mắc nào, vui lòng liên hệ với chúng tôi để được hỗ trợ.', ]], ['id' => 'footer', 'type' => 'footer', 'label' => 'Footer', 'enabled' => true, 'order' => 5, 'config' => []], ]; } // invoice_notification (default) return [ ['id' => 'greeting', 'type' => 'greeting', 'label' => 'Lời chào', 'enabled' => true, 'order' => 1, 'config' => []], ['id' => 'invoice_info', 'type' => 'invoice_info', 'label' => 'Thông tin hóa đơn', 'enabled' => true, 'order' => 2, 'config' => [ 'fields' => ['invoice_number', 'created_at', 'due_date', 'total', 'status'], ]], ['id' => 'customer_info','type' => 'customer_info','label' => 'Thông tin khách hàng', 'enabled' => false, 'order' => 3, 'config' => [ 'fields' => ['name', 'email'], ]], ['id' => 'order_items', 'type' => 'order_items', 'label' => 'Chi tiết sản phẩm', 'enabled' => true, 'order' => 4, 'config' => []], ['id' => 'attachments', 'type' => 'attachments', 'label' => 'File đính kèm', 'enabled' => true, 'order' => 5, 'config' => []], ['id' => 'custom_text', 'type' => 'custom_text', 'label' => 'Lời nhắn', 'enabled' => true, 'order' => 6, 'config' => [ 'content' => 'Nếu bạn có bất kỳ thắc mắc nào, vui lòng liên hệ với chúng tôi để được hỗ trợ.', ]], ['id' => 'footer', 'type' => 'footer', 'label' => 'Footer', 'enabled' => true, 'order' => 7, 'config' => []], ]; } /** Field definitions exposed per block type */ public static function blockFieldDefinitions(): array { return [ 'invoice_info' => [ ['key' => 'invoice_number', 'label' => 'Số hóa đơn'], ['key' => 'created_at', 'label' => 'Ngày tạo'], ['key' => 'due_date', 'label' => 'Hạn thanh toán'], ['key' => 'total', 'label' => 'Tổng tiền'], ['key' => 'sub_total', 'label' => 'Tiền dịch vụ'], ['key' => 'tax', 'label' => 'Thuế'], ['key' => 'status', 'label' => 'Trạng thái'], ['key' => 'payment_method', 'label' => 'Phương thức TT'], ], 'customer_info' => [ ['key' => 'name', 'label' => 'Tên khách hàng'], ['key' => 'email', 'label' => 'Email'], ['key' => 'address', 'label' => 'Địa chỉ'], ], 'vm_credentials' => [ ['key' => 'service_host', 'label' => 'Địa chỉ IP'], ['key' => 'service_username', 'label' => 'Username'], ['key' => 'service_port', 'label' => 'Port'], ['key' => 'service_password', 'label' => 'Mật khẩu'], ['key' => 'os_name', 'label' => 'Hệ điều hành'], ], 'product_info' => [ ['key' => 'product_name', 'label' => 'Tên sản phẩm'], ['key' => 'product_billing', 'label' => 'Chu kỳ thanh toán'], ['key' => 'product_price', 'label' => 'Giá dịch vụ'], ['key' => 'service_due_exp', 'label' => 'Ngày hết hạn'], ], ]; } }