kimjbstar/prisma-class-generator

Prisma type and enum are not generated

ArkasDev opened this issue · 0 comments

Unfortunately types and enums are not generated. This unfortunately makes the use of the generator completely useless.

TSError: ⨯ Unable to compile TypeScript: [0] src/data/gen/user.ts(26,20): error TS2304: Cannot find name 'DeliveryAddress'.

generator client {
  provider = "prisma-client-js"
}

generator prismaClassGenerator {
  provider               = "prisma-class-generator"
  dryRun                 = false
  separateRelationFields = false
  output                 = "./gen"
}

datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

model User {
  id                String           @id @default(auto()) @map("_id") @db.ObjectId
  email             String           @unique @map("_email")
  deliveryAddress   DeliveryAddress?
  state             UserState?
}

enum UserState {
  QUEUE
  ACTIVE
}

type DeliveryAddress {
  firstName             String
  lastName              String
  streetName            String
  streetNumber          String
  postalCode            String
  city                  String
  countryId             Int
  phone                 String
  additionalInformation String
}