import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
import { Document } from 'mongoose'

export type SiteConfigDocument = SiteConfig & Document

@Schema({ timestamps: true })
export class SiteConfig {
  @Prop({ required: true, unique: true })
  key: string

  @Prop({ required: true, type: Object })
  value: any

  @Prop({ default: '' })
  description?: string
}

export const SiteConfigSchema = SchemaFactory.createForClass(SiteConfig)
