modifications

main
josh 3 years ago
parent b8f74a685f
commit 31b755e904

@ -31,9 +31,9 @@ facebook:
callbackURL: 'https://myfin.api.teorainfotech.com/api/v1/auth/facebook/redirect' callbackURL: 'https://myfin.api.teorainfotech.com/api/v1/auth/facebook/redirect'
mail: mail:
fromMail: 'website.tscb@gmail.com' fromMail: 'tender.tscb178@gmail.com'
user: 'website.tscb@gmail.com' user: 'tender.tscb178@gmail.com'
pass: 'zubhybaneozurlvy' pass: 'gsccukdorvjyfrxr'
cron: cron:
scheduler: false scheduler: false
@ -50,7 +50,7 @@ smsPhoneNumberArgName:
message: 'text' message: 'text'
url: url:
url: "http://localhost:4200/#" url: "https://tender.accuratesoftware.online/#"
bodyWay2SMS: bodyWay2SMS:
apikey: "CKDG9HL5KYFLLILRMX3QX1CPKOIP8QF1" apikey: "CKDG9HL5KYFLLILRMX3QX1CPKOIP8QF1"

@ -1,7 +1,7 @@
import { Controller, Get, UseGuards, Res, Req, Body, ValidationPipe, Post, HttpCode, Ip, HostParam, HttpStatus, Put, Param, Patch } from '@nestjs/common'; import { Controller, Get, UseGuards, Res, Req, Body, ValidationPipe, Post, HttpCode, Ip, HostParam, HttpStatus, Put, Param, Patch } from '@nestjs/common';
import { TokenDto } from './dto/token.dto'; import { TokenDto } from './dto/token.dto';
//import { AuthGuard } from '@nestjs/passport';
import * as config from 'config'; import * as config from 'config';
import { AuthCreadentialsDto } from './dto/auth-credentials.dto'; import { AuthCreadentialsDto } from './dto/auth-credentials.dto';
import { AuthService } from './auth.service'; import { AuthService } from './auth.service';
@ -26,7 +26,6 @@ export class AuthController {
} }
@Post('/signin') @Post('/signin')
async signIn(@Body(ValidationPipe) async signIn(@Body(ValidationPipe)
authCredentialDto: AuthCreadentialsDto, authCredentialDto: AuthCreadentialsDto,
@ -65,7 +64,7 @@ export class AuthController {
@Post('/otp/:flag') @Post('/otp/:flag')
async sendOtp( async sendOtp(
@Body() body: { email: string}, @Body() body: { email: string, custName: string, tenderName: string, bidOpenDate: string },
@Param('flag') flag: string @Param('flag') flag: string
): Promise<void> { ): Promise<void> {
return await this.authService.sendOtp(body, flag); return await this.authService.sendOtp(body, flag);

@ -123,18 +123,203 @@ export class AuthService {
} }
async sendMail(email: string, data: string, flag: string) { async sendMail(email: string, custName: string, tenderName: string, bidOpenDate: string, data: string, flag: string) {
let content: string; let content: string;
let subject: string = "Login Credentials"; let subject: string = "Login Credentials";
if (flag == 'otp') { if (flag == 'otp') {
content = `Your one time password(OTP) for Tender Registration is, ${data} `; content = `
<!doctype html>
<html lang="en-US">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>OTP</title>
<meta name="description" content="New Account Email Template.">
<style type="text/css">
a:hover {text-decoration: underline !important;}
</style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" style="margin: 0px; background-color: #f2f3f8;" leftmargin="0">
<!-- 100% body table -->
<table cellspacing="0" border="0" cellpadding="0" width="100%" bgcolor="#f2f3f8"
style="@import url(https://fonts.googleapis.com/css?family=Rubik:300,400,500,700|Open+Sans:300,400,600,700); font-family: 'Open Sans', sans-serif;">
<tr>
<td>
<table style="background-color: #f2f3f8; max-width:800px; margin:0 auto;" width="100%" border="0"
align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="height:80px;">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center;">
<a href="https://www.thrickodithanamscb.in/" title="logo" target="_blank">
<img width="60" src="https://www.thrickodithanamscb.in/assets/img/emblemwithoutbg.png" title="logo" alt="logo">
</a>
<h3 style="font-family: "Lucida Console", "Courier New", monospace;">THRICKODITHANAM SCB</h3>
</td>
</tr>
<tr>
<td style="height:20px;">&nbsp;</td>
</tr>
<tr>
<td>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"
style="max-width:670px; background:#fff; border-radius:3px; text-align:center;-webkit-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);-moz-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);box-shadow:0 6px 18px 0 rgba(0,0,0,.06);">
<tr>
<td style="height:40px;">&nbsp;</td>
</tr>
<tr>
<td style="padding:0 35px;">
<h1 style="color:#1e1e2d; font-weight:500; margin:0;font-size:32px;font-family:'Rubik',sans-serif;">OTP
</h1>
<p style="font-size:15px; color:#455056; margin:8px 0 0; line-height:24px;">
Please Register immediately after getting OTP , <br>
<strong>Your one time password(OTP) for register in tenders is</strong>.</p>
<span
style="display:inline-block; vertical-align:middle; margin:29px 0 26px; border-bottom:1px solid #cecece; width:100px;"></span>
<p
style="color:#455056; font-size:18px;line-height:20px; margin:0; font-weight: 500;">
<strong
style="display: block; font-size: 13px; margin: 24px 0 4px 0; font-weight:normal; color:rgba(0,0,0,.64);">OTP</strong>
<h1 style="font-family: "Lucida Console", "Courier New", monospace;"> ${data}</h1>
</p>
</td>
</tr>
<tr>
<td style="height:40px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center;">
<p style="font-size:14px; color:rgba(69, 80, 86, 0.7411764705882353); line-height:18px; margin:0 0 0;">&copy;<strong> <a href="https://www.thrickodithanamscb.in/" >www.thrickodithanamscb.in</a></strong> </p>
</td>
</tr>
<tr>
<td style="height:80px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<!--/100% body table-->
</body>
</html> `;
subject = 'OTP' subject = 'OTP'
} }
if (flag == 'uDocSub') {
content = `Dear ${custName},<br><br>
We hope this email finds you well. We would like to express our sincere gratitude for your participation in the tender process for <a style="color:red;">${tenderName}</a>. We are pleased to inform you that your tender documents have been successfully submitted. Thank you for your meticulous efforts in preparing and submitting all the necessary documents within the specified timeframe.<br><br>
The bid opening for the tender you have participated in is scheduled for <a style="color:red;">${bidOpenDate}</a>. During this process, all submitted tenders will be carefully reviewed and assessed. We will diligently consider each proposal and evaluate it against the criteria outlined in the tender documentation.<br>
Should any additional information or documents be required, we will promptly reach out to you via the contact details provided during the submission process.<br><br>
Should you have any queries or require any clarification regarding the tender process or your submission, please contact our dedicated tender support team. You can reach us via email at tscb178@gmail.com or by calling our helpline at tel:04812441062 or tel:04812443452.<br><br>
Once again, we extend our heartfelt appreciation for your participation in this tender. Your interest and contribution are highly valued, and we look forward to the possibility of working together in the future.<br><br>
Best regards,<br>
Thrickodithanam Service Co-operative Bank LTD No 178,<br>
Kunnumpuram, Thrickodithanam,<br> Kottayam, Kerala, 686105.`;
subject = 'Tender Submission Successful - Thank you for your participation!'
}
if (flag == 'fpwd') { if (flag == 'fpwd') {
content = `Your one time password(OTP) for Password reset is, ${data}`; content = ` <!doctype html>
<html lang="en-US">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>OTP</title>
<meta name="description" content="New Account Email Template.">
<style type="text/css">
a:hover {text-decoration: underline !important;}
</style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" style="margin: 0px; background-color: #f2f3f8;" leftmargin="0">
<!-- 100% body table -->
<table cellspacing="0" border="0" cellpadding="0" width="100%" bgcolor="#f2f3f8"
style="@import url(https://fonts.googleapis.com/css?family=Rubik:300,400,500,700|Open+Sans:300,400,600,700); font-family: 'Open Sans', sans-serif;">
<tr>
<td>
<table style="background-color: #f2f3f8; max-width:670px; margin:0 auto;" width="100%" border="0"
align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="height:80px;">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center;">
<a href="https://www.thrickodithanamscb.in/" title="logo" target="_blank">
<img width="60" src="https://www.thrickodithanamscb.in/assets/img/emblemwithoutbg.png" title="logo" alt="logo">
</a>
<h3 style="font-family: "Lucida Console", "Courier New", monospace;">THRICKODITHANAM SCB</h3>
</td>
</tr>
<tr>
<td style="height:20px;">&nbsp;</td>
</tr>
<tr>
<td>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"
style="max-width:670px; background:#fff; border-radius:3px; text-align:center;-webkit-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);-moz-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);box-shadow:0 6px 18px 0 rgba(0,0,0,.06);">
<tr>
<td style="height:40px;">&nbsp;</td>
</tr>
<tr>
<td style="padding:0 35px;">
<h1 style="color:#1e1e2d; font-weight:500; margin:0;font-size:32px;font-family:'Rubik',sans-serif;">OTP
</h1>
<p style="font-size:15px; color:#455056; margin:8px 0 0; line-height:24px;">
Please Register immediately after getting OTP , <br>
<strong>Your one time password(OTP) for Reset Password is</strong>.</p>
<span
style="display:inline-block; vertical-align:middle; margin:29px 0 26px; border-bottom:1px solid #cecece; width:100px;"></span>
<p
style="color:#455056; font-size:18px;line-height:20px; margin:0; font-weight: 500;">
<strong
style="display: block; font-size: 13px; margin: 24px 0 4px 0; font-weight:normal; color:rgba(0,0,0,.64);">OTP</strong>
<h1 style="font-family: "Lucida Console", "Courier New", monospace;"> ${data}</h1>
</p>
</td>
</tr>
<tr>
<td style="height:40px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center;">
<p style="font-size:14px; color:rgba(69, 80, 86, 0.7411764705882353); line-height:18px; margin:0 0 0;">&copy;
<strong> <a href="https://www.thrickodithanamscb.in/" >www.thrickodithanamscb.in</a></strong> </p>
</td>
</tr>
<tr>
<td style="height:80px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<!--/100% body table-->
</body>
</html> `;
subject = 'OTP' subject = 'OTP'
} }
@ -144,10 +329,10 @@ export class AuthService {
async sendOtp(body: { email: string}, flag: string): Promise<void> { async sendOtp(body: { email: string, custName: string, tenderName: string, bidOpenDate: string }, flag: string): Promise<void> {
if (body.email) { if (body.email) {
if (flag == 'F' || flag == 'R'){ if (flag == 'F' || flag == 'R' || flag == 'UD') {
let isUserExist = await this.pcduserRepository.findOne({ where: { email: body.email } }); let isUserExist = await this.pcduserRepository.findOne({ where: { email: body.email } });
@ -161,10 +346,13 @@ export class AuthService {
} else { } else {
let newOtp = await this.generateOtp(body.email, flag); let newOtp = await this.generateOtp(body.email, flag);
if (body.email && flag == 'R') { if (body.email && flag == 'R') {
await this.sendMail(body.email, newOtp, 'otp'); await this.sendMail(body.email, body.custName, body.tenderName, body.bidOpenDate, newOtp, 'otp');
} }
if (body.email && flag == 'F') { if (body.email && flag == 'F') {
await this.sendMail(body.email, newOtp, 'fpwd'); await this.sendMail(body.email, body.custName, body.tenderName, body.bidOpenDate, newOtp, 'fpwd');
}
if (body.email && flag == 'UD') {
await this.sendMail(body.email, body.custName, body.tenderName, body.bidOpenDate, newOtp, 'uDocSub');
} }
} }
@ -178,7 +366,6 @@ export class AuthService {
} }
} }
async tempSignUp(pcdUserDto: PcduserDto): Promise<any> { async tempSignUp(pcdUserDto: PcduserDto): Promise<any> {
const filter: FindManyOptions = { where: { "refCode": pcdUserDto.email, "status": "I" }, order: { code: "DESC" } }; const filter: FindManyOptions = { where: { "refCode": pcdUserDto.email, "status": "I" }, order: { code: "DESC" } };
const newOtp = await this.pcdotpRepository.find(filter); const newOtp = await this.pcdotpRepository.find(filter);
@ -190,7 +377,6 @@ export class AuthService {
throw new UnauthorizedException('Unauthorized Access'); throw new UnauthorizedException('Unauthorized Access');
} }
//Creating Random User_Id for every user registered //Creating Random User_Id for every user registered
const lastUser: PcduserDto = await this.pcduserRepository.findOne({ const lastUser: PcduserDto = await this.pcduserRepository.findOne({
where: {}, where: {},

@ -13,9 +13,7 @@ export class EmailService {
async sendMail(toMail:string,subject:string,bodyText: string,htmlText:string){ async sendMail(toMail:string,subject:string,bodyText: string,htmlText:string){
this.mailerService.sendMail({ this.mailerService.sendMail({
to: toMail, // sender address to: toMail, // sender addressject: subject, // Subject line
from: mail.fromMail, // list of receivers
subject: subject, // Subject line
text: bodyText, // plaintext body text: bodyText, // plaintext body
html: htmlText, // HTML body content html: htmlText, // HTML body content
}) })

@ -13,6 +13,7 @@ import { join, extname } from 'path';
import { tenderDocRepository } from 'src/tables/tender-documents/tender-doc.repository'; import { tenderDocRepository } from 'src/tables/tender-documents/tender-doc.repository';
import { TenderDocumentDto } from 'src/dto/tender-document.dto'; import { TenderDocumentDto } from 'src/dto/tender-document.dto';
import { InjectRepository } from '@nestjs/typeorm'; import { InjectRepository } from '@nestjs/typeorm';
import { log } from 'console';
export function createFolders(filePath: string) { export function createFolders(filePath: string) {
@ -58,9 +59,8 @@ export class FileUploadController {
return cb(null, childFolder); return cb(null, childFolder);
}, },
filename: (req, file, cb) => { filename: (req, file, cb) => {
console.log('===here===file upload=='); // Use the original filename instead of generating a random name
const randomName = Array(32).fill(null).map(() => (Math.round(Math.random() * 16)).toString(16)).join(''); return cb(null, `${file.originalname}`);
return cb(null, `${randomName}${extname(file.originalname)}`);
} }
}) })
})) }))
@ -88,9 +88,8 @@ export class FileUploadController {
return cb(null, filePath); return cb(null, filePath);
}, },
filename: (req, file, cb) => { filename: (req, file, cb) => {
console.log('===here===file upload=='); // Use the original filename instead of generating a random name
const randomName = Array(32).fill(null).map(() => (Math.round(Math.random() * 16)).toString(16)).join(''); return cb(null, `${file.originalname}`);
return cb(null, `${randomName}${extname(file.originalname)}`);
} }
}) })
})) }))
@ -116,9 +115,8 @@ export class FileUploadController {
return cb(null, filePath); return cb(null, filePath);
}, },
filename: (req, file, cb) => { filename: (req, file, cb) => {
console.log('===here===file upload=='); // Use the original filename instead of generating a random name
const randomName = Array(32).fill(null).map(() => (Math.round(Math.random() * 16)).toString(16)).join(''); return cb(null, `${file.originalname}`);
return cb(null, `${randomName}${extname(file.originalname)}`);
} }
}) })
})) }))
@ -243,9 +241,8 @@ async deleteNotice(
return cb(null, filePath); return cb(null, filePath);
}, },
filename: (req, file, cb) => { filename: (req, file, cb) => {
console.log('===here===file upload=='); // Use the original filename instead of generating a random name
const randomName = Array(32).fill(null).map(() => (Math.round(Math.random() * 16)).toString(16)).join(''); return cb(null, `${file.originalname}`);
return cb(null, `${randomName}${extname(file.originalname)}`);
} }
}) })
})) }))
@ -380,7 +377,13 @@ async deleteNotice(
@Req() req, @Req() req,
) { ) {
const folderPath = path.join('./uploads/Drawings', id); const folderPath = path.join('./uploads/Drawings', id);
console.log(folderPath);
if (!fs.existsSync(folderPath)) { if (!fs.existsSync(folderPath)) {
console.log(
"helloo"
);
res.status(404).send({ error: 'File not found' }); res.status(404).send({ error: 'File not found' });
return; return;
} }

@ -3,7 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm';
import { PaymentMasterDto } from 'src/dto/payment-master.dto'; import { PaymentMasterDto } from 'src/dto/payment-master.dto';
import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service'; import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service';
import { PaymentMasterRepository } from './payment-master.repository'; import { PaymentMasterRepository } from './payment-master.repository';
import { log } from 'console';
@Injectable() @Injectable()
export class PaymentMasterService extends PcdFormGridService<PaymentMasterDto>{ export class PaymentMasterService extends PcdFormGridService<PaymentMasterDto>{
@ -58,8 +58,6 @@ async finalBidAmt(tenderId ,userId,body){
}else{ }else{
throw new BadRequestException('Bid Amount Already Exist') throw new BadRequestException('Bid Amount Already Exist')
} }
} }
} }

@ -15,7 +15,14 @@ export class TenderController extends PcdTransactionController<TenderDetailDto>
@Get('admin') @Get('admin')
async getTender() { async getTender() {
return this.tenderService.GetAdminTenderD() return this.tenderService.GetAdminTenderD()
} }
@Get('admin/dashboard')
async getDashboard() {
return this.tenderService.GetAdminDashboard()
}
} }

@ -54,4 +54,8 @@ export class TenderService extends PcdTransactionService<TenderDetailDto>{
return this.tenderMasterRepository.find() return this.tenderMasterRepository.find()
} }
async GetAdminDashboard(){
let query = `select id, title , bid_open_date as bidOpenDate, publish_date as publishDate from tender_master tm `
return this.tenderMasterRepository.query(query)
}
} }

Loading…
Cancel
Save