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:
@@ -86,6 +86,10 @@ export const CreateOrderSchema = z.object({
|
||||
notes: z.string().nullish(),
|
||||
items: z.array(OrderItemSchema).optional(),
|
||||
sections: z.array(OrderSectionSchema).optional(),
|
||||
create_project: z
|
||||
.preprocess((v) => v === true || v === 1 || v === "1", z.boolean())
|
||||
.optional()
|
||||
.default(true),
|
||||
});
|
||||
|
||||
export const UpdateOrderSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user