From ad530510a4aba72f3074f1a7dec82cc9018db7b4 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 19 Mar 2021 23:57:18 +0300 Subject: feat: add Transfers service --- src/models/transfer/transfer.schema.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/models/transfer/transfer.schema.ts (limited to 'src/models/transfer/transfer.schema.ts') 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 }); + -- cgit v1.2.3