feat(orders): manual order optionally creates a linked project
Add `create_project` flag (default true) to `CreateOrderSchema` and `CreateOrderData`. When true and `quotation_id` is absent, `createOrder` creates a `projects` row sharing the order's shared-pool number and `order_id` link — mirroring the from-quotation flow. The route audits the new project creation when it occurs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -216,6 +216,16 @@ export default async function ordersRoutes(
|
||||
entityId: result.id,
|
||||
description: `Vytvořena objednávka ${result.order_number}`,
|
||||
});
|
||||
if (result.project_id) {
|
||||
await logAudit({
|
||||
request,
|
||||
authData: request.authData,
|
||||
action: "create",
|
||||
entityType: "project",
|
||||
entityId: result.project_id,
|
||||
description: `Vytvořen projekt k objednávce ${result.order_number}`,
|
||||
});
|
||||
}
|
||||
return success(
|
||||
reply,
|
||||
{ id: result.id },
|
||||
|
||||
Reference in New Issue
Block a user