Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
523 B
0
Indexable
Never
// src/platform/platform.model.ts

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

export type PlatformDocument = Platform & Document;

@Schema()
export class Platform {
  @Prop({ required: true })
  name: string;

  @Prop()
  image: string;

  @Prop({ enum: ['web', 'android', 'apple', 'desktop'], required: true })
  type: string;

  @Prop({ type: Date, default: Date.now })
  timestamp: Date;
}

export const PlatformSchema = SchemaFactory.createForClass(Platform);