import BaseModel from './BaseModel';
import { index, prop } from '@typegoose/typegoose';

class Reward {
    @prop({ required: true })
    id: number;
    @prop({ required: true })
    count: number;
}

@index({ sendTime: 1 })
export default class MailTemp extends BaseModel {

    @prop({ required: true })
    gmmailId: string;

    @prop({ required: true })
    contentId: number;                  // dic_email_content.json中的id

    @prop({ required: true })
    sendTime: number;

    @prop({ required: true })
    endTime: number;

    @prop({ required: true })
    title: string;                   // 标题

    @prop({ required: true })
    sendName: string;                   // 发件人

    @prop({ required: true })
    content: string;                   // 内容

    @prop({ required: true })
    hasGoods: boolean;

    @prop({ required: true, type: Reward, default: [], _id: false })
    goods: Array<Reward>;

}