diff --git a/package-lock.json b/package-lock.json index e3e632c..f81e5ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,16 +18,21 @@ "accesscontrol": "^2.2.1", "bcrypt": "^5.1.0", "bcryptjs": "^2.4.3", + "body-parser": "^1.20.2", "connect-flash": "^0.1.1", "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", "express-session": "^1.17.3", + "mime-types": "^2.1.35", + "multer": "^1.4.5-lts.1", "passport": "^0.6.0", "passport-local": "^1.0.0" }, "devDependencies": { "@types/express": "^4.17.17", + "@types/mime-types": "^2.1.1", + "@types/multer": "^1.4.7", "@types/node": "^20.4.5", "@types/pg": "^8.10.2", "@types/sequelize": "^4.28.15", @@ -247,12 +252,27 @@ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, + "node_modules/@types/mime-types": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.1.tgz", + "integrity": "sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==", + "dev": true + }, "node_modules/@types/ms": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", "dev": true }, + "node_modules/@types/multer": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.7.tgz", + "integrity": "sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, "node_modules/@types/node": { "version": "20.4.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.5.tgz", @@ -514,6 +534,11 @@ "node": ">= 8" } }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -590,12 +615,12 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -603,7 +628,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -633,6 +658,11 @@ "node": ">=8" } }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, "node_modules/buffer-writer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", @@ -642,6 +672,17 @@ "node": ">=4" } }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -764,6 +805,47 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -819,6 +901,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -1118,6 +1205,43 @@ "node": ">= 0.6" } }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -1556,6 +1680,11 @@ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", "dev": true }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, "node_modules/js-beautify": { "version": "1.14.9", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.9.tgz", @@ -1735,6 +1864,14 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", @@ -1803,6 +1940,34 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/multer/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -2204,6 +2369,11 @@ "integrity": "sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==", "dev": true }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -2259,9 +2429,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -2615,6 +2785,14 @@ "node": ">= 0.8" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -2801,6 +2979,11 @@ "node": ">= 0.6" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "node_modules/typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -2962,7 +3145,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, "engines": { "node": ">=0.4" } diff --git a/package.json b/package.json index 5d5459d..8664105 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,21 @@ "accesscontrol": "^2.2.1", "bcrypt": "^5.1.0", "bcryptjs": "^2.4.3", + "body-parser": "^1.20.2", "connect-flash": "^0.1.1", "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", "express-session": "^1.17.3", + "mime-types": "^2.1.35", + "multer": "^1.4.5-lts.1", "passport": "^0.6.0", "passport-local": "^1.0.0" }, "devDependencies": { "@types/express": "^4.17.17", + "@types/mime-types": "^2.1.1", + "@types/multer": "^1.4.7", "@types/node": "^20.4.5", "@types/pg": "^8.10.2", "@types/sequelize": "^4.28.15", diff --git a/src/controllers/InstitutionController.ts b/src/controllers/InstitutionController.ts new file mode 100644 index 0000000..34284d4 --- /dev/null +++ b/src/controllers/InstitutionController.ts @@ -0,0 +1,56 @@ +import Institution from "../database/models/Institution"; +import InstitutionService from "../services/InstitutionService"; +import { Response, Request } from "express"; + +const _mapRequestToData = (req: Request) => { + const data = req.body as unknown as Institution; + if (req.file && req.file.size > 0) { + data.image = req.file?.buffer.toString('base64'); + } + else { + data.image = null; + } + + data.adress = JSON.parse(req.body.adress); + return data; +}; + +const _mapInstitutionImage = (entity: Institution) => { + if (entity.image) { + const image = Buffer.from(entity.image, 'base64').toString('ascii'); + if (image) { + entity.image = `data:image/png;base64,${image}`; + } + } + return entity; +}; + +class InstitutionController { + public static async save(req: Request, res: Response) { + const data = _mapRequestToData(req); + InstitutionService.SaveWithDependences(data); + return res.status(200).send({}); + } + + public static async detail(req: Request, res: Response) { + try { + let entity = await Institution.findByPk(req.params.id, { + include: [ + 'address', + ], + }); + + if (entity) { + entity = _mapInstitutionImage(entity); + return res.status(200).json(entity); + } + return res.status(404).json({}); + } + catch (error) { + console.error(error); + return res.status(500).json(error).send(); + } + } +} + +export default InstitutionController; \ No newline at end of file diff --git a/src/database/entities.ts b/src/database/entities.ts index 3fcf67a..73e795a 100644 --- a/src/database/entities.ts +++ b/src/database/entities.ts @@ -1,3 +1,4 @@ +import Address from "./models/Address"; import Animal from "./models/Animal"; import Institution from "./models/Institution"; import User from "./models/User"; @@ -7,4 +8,5 @@ export const entities: any[] = [ Institution, UserRole, Animal, + Address, ] \ No newline at end of file diff --git a/src/database/models/Address.ts b/src/database/models/Address.ts new file mode 100644 index 0000000..928b250 --- /dev/null +++ b/src/database/models/Address.ts @@ -0,0 +1,50 @@ +import { Model, DataTypes } from 'sequelize'; +import database from '../database'; +import Institution from './Institution'; + +class Address extends Model { + public id!: number; + public street!: string; + public number!: string; + public cep!: string; + public complement!: string; +} + +Address.init( + { + id: { + type: DataTypes.INTEGER, + primaryKey: true, + autoIncrement: true, + }, + street: { + type: DataTypes.STRING, + allowNull: true, + }, + number: { + type: DataTypes.STRING, + allowNull: true, + }, + cep: { + type: DataTypes.STRING, + allowNull: true, + }, + complement: { + type: DataTypes.STRING, + allowNull: true, + }, + }, + { + tableName: 'address', + sequelize: database.connection, + } +); + +Institution.belongsTo(Address, { + foreignKey:'idAddress', + as: 'address', +}); + + + +export default Address; \ No newline at end of file diff --git a/src/database/models/Institution.ts b/src/database/models/Institution.ts index b3d9330..ee6f25c 100644 --- a/src/database/models/Institution.ts +++ b/src/database/models/Institution.ts @@ -1,16 +1,19 @@ import { Model, DataTypes } from 'sequelize'; import database from '../database'; - +import multer from 'multer'; +import Address from './Address'; class Institution extends Model { public id!: number; public name!: string; - public cnpj?: string; + public document?: string; public description!: string; public phone?: string; public site?: string; public email?: string; - public image?: string; + public image?: string | null; public receive_volunteers!: string; + public adress!: Address + public idAddress!: number } Institution.init( @@ -24,7 +27,11 @@ Institution.init( type: DataTypes.STRING, allowNull: false, }, - cnpj:{ + document:{ + type: DataTypes.STRING, + allowNull: true, + }, + email:{ type: DataTypes.STRING, allowNull: true, }, diff --git a/src/middlewares/acl/CheckAclPermission.ts b/src/middlewares/acl/CheckAclPermission.ts index cc22a45..9c2e20e 100644 --- a/src/middlewares/acl/CheckAclPermission.ts +++ b/src/middlewares/acl/CheckAclPermission.ts @@ -12,7 +12,7 @@ export default function CheckAclPermission(role: Roles) { return next(); } - return res.status(403).json({ message: 'Perfil sem permissão!' }); + return res.status(401).json({ message: 'Not allowed profile!' }); } }; diff --git a/src/routes.ts b/src/routes.ts index 3d68165..e915d37 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -4,6 +4,8 @@ import { AuthenticatedRequest } from ".."; import { Response, Request } from "express"; import CheckUserPermission from "./middlewares/acl/CheckAclPermission"; import { Roles } from "./enums/Roles"; +import InstitutionController from "./controllers/InstitutionController"; +import multer from "multer"; const routes = Router(); routes.post( @@ -18,8 +20,25 @@ routes.post( } ); + +const storage = multer.memoryStorage(); +const upload = multer({ storage }); + +routes.post('/institution/save', + [ + upload.single('logo'), + CheckUserPermission(Roles.User) + ], + (req: Request, res: Response) => { + return InstitutionController.save(req, res); + }); + +routes.get('/institution/:id', CheckUserPermission(Roles.User), (req, res) => { + return InstitutionController.detail(req, res); +}); + routes.get('/testingRoute', CheckUserPermission(Roles.User), (req, res) => { res.json({ message: 'Usuário encontrado!' }); - }); - +}); + export default routes; \ No newline at end of file diff --git a/src/services/AdressService.ts b/src/services/AdressService.ts new file mode 100644 index 0000000..332cb03 --- /dev/null +++ b/src/services/AdressService.ts @@ -0,0 +1,10 @@ +import Address from "../database/models/Address"; +import BaseService from "./BaseService"; + +class AdressService extends BaseService
{ + constructor() { + super(Address); + } +} + +export default AdressService; \ No newline at end of file diff --git a/src/services/BaseService.ts b/src/services/BaseService.ts index 0c2cad9..ef50de9 100644 --- a/src/services/BaseService.ts +++ b/src/services/BaseService.ts @@ -1,4 +1,4 @@ -import { Model, ModelStatic } from "sequelize"; +import { Model, ModelStatic, Transaction } from "sequelize"; class BaseService