Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/content/src/flows/cta_creation_default.flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
{
Expand Down
5 changes: 4 additions & 1 deletion packages/content/src/flows/signal_to_topic_promotion.flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
},
},
{
Expand Down
6 changes: 5 additions & 1 deletion packages/procurement/src/flows/pr_to_po_convert.flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
4 changes: 3 additions & 1 deletion packages/procurement/src/objects/procurement_order.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading