1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import { Document, Schema, Types } from 'mongoose';
export interface TransferSchema extends Document {
date: string;
operation: 'in' | 'out';
contractorId: string;
amount: number;
}
export const transferSchema = new Schema({
date: {
type: Date,
required: true,
},
operation: {
type: String,
required: true,
},
contractorId: {
type: Types.ObjectId,
required: true,
},
amount: {
type: Number,
required: true,
},
}, { timestamps: true });
|