From d5eb391ec62b2add8da179d5829430a5933163b1 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:10:25 -0500 Subject: [PATCH] Add new file --- src/models/proclamation | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/models/proclamation diff --git a/src/models/proclamation b/src/models/proclamation new file mode 100644 index 0000000..fa0b9fb --- /dev/null +++ b/src/models/proclamation @@ -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('Proclamations', Proclamation);