summaryrefslogtreecommitdiff
path: root/src/models/Log.ts
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@hey.com>2023-10-06 12:32:37 +0100
committerRaphael Kabo <raphaelkabo@hey.com>2023-10-06 12:32:37 +0100
commit63cf813f4a284cfaec8114c623d13e9d650569f6 (patch)
tree655185cce75f8d6632f8761e62c64bd53be71da9 /src/models/Log.ts
parent6e5e2e5fc55f5ff1c78c41d0acbdcf82221fc2cf (diff)
Add Typescript interfaces for Mongoose models
Diffstat (limited to 'src/models/Log.ts')
-rwxr-xr-xsrc/models/Log.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/models/Log.ts b/src/models/Log.ts
new file mode 100755
index 0000000..8f905fd
--- /dev/null
+++ b/src/models/Log.ts
@@ -0,0 +1,33 @@
+import mongoose from "mongoose";
+
+export interface ILog extends mongoose.Document {
+ status: string;
+ process: string;
+ message: string;
+ timestamp: Date;
+}
+
+const LogSchema = new mongoose.Schema({
+ status: {
+ type: String,
+ trim: true,
+ required: true,
+ },
+ process: {
+ type: String,
+ trim: true,
+ required: true,
+ },
+ message: {
+ type: String,
+ trim: true,
+ required: true,
+ },
+ timestamp: {
+ type: Date,
+ trim: true,
+ required: true,
+ },
+});
+
+export default mongoose.model<ILog>("Log", LogSchema);