diff --git a/config/default.yml b/config/default.yml index 5de349e..a050855 100644 --- a/config/default.yml +++ b/config/default.yml @@ -31,9 +31,9 @@ facebook: callbackURL: 'https://myfin.api.teorainfotech.com/api/v1/auth/facebook/redirect' mail: - fromMail: 'innovationscochin@gmail.com' - user: 'innovationscochin@gmail.com' - pass: 'Inno@ict' + fromMail: 'website.tscb@gmail.com' + user: 'website.tscb@gmail.com' + pass: 'zubhybaneozurlvy' cron: scheduler: false diff --git a/src/app.module.ts b/src/app.module.ts index 42a9043..942de7e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -6,6 +6,12 @@ import { AuthModule } from './auth/auth.module'; import { FileUploadModule } from './file-upload/file-upload.module'; import { ScheduleModule } from '@nestjs/schedule'; import { TenderDetailsModule } from './tender-master/tender-details.module'; +import { FormOfContractModule } from './tables/form-of-contract/form-of-contract.module'; +import { PaymentModeModule } from './tables/payment-mode/payment-mode.module'; +import { TenderTypeModule } from './tables/tender-type/tender-type.module'; +import { ProductCategoryModule } from './tables/product-category/product-category.module'; +import { TenderCategoryModule } from './tables/tender-category/tender-category.module'; +import { EmdFeeTypeModule } from './tables/emd-fee-type/emd-fee-type.module'; @@ -17,6 +23,12 @@ import { TenderDetailsModule } from './tender-master/tender-details.module'; FileUploadModule, AuthModule, TenderDetailsModule, + FormOfContractModule, + PaymentModeModule, + TenderTypeModule, + ProductCategoryModule, + TenderCategoryModule, + EmdFeeTypeModule, ], }) diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 5da10e2..74ff40b 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -48,15 +48,12 @@ export class AuthController { - // @Get('delete-data') - // async deleteData() { - // return this.authService.deleteData(); - // } - // @Post('/signup') - // async signUp(@Body(ValidationPipe) signUp: TempSignUpDto, @Req() req, @Ip() ip): Promise { + // async signUp(@Body(ValidationPipe) signUp: TempSignUpDto): Promise { // // request.connection.remoteAddress - // return this.authService.tempSignUp(signUp, ip); + // console.log("hello"); + + // return this.authService.tempSignUp(signUp); // } @Post('/forgot-password') @@ -70,13 +67,13 @@ export class AuthController { return await this.authService.forgotPassword(body); } - // @Post('/otp/:flag') - // async sendOtp( - // @Body() body: { email?: string, mobile: string ,deviceId?:string}, - // @Param('flag') flag: string - // ): Promise { - // return await this.authService.sendOtp(body, flag ); - // } + @Post('/otp/:flag') + async sendOtp( + @Body() body: { email: string}, + @Param('flag') flag: string + ): Promise { + return await this.authService.sendOtp(body, flag ); + } // @Post('/resend-otp/:flag') // async resendOtp( @@ -86,15 +83,13 @@ export class AuthController { // return await this.authService.resendOtp(body,flag); // } - // @Post('/verifyOtp/:flag') - // async verifyOtp( - // @Body() body: { otp: string, mobile: string, deviceId:string }, - // @Param('flag') flag: string - // ): Promise { - // console.log("deviceId",body.deviceId); - - // return await this.authService.verifyOtp(body, flag); - // } + @Post('/verifyOtp/:flag') + async verifyOtp( + @Body() body: { otp: string, email: string }, + @Param('flag') flag: string + ): Promise { + return await this.authService.verifyOtp(body, flag); + } @@ -117,14 +112,14 @@ export class AuthUserController { - @Put('/:id') - async updateUser( - @Body() body: PcduserDto, - @GetUser() user: PcduserDto, - @Param('id') id: string, - ): Promise { - return await this.authService.updateUser(body, user, id); - } + // @Put('/:id') + // async updateUser( + // @Body() body: PcduserDto, + // @GetUser() user: PcduserDto, + // @Param('id') id: string, + // ): Promise { + // return await this.authService.updateUser(body, user, id); + // } // @Patch('change-password') // async changePasswordCurrentUser( diff --git a/src/auth/auth.module.ts b/src/auth/auth.module.ts index ea09a7a..d9fc2df 100644 --- a/src/auth/auth.module.ts +++ b/src/auth/auth.module.ts @@ -11,6 +11,8 @@ import { CryptoService } from './crypto.service'; import { JwtStrategy } from './jwt.stategy'; import { PcduserRepository } from './pcduser.repository'; import { PcdotpRepository } from './pcdotp.repository'; +import { EmailService } from 'src/email/email.service'; +import { EmailModule } from 'src/email/email.module'; const jwtConfig = config.get('jwt'); @@ -28,13 +30,15 @@ const jwtConfig = config.get('jwt'); PcduserRepository, PcdotpRepository, - ]), + ]),EmailModule, ], controllers: [AuthController, AuthUserController], providers: [ AuthService, CryptoService, JwtStrategy, + + ], exports: [ diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index c67e28a..9236c2f 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -29,6 +29,7 @@ import { UserBankDto } from './dto/user-bank.dto'; import { ChangePasswordDto } from './dto/change-password.dto'; import { log } from 'console'; import { version } from 'os'; +import { EmailService } from 'src/email/email.service'; export enum Provider { GOOGLE = 'google' } @@ -42,7 +43,7 @@ export class AuthService { private jwtService: JwtService, private crypto: CryptoService, private pcdotpRepository: PcdotpRepository, - + private mailService : EmailService ) { @@ -68,9 +69,6 @@ export class AuthService { async signIn(authCredentialsDto: AuthCreadentialsDto, ip?: string): Promise { - - - const user: PcduserDto = await this.validateUserPassword(authCredentialsDto); if (!user) { @@ -116,96 +114,60 @@ export class AuthService { } - // } - // async checkPhno(phno): Promise { - // const connection = await this.createConnection(); - // try { - // const data = await connection.execute(` - // SELECT * FROM PACS_MOB_CUST pmc WHERE pmc.MOBILE =${phno} `); - // await connection.commit(); - // return data?.rows; - // } catch (error) { - // await connection.rollback(); - // console.log(error); - // } - // finally { - // await this.closeConnection(connection) - // } - - - - // throw new UnauthorizedException('Invalid Credentials') - // // return await this.generateTokens(user, user.userName, ip, authCredentialsDto.module, user['changePassword']); - // return true - // } - - // async sendOtp(body: { email?: string, mobile: string, deviceId?: string }, flag: string): Promise { - - // if (body.mobile) { - // if ((body.mobile.trim() != '') && (flag == 'F' || flag == 'R')) { - - // let isUserExist = await this.pcduserRepository.findOne({ where: { mobileNumber: body.mobile } }); - - // console.log("isUserExist",isUserExist); + async sendMail(email: string, data: string, flag: string) { + let content: string; + let subject: string = "Login Credentials"; + if (flag == 'otp') { + content = `Your one time password(OTP) for Tender Registration is, ${data} `; + subject = 'OTP' - // if (!isUserExist){ - // throw new BadRequestException("Invalid User"); - - // } + } + // if (flag == 'pwd') { + // content = `Your New Password for Accurate Application Registration is, ${data}`; + // subject = 'New Password' + // } + // if (flag == 'fpwd') { + // content = `Your one time password(OTP) for Password reset is, ${data}`; + // subject = 'OTP' + // } + + await this.mailService.sendMail(email, subject, content, content); + } - // if (flag === 'F' && isUserExist.deviceId !== body.deviceId && (isUserExist.bankId != 'acc1' && isUserExist.bankId != 'sims')) { - // throw new BadRequestException("Unauthorized Device"); - // } + + async sendOtp(body: { email: string}, flag: string): Promise { - // if (flag == 'R' && isUserExist.deviceId != null && isUserExist.deviceId != '' - // && isUserExist.deviceId != undefined && isUserExist.bankId != 'acc1') { - // throw new BadRequestException("User Already exist"); - // } - // let newOtp = await this.generateOtp(isUserExist.userId.toString(), flag); - // // if (isUserExist.email) { - // // await this.sendMail(isUserExist.email, newOtp, 'fpwd'); - // // } - // let config = database.filter(data => { - // return data.corpCode == isUserExist.bankId - // }); - // if (config[0].sms == 'globalSms' && isUserExist.mobileNumber) { - // await this.simsSms(config[0], isUserExist, newOtp) + if (body.email) { + if (flag == 'F' || flag == 'R'){ - // } else { + let isUserExist = await this.pcduserRepository.findOne({ where: { email: body.email } }); + + console.log("isUserExist",isUserExist); - // await this.smsService.sendSms(isUserExist.mobileNumber, `${newOtp}`).then(res => { - // console.log(res); + if (flag == 'R' && isUserExist) { + throw new BadRequestException("Already registered with this email Id."); + }else{ + let newOtp = await this.generateOtp(body.email, flag); + + + if (body.email && flag == 'R') { + await this.sendMail(body.email, newOtp, 'otp'); + } + } - // }, err => { - // console.log(err); + } err => { + console.log(err,"hello12345"); - // }); - - - // } - - // } - // } + }; - // } - - // async simsSms(config, isUserExist: PcduserDto, otp) { - // const connection = await this.createConnection(isUserExist.bankId); - // try { - // const data = await connection.execute(`select msg_text from PACS_MSG_TEXT where depo_loan='O'`, [], { outFormat: oracledb.OBJECT }) - // let smsBody = { message: data.rows[0].MSG_TEXT.replace('#20', otp), number: isUserExist.mobileNumber, purpose: 'OTP', template: 'OTP' } - // this.smsService.globalSms(smsBody, isUserExist) - // } - // catch (err) { - // console.log(err); - // } - // finally { } + } - // } + } + // async duplicateCheckingEmail(email: string, flag: string, filter?: FindManyOptions): Promise { @@ -220,65 +182,37 @@ export class AuthService { // } - // async verifyOtp(body: { otp: string, mobile: string, deviceId: string }, flag: string): Promise { - - // console.log('body===', body, flag); - // let currentUser = await this.pcduserRepository.findOne({ where: { mobileNumber: body.mobile } }); - - // // const currentUser = await this.duplicateCheckingEmail(body.email, flag); - // console.log(currentUser); - - // let refCode; - - // if (flag == 'F' && currentUser) { - // refCode = currentUser.userId; - // } - // if (flag == 'R' && currentUser) { - // refCode = currentUser.userId; - // } - // const filter: FindManyOptions = { where: { "refCode": refCode, "status": "I" }, order: { code: "DESC" } }; - // console.log(filter); - - // const newOtp = await this.pcdotpRepository.find(filter); - // console.log(newOtp); - // if (!newOtp) - // throw new BadRequestException("OTP Error. Resend OTP"); - // let currentDateTime = new Date().valueOf(); - // let otpTime = newOtp[0].createdDate.valueOf(); - // let diffMs = (currentDateTime - otpTime); - // let otpExpiry = 120000 - - // let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); - - // if (diffMins > config.get('otp').expiresIn) - // throw new RequestTimeoutException('*OTP Expired'); - - // //otp expiries in 2 minutes - // if (diffMs > otpExpiry) - // throw new RequestTimeoutException('*OTP Expired'); - - // if (newOtp[0].otp != body.otp) - // throw new UnauthorizedException("*Invalid OTP"); - // if (newOtp[0].otp == body.otp) { - // newOtp[0].status = 'V'; - // await this.pcdotpRepository.save(newOtp[0]); - // } + async verifyOtp(body: { otp: string, email: string }, flag: string): Promise { + console.log('body===', body, flag); + + const filter: FindManyOptions = { where: { "refCode": body.email, "status": "I" }, order: { code: "DESC" } }; + + const newOtp = await this.pcdotpRepository.find(filter); + if (!newOtp) + throw new BadRequestException("OTP Error. Resend OTP"); + let currentDateTime = new Date().valueOf(); + let otpTime = newOtp[0].createdDate.valueOf(); + let diffMs = (currentDateTime - otpTime); + let otpExpiry = 600000; //otp expire in 10 minutes + let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); - // if (flag == 'R') { - // currentUser.status = 'V'; - // currentUser.deviceId = body.deviceId - // const regUser = this.pcduserRepository.save(currentUser); - // return regUser; - // } + if (diffMins > config.get('otp').expiresIn) + throw new RequestTimeoutException('*OTP Expired'); - // if (flag == 'F') - // return currentUser; + + if (diffMs > otpExpiry) + throw new RequestTimeoutException('*OTP Expired'); - // } + if (newOtp[0].otp != body.otp) + throw new UnauthorizedException("*Invalid OTP"); + if (newOtp[0].otp == body.otp) { + return { data: 'success' }; + } + } // async resendOtp(body: { code?: string | number, email?: string, mobile: string }, flag: string): Promise { // // const newOtp = await this.generateOtp(body.code.toString(), 'RR'); @@ -297,22 +231,29 @@ export class AuthService { var otpGenerator = require('otp-generator') const newOtp = await otpGenerator.generate(6, { upperCase: false, specialChars: false, alphabets: false }); - console.log("===newOtp====", newOtp); + let usedFor: string = ''; + + switch (flag) { case "R": usedFor = "REGISTRATION"; + break; case "RR": usedFor = "REGISTRATION RESEND" + break; case "F": usedFor = "FORGOT PASSWORD"; + break; case "FR": usedFor = "FORGOT PASSWORD RESEND"; - + break; } try { + + let igotp: PcdotpDto = new PcdotpDto(); igotp.otp = newOtp; igotp.createdBy = 'SYSTEM'; @@ -331,55 +272,55 @@ export class AuthService { } - async updateUser(body: PcduserDto, user: PcduserDto, id: string): Promise { - - const updatedUser = await this.pcduserRepository.findOne(id); - if (updatedUser) { - await this.duplicateCheckingUser(body, 'U'); - updatedUser.userName = body.userName; - // updatedUser.email = body.email; - updatedUser.mobileNumber = body.mobileNumber; - updatedUser.modifiedBy = user.userId; - updatedUser.userImagePath = body.userImagePath; - updatedUser.memberNo = body.memberNo; - for (let eagerCol of await this.pcduserRepository.getEagerColumns()) { - delete body[eagerCol]; - } + // async updateUser(body: PcduserDto, user: PcduserDto, id: string): Promise { + + // const updatedUser = await this.pcduserRepository.findOne(id); + // if (updatedUser) { + // await this.duplicateCheckingUser(body, 'U'); + // updatedUser.userName = body.userName; + // // updatedUser.email = body.email; + // updatedUser.mobileNumber = body.mobileNumber; + // updatedUser.modifiedBy = user.userId; + // updatedUser.userImagePath = body.userImagePath; + // updatedUser.memberNo = body.memberNo; + // for (let eagerCol of await this.pcduserRepository.getEagerColumns()) { + // delete body[eagerCol]; + // } - try { - delete updatedUser["pass"]; - delete updatedUser["salt"]; - delete updatedUser["refreshtoken"]; - return await this.pcduserRepository.save(updatedUser); - } catch (error) { - - console.log("====error====", error); - throw new BadRequestException(error.message); - } - } - else - throw new BadRequestException("User does not Exist"); - } + // try { + // delete updatedUser["pass"]; + // delete updatedUser["salt"]; + // delete updatedUser["refreshtoken"]; + // return await this.pcduserRepository.save(updatedUser); + // } catch (error) { + + // console.log("====error====", error); + // throw new BadRequestException(error.message); + // } + // } + // else + // throw new BadRequestException("User does not Exist"); + // } - async duplicateCheckingUser(body: PcduserDto, flag: string): Promise { - let existingUser: PcduserDto; - if (flag == 'I') { - let existingIgUser: PcduserDto = await this.pcduserRepository.findOne({ where: { email: body.email } }); - if (existingIgUser) - throw new BadRequestException(`User with same Email exist`); - existingUser = await this.pcduserRepository.findOne({ where: [{ "userId": body.userId }, { "email": body.email }, { "mobileNumber": body.mobileNumber }] }); - } - else { - existingUser = await this.pcduserRepository.findOne({ where: [{ "userId": (body.userId), "email": body.email }, { "userId": Not(body.userId), "mobileNumber": body.mobileNumber }] }); - } - if (existingUser) { - if (flag == 'I' && existingUser.userId == body.userId) - throw new BadRequestException(`Duplication in UserId ${body.userId}`); - if (existingUser.email == body.email) - throw new BadRequestException(`Duplication in Email ${body.email}`); - } + // async duplicateCheckingUser(body: PcduserDto, flag: string): Promise { + // let existingUser: PcduserDto; + // if (flag == 'I') { + // let existingIgUser: PcduserDto = await this.pcduserRepository.findOne({ where: { email: body.email } }); + // if (existingIgUser) + // throw new BadRequestException(`User with same Email exist`); + // existingUser = await this.pcduserRepository.findOne({ where: [{ "userId": body.userId }, { "email": body.email }, { "mobileNumber": body.mobileNumber }] }); + // } + // else { + // existingUser = await this.pcduserRepository.findOne({ where: [{ "userId": (body.userId), "email": body.email }, { "userId": Not(body.userId), "mobileNumber": body.mobileNumber }] }); + // } + // if (existingUser) { + // if (flag == 'I' && existingUser.userId == body.userId) + // throw new BadRequestException(`Duplication in UserId ${body.userId}`); + // if (existingUser.email == body.email) + // throw new BadRequestException(`Duplication in Email ${body.email}`); + // } - } + // } // async googleSignIn(mediaData: any, ip?: string): Promise { @@ -564,73 +505,4 @@ export class AuthService { // return await this.generateTokens(pcduser, pcduser.userName, ip, ""); //specify the module here // } - // async createOnlineUsers() { - // let createdConnection: Connection; - // try { - // createdConnection = getConnection(dbConfig.oraclesid || 'con'); - - // } catch (e) { - // createdConnection = await createConnection({ - // name: dbConfig.oraclesid || 'con', - // type: "oracle", - // host: process.env.RDS_HOSTNAME || dbConfig.oraclehost, - // port: process.env.RDS_PORT || dbConfig.oracleport, - // username: process.env.RDS_USERNAME || dbConfig.oracleusername, - // password: process.env.RDS_PASSWORD || dbConfig.oraclepassword, - // sid: process.env.RDS_DB_NAME || dbConfig.oraclesid, - // logging: true, - // // entities: [Iuser, IuserLog, Imotp, Book], - // entities: [__dirname + '/../**/*.entity.{js,ts}'], - // synchronize: false, - // }); - - // } - // let existingUser = await this.pcduserRepository.find({ select: ["custId"] }); - // let existingUserArr = []; - // for (let usr of existingUser) { - // existingUserArr.push(usr.custId); - // } - // createdConnection.connect(); - // let oracustRep = createdConnection.getCustomRepository(CustomerRepository); - // let newOraCust = await oracustRep.find({ select: ["intcustno", "customerMailId", "customerName", "customerMobileNo"], where: { "intcustno": Not(In(existingUserArr)), "customerMobileNo": Not(IsNull()) }, }); - // let unnewOraCust = newOraCust.filter( - // (value, index, self) => - // index === self.findIndex((t) => ( - // t.intcustno === value.intcustno) - // ) - // ); - // for (let row of newOraCust) { - // let authCredentials = new TempSignUpDto(); - // authCredentials.custId = row.intcustno; - // authCredentials.email = row.customerMailId ? row.customerMailId.toLowerCase() : null; - // authCredentials.username = row.customerName; - // authCredentials.password = 'admin'; - // console.log('|||||||||||||', authCredentials, '|||||||||||||'); - // try { - // const result = await this.pcduserRepository.signUp(authCredentials, row.customerMobileNo, row.shareno); - - // } catch (err) { - // console.log(err); - - // // throw new BadRequestException("Error in Password creation"); - // } - - // } - // } - // async changeAccount(acNo, memberNo: string, user: PcduserDto) { - // return await this.pcduserRepository.update(user.userId, { "custId": acNo, "memberNo": memberNo }); - // } - - // async sendSample() { - // this.smsService.sendSms(8893774869, 787878); - // console.log('=========='); - // return; - - - // } - // async encryptBankCode(bankCode: string) { - // return await this.crypto.encryptAesB64(bankCode); - // } - - -} +} \ No newline at end of file diff --git a/src/auth/dto/pcdotp.dto.ts b/src/auth/dto/pcdotp.dto.ts index 0f962e1..a2a16fd 100644 --- a/src/auth/dto/pcdotp.dto.ts +++ b/src/auth/dto/pcdotp.dto.ts @@ -6,7 +6,7 @@ export class PcdotpDto extends PcdBaseDto{ otp: string; - refCode: number | any; + refCode: string; usedFor: string; diff --git a/src/auth/dto/temp-sign-up.dto.ts b/src/auth/dto/temp-sign-up.dto.ts index 17cb098..66377e8 100644 --- a/src/auth/dto/temp-sign-up.dto.ts +++ b/src/auth/dto/temp-sign-up.dto.ts @@ -6,12 +6,9 @@ export class TempSignUpDto { // @MinLength(0) // @MaxLength(12) // @IsNotEmpty() - email?: string; + email: string; - @IsNotEmpty() - custId: string; - @IsString() @MinLength(2) diff --git a/src/auth/pcdotp.entity.ts b/src/auth/pcdotp.entity.ts index 95af6ca..8618ee9 100644 --- a/src/auth/pcdotp.entity.ts +++ b/src/auth/pcdotp.entity.ts @@ -18,11 +18,11 @@ export class Pcdotp extends PcdBaseEntity { otp: string; @Column({ - type: 'numeric', + type: 'varchar', name: 'ref_code', nullable: true, }) - refCode: number; + refCode: string; @Column({ type: 'varchar', diff --git a/src/auth/pcduser.repository.ts b/src/auth/pcduser.repository.ts index 272146b..6e79329 100644 --- a/src/auth/pcduser.repository.ts +++ b/src/auth/pcduser.repository.ts @@ -41,12 +41,12 @@ export class PcduserRepository extends Repository{ } user.userId = maxCode.toString(); user.userName = authCredentials.username; - user.custId = authCredentials.custId; + user.email = authCredentials.email; user.createdBy = "SYSTEM"; user.modifiedBy = "SYSTEM"; user.groupOrUser = 'U'; - user.memberNo = authCredentials.custId; + user.secuLevel = secuLevel; user.salt = salt; user.pass = await this.hashPassword(authCredentials.password, salt); diff --git a/src/dto/customer.dto.ts b/src/dto/customer.dto.ts deleted file mode 100644 index 129acdb..0000000 --- a/src/dto/customer.dto.ts +++ /dev/null @@ -1,45 +0,0 @@ - -export class ScbcustomerDto { - - custId:number; - - branchCode:string; - - customerCode:string; - - customerName:string; - - customerAddress1:string; - - customerAddress2:string; - - customerAddress3:string; - - postofficeName:string; - - landMark:string; - - city:string; - - taluk:string; - - district:string; - - state:string; - - pincode:string; - - dateOfBirth:Date; - - customerMailId:string; - - customerMobileNo:string; - - status:number; - - gender:string; - - photoImage: string; - - customerType: number; -} diff --git a/src/dto/emd-fee-type.dto.ts b/src/dto/emd-fee-type.dto.ts new file mode 100644 index 0000000..7e20921 --- /dev/null +++ b/src/dto/emd-fee-type.dto.ts @@ -0,0 +1,6 @@ +export class EmdFeeTypeDto { + id:number; + + emdFeeType:string; + +} \ No newline at end of file diff --git a/src/dto/form-of-contract.dto.ts b/src/dto/form-of-contract.dto.ts new file mode 100644 index 0000000..b1fdeee --- /dev/null +++ b/src/dto/form-of-contract.dto.ts @@ -0,0 +1,4 @@ +export class FormOfContractDto { + id: number; + formOfContract: string; +} \ No newline at end of file diff --git a/src/dto/ifsc-dto.ts b/src/dto/ifsc-dto.ts deleted file mode 100644 index 5e8941b..0000000 --- a/src/dto/ifsc-dto.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class IfscListDto { - bank: string; - ifsc: string; - branch: string; - address: string; - city1: string; - city2: string; - state: string; - std_code: string; - phone: string; -} diff --git a/src/dto/pacs-mob-benef.dto.ts b/src/dto/pacs-mob-benef.dto.ts deleted file mode 100644 index 4e78ff8..0000000 --- a/src/dto/pacs-mob-benef.dto.ts +++ /dev/null @@ -1,23 +0,0 @@ - -export interface PacsMobBenefDto { - benefId: number; - - custId: string; - - bankId: string; - - targetType: string; - - targetId: string; - - targetNo: string; - - beneficiaryName: string; - - isactive: string; - - entryTime: string; - - trgtId: string; -} - diff --git a/src/dto/payment-mode.dto.ts b/src/dto/payment-mode.dto.ts new file mode 100644 index 0000000..26b4ec5 --- /dev/null +++ b/src/dto/payment-mode.dto.ts @@ -0,0 +1,7 @@ +export class PaymentModeDto{ + + id:number ; + + paymentMode:string; + +} \ No newline at end of file diff --git a/src/dto/pigmy-daily.dto.ts b/src/dto/pigmy-daily.dto.ts deleted file mode 100644 index 689c09a..0000000 --- a/src/dto/pigmy-daily.dto.ts +++ /dev/null @@ -1,51 +0,0 @@ -export interface PigmyDailyDto { - dayDt: Date; - - brcode: string; - - code: string; - - agcode: number; - - accno: string; - - cashAdj: string; - - credit: number; - - debit: null; - - bal: number; - - clerk: string; - - cashier: string; - - manager: string; - - intCode: null; - - intAmt: null; - - intdt: null; - - othCode: null; - - othCharge: null; - - passbook: null; - - sdclerk: null; - - sdmgr: null; - - slipno: null; - - pname: null; - - collDt: null; - - trSection: null; - - transId: null; -} diff --git a/src/dto/product-category.dto.ts b/src/dto/product-category.dto.ts new file mode 100644 index 0000000..2daf87e --- /dev/null +++ b/src/dto/product-category.dto.ts @@ -0,0 +1,6 @@ +export class ProductCategoryDto { + + id:number; + + productCategory:string; +} \ No newline at end of file diff --git a/src/dto/purchase.dto.ts b/src/dto/purchase.dto.ts deleted file mode 100644 index 4a629f1..0000000 --- a/src/dto/purchase.dto.ts +++ /dev/null @@ -1,17 +0,0 @@ - -export class PurchaseDto { - - amount: number; - - application: number; - - mobile: string; - - email: string; - - type: string; - - menuId: string; - - -} \ No newline at end of file diff --git a/src/dto/sb-new.dto.ts b/src/dto/sb-new.dto.ts deleted file mode 100644 index cf3a8cd..0000000 --- a/src/dto/sb-new.dto.ts +++ /dev/null @@ -1,12 +0,0 @@ -export class SbNewDto { - id: number; - name: string; - houseName: string; - aadharNo: string; - postCode: string; - guardian: string; - agcode: number; - amount: number; - createdBy: string; - createdAt: Date; -} diff --git a/src/dto/sbmaster.dto.ts b/src/dto/sbmaster.dto.ts deleted file mode 100644 index cf7111a..0000000 --- a/src/dto/sbmaster.dto.ts +++ /dev/null @@ -1,65 +0,0 @@ -export interface SbMasterDto { - brcode: string; - - code: string; - - accno: string; - - dayDt: Date; - - custId: string; - - memno: string; - - mcode: string; - - nature: string; - - minorDob: Date; - - operBy: string; - - amount: number | 0; - - yearopn: number | 0; - - recoCode: string; - - recoAccno: string; - - recoName: string; - - intrate: number | 0; - - indInst: string; - - closeDt: Date; - - intFreeze: string; - - minBalance: number | 0; - - agentCode: number | 0; - - userId: number | 0; - - entryTime: string; - - oldAccno: string; - - newAccno: string; - - lineNo: number | 0; - - ordno: number | 0; - - zeroornot: string; - - mgrId: number | 0; - - atmCardno: string; - - atmCardIssdt: Date; - - atmCard: string; -} diff --git a/src/dto/scbbank.dto.ts b/src/dto/scbbank.dto.ts deleted file mode 100644 index c4ba9fc..0000000 --- a/src/dto/scbbank.dto.ts +++ /dev/null @@ -1,12 +0,0 @@ -export class ScbbankDto{ - - bankCode: number; - - bankName: string; - - bankAddress1: string; - - bankAddress2: string; - - bankMailId: string; -} \ No newline at end of file diff --git a/src/dto/scbbranch.dto.ts b/src/dto/scbbranch.dto.ts deleted file mode 100644 index 4b649bb..0000000 --- a/src/dto/scbbranch.dto.ts +++ /dev/null @@ -1,14 +0,0 @@ -export class ScbbranchDto { - - branchCode: number; - - branchName: string; - - branchAddress1: string; - - branchAddress2: string; - - branchMailId: string; - - branchPone1: string; -} diff --git a/src/dto/scbchequebook-request.dto.ts b/src/dto/scbchequebook-request.dto.ts deleted file mode 100644 index b6a1a3f..0000000 --- a/src/dto/scbchequebook-request.dto.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbchequebookRequestDto extends PcdBaseDto { - - chequebookId: number; - - custId: number; - - chequebookrequestType: string; -} \ No newline at end of file diff --git a/src/dto/scbcustomer-online.dto.ts b/src/dto/scbcustomer-online.dto.ts deleted file mode 100644 index d061c6a..0000000 --- a/src/dto/scbcustomer-online.dto.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbcustomerOnlineDto extends PcdBaseDto { - - userId: number; - - intcusto: number; - - onlineApplyDate: Date; - - onlineApprovedDate: Date; - - onlineStartDate: Date; - - onlineEndDate: Date; - - onlineApprovedBy: number; - - photoImage: Buffer; - -} \ No newline at end of file diff --git a/src/dto/scbdeposit-scheme-detail.dto.ts b/src/dto/scbdeposit-scheme-detail.dto.ts deleted file mode 100644 index d6cb465..0000000 --- a/src/dto/scbdeposit-scheme-detail.dto.ts +++ /dev/null @@ -1,14 +0,0 @@ -export class ScbdepositSchemeDetailDto { - - schemeno: number - - interestRate: number; - - effectiveDate: Date; - - periodFrom: number; - - periodTo: number; - -} - diff --git a/src/dto/scbdeposit-scheme.dto.ts b/src/dto/scbdeposit-scheme.dto.ts deleted file mode 100644 index cc85aa3..0000000 --- a/src/dto/scbdeposit-scheme.dto.ts +++ /dev/null @@ -1,12 +0,0 @@ - -export class ScbdepositSchemeDto { - - intschemeno:number; - - depositType:string; - - depositSubType:string; - - interestRate:number; -} - diff --git a/src/dto/scbemployee.dto.ts b/src/dto/scbemployee.dto.ts deleted file mode 100644 index 19a4b37..0000000 --- a/src/dto/scbemployee.dto.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class ScbemployeeDto { - branchCode: string; - empNo: number; - empName: string; - empAdd1: string; - empAdd2: string; - empAdd3: string; - designation: number; - custId: number; - customerType: number; -} diff --git a/src/dto/scbfd-deposit.dto.ts b/src/dto/scbfd-deposit.dto.ts deleted file mode 100644 index 5c63b4b..0000000 --- a/src/dto/scbfd-deposit.dto.ts +++ /dev/null @@ -1,34 +0,0 @@ -export class ScbfdDepositDto { - - scbFdno: number; - - branchCode: string; - - fdNo: number; - - intcustno: number; - - depositDate: Date; - - depositAmount: number; - - maturityDate: Date; - - maturityAmount: number; - - depositPeriod: number; - - status: number; - - modifiedBy: string; - - modifiedDate: Date; - - interestRate: number; - - jointAcFlag: string; - - jointCustName: string; - - periodInd: string; -} \ No newline at end of file diff --git a/src/dto/scbloan-detail.dto.ts b/src/dto/scbloan-detail.dto.ts deleted file mode 100644 index 0ea980c..0000000 --- a/src/dto/scbloan-detail.dto.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbloanDetailDto extends PcdBaseDto{ - - scbloanno:number; - - branchCode:string; - - voucherNo:string; - - voucherDt:Date; - - voucherDescription:string; - - chequeNo:string; - - chequeDate:Date; - - amount:number; - -} \ No newline at end of file diff --git a/src/dto/scbloan.dto.ts b/src/dto/scbloan.dto.ts deleted file mode 100644 index ef7b882..0000000 --- a/src/dto/scbloan.dto.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbloanDto extends PcdBaseDto{ - - scbloanno:number; - - branchCode:string; - - loanNo:number; - - custId:number; - - loanType:string; - - loanAmount:number; - - loanTakenDate:Date; - - maturityDate:Date; - - closedDate:Date; - - balanceAmount:number; - - interestPercent:number; - - noOfInstalment:number; - - loanPurpose:string; - - status:number; - elbAmount: number; - overDueInterest: number; - instalmentAmount: string; - noOfInstalmentDue: string; - totalAmountDue: string; - - nextDueDate: Date; - -} \ No newline at end of file diff --git a/src/dto/scblocker-detail.dto.ts b/src/dto/scblocker-detail.dto.ts deleted file mode 100644 index 89e4e02..0000000 --- a/src/dto/scblocker-detail.dto.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom"; - -export class ScblockerDetailDto extends PcdBaseEntity { - - branchCode: string; - - scblockerno: number; - - inttransno: number; - - transactionDate: Date; - - description: string; - - transactionAmount: number; - - createdBy: string; - - createdDate: Date; - -} diff --git a/src/dto/scblocker.dto.ts b/src/dto/scblocker.dto.ts deleted file mode 100644 index 1479acc..0000000 --- a/src/dto/scblocker.dto.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScblockerDto extends PcdBaseDto{ - - branchCode: string; - - scblockerno: number; - - lockerNo: number; - - custId: number; - - startDate: Date; - - rentAmount: number; - - endDate: Date; - - status: number; - - createdBy: string; - - createdDate: Date; - -} diff --git a/src/dto/scbmds-voucher-detail.dto.ts b/src/dto/scbmds-voucher-detail.dto.ts deleted file mode 100644 index ad7047c..0000000 --- a/src/dto/scbmds-voucher-detail.dto.ts +++ /dev/null @@ -1,14 +0,0 @@ -export class ScbmdsVoucherDetailDto { - - scbmdsno: number; - - branchCode: string; - - voucherNo: string; - - voucherDate: Date; - - voucherDesc: string; - - amount: number; -} \ No newline at end of file diff --git a/src/dto/scbmds-voucher.dto.ts b/src/dto/scbmds-voucher.dto.ts deleted file mode 100644 index 1da7406..0000000 --- a/src/dto/scbmds-voucher.dto.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbmdsVoucherDto extends PcdBaseDto{ - - scbmdsno: number; - - branchCode: string; - - mdsno: number; - - mdsSeriesNo: string; - - custId: number; - - status: number; - - salaAmount: number; - - balanceAmount: number; - - instalmentDate: Date; - - instalmentAmount: number; - - lastInstalmentPaidDate: Date; - - dueInstalment: number; - - dueAmount: number; - - totalInstallment: number; - - remittedInstallment: number; - - nextDueAmount: number; - - nextDueDate: number; -} \ No newline at end of file diff --git a/src/dto/scbpassbook.dto.ts b/src/dto/scbpassbook.dto.ts deleted file mode 100644 index ff764fb..0000000 --- a/src/dto/scbpassbook.dto.ts +++ /dev/null @@ -1,18 +0,0 @@ - -export class SbPassbookDto{ - - date: Date; - - intr: number; - - other: number; - - balance: number; - - amount:number; - - remarks: string; - - intshareno: number; - -} \ No newline at end of file diff --git a/src/dto/scbrd-deposit-detail.dto.ts b/src/dto/scbrd-deposit-detail.dto.ts deleted file mode 100644 index 8c61aa4..0000000 --- a/src/dto/scbrd-deposit-detail.dto.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbrdDepositDetailDto extends PcdBaseDto{ - - branchCode: string; - - inttransno: number; - - scbrdno: number; - - voucherNo: string; - - voucherDate: Date; - - chequeNo: string; - - chequeDate: Date; - - description: string; - - amtCashDr: number; - - amtCashCr: number; -} diff --git a/src/dto/scbrd-deposit.dto.ts b/src/dto/scbrd-deposit.dto.ts deleted file mode 100644 index f5f448c..0000000 --- a/src/dto/scbrd-deposit.dto.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbrdDepositDto extends PcdBaseDto{ - - branchCode: string; - - scbrdno: number; - - rdNo: number; - - custId: number; - - startDate: Date; - - balanceAmount: number; - - endDate: Date; - - status: number; - -} diff --git a/src/dto/scbsb-deposit-detail.dto.ts b/src/dto/scbsb-deposit-detail.dto.ts deleted file mode 100644 index 856ce66..0000000 --- a/src/dto/scbsb-deposit-detail.dto.ts +++ /dev/null @@ -1,27 +0,0 @@ -export class ScbsbDepositDetailDto { - - branchCode: string; - - inttransno: number; - - scbsbno: number; - - voucherNo: string; - - voucherDate: Date; - - chequeNo: string; - - chequeDate: Date; - - description: string; - - amtCashDr: number; - - amtCashCr: number; - - createdBy: string; - - createdDate: Date; - -} \ No newline at end of file diff --git a/src/dto/scbsb-deposit.dto.ts b/src/dto/scbsb-deposit.dto.ts deleted file mode 100644 index 65ad1d1..0000000 --- a/src/dto/scbsb-deposit.dto.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ScbsbDepositDetailDto } from "./scbsb-deposit-detail.dto"; - -export class ScbsbDepositDto { - - scbsbno: number; - - branchCode: string; - - custId: number; - - startDate: Date; - - sbNo: string; - - balanceAmount: number; - - endDate: Date; - - status: number; - - createdBy: string; - - createdDate: Date; - - sbDeatil: ScbsbDepositDetailDto[]; - - sbNominee: string; - - jointFlag: string; - - jointCustName: string; - - sbInterestRate: number; - -} \ No newline at end of file diff --git a/src/dto/scbsb-transfer.dto.ts b/src/dto/scbsb-transfer.dto.ts deleted file mode 100644 index 6e9eb0f..0000000 --- a/src/dto/scbsb-transfer.dto.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { PcdBaseDto } from "src/framework/custom/pcd-dto.custom"; - -export class ScbsbTransferDto extends PcdBaseDto { - - id: number; - - custId: number - - depositType: string; - - depositAmount: number; - - intsbno: number; - - intschemeno: number; - - monthlyInterest: string; - - periodFrom: number; - - periodTo: number; - - customerDuration: number; -} \ No newline at end of file diff --git a/src/dto/scbshare.dto.ts b/src/dto/scbshare.dto.ts deleted file mode 100644 index 598719b..0000000 --- a/src/dto/scbshare.dto.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { PcdViewEntity } from "src/framework/custom/pcd-view-entity.custom"; -import { Column, ViewEntity } from "typeorm"; - - -export class SbShareDto { - - shareType: string; - - amount: number; - - shareClass: string; - - intcustno: number; - - intshareno: number; - - -} diff --git a/src/dto/scbsms.dto.ts b/src/dto/scbsms.dto.ts deleted file mode 100644 index ccf3aeb..0000000 --- a/src/dto/scbsms.dto.ts +++ /dev/null @@ -1,29 +0,0 @@ -export class ScbsmsDto { - - id: number; - - purpose: string; - - message: string; - - messageDate: Date; - - status: string; - - genertedBy: string; - - messageid: string; - - bankId: string; - - custId:string; - - senderId: string; - - receiver: string; - - additionalInfo: string; - - type: string; - -} diff --git a/src/dto/tender-category.dto.ts b/src/dto/tender-category.dto.ts new file mode 100644 index 0000000..6a5a368 --- /dev/null +++ b/src/dto/tender-category.dto.ts @@ -0,0 +1,6 @@ +export class TenderCategoryDto{ + + id:number; + + tenderCategory:string; +} \ No newline at end of file diff --git a/src/dto/tender-master.dto.ts b/src/dto/tender-master.dto.ts new file mode 100644 index 0000000..c0221e6 --- /dev/null +++ b/src/dto/tender-master.dto.ts @@ -0,0 +1,60 @@ +export class TenderDetailDto{ + createdBy: string; + createdDate: string; + modifiedBy: string; + modifiedDate: string; + versionNo: number; + sessionNo: number; + id: number; + orgChain: string; + tenderRefNo: string; + tenderId: string; + allowTechEval: string; + paymentMode: number; + allowWithdraw: string; + noOfCovers: number; + itemwiseTechEval: string; + allowTwoStageBid: string; + tenderFee: number; + feePayableTo: string; + feePayableAt: string; + tenderFeeExemption: number; + emdAmt: number; + emdPayableTo: string; + allowEmdBgOrSt: string; + emdPercentage: number; + emdPayableAt: string; + title: string; + workDesc: string; + ndaPreQualification: string; + remarks: string; + tenderValue: number; + contractType: string; + location: string; + preBidMeetAdd: string; + allowNdaTender: string; + productCategory: number; + bidValidity: number; + pincode: number; + preBidDate: Date; + allowPreferencialBidder: string; + subCategory: string; + periodOfWork: number; + preBidMeetPlace: string; + bidOpeningPlace: string; + publishDate: Date; + saleStartDate: Date; + clarificationStartDate: Date; + bidSubStartDate: Date; + bidOpenDate: Date; + saleEndDate: Date; + clarificationEndDate: Date; + bidSubEndDate: Date; + tenderInvName: string; + tenderInvAddess: string; + tenderType: number; + tenderCategory: number; + formOfContract: number; + emd_fee_type: string; + activeYn: string; +} \ No newline at end of file diff --git a/src/dto/tender-type.dto.ts b/src/dto/tender-type.dto.ts new file mode 100644 index 0000000..1991b41 --- /dev/null +++ b/src/dto/tender-type.dto.ts @@ -0,0 +1,6 @@ +export class TenderTypeDto{ + + id:number; + + tenderType:string; +} \ No newline at end of file diff --git a/src/email/email.controller.ts b/src/email/email.controller.ts new file mode 100644 index 0000000..b47a351 --- /dev/null +++ b/src/email/email.controller.ts @@ -0,0 +1,16 @@ +import { Controller, Get, Post, Body } from '@nestjs/common'; +import { EmailService } from './email.service'; + +@Controller('email') +export class EmailController { + + constructor( + private service: EmailService + ) { } + + // @Post() + // sendMail(@Body() body){ + // console.log("===here===") + // return this.service.sendMail(body.toMail,body.subject,body.bodyText,body.htmlText); + // } +} diff --git a/src/email/email.module.ts b/src/email/email.module.ts new file mode 100644 index 0000000..f4fa7c1 --- /dev/null +++ b/src/email/email.module.ts @@ -0,0 +1,35 @@ +import { Module } from '@nestjs/common'; +import { EmailController } from './email.controller'; +import { EmailService } from './email.service'; +import { HandlebarsAdapter, MailerModule } from '@nest-modules/mailer'; +import * as config from 'config'; + +const emailConfig = config.get('mail'); + +@Module({ + imports: [ + MailerModule.forRootAsync({ + useFactory: () => ({ + // remember to turn-on the Less secure app access in the gmail security + transport: { + host: 'smtp.gmail.com', + port: 465, + secure: true, + auth: { + user: emailConfig.user, + pass: emailConfig.pass + }, + tls: { rejectUnauthorized: false } + }, + + }), + }), + ], + controllers: [EmailController], + providers: [EmailService,], + exports: [ + MailerModule, + EmailService + ] +}) +export class EmailModule { } diff --git a/src/email/email.service.ts b/src/email/email.service.ts new file mode 100644 index 0000000..e07c236 --- /dev/null +++ b/src/email/email.service.ts @@ -0,0 +1,29 @@ +import { Injectable } from '@nestjs/common'; +import { MailerService } from '@nest-modules/mailer'; +import * as config from 'config'; + +const mail= config.get('mail'); + +@Injectable() +export class EmailService { + constructor( + private readonly mailerService: MailerService + ) { } + // documenation : https://www.npmjs.com/package/@nest-modules/mailer + + async sendMail(toMail:string,subject:string,bodyText: string,htmlText:string){ + this.mailerService.sendMail({ + to: toMail, // sender address + from: mail.fromMail, // list of receivers + subject: subject, // Subject line + text: bodyText, // plaintext body + html: htmlText, // HTML body content + }) + .then((res) => { + console.log("==== here==res==", res) + }) + .catch((err) => { + console.log("=====err====", err); + }); + } +} diff --git a/src/framework/beans/pcd-form-grid.controller.ts b/src/framework/beans/pcd-form-grid.controller.ts index 0d677af..6945e1e 100644 --- a/src/framework/beans/pcd-form-grid.controller.ts +++ b/src/framework/beans/pcd-form-grid.controller.ts @@ -20,16 +20,15 @@ export class PcdFormGridController{ } - // @Get('/:id') - // async getOne( - // @Query() filterDto: FindManyOptions, - // @Param('id') id: string, - // @GetUser() user: PcduserDto, - // ): Promise { - // this.logger.verbose(`User "${user.userName}" retrieving all tasks. Filters: ${JSON.stringify(filterDto)}`) //for logging - // console.log("===filter==", filterDto); - // return await this.service.findOne(filterDto, id, user); - // } + @Get('/:id') + async getOne( + @Query() filterDto: FindManyOptions, + @Param('id') id: string, + @GetUser() user: PcduserDto, + ): Promise { + + return await this.service.findOne(filterDto, id, user); + } @UsePipes(ValidationPipe) @Post() diff --git a/src/framework/beans/pcd-form-grid.service.ts b/src/framework/beans/pcd-form-grid.service.ts index b88d1b4..8cb2b16 100644 --- a/src/framework/beans/pcd-form-grid.service.ts +++ b/src/framework/beans/pcd-form-grid.service.ts @@ -23,8 +23,6 @@ export class PcdFormGridService implements PcdFormGridInterface { } async findAll(filter: FindManyOptions, user: PcduserDto): Promise { if (!filter.where) filter.where = {}; - if (this.CUSTID) - filter.where[this.CUSTID] = user.custId; if (!await this.preFindAll(filter, user)) throw new BadRequestException(`Unepected Error Occured in findAll`); @@ -46,8 +44,7 @@ export class PcdFormGridService implements PcdFormGridInterface { async findOne(filter: FindManyOptions, id: string | number, user: PcduserDto): Promise { if (!filter.where) filter.where = {}; - if (this.CUSTID) - filter.where[this.CUSTID] = user.custId; + filter.where[this.MAIN_KEY] = id; if (!await this.preFindOne(filter, id, user)) diff --git a/src/tables/emd-fee-type/emd-fee-type.controller.ts b/src/tables/emd-fee-type/emd-fee-type.controller.ts new file mode 100644 index 0000000..31c6d99 --- /dev/null +++ b/src/tables/emd-fee-type/emd-fee-type.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { EmdFeeTypeDto } from 'src/dto/emd-fee-type.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { EmdFeeTypeService } from './emd-fee-type.service'; + +@Controller('emd-fee-type') +export class EmdFeeTypeController extends PcdFormGridController{ + + constructor( + private emdFeeTypeService: EmdFeeTypeService + ) { + super(emdFeeTypeService); + } + +} diff --git a/src/tables/emd-fee-type/emd-fee-type.entity.ts b/src/tables/emd-fee-type/emd-fee-type.entity.ts new file mode 100644 index 0000000..d18fcaf --- /dev/null +++ b/src/tables/emd-fee-type/emd-fee-type.entity.ts @@ -0,0 +1,24 @@ +import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom"; +import { TenderMaster } from "src/tender-master/tender-master.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('emd_fee_type') +export class EmdFeeType extends PcdBaseEntity{ + + @PrimaryGeneratedColumn({ + name:"id" + }) + id:number + + @Column({ + name:'emd_fee_type', + type:'varchar', + length:500, + nullable:true + }) + emdFeeType:string + + @OneToMany(() => TenderMaster, (tenderMaster) => tenderMaster.emdFeeTypeD ) + tenderMaster:TenderMaster[] + +} \ No newline at end of file diff --git a/src/tables/emd-fee-type/emd-fee-type.module.ts b/src/tables/emd-fee-type/emd-fee-type.module.ts new file mode 100644 index 0000000..d0e3704 --- /dev/null +++ b/src/tables/emd-fee-type/emd-fee-type.module.ts @@ -0,0 +1,13 @@ +import { Module } from '@nestjs/common'; +import { EmdFeeTypeController } from './emd-fee-type.controller'; +import { EmdFeeTypeService } from './emd-fee-type.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { EmdFeeTypeRepository } from './emd-fee-type.repository'; + +@Module({ imports: [ + TypeOrmModule.forFeature([EmdFeeTypeRepository]) +], + controllers: [EmdFeeTypeController], + providers: [EmdFeeTypeService] +}) +export class EmdFeeTypeModule {} diff --git a/src/tables/emd-fee-type/emd-fee-type.repository.ts b/src/tables/emd-fee-type/emd-fee-type.repository.ts new file mode 100644 index 0000000..8a506cf --- /dev/null +++ b/src/tables/emd-fee-type/emd-fee-type.repository.ts @@ -0,0 +1,7 @@ +import { EntityRepository, Repository } from "typeorm"; +import { EmdFeeType } from "./emd-fee-type.entity"; + +@EntityRepository(EmdFeeType) +export class EmdFeeTypeRepository extends Repository{ + +} diff --git a/src/tables/emd-fee-type/emd-fee-type.service.ts b/src/tables/emd-fee-type/emd-fee-type.service.ts new file mode 100644 index 0000000..ec0099d --- /dev/null +++ b/src/tables/emd-fee-type/emd-fee-type.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { EmdFeeTypeDto } from 'src/dto/emd-fee-type.dto'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { EmdFeeTypeRepository } from './emd-fee-type.repository'; + +@Injectable() +export class EmdFeeTypeService extends PcdFormGridService{ + + constructor( + @InjectRepository(EmdFeeTypeRepository) + private emdFeeTypeRepository: EmdFeeTypeRepository, + ) { + super(emdFeeTypeRepository); + } + +} diff --git a/src/tables/form-of-contract/form-of-contract.controller.ts b/src/tables/form-of-contract/form-of-contract.controller.ts new file mode 100644 index 0000000..70c1719 --- /dev/null +++ b/src/tables/form-of-contract/form-of-contract.controller.ts @@ -0,0 +1,12 @@ +import { Controller } from '@nestjs/common'; +import { FormOfContractDto } from 'src/dto/form-of-contract.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { FormOfContractService } from './form-of-contract.service'; + +@Controller('form-of-contract') +export class FormOfContractController extends PcdFormGridController { + constructor( + private formOfContractService: FormOfContractService + ) { + super(formOfContractService); + }} diff --git a/src/tables/form-of-contract/form-of-contract.module.ts b/src/tables/form-of-contract/form-of-contract.module.ts new file mode 100644 index 0000000..f5a8c21 --- /dev/null +++ b/src/tables/form-of-contract/form-of-contract.module.ts @@ -0,0 +1,15 @@ +import { Module } from '@nestjs/common'; +import { FormOfContractController } from './form-of-contract.controller'; +import { FormOfContractService } from './form-of-contract.service'; +import { typeOrmConfig } from 'src/config/typeorm.config'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { FormOfContractRepository } from './form-of-contract.repository'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([FormOfContractRepository]) + ], + controllers: [FormOfContractController], + providers: [FormOfContractService] +}) +export class FormOfContractModule {} diff --git a/src/tables/form-of-contract/form-of-contract.service.ts b/src/tables/form-of-contract/form-of-contract.service.ts new file mode 100644 index 0000000..c13f8f2 --- /dev/null +++ b/src/tables/form-of-contract/form-of-contract.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { FormOfContractDto } from 'src/dto/form-of-contract.dto'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { FormOfContractRepository } from './form-of-contract.repository'; + +@Injectable() +export class FormOfContractService extends PcdFormGridService { + constructor( + @InjectRepository(FormOfContractRepository) + private formOfContractRepository: FormOfContractRepository, + ) { + super(formOfContractRepository); + } + +} diff --git a/src/tables/payment-mode/payment-mode.controller.ts b/src/tables/payment-mode/payment-mode.controller.ts new file mode 100644 index 0000000..f4f97fb --- /dev/null +++ b/src/tables/payment-mode/payment-mode.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { PaymentModeDto } from 'src/dto/payment-mode.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { PaymentModeService } from './payment-mode.service'; + +@Controller('payment-mode') +export class PaymentModeController extends PcdFormGridController { + + constructor( + private paymentModeService: PaymentModeService + ) { + super(paymentModeService); + } + +} diff --git a/src/tables/payment-mode/payment-mode.module.ts b/src/tables/payment-mode/payment-mode.module.ts new file mode 100644 index 0000000..6e9bd75 --- /dev/null +++ b/src/tables/payment-mode/payment-mode.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { PaymentModeController } from './payment-mode.controller'; +import { PaymentModeService } from './payment-mode.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { PaymentModeRepository } from './payment-mode.repository'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([PaymentModeRepository]) + ], + controllers: [PaymentModeController], + providers: [PaymentModeService] +}) +export class PaymentModeModule {} diff --git a/src/tables/payment-mode/payment-mode.service.ts b/src/tables/payment-mode/payment-mode.service.ts new file mode 100644 index 0000000..4351286 --- /dev/null +++ b/src/tables/payment-mode/payment-mode.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { PaymentModeDto } from 'src/dto/payment-mode.dto'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { PaymentModeRepository } from './payment-mode.repository'; + +@Injectable() +export class PaymentModeService extends PcdFormGridService{ + + constructor( + @InjectRepository(PaymentModeRepository) + private paymentModeRepository: PaymentModeRepository, + ) { + super(paymentModeRepository); + } +} diff --git a/src/tables/product-category/product-category.controller.ts b/src/tables/product-category/product-category.controller.ts new file mode 100644 index 0000000..39a1dbb --- /dev/null +++ b/src/tables/product-category/product-category.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { ProductCategoryDto } from 'src/dto/product-category.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { ProductCategoryService } from './product-category.service'; + +@Controller('product-category') +export class ProductCategoryController extends PcdFormGridController { + + constructor( + private productCategoryService: ProductCategoryService + ) { + super(productCategoryService); + } + +} diff --git a/src/tables/product-category/product-category.module.ts b/src/tables/product-category/product-category.module.ts new file mode 100644 index 0000000..b9ee4ba --- /dev/null +++ b/src/tables/product-category/product-category.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { ProductCategoryController } from './product-category.controller'; +import { ProductCategoryService } from './product-category.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { ProductCategoryRepository } from './product-category.repository'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([ProductCategoryRepository]) + ], + controllers: [ProductCategoryController], + providers: [ProductCategoryService] +}) +export class ProductCategoryModule {} diff --git a/src/tables/product-category/product-category.service.ts b/src/tables/product-category/product-category.service.ts new file mode 100644 index 0000000..56f3baf --- /dev/null +++ b/src/tables/product-category/product-category.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { ProductCategoryDto } from 'src/dto/product-category.dto'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { ProductCategoryRepository } from './product-category.repository'; + +@Injectable() +export class ProductCategoryService extends PcdFormGridService{ + + constructor( + @InjectRepository(ProductCategoryRepository) + private productCategoryRepository: ProductCategoryRepository, + ) { + super(productCategoryRepository); + } + +} diff --git a/src/tables/tender-category/tender-category.controller.ts b/src/tables/tender-category/tender-category.controller.ts new file mode 100644 index 0000000..430d84b --- /dev/null +++ b/src/tables/tender-category/tender-category.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { TenderCategoryDto } from 'src/dto/tender-category.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { TenderCategoryService } from './tender-category.service'; + +@Controller('tender-category') +export class TenderCategoryController extends PcdFormGridController{ + + constructor( + private tenderCategoryService: TenderCategoryService + ) { + super(tenderCategoryService); + } + +} diff --git a/src/tables/tender-category/tender-category.module.ts b/src/tables/tender-category/tender-category.module.ts new file mode 100644 index 0000000..ade7bdb --- /dev/null +++ b/src/tables/tender-category/tender-category.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { TenderCategoryController } from './tender-category.controller'; +import { TenderCategoryService } from './tender-category.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { TenderCategoryRepository } from './tender-category.repository'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([TenderCategoryRepository]) + ], + controllers: [TenderCategoryController], + providers: [TenderCategoryService] +}) +export class TenderCategoryModule {} diff --git a/src/tables/tender-category/tender-category.service.ts b/src/tables/tender-category/tender-category.service.ts new file mode 100644 index 0000000..2e38224 --- /dev/null +++ b/src/tables/tender-category/tender-category.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { TenderCategoryDto } from 'src/dto/tender-category.dto'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { TenderCategoryRepository } from './tender-category.repository'; + +@Injectable() +export class TenderCategoryService extends PcdFormGridService{ + + constructor( + @InjectRepository(TenderCategoryRepository) + private tenderCategoryRepository: TenderCategoryRepository, + ) { + super(tenderCategoryRepository); + } + +} diff --git a/src/tables/tender-type/tender-type.controller.ts b/src/tables/tender-type/tender-type.controller.ts new file mode 100644 index 0000000..20455e9 --- /dev/null +++ b/src/tables/tender-type/tender-type.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { TenderTypeDto } from 'src/dto/tender-type.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { TenderTypeService } from './tender-type.service'; + +@Controller('tender-type') +export class TenderTypeController extends PcdFormGridController{ + + constructor( + private tenderTypeService: TenderTypeService + ) { + super(tenderTypeService); + } + +} diff --git a/src/tables/tender-type/tender-type.module.ts b/src/tables/tender-type/tender-type.module.ts new file mode 100644 index 0000000..cc0e5c9 --- /dev/null +++ b/src/tables/tender-type/tender-type.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { TenderTypeController } from './tender-type.controller'; +import { TenderTypeService } from './tender-type.service'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { TenderTypeRepository } from './tender-type.repository'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([TenderTypeRepository]) + ], + controllers: [TenderTypeController], + providers: [TenderTypeService] +}) +export class TenderTypeModule {} diff --git a/src/tables/tender-type/tender-type.service.ts b/src/tables/tender-type/tender-type.service.ts new file mode 100644 index 0000000..b20f6f8 --- /dev/null +++ b/src/tables/tender-type/tender-type.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { TenderTypeDto } from 'src/dto/tender-type.dto'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { TenderTypeRepository } from './tender-type.repository'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; + +@Injectable() +export class TenderTypeService extends PcdFormGridService{ + + constructor( + @InjectRepository(TenderTypeRepository) + private tenderTypeRepository: TenderTypeRepository, + ) { + super(tenderTypeRepository); + } + +} diff --git a/src/tender-master/tender-details.controller.ts b/src/tender-master/tender-details.controller.ts index da8b968..e70ba46 100644 --- a/src/tender-master/tender-details.controller.ts +++ b/src/tender-master/tender-details.controller.ts @@ -1,39 +1,16 @@ -import { Controller,Get} from '@nestjs/common'; +import { Controller,Get, Param} from '@nestjs/common'; import { TenderDetailsService } from './tender-details.service'; +import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller'; +import { TenderMaster } from './tender-master.entity'; +import { TenderDetailDto } from 'src/dto/tender-master.dto'; @Controller('tender-details') -export class TenderDetailsController { +export class TenderDetailsController extends PcdFormGridController { constructor( - private tenderDetailsService:TenderDetailsService - - ){ - } - - //@Get() - async getTenderDeatil():Promise{ - return await this.tenderDetailsService.getTenderDesc(); + private tenderDetailsService: TenderDetailsService + ) { + super(tenderDetailsService); } - @Get('tender-type') - async getTenderType():Promise{ - return await this.tenderDetailsService.getTenderType(); - } - @Get('tender-category') - async getTenderCategory():Promise{ - return await this.tenderDetailsService.getTenderCategory(); - } - @Get('payment-mode') - async getPaymentMode():Promise{ - return await this.tenderDetailsService.getPaymentMode(); - } - @Get('form-contract') - async getFormContract():Promise{ - return await this.tenderDetailsService.getFormOfContract(); - } - @Get('product-category') - async getProductCategory():Promise{ - return await this.tenderDetailsService.getProductCategory(); - } - } diff --git a/src/tender-master/tender-details.module.ts b/src/tender-master/tender-details.module.ts index 7849a43..fe0bbe2 100644 --- a/src/tender-master/tender-details.module.ts +++ b/src/tender-master/tender-details.module.ts @@ -3,23 +3,12 @@ import { TenderDetailsController } from './tender-details.controller'; import { TenderDetailsService } from './tender-details.service'; import { TenderMasterRepository } from './tender-master.repository'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { FormOfContractRepository } from 'src/tables/form-of-contract/form-of-contract.repository'; -import { PaymentModeRepository } from 'src/tables/payment-mode/payment-mode.repository'; -import { ProductCategoryRepository } from 'src/tables/product-category/product-category.repository'; -import { TenderCategoryRepository } from 'src/tables/tender-category/tender-category.repository'; -import { TenderTypeRepository } from 'src/tables/tender-type/tender-type.repository'; @Module({ imports: [ TypeOrmModule.forFeature([ - FormOfContractRepository, - TenderMasterRepository, - PaymentModeRepository, - ProductCategoryRepository, - TenderCategoryRepository, - TenderTypeRepository - + TenderMasterRepository ]), ], controllers: [TenderDetailsController], diff --git a/src/tender-master/tender-details.service.ts b/src/tender-master/tender-details.service.ts index 08bf76b..ab87f32 100644 --- a/src/tender-master/tender-details.service.ts +++ b/src/tender-master/tender-details.service.ts @@ -5,38 +5,18 @@ import { TenderCategoryRepository } from 'src/tables/tender-category/tender-cate import { FormOfContractRepository } from 'src/tables/form-of-contract/form-of-contract.repository'; import { ProductCategoryRepository } from 'src/tables/product-category/product-category.repository'; import { PaymentModeRepository } from 'src/tables/payment-mode/payment-mode.repository'; +import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; +import { TenderDetailDto } from 'src/dto/tender-master.dto'; +import { InjectRepository } from '@nestjs/typeorm'; @Injectable() -export class TenderDetailsService { +export class TenderDetailsService extends PcdFormGridService{ -constructor( - private tenderMasterRepository:TenderMasterRepository, - private tenderTypeRepository:TenderTypeRepository, - private tenderCategoryRepository: TenderCategoryRepository, - private formOfContractRepository:FormOfContractRepository, - private productcategoryRepository:ProductCategoryRepository, - private paymentModeRepository : PaymentModeRepository -){} - - async getTenderDesc(){ - return await this.tenderMasterRepository.find({ select: ["title","tenderRefNo","saleEndDate","bidOpenDate"]}) - } - - async getTenderType(){ - return await this.tenderTypeRepository.find({ select: ["id","tenderType"]}) - } - async getTenderCategory(){ - return await this.tenderCategoryRepository.find({ select: ["id","tenderCategory"]}) + constructor( + @InjectRepository(TenderMasterRepository) + private tenderMasterRepository: TenderMasterRepository, + ) { + super(tenderMasterRepository); } - async getPaymentMode(){ - return await this.paymentModeRepository.find({ select: ["id","paymentMode"]}) - } - async getFormOfContract(){ - return await this.formOfContractRepository.find({ select: ["id","formOfContract"]}) - } - async getProductCategory(){ - return await this.productcategoryRepository.find({ select: ["id","productCategory"]}) - } - } diff --git a/src/tender-master/tender-master.entity.ts b/src/tender-master/tender-master.entity.ts index 27aa072..c089291 100644 --- a/src/tender-master/tender-master.entity.ts +++ b/src/tender-master/tender-master.entity.ts @@ -1,6 +1,7 @@ import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom"; import { ImportantDoc } from "src/imp-doc/imp-doc.entity"; import { paymentInstrument } from "src/payment-instrument/payment-ins.entity"; +import { EmdFeeType } from "src/tables/emd-fee-type/emd-fee-type.entity"; import { FormOfContract } from "src/tables/form-of-contract/form-of-contract.entity"; import { PaymentMode } from "src/tables/payment-mode/payment-mode.entity"; import { ProductCategory } from "src/tables/product-category/product-category.entity"; @@ -344,11 +345,18 @@ export class TenderMaster extends PcdBaseEntity{ @Column({ name:"emd_fee_type", type:"varchar", - length:500, nullable:true }) emd_fee_type:string + @Column({ + name:"activeyn", + type:"varchar", + length:1, + nullable:true + }) + activeYn:string + @OneToMany(() => ImportantDoc, (importantDoc) => importantDoc.tenderIdD ) importantDoc:ImportantDoc[] @@ -358,26 +366,30 @@ export class TenderMaster extends PcdBaseEntity{ @OneToMany(() => TenderDoc, (TenderDoc) => TenderDoc.tenderIdD ) TenderDoc:TenderDoc[] - @ManyToOne(() => TenderType,(tenderType)=> tenderType.tenderMaster) + @ManyToOne(() => TenderType,(tenderType)=> tenderType.tenderMaster,{eager:true}) @JoinColumn([{ name: "tender_type", referencedColumnName: "id" }]) tenderTypeD:TenderType - @ManyToOne(() => TenderCategory,(tenderCategory)=> tenderCategory.tenderMaster) + @ManyToOne(() => TenderCategory,(tenderCategory)=> tenderCategory.tenderMaster,{eager:true}) @JoinColumn([{ name: "tender_category", referencedColumnName: "id" }]) tenderCategoryD:TenderCategory - @ManyToOne(() => PaymentMode,(paymentMode)=> paymentMode.tenderMaster) + @ManyToOne(() => PaymentMode,(paymentMode)=> paymentMode.tenderMaster,{eager:true}) @JoinColumn([{ name: "payment_mode", referencedColumnName: "id" }]) paymentModeD:PaymentMode - @ManyToOne(() => FormOfContract,(formOfContract)=> formOfContract.tenderMaster) + @ManyToOne(() => FormOfContract,(formOfContract)=> formOfContract.tenderMaster,{eager:true}) @JoinColumn([{ name: "form_of_contract", referencedColumnName: "id" }]) formOfContractD:FormOfContract - @ManyToOne(() => ProductCategory,(productCategory)=> productCategory.tenderMaster) + @ManyToOne(() => ProductCategory,(productCategory)=> productCategory.tenderMaster,{eager:true}) @JoinColumn([{ name: "product_cat", referencedColumnName: "id" }]) productCategoryD:ProductCategory + + @ManyToOne(() => EmdFeeType,(EmdFeeType)=> EmdFeeType.tenderMaster,{eager:true}) + @JoinColumn([{ name: "emd_fee_type", referencedColumnName: "id" }]) + emdFeeTypeD:ProductCategory }