Pular para o conteúdo principal

nextSuggestedPostsToCreate

@raizfc/contracts


@raizfc/contracts / nextSuggestedPostsToCreate

Function: nextSuggestedPostsToCreate()

nextSuggestedPostsToCreate(candidates, existingIds, nowIso): readonly Readonly<{ createdAt: string; decidedAt?: string; decidedBy?: string; id: string; kind: FeedMatchCardKind; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; rejectionReason?: string; sourceMatchId: string; status: SuggestedPostStatus; targetRoute: string; teamId: string; text: string; title: string; version: number; }>[]

Defined in: engagement/feed-suggestion.dto.ts:112

Reconciles freshly-computed candidates against already-materialized suggestion ids (SPEC-API-ENGAGEMENT-001 "generation request idempotente"): only genuinely new candidates are returned for persistence — a suggestion already suggested/approved/rejected is never recreated or overwritten, so a manager's pending decision (or already-made one) can't be reset by the next lazy reconciliation pass.

Parameters

candidates

readonly (Omit<Readonly<{ createdAt: string; decidedAt?: string; decidedBy?: string; id: string; kind: FeedMatchCardKind; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; rejectionReason?: string; sourceMatchId: string; status: SuggestedPostStatus; targetRoute: string; teamId: string; text: string; title: string; version: number; }>, "status" | "createdAt" | "version"> | undefined)[]

existingIds

ReadonlySet<string>

nowIso

string

Returns

readonly Readonly<{ createdAt: string; decidedAt?: string; decidedBy?: string; id: string; kind: FeedMatchCardKind; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; rejectionReason?: string; sourceMatchId: string; status: SuggestedPostStatus; targetRoute: string; teamId: string; text: string; title: string; version: number; }>[]