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

@Schema()
export class payment extends Document {
    @Prop({ type: Types.ObjectId, ref: "users", default: null })
    vendor_id: Types.ObjectId = null

    @Prop({ type: Number, default: 0 })
    amount: number;

    @Prop({ type: String, default: null })
    status: string;

    @Prop({ type: String, default: null })
    currency: string;

    @Prop({ type: String, default: null })
    payment_method: string;

    @Prop({ type: Number, default: () => moment().utc().valueOf() })
    created_at: number;
}

export const paymentSchema = SchemaFactory.createForClass(payment);