dbl-coins-invest
Version:
Sharade DBL package over other coins invest services
31 lines (27 loc) • 766 B
JavaScript
import { Investment } from "./models";
import DBL from "./dbl";
import { Portfolio } from "./models/portfolio";
export default class InvestmentService extends DBL {
constructor(userSub) {
super();
this.userSub = userSub;
this.model = Investment;
}
getAll() {
return Account.findAll({
include: [{
model: User,
as: 'Users',
where: {userSub: this.userSub}
},
{
model: Portfolio,
as: 'Portfolios',
where: {
id: 1,//portfolioId
}, include: [{model: Investment, as: 'Investments'}]
}
]
})
}
}