Unify Ads/RRSS approval flow and add personalized Meta creative regen.
Agency validates first then client; Meta copy is 5+5+1 with on-image vs feed layers, emojis on feed, and partial v2 by image/hook/support/copy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -68,7 +68,7 @@ export type DuePublishResult = {
|
||||
* Fetch and publish due items.
|
||||
* Criteria: scheduled_at <= now, cover present, and
|
||||
* - publish_status in (queued, failed), OR
|
||||
* - publish_status=idle AND status=aprobado
|
||||
* - publish_status=idle AND status=aprobada
|
||||
*/
|
||||
export async function processDuePipelinePublishes(opts?: {
|
||||
limit?: number;
|
||||
@@ -107,7 +107,7 @@ export async function processDuePipelinePublishes(opts?: {
|
||||
const q1 =
|
||||
`${base}/rest/v1/creative_pipeline?publish_status=in.(queued,failed)&${common}`;
|
||||
const q2 =
|
||||
`${base}/rest/v1/creative_pipeline?publish_status=eq.idle&status=eq.aprobado&${common}`;
|
||||
`${base}/rest/v1/creative_pipeline?publish_status=eq.idle&status=eq.aprobada&${common}`;
|
||||
|
||||
const [r1, r2] = await Promise.all([
|
||||
fetch(q1, { headers, cache: 'no-store' }),
|
||||
@@ -165,7 +165,7 @@ export async function processDuePipelinePublishes(opts?: {
|
||||
publish_status: 'publishing',
|
||||
publish_attempts: attempts,
|
||||
publish_error: null,
|
||||
status: 'aprobado',
|
||||
status: 'aprobada',
|
||||
});
|
||||
if (!lock.ok) {
|
||||
results.push({
|
||||
@@ -263,7 +263,7 @@ export async function processDuePipelinePublishes(opts?: {
|
||||
publish_status: 'published',
|
||||
publish_error: null,
|
||||
published_at: new Date().toISOString(),
|
||||
status: 'publicado',
|
||||
status: 'publicada',
|
||||
meta_ig_media_id: igMediaId,
|
||||
meta_fb_post_id: fbPostId,
|
||||
caption: cleanCaption || null,
|
||||
|
||||
Reference in New Issue
Block a user