community-relations/src/models/Proclamation.ts

38 lines
918 B
TypeScript
Raw Normal View History

2021-03-19 21:23:38 -04:00
import { Document, model, Schema } from 'mongoose';
export interface ProclamationInterface extends Document {
issuer: string;
subject: string;
body: string;
at: number;
oID: string;
results?: {
yea: number;
nay: number;
present: number;
absent: number;
};
msg: string;
processed?: boolean;
votedDirectors: string[];
}
const Proclamation = new Schema({
issuer: { type: String, required: true },
subject: { type: String, required: true },
body: { type: String, required: true },
at: { type: Number, required: true },
oID: { type: String, required: true, unique: true },
results: {
yea: Number,
nay: Number,
present: Number,
absent: Number,
},
msg: { type: String, required: true, unique: true },
processed: Boolean,
2021-03-24 00:15:53 -04:00
votedDirectors: { type: Array, required: true },
2021-03-19 21:23:38 -04:00
});
export default model<ProclamationInterface>('Proclamations', Proclamation);