diff options
Diffstat (limited to 'src/models/transfer/transfer.schema.ts')
-rw-r--r-- | src/models/transfer/transfer.schema.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/models/transfer/transfer.schema.ts b/src/models/transfer/transfer.schema.ts new file mode 100644 index 0000000..ebdb6ab --- /dev/null +++ b/src/models/transfer/transfer.schema.ts @@ -0,0 +1,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 }); + |