Notification service #35

Merged
bilal.catic merged 26 commits from notification-service into master 2019-09-30 16:23:40 +02:00
Showing only changes of commit 12f826ef55 - Show all commits

View File

@@ -0,0 +1,23 @@
"use strict";
const db = require("../../models/index");
const findRealEstatesForSearchRequest = async searchRequestId => {
const query = {
searchRequestId
};
const include = [{ model: db.RealEstate }];
return await db.SearchRequestMatch.findAll({ where: query, include });
};
const addMatches = async matchingRecords => {
return await db.SearchRequestMatch.bulkCreate(matchingRecords, {
ignoreDuplicates: true
});
};
module.exports = {
findRealEstatesForSearchRequest,
addMatches
};