community-relations/src/models/Resolution.ts

34 lines
765 B
TypeScript
Raw Normal View History

2021-02-07 20:58:26 -05:00
import { Document, model, Schema } from 'mongoose';
export interface ResolutionInterface extends Document {
issuedBy: string;
subject: string;
body: string;
at: Date;
oID: string;
voteResults: {
yea: number;
nay: number;
present: number;
absent: number;
};
acceptedAt: number;
}
const Resolution = new Schema({
issuedBy: { type: String, required: true },
subject: { type: String, required: true },
body: { type: String, required: true },
at: { type: Date, required: true },
oID: { type: String, required: true, unique: true },
voteResults: {
yea: Number,
Nay: Number,
present: Number,
absent: Number,
},
acceptedAt: Number,
});
export default model<ResolutionInterface>('Resolutions', Resolution);