一键导入
docuware
DocuWare document management integration patterns. Use when working with DocuWare connector, webhooks, document imports, or app/Services/DocuWare/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
DocuWare document management integration patterns. Use when working with DocuWare connector, webhooks, document imports, or app/Services/DocuWare/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | docuware |
| description | DocuWare document management integration patterns. Use when working with DocuWare connector, webhooks, document imports, or app/Services/DocuWare/. |
| compatible_agents | ["architect","implement","refactor","review"] |
app/Services/DocuWare/ or related import jobs.codebar-ag/laravel-docuware package is installed.config/laravel-docuware.php.DocumentImport model, migration, and queue job exist.Invoice fields).codebar-ag/laravel-docuware package (not raw Saloon)CodebarAg\DocuWare\Connectors\DocuWareConnector with ConfigWithCredentialsconfig('laravel-docuware.credentials.*') — never env() directlyapp/Services/DocuWare/DocuWareService.phpfetchDocument(), downloadAndStore(), mapToInvoiceData(), processImport()config/docuware-fields.phpDB::transaction() for model creation + import status updatesource_document_id already existsPOST /api/docuware/webhook receives payloadVerifyDocuWareSignature middlewaresource_document_id, document_type, event, timestamps as needed)DocumentImport record with status pendingProcessDocuWareImport queued jobDocumentImport model tracks: pending → processing → completed / failedDB::transaction() when creating model and updating import status together// DocuWareService — optional connector for testability
class DocuWareService
{
public function __construct(?DocuWareConnector $connector = null)
{
$this->connector = $connector ?? new DocuWareConnector();
}
public function processImport(DocumentImport $import): void
{
if (! config('laravel-docuware.credentials.api_url')) {
throw new DocuWareNotConfiguredException();
}
$import->update(['status' => 'processing']);
try {
DB::transaction(function () use ($import) {
$document = $this->fetchDocument($import->source_document_id);
$data = $this->mapToInvoiceData($document);
validator($data, [
'customer_id' => ['required', 'integer', 'exists:customers,id'],
'amount' => ['required', 'numeric'],
'status' => ['required', 'string'],
])->validate();
$model = Invoice::create($data);
$import->update(['status' => 'completed', 'importable_id' => $model->id]);
activity()->performedOn($import)->log('Document import completed.');
});
} catch (Throwable $e) {
Log::warning('DocuWare import failed.', [
'import_id' => $import->id,
'source_document_id' => $import->source_document_id,
'message' => $e->getMessage(),
]);
$import->update(['status' => 'failed']);
throw $e;
}
}
}
// Duplicate detection before processing
if (DocumentImport::where('source_document_id', $payload['id'])->exists()) {
return response()->json(['status' => 'skipped'], 200);
}
DocuWareConnector and inject it into DocuWareService.pending to processing to completed/failed).import_id and source_document_id).env() directly for DocuWare credentials — use config()DB::transaction() when creating models and updating import statusfailed, and re-throw when neededsource_document_idServices/SKILL.md — service class conventionsJobs/SKILL.md — queued job for ProcessDocuWareImportReadonly data containers with typed factory methods (`fromArray`, `fromModel`, `fromCollection`, `fromRequest`) used to pass structured data between application layers — especially for external API responses, Eloquent models, and service boundaries. Use this skill whenever creating, reviewing, or refactoring DTOs, Data Transfer Objects, value objects for inter-layer communication, or mapping payloads from APIs, models, or collections into typed PHP objects. Also trigger when the user mentions spatie/laravel-data alternatives, data mapping, or payload normalization in a Laravel context.
Eloquent model conventions for mass assignment, casts, relationship naming, activity logging, and mandatory model tests (CRUD + relations).
Single-purpose business logic classes that encapsulate one well-defined business operation. Actions are the primary location for business logic in Laravel applications, invoked from controllers, commands, or jobs.
Albatros accounting API integration via Saloon. Use when working with app/Services/Albatros/, AlbatrosConnector, or Albatros DTOs.
Laravel Blade template conventions covering components, output escaping, security, structure, and formatting.
Artisan console command classes that serve as the CLI entry point for operations. Commands validate input and delegate all business logic to Actions or Services.