From b4b18cd44d20901914e2cec2de5d8ffca668f2b6 Mon Sep 17 00:00:00 2001 From: Nikola Petrov Date: Tue, 16 Jul 2024 15:06:58 +0200 Subject: [PATCH] UP model -> ts --- models/cashTransactionModel.js | 14 -------------- models/cashTransactionModel.ts | 15 +++++++++++++++ models/mediaModel.js | 15 --------------- models/mediaModel.ts | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 models/cashTransactionModel.js create mode 100644 models/cashTransactionModel.ts delete mode 100644 models/mediaModel.js create mode 100644 models/mediaModel.ts diff --git a/models/cashTransactionModel.js b/models/cashTransactionModel.js deleted file mode 100644 index 7d63553..0000000 --- a/models/cashTransactionModel.js +++ /dev/null @@ -1,14 +0,0 @@ -var mongoose = require('mongoose'); -var Schema = mongoose.Schema; - -var cashTransaction = new Schema({ - 'raw': String, - 'day': Number, - 'month': Number, - 'year': Number, - 'amount': Number, - 'type': Number, - 'company': String, -}); - -module.exports = mongoose.model('cashTransaction', cashTransaction); diff --git a/models/cashTransactionModel.ts b/models/cashTransactionModel.ts new file mode 100644 index 0000000..e71ca90 --- /dev/null +++ b/models/cashTransactionModel.ts @@ -0,0 +1,15 @@ +import mongoose, { Schema } from 'mongoose'; + +const cashTransaction = new Schema({ + 'raw': String, + 'day': Number, + 'month': Number, + 'year': Number, + 'amount': Number, + 'type': Number, + 'company': String, +}); + +const CashTransaction = mongoose.model('cashTransaction', cashTransaction); + +export default CashTransaction; diff --git a/models/mediaModel.js b/models/mediaModel.js deleted file mode 100644 index 18121ce..0000000 --- a/models/mediaModel.js +++ /dev/null @@ -1,15 +0,0 @@ -var mongoose = require('mongoose'); -var Schema = mongoose.Schema; - -var mediaSchema = new Schema({ - 'title': String, - 'released': String, - 'webImg': String, - 'code': String -}); - -module.exports = { - MovieModel: mongoose.model('movie', mediaSchema), - SeriesModel: mongoose.model('series', mediaSchema), - GameModel: mongoose.model('game', mediaSchema) -}; \ No newline at end of file diff --git a/models/mediaModel.ts b/models/mediaModel.ts new file mode 100644 index 0000000..b284c4b --- /dev/null +++ b/models/mediaModel.ts @@ -0,0 +1,14 @@ +import mongoose, { Schema } from 'mongoose'; + +const mediaSchema = new Schema({ + 'title': String, + 'released': String, + 'webImg': String, + 'code': String +}); + +const MovieModel = mongoose.model('movie', mediaSchema); +const SeriesModel = mongoose.model('series', mediaSchema); +const GameModel = mongoose.model('game', mediaSchema); + +export { MovieModel, SeriesModel, GameModel }; \ No newline at end of file