Variable prismaModelCreateOmitIdConst

prismaModelCreateOmitId: typeof prismaModelCreateOmitId = ...

Use this to prevent the id property from being included when creating a mock record, allowing the database's internal auto-increment functionality to generate one. This is necessary when testing creation of new records because manually specified ids do not increment the auto incrementor.

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

export const mockUsers = {
user1: {
id: 1,
authRole: 'admin',
[prismaModelCreateOmitId]: true,
},
user2: {
id: 2,
authRole: 'admin',
[prismaModelCreateOmitId]: true,
},
} as const satisfies PrismaKeyedModelCreate<PrismaClient, 'User'>;

@augment-vir/common