import { EntitySchema } from 'typeorm'

export type ClassEntity = {
  id: string
  name: string
  type: string
  familyPhoto: string | null
}

export const ClassEntitySchema = new EntitySchema<ClassEntity>({
  name: 'ClassEntity',
  tableName: 'classes',
  columns: {
    id: {
      type: String,
      primary: true
    },
    name: {
      type: String
    },
    type: {
      type: String,
      default: 'cheap'
    },
    familyPhoto: {
      name: 'family_photo',
      type: String,
      nullable: true
    }
  },
  relations: {}
})
