councilstake.js 1.2 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. var __assign = (this && this.__assign) || function () {
  3. __assign = Object.assign || function(t) {
  4. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5. s = arguments[i];
  6. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  7. t[p] = s[p];
  8. }
  9. return t;
  10. };
  11. return __assign.apply(this, arguments);
  12. };
  13. exports.__esModule = true;
  14. var db_1 = require("../db");
  15. var sequelize_1 = require("sequelize");
  16. var Stake = db_1["default"].define('consulstake', {
  17. stake: sequelize_1.DataTypes.INTEGER
  18. });
  19. Stake.findAllWithIncludes = function () {
  20. return this.findAll({
  21. include: [{ model: db_1["default"].models.consul }, { model: db_1["default"].models.member }]
  22. });
  23. };
  24. Stake.findByIdWithIncludes = function (id, args) {
  25. return this.findByPk(id, __assign(__assign({}, args), { include: [{ model: db_1["default"].models.consul }, { model: db_1["default"].models.member }] }));
  26. };
  27. Stake.findWithIncludes = function (args) {
  28. return this.findAll(__assign(__assign({}, args), { include: [{ model: db_1["default"].models.consul }, { model: db_1["default"].models.member }] }));
  29. };
  30. exports["default"] = Stake;