summaryrefslogtreecommitdiff
path: root/src/models/account/account.schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/account/account.schema.ts')
-rw-r--r--src/models/account/account.schema.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/models/account/account.schema.ts b/src/models/account/account.schema.ts
new file mode 100644
index 0000000..3ce3983
--- /dev/null
+++ b/src/models/account/account.schema.ts
@@ -0,0 +1,23 @@
+import { Document, Schema } from 'mongoose';
+
+export interface AccountSchema extends Document {
+ name: string;
+ code: string;
+ balance: number;
+}
+
+export const accountSchema = new Schema({
+ name: {
+ type: String,
+ required: true,
+ },
+ code: {
+ type: String,
+ required: true,
+ },
+ balance: {
+ type: Number,
+ default: 0,
+ },
+}, { timestamps: true });
+