vulnerabilities resolved
This commit is contained in:
parent
1f49012644
commit
6a68ca024a
4406
package-lock.json
generated
4406
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,6 @@
|
|||||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs-modules/mailer": "^2.0.2",
|
|
||||||
"@nestjs/common": "^11.0.1",
|
"@nestjs/common": "^11.0.1",
|
||||||
"@nestjs/config": "^4.0.2",
|
"@nestjs/config": "^4.0.2",
|
||||||
"@nestjs/core": "^11.0.1",
|
"@nestjs/core": "^11.0.1",
|
||||||
@ -29,6 +28,7 @@
|
|||||||
"@nestjs/platform-express": "^11.0.1",
|
"@nestjs/platform-express": "^11.0.1",
|
||||||
"@nestjs/swagger": "^11.0.6",
|
"@nestjs/swagger": "^11.0.6",
|
||||||
"@nestjs/typeorm": "^11.0.0",
|
"@nestjs/typeorm": "^11.0.0",
|
||||||
|
"@types/nodemailer": "^6.4.17",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.1",
|
"class-validator": "^0.14.1",
|
||||||
@ -37,7 +37,7 @@
|
|||||||
"joi": "^17.13.3",
|
"joi": "^17.13.3",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"jwk-to-pem": "^2.0.7",
|
"jwk-to-pem": "^2.0.7",
|
||||||
"mssql": "^10.0.4",
|
"mssql": "^11.0.1",
|
||||||
"mysql2": "^3.12.0",
|
"mysql2": "^3.12.0",
|
||||||
"nodemailer": "^7.0.3",
|
"nodemailer": "^7.0.3",
|
||||||
"oracledb": "^6.7.2",
|
"oracledb": "^6.7.2",
|
||||||
@ -66,7 +66,7 @@
|
|||||||
"@types/oracledb": "^6.5.4",
|
"@types/oracledb": "^6.5.4",
|
||||||
"@types/supertest": "^6.0.2",
|
"@types/supertest": "^6.0.2",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"eslint": "^9.18.0",
|
"eslint": "^9.31.0",
|
||||||
"eslint-config-prettier": "^10.0.1",
|
"eslint-config-prettier": "^10.0.1",
|
||||||
"eslint-plugin-prettier": "^5.2.2",
|
"eslint-plugin-prettier": "^5.2.2",
|
||||||
"globals": "^15.14.0",
|
"globals": "^15.14.0",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { IsEmail, IsEnum, IsString, ValidateNested } from 'class-validator';
|
import { IsEmail, IsEnum, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||||
|
|
||||||
export class AuthLoginDTO {
|
export class AuthLoginDTO {
|
||||||
@ApiProperty({ required: true })
|
@ApiProperty({ required: true })
|
||||||
@ -51,16 +51,11 @@ export class MailTemplateDTO {
|
|||||||
@IsString()
|
@IsString()
|
||||||
subject: string;
|
subject: string;
|
||||||
|
|
||||||
// @ApiProperty({ required: true })
|
|
||||||
// @IsString()
|
|
||||||
// text: string;
|
|
||||||
|
|
||||||
@ApiProperty({ required: true })
|
@ApiProperty({ required: true })
|
||||||
@IsString()
|
@IsString()
|
||||||
template: string;
|
templateName: string;
|
||||||
|
|
||||||
@ApiProperty({ type: () => MailContextDTO, required: true })
|
@IsOptional()
|
||||||
@ValidateNested()
|
@IsObject()
|
||||||
@Type(() => MailContextDTO)
|
variables?: Record<string, any>;
|
||||||
context: MailContextDTO;
|
|
||||||
}
|
}
|
||||||
@ -5,9 +5,10 @@ import { DbModule } from 'src/db/db.module';
|
|||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { JwtService } from '@nestjs/jwt';
|
import { JwtService } from '@nestjs/jwt';
|
||||||
import { OracleModule } from 'src/oracle/oracle.module';
|
import { OracleModule } from 'src/oracle/oracle.module';
|
||||||
|
import { MailModule } from 'src/mail/mail.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [DbModule, forwardRef(() => OracleModule)],
|
imports: [DbModule,MailModule, forwardRef(() => OracleModule)],
|
||||||
providers: [
|
providers: [
|
||||||
AuthService,
|
AuthService,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,10 +10,10 @@ import * as jwt from "jsonwebtoken"
|
|||||||
import { UnauthorizedException } from 'src/exceptions/unauthorized.exception';
|
import { UnauthorizedException } from 'src/exceptions/unauthorized.exception';
|
||||||
import { ConflictException } from 'src/exceptions/conflict.exception';
|
import { ConflictException } from 'src/exceptions/conflict.exception';
|
||||||
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
||||||
import { MailerService } from '@nestjs-modules/mailer';
|
|
||||||
import { JwtService } from '@nestjs/jwt';
|
import { JwtService } from '@nestjs/jwt';
|
||||||
import { UserMaintenanceService } from 'src/oracle/user-maintenance/user-maintenance.service';
|
import { UserMaintenanceService } from 'src/oracle/user-maintenance/user-maintenance.service';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import { MailService } from 'src/mail/mail.service';
|
||||||
|
|
||||||
|
|
||||||
interface DecodedToken {
|
interface DecodedToken {
|
||||||
@ -43,7 +43,7 @@ export class AuthService {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly oracleDBService: OracleDBService,
|
private readonly oracleDBService: OracleDBService,
|
||||||
private readonly configService: ConfigService,
|
private readonly configService: ConfigService,
|
||||||
private readonly mailService: MailerService,
|
private readonly mailService: MailService,
|
||||||
private readonly userMaintenanceService: UserMaintenanceService,
|
private readonly userMaintenanceService: UserMaintenanceService,
|
||||||
@Inject("REGISTER_SIGN_JWT") readonly REGISTER_SIGN_JWT: JwtService,
|
@Inject("REGISTER_SIGN_JWT") readonly REGISTER_SIGN_JWT: JwtService,
|
||||||
@Inject("REGISTER_VERIFY_JWT") readonly REGISTER_VERIFY_JWT: JwtService
|
@Inject("REGISTER_VERIFY_JWT") readonly REGISTER_VERIFY_JWT: JwtService
|
||||||
@ -759,47 +759,6 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMailTemplate(body: SendMailDTO, token: string, source: string): Promise<MailTemplateDTO | null> {
|
|
||||||
|
|
||||||
switch (body.P_MAIL_TYPE) {
|
|
||||||
case MailTypeDTO.REGISTER_CLIENT:
|
|
||||||
return {
|
|
||||||
to: body.P_TO,
|
|
||||||
subject: `🔐 Register Your Account`,
|
|
||||||
template: 'a',
|
|
||||||
context: {
|
|
||||||
to: body.P_TO,
|
|
||||||
url: `https://client.alphaomegainfosys.com/register`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case MailTypeDTO.FORGOT_PASSWORD:
|
|
||||||
return {
|
|
||||||
to: body.P_TO,
|
|
||||||
subject: `Reset your password`,
|
|
||||||
template: 'b',
|
|
||||||
context: {
|
|
||||||
to: body.P_TO,
|
|
||||||
url: `${source === 'ua' ? `https://policy.alphaomegainfosys.com/forgot-password/${token}`
|
|
||||||
: source === 'sa' ? `https://sp.alphaomegainfosys.com/forgot-password/${token}`
|
|
||||||
: source === 'ca' ? `https://client.alphaomegainfosys.com/forgot-password/${token}` : ''}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// case MailTypeDTO.DEMO_MAIL:
|
|
||||||
// return {
|
|
||||||
// to: body.P_TO,
|
|
||||||
// subject: `Testing`,
|
|
||||||
// template: 'demo',
|
|
||||||
// context: {
|
|
||||||
// to: body.P_TO,
|
|
||||||
// url: `https://client.alphaomegainfosys.com/register/${token}`
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async generateUUID() {
|
async generateUUID() {
|
||||||
try {
|
try {
|
||||||
const uuid = uuidv4();
|
const uuid = uuidv4();
|
||||||
@ -882,6 +841,36 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getMailTemplate(body: SendMailDTO, token: string, source: string): Promise<MailTemplateDTO | null> {
|
||||||
|
|
||||||
|
switch (body.P_MAIL_TYPE) {
|
||||||
|
case MailTypeDTO.REGISTER_CLIENT:
|
||||||
|
return {
|
||||||
|
to: body.P_TO,
|
||||||
|
subject: `🔐 Register Your Account`,
|
||||||
|
templateName: 'a',
|
||||||
|
variables: {
|
||||||
|
to: body.P_TO,
|
||||||
|
url: `https://client.alphaomegainfosys.com/register`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case MailTypeDTO.FORGOT_PASSWORD:
|
||||||
|
return {
|
||||||
|
to: body.P_TO,
|
||||||
|
subject: `Reset your password`,
|
||||||
|
templateName: 'b',
|
||||||
|
variables: {
|
||||||
|
to: body.P_TO,
|
||||||
|
url: `${source === 'ua' ? `https://policy.alphaomegainfosys.com/forgot-password/${token}`
|
||||||
|
: source === 'sa' ? `https://sp.alphaomegainfosys.com/forgot-password/${token}`
|
||||||
|
: source === 'ca' ? `https://client.alphaomegainfosys.com/forgot-password/${token}` : ''}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async sendMail(body: SendMailDTO) {
|
async sendMail(body: SendMailDTO) {
|
||||||
console.log("mail body : ", body);
|
console.log("mail body : ", body);
|
||||||
let token: string;
|
let token: string;
|
||||||
|
|||||||
@ -1,34 +1,10 @@
|
|||||||
// import { MssqlConfig, OracleConfig } from 'ormconfig';
|
import { createPool, Pool, Connection } from 'oracledb';
|
||||||
import { createPool, Pool, Connection as cob } from 'oracledb';
|
import { ConnectionPool } from 'mssql';
|
||||||
import { Connection, ConnectionPool } from 'mssql';
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InternalServerException } from 'src/exceptions/internalServerError.exception';
|
import { InternalServerException } from 'src/exceptions/internalServerError.exception';
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { getMssqlConfig, getOracleConfig } from './db.config';
|
import { getMssqlConfig, getOracleConfig } from './db.config';
|
||||||
|
|
||||||
// @Injectable()
|
|
||||||
// export class OracleDBService {
|
|
||||||
// private pool: Pool;
|
|
||||||
|
|
||||||
// constructor() {
|
|
||||||
// this.initializePool();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private async initializePool() {
|
|
||||||
// this.pool = await createPool({
|
|
||||||
// ...OracleConfig,
|
|
||||||
// poolMin: 1,
|
|
||||||
// poolMax: 10,
|
|
||||||
// poolIncrement: 1,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// async getConnection(): Promise<cob> {
|
|
||||||
// const connection = await this.pool.getConnection();
|
|
||||||
// return connection;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class OracleDBService {
|
export class OracleDBService {
|
||||||
private pool: Pool | null = null;
|
private pool: Pool | null = null;
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { MailerModule } from '@nestjs-modules/mailer';
|
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import * as Joi from 'joi';
|
import * as Joi from 'joi';
|
||||||
import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';
|
import { MailService } from './mail.service';
|
||||||
|
import * as nodemailer from 'nodemailer';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@ -14,15 +15,15 @@ import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handleba
|
|||||||
MAIL_PASS: Joi.string().required(),
|
MAIL_PASS: Joi.string().required(),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
],
|
||||||
|
|
||||||
MailerModule.forRootAsync({
|
providers: [
|
||||||
imports: [ConfigModule],
|
{
|
||||||
useFactory: (configService: ConfigService) => {
|
provide: 'MAIL_TRANSPORTER',
|
||||||
const templatePath = join(__dirname, '../../..', 'public', 'mail-templates');
|
useFactory: async (configService: ConfigService) => {
|
||||||
console.log('Resolved mail template path:', templatePath);
|
return nodemailer.createTransport(
|
||||||
|
{
|
||||||
return {
|
// service: "gmail",
|
||||||
transport: {
|
|
||||||
host: 'smtp.gmail.com',
|
host: 'smtp.gmail.com',
|
||||||
port: 587,
|
port: 587,
|
||||||
secure: false,
|
secure: false,
|
||||||
@ -31,21 +32,18 @@ import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handleba
|
|||||||
pass: configService.get<string>('MAIL_PASS'),
|
pass: configService.get<string>('MAIL_PASS'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaults: {
|
{
|
||||||
from: `"Carnet APP" <${configService.get<string>('MAIL_USER')}>`,
|
from: `"Carnet APP" <${configService.get<string>('MAIL_USER')}>`,
|
||||||
},
|
}
|
||||||
template: {
|
);
|
||||||
dir: templatePath,
|
|
||||||
adapter: new HandlebarsAdapter(),
|
|
||||||
options: {
|
|
||||||
strict: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
inject: [ConfigService],
|
inject: [ConfigService],
|
||||||
}),
|
},
|
||||||
|
MailService,
|
||||||
],
|
],
|
||||||
|
exports: [MailService],
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export class MailModule { }
|
export class MailModule { }
|
||||||
|
|||||||
42
src/mail/mail.service.ts
Normal file
42
src/mail/mail.service.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// mailer.service.ts
|
||||||
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
|
import { Transporter } from 'nodemailer';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as Handlebars from 'handlebars';
|
||||||
|
import { MailTemplateDTO } from 'src/auth/auth.dto';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class MailService {
|
||||||
|
private templatesCache = new Map<string, Handlebars.TemplateDelegate>();
|
||||||
|
|
||||||
|
constructor(@Inject('MAIL_TRANSPORTER') private readonly transporter: Transporter) {
|
||||||
|
console.log(path.join(process.cwd(), 'public', 'mail-templates', 'a.hbs'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private loadTemplate(templateName: string): Handlebars.TemplateDelegate {
|
||||||
|
if (this.templatesCache.has(templateName)) {
|
||||||
|
return this.templatesCache.get(templateName)!;
|
||||||
|
}
|
||||||
|
|
||||||
|
const templatePath = path.join(process.cwd(), 'public', 'mail-templates', `${templateName}.hbs`);
|
||||||
|
const source = fs.readFileSync(templatePath, 'utf8');
|
||||||
|
const compiled = Handlebars.compile(source);
|
||||||
|
this.templatesCache.set(templateName, compiled);
|
||||||
|
return compiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendMail(data: MailTemplateDTO) {
|
||||||
|
const template = this.loadTemplate(data.templateName);
|
||||||
|
const html = template(data.variables);
|
||||||
|
|
||||||
|
const mailOptions = {
|
||||||
|
to: data.to,
|
||||||
|
subject: data.subject,
|
||||||
|
html,
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.transporter.sendMail(mailOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -47,7 +47,7 @@ export class ManageClientsService {
|
|||||||
|
|
||||||
const finalBody: CreateClientDataDTO = { ...newBody, ...reqBody };
|
const finalBody: CreateClientDataDTO = { ...newBody, ...reqBody };
|
||||||
|
|
||||||
let connection: Connection; // Fixed duplicate declaration
|
let connection: mssql.ConnectionPool; // Fixed duplicate declaration
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -98,7 +98,7 @@ export class ManageClientsService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
GetPreparerByClientid = async (body: GetClientDTO) => {
|
GetPreparerByClientid = async (body: GetClientDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -142,7 +142,7 @@ export class ManageClientsService {
|
|||||||
|
|
||||||
const finalBody: UpdateClientDTO = { ...newBody, ...reqBody };
|
const finalBody: UpdateClientDTO = { ...newBody, ...reqBody };
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
@ -196,7 +196,7 @@ export class ManageClientsService {
|
|||||||
...reqBody,
|
...reqBody,
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -272,7 +272,7 @@ export class ManageClientsService {
|
|||||||
|
|
||||||
const finalBody: UpdateClientContactsDTO = { ...newBody, ...reqBody };
|
const finalBody: UpdateClientContactsDTO = { ...newBody, ...reqBody };
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -327,7 +327,7 @@ export class ManageClientsService {
|
|||||||
|
|
||||||
const finalBody: UpdateClientLocationsDTO = { ...newBody, ...reqBody };
|
const finalBody: UpdateClientLocationsDTO = { ...newBody, ...reqBody };
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -379,7 +379,7 @@ export class ManageClientsService {
|
|||||||
...reqBody,
|
...reqBody,
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -452,7 +452,7 @@ export class ManageClientsService {
|
|||||||
...reqBody,
|
...reqBody,
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -505,7 +505,7 @@ export class ManageClientsService {
|
|||||||
...reqBody,
|
...reqBody,
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -553,7 +553,7 @@ export class ManageClientsService {
|
|||||||
...reqBody,
|
...reqBody,
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class ManageFeeService {
|
|||||||
// Basic Fee Setup
|
// Basic Fee Setup
|
||||||
|
|
||||||
async GETBASICFEERATES(body: GetFeeGeneralDTO): Promise<any[] | Object> {
|
async GETBASICFEERATES(body: GetFeeGeneralDTO): Promise<any[] | Object> {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -41,7 +41,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATEBASICFEE(body: CreateBasicFeeDTO) {
|
async CREATEBASICFEE(body: CreateBasicFeeDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -63,7 +63,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async UPDATEBASICFEE(body: UpdateBasicFeeDTO) {
|
async UPDATEBASICFEE(body: UpdateBasicFeeDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -86,7 +86,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async GETBONDRATES(body: GetFeeGeneralDTO): Promise<any[] | object> {
|
async GETBONDRATES(body: GetFeeGeneralDTO): Promise<any[] | object> {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -111,7 +111,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async CREATEBONDRATE(body: CreateBondRateDTO) {
|
async CREATEBONDRATE(body: CreateBondRateDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -138,7 +138,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async UPDATEBONDRATE(body: UpdateBondRateDTO) {
|
async UPDATEBONDRATE(body: UpdateBondRateDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -161,7 +161,7 @@ export class ManageFeeService {
|
|||||||
// CArgo Rate
|
// CArgo Rate
|
||||||
|
|
||||||
async GETCARGORATES(body: GetFeeGeneralDTO): Promise<any[] | object> {
|
async GETCARGORATES(body: GetFeeGeneralDTO): Promise<any[] | object> {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -185,7 +185,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATECARGORATE(body: CreateCargoRateDTO) {
|
async CREATECARGORATE(body: CreateCargoRateDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -209,7 +209,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async UPDATECARGORATE(body: UpdateCargoRateDTO) {
|
async UPDATECARGORATE(body: UpdateCargoRateDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -233,7 +233,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async GETCFFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETCFFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -258,7 +258,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async CREATECFFEE(body: CreateCfFeeDTO) {
|
async CREATECFFEE(body: CreateCfFeeDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -285,7 +285,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async UPDATECFFEE(body: UpdateCfFeeDTO) {
|
async UPDATECFFEE(body: UpdateCfFeeDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -308,7 +308,7 @@ export class ManageFeeService {
|
|||||||
// Continuation sheet
|
// Continuation sheet
|
||||||
|
|
||||||
async GETCSFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETCSFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -333,7 +333,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATECSFEE(body: CreateCsFeeDTO) {
|
async CREATECSFEE(body: CreateCsFeeDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -357,7 +357,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async UPDATECSFEE(body: UpdateCsFeeDTO) {
|
async UPDATECSFEE(body: UpdateCsFeeDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -381,7 +381,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async GETEFFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETEFFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -405,7 +405,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATEEFFEE(body: CreateEfFeeDTO) {
|
async CREATEEFFEE(body: CreateEfFeeDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -432,7 +432,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async UPDATEEFFEE(body: UpdateEfFeeDTO) {
|
async UPDATEEFFEE(body: UpdateEfFeeDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -456,7 +456,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async GETFEECOMM(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETFEECOMM(body: GetFeeGeneralDTO): Promise<any[]> {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -483,7 +483,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
async CREATEFEECOMM(body: CreateFeeCommDTO) {
|
async CREATEFEECOMM(body: CreateFeeCommDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -507,7 +507,7 @@ export class ManageFeeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async UPDATEFEECOMM(body: UpdateFeeCommDTO) {
|
async UPDATEFEECOMM(body: UpdateFeeCommDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export class ManageHoldersService {
|
|||||||
|
|
||||||
const finalBody: CreateHoldersDTO = { ...newBody, ...reqBody };
|
const finalBody: CreateHoldersDTO = { ...newBody, ...reqBody };
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -103,7 +103,7 @@ export class ManageHoldersService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
GetHolderRecord = async (body: GetHolderDTO) => {
|
GetHolderRecord = async (body: GetHolderDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -119,7 +119,7 @@ export class ManageHoldersService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
UpdateHolder = async (body: UpdateHolderDTO) => {
|
UpdateHolder = async (body: UpdateHolderDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new mssql.Request(connection);
|
const request: Request = new mssql.Request(connection);
|
||||||
@ -153,7 +153,7 @@ export class ManageHoldersService {
|
|||||||
|
|
||||||
UpdateHolderContact = async (body: UpdateHolderContactDTO) => {
|
UpdateHolderContact = async (body: UpdateHolderContactDTO) => {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new mssql.Request(connection);
|
const request: Request = new mssql.Request(connection);
|
||||||
@ -181,7 +181,7 @@ export class ManageHoldersService {
|
|||||||
|
|
||||||
GetHolderContacts = async (body: GetHolderDTO) => {
|
GetHolderContacts = async (body: GetHolderDTO) => {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -200,7 +200,7 @@ export class ManageHoldersService {
|
|||||||
|
|
||||||
console.log(body);
|
console.log(body);
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -216,7 +216,7 @@ export class ManageHoldersService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ReactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
ReactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -233,7 +233,7 @@ export class ManageHoldersService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
InactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
InactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
@ -250,7 +250,7 @@ export class ManageHoldersService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ReactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
ReactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request: Request = new Request(connection);
|
const request: Request = new Request(connection);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { Connection, Request } from 'mssql';
|
import { Connection, Request } from 'mssql';
|
||||||
import { MssqlDBService } from 'src/db/db.service';
|
import { MssqlDBService } from 'src/db/db.service';
|
||||||
|
import * as mssql from 'mssql';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MssqlService {
|
export class MssqlService {
|
||||||
@ -8,7 +9,7 @@ export class MssqlService {
|
|||||||
constructor(private readonly mssqlDBService: MssqlDBService) { }
|
constructor(private readonly mssqlDBService: MssqlDBService) { }
|
||||||
|
|
||||||
async checkConnection() {
|
async checkConnection() {
|
||||||
let connection : Connection;
|
let connection : mssql.ConnectionPool;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class ParamTableService {
|
|||||||
console.log(finalBody);
|
console.log(finalBody);
|
||||||
|
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -35,7 +35,7 @@ export class ParamTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATETABLERECORD(body: CreateTableRecordDTO) {
|
async CREATETABLERECORD(body: CreateTableRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -57,7 +57,7 @@ export class ParamTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async CREATEPARAMRECORD(body: CreateParamRecordDTO) {
|
async CREATEPARAMRECORD(body: CreateParamRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -87,7 +87,7 @@ export class ParamTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async UPDATEPARAMRECORD(body: UpdateParamRecordDTO) {
|
async UPDATEPARAMRECORD(body: UpdateParamRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -116,7 +116,7 @@ export class ParamTableService {
|
|||||||
|
|
||||||
async INACTIVATEPARAMRECORD(body: ActivateOrInactivateParamRecordDTO) {
|
async INACTIVATEPARAMRECORD(body: ActivateOrInactivateParamRecordDTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -136,7 +136,7 @@ export class ParamTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async REACTIVATEPARAMRECORD(body: ActivateOrInactivateParamRecordDTO) {
|
async REACTIVATEPARAMRECORD(body: ActivateOrInactivateParamRecordDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export class CarnetSequenceService {
|
|||||||
|
|
||||||
async getCarnetSequence(body: SPID_DTO) {
|
async getCarnetSequence(body: SPID_DTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -26,7 +26,7 @@ export class CarnetSequenceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createCarnetSequence(body: CreateCarnetSequenceDTO) {
|
async createCarnetSequence(body: CreateCarnetSequenceDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export class RegionService {
|
|||||||
constructor(private readonly mssqlDBService: MssqlDBService) { }
|
constructor(private readonly mssqlDBService: MssqlDBService) { }
|
||||||
|
|
||||||
async getRegions() {
|
async getRegions() {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -24,7 +24,7 @@ export class RegionService {
|
|||||||
|
|
||||||
async insetNewRegions(body: InsertRegionsDto) {
|
async insetNewRegions(body: InsertRegionsDto) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -39,7 +39,7 @@ export class RegionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateRegions(body: UpdateRegionDto){
|
async updateRegions(body: UpdateRegionDto){
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export class SpContactsService {
|
|||||||
|
|
||||||
async getSpAllContacts(body: SPID_DTO) {
|
async getSpAllContacts(body: SPID_DTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -30,7 +30,7 @@ export class SpContactsService {
|
|||||||
|
|
||||||
async getSPDefaultcontacts(body: SPID_DTO) {
|
async getSPDefaultcontacts(body: SPID_DTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -45,7 +45,7 @@ export class SpContactsService {
|
|||||||
|
|
||||||
async inactivateSPContact(body: SP_CONTACTID_DTO) {
|
async inactivateSPContact(body: SP_CONTACTID_DTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -59,7 +59,7 @@ export class SpContactsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async insertSPContacts(body: InsertSPContactsDTO) {
|
async insertSPContacts(body: InsertSPContactsDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -83,7 +83,7 @@ export class SpContactsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setSPDefaultcontact(body: SP_CONTACTID_DTO) {
|
async setSPDefaultcontact(body: SP_CONTACTID_DTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -97,7 +97,7 @@ export class SpContactsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateSPContacts(body: UpdateSPContactsDTO) {
|
async updateSPContacts(body: UpdateSPContactsDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export class SpService {
|
|||||||
|
|
||||||
async getAllServiceproviders() {
|
async getAllServiceproviders() {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -26,7 +26,7 @@ export class SpService {
|
|||||||
|
|
||||||
async getSpBySpid(body: SPID_DTO) {
|
async getSpBySpid(body: SPID_DTO) {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -40,7 +40,7 @@ export class SpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async insertNewServiceProvider(body: InsertNewServiceProviderDTO) {
|
async insertNewServiceProvider(body: InsertNewServiceProviderDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
@ -69,7 +69,7 @@ export class SpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateServiceProvider(body: UpdateServiceProviderDTO) {
|
async updateServiceProvider(body: UpdateServiceProviderDTO) {
|
||||||
let connection: Connection;
|
let connection: mssql.ConnectionPool;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
const request = new Request(connection);
|
const request = new Request(connection);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ export class ParamTableController {
|
|||||||
|
|
||||||
@Get('GetCountriesAndMessages')
|
@Get('GetCountriesAndMessages')
|
||||||
GET_COUNTRIES_AND_MESSAGES() {
|
GET_COUNTRIES_AND_MESSAGES() {
|
||||||
return this.GET_COUNTRIES_AND_MESSAGES();
|
return this.paramTableService.GET_COUNTRIES_AND_MESSAGES();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('/CreateTableRecord')
|
@Post('/CreateTableRecord')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user