Type Alias PrismaAllModelsCreate<PrismaClient>

PrismaAllModelsCreate<PrismaClient>: Readonly<Partial<{
    [Model in PrismaModelName<PrismaClient>]: Readonly<PrismaKeyedModelCreate<PrismaClient, Model>> | ReadonlyArray<Readonly<PrismaModelCreate<PrismaClient, Model>>>
}>>

Model create data stored by model name in either array or keyed form. Used in prisma.client.addData() from @augment-vir/node.

Type Parameters

import {PrismaKeyedModelCreate} from '@augment-vir/common';
import type {PrismaClient} from '@prisma/client';

const mockData: ModelCreateData<PrismaClient> = {
user: {
mockUser1: {
first_name: 'one',
id: 123,
// etc.
},
mockUser2: {
first_name: 'two',
id: 124,
auth_role: 'user',
// etc.
},
},
region: [
{
id: 1,
name: 'North America',
// etc.
},
{
id: 2,
name: 'Europe',
// etc.
},
],
};

@augment-vir/common