UNPKG

sequelize-ts-boilerplate

Version:

A REST API scaffolding tool designed to scale and easily generate CRUD endpoints based on database schema design

46 lines 3.54 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const Order2EntityMap_PendingSupplier_1 = require("../persistent-classes/Order2EntityMap_PendingSupplier"); class Order2EntityMap_PendingSupplierService { constructor() { /*** generated service methods here ***/ this.findAllOrder2EntityMap_PendingSuppliers = () => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.findAll({ raw: true }); }); this.findAllOrder2EntityMap_PendingSuppliersByOid = (Oid) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.findAll({ where: { Oid }, raw: true }); }); this.findOneOrder2EntityMap_PendingSupplierByOid = (Oid) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.findOne({ where: { Oid }, raw: true }); }); this.updateOrder2EntityMap_PendingSupplier = (order2entitymap_pendingsupplier) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.update(Object.assign({}, order2entitymap_pendingsupplier), { where: { Oid: order2entitymap_pendingsupplier['Oid'] } }); }); this.saveOrder2EntityMap_PendingSupplier = (order2entitymap_pendingsupplier) => __awaiter(this, void 0, void 0, function* () { return yield new Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier(Object.assign({}, order2entitymap_pendingsupplier)).save(); }); this.batchSaveOrder2EntityMap_PendingSuppliers = (order2entitymap_pendingsuppliers) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.bulkCreate(order2entitymap_pendingsuppliers.map((x) => { // do work here return Object.assign({}, x); })); }); this.deleteOrder2EntityMap_PendingSupplierByOid = (Oid) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.destroy({ where: { Oid } }); }); /************************** Methods not attached to 'Controller' below here ******************************/ this.findAllOrder2EntityMap_PendingSuppliersByColumns = (columns) => __awaiter(this, void 0, void 0, function* () { return yield Order2EntityMap_PendingSupplier_1.Order2EntityMap_PendingSupplier.findAll({ where: Object.assign({}, columns), raw: true }); }); } } exports.default = new Order2EntityMap_PendingSupplierService(); //# sourceMappingURL=Order2EntityMap_PendingSupplier.service.js.map