Skip to main content
zerotal

Documentation


Documentation / @zerotal/testing / index / FactoryPayload

Type Alias: FactoryPayload<T>

FactoryPayload<T> = Omit<InsertPayload<T>, FKKeys<T> & keyof InsertPayload<T>> & Partial<Pick<InsertPayload<T>, FKKeys<T> & keyof InsertPayload<T>>>

Defined in: testing/src/factory.ts:28

The return type expected from a factory definition callback.

Like InsertPayload but with all foreign-key fields (*Id) made optional — they are injected at create-time via .for(model) or explicit overrides, so the factory definition does not need to supply them.

Non-FK required fields (title, body, name, email, …) remain required, giving the definition callback full type safety without false positives.

Type Parameters

T

T extends BaseModel