Add new file
parent
4b1c61f6e4
commit
d5eb391ec6
|
@ -0,0 +1,29 @@
|
||||||
|
import { Document, model, Schema } from 'mongoose';
|
||||||
|
|
||||||
|
export interface ProclamationInterface extends Document {
|
||||||
|
issuedBy: string;
|
||||||
|
subject: string;
|
||||||
|
body: string;
|
||||||
|
at: Date;
|
||||||
|
oID: string;
|
||||||
|
voteResults: {
|
||||||
|
yea: number;
|
||||||
|
nay: number;
|
||||||
|
};
|
||||||
|
acceptedAt: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Proclamation = 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,
|
||||||
|
},
|
||||||
|
acceptedAt: Number,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default model<ProclamationInterface>('Proclamations', Proclamation);
|
Loading…
Reference in New Issue