summaryrefslogtreecommitdiff
path: root/src/models/account/account.schema.ts
blob: 3ce398311ef94f0c7f4187bd06b36508fa7de2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 });