diff --git a/packages/content/src/flows/cta_creation_default.flow.ts b/packages/content/src/flows/cta_creation_default.flow.ts index ac37ea8..ba1173a 100644 --- a/packages/content/src/flows/cta_creation_default.flow.ts +++ b/packages/content/src/flows/cta_creation_default.flow.ts @@ -28,7 +28,13 @@ export const CtaCreationDefaultFlow: Flow = { config: { objectName: 'content_piece', triggerType: 'record-after-create', - condition: '!isBlank(record.target_channels)', + // Supported operator (`!= null`) instead of isBlank(), which the + // runtime condition dialect does not evaluate. NOTE: `target_channels` + // is a multi-lookup (junction table), so it is not present on the + // after-create record row the condition sees — this flow therefore + // still won't fire until a fork promotes the channel link onto the + // piece or triggers off the junction. Single-channel forks work today. + condition: 'record.target_channels != null', }, }, { diff --git a/packages/content/src/flows/signal_to_topic_promotion.flow.ts b/packages/content/src/flows/signal_to_topic_promotion.flow.ts index 8c6640d..07bc5b1 100644 --- a/packages/content/src/flows/signal_to_topic_promotion.flow.ts +++ b/packages/content/src/flows/signal_to_topic_promotion.flow.ts @@ -28,7 +28,10 @@ export const SignalToTopicPromotionFlow: Flow = { config: { objectName: 'content_signal', triggerType: 'record-after-update', - condition: 'status == "promoted" && PRIOR(status) != "promoted"', + // Use `previous.status` (the proven record-change idiom) — PRIOR() is + // not evaluated by the runtime condition dialect, which silently + // skipped this flow so promotions never created a topic. + condition: 'status == "promoted" && previous.status != "promoted"', }, }, { diff --git a/packages/procurement/src/flows/pr_to_po_convert.flow.ts b/packages/procurement/src/flows/pr_to_po_convert.flow.ts index 3e308ed..0354c29 100644 --- a/packages/procurement/src/flows/pr_to_po_convert.flow.ts +++ b/packages/procurement/src/flows/pr_to_po_convert.flow.ts @@ -57,7 +57,11 @@ export const PRToPOConvertFlow: Flow = { total_amount: '{pr.estimated_amount}', received_amount: 0, cost_center: '{pr.cost_center}', - order_date: 'today()', + // order_date is intentionally left unset on the draft PO — the buyer + // sets it when sending (enforced by `sent_requires_order_date`). A + // literal 'today()' string is not a valid date and the runtime's + // date validation rejects it, which previously aborted the whole + // PR→PO conversion. expected_delivery: '{pr.needed_by}', notes: 'Auto-generated from PR {pr.request_number} ({pr.title}). Review line items before sending.', diff --git a/packages/procurement/src/objects/procurement_order.object.ts b/packages/procurement/src/objects/procurement_order.object.ts index 124619b..c60c2eb 100644 --- a/packages/procurement/src/objects/procurement_order.object.ts +++ b/packages/procurement/src/objects/procurement_order.object.ts @@ -106,8 +106,10 @@ export const PurchaseOrder = ObjectSchema.create({ }), order_date: Field.date({ label: 'Order Date', - required: true, + required: false, group: 'fulfillment', + description: + 'Set when the PO is sent to the vendor. Not required on a draft (a PR→PO conversion creates a draft without one); the `sent_requires_order_date` validation enforces it at send time.', }), expected_delivery: Field.date({ label: 'Expected Delivery',