feat: bật/tắt yêu cầu hoàn tất hồ sơ, xoá dịch vụ kèm đơn/hoá đơn, sync tên VM đã gán

- setting.require_complete_profile (mặc định bật), trả qua GET v1/setting
- bulkDeleteServices xoá mềm invoice nâng cấp + order mồ côi (ServiceOrderRecorder::discardOrder)
- createService trỏ dịch vụ sang order mới thì bỏ order cũ
- SyncVirtualMachine cập nhật name + gắn virtual_machine_id cho module_vmware

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-15 08:04:02 +07:00
co-authored by Claude Opus 5.5
parent bf78f3b810
commit 0bd15f6018
9 changed files with 198 additions and 9 deletions
+14 -1
View File
@@ -13,8 +13,21 @@ final class PublicSetting
*/
public static function values(): array
{
$value = json_decode((string) Setting::where('key', 'setting')->value('value'), true) ?: [];
$value = self::raw();
return array_map(fn (string $field) => (string) ($value[$field] ?? ''), array_combine(self::FIELDS, self::FIELDS));
}
public static function requireCompleteProfile(): bool
{
return (bool) (self::raw()['require_complete_profile'] ?? true);
}
/**
* @return array<string, mixed>
*/
private static function raw(): array
{
return json_decode((string) Setting::where('key', 'setting')->value('value'), true) ?: [];
}
}