cr-database/models/Merchant.ts

25 lines
479 B
TypeScript
Raw Normal View History

2021-12-25 13:37:42 -05:00
import { Document, Schema, model } from 'mongoose';
export interface MerchantInterface extends Document {
name: string,
key: string,
privileged: boolean,
/**
* type
* - 0: soft
* - 1: hard
*/
type: 0 | 1;
pulls: [{ type: 0 | 1, reason: string, date: Date }],
}
const Merchant: Schema = new Schema({
name: String,
key: String,
privileged: Boolean,
type: Number,
pulls: Array,
});
export default model<MerchantInterface>('Merchant', Merchant);