modified
parent
7cb0c9e694
commit
18d0d2e04d
@ -1,39 +0,0 @@
|
||||
// cluster.ts
|
||||
import * as cluster from 'cluster';
|
||||
import * as os from 'os';
|
||||
|
||||
export class Cluster {
|
||||
static register(workers: Number, callback: Function): void {
|
||||
if (cluster.isMaster) {
|
||||
console.log(`Master server started on ${process.pid}`);
|
||||
|
||||
//ensure workers exit cleanly
|
||||
process.on('SIGINT', function () {
|
||||
console.log('Cluster shutting down...');
|
||||
for (var id in cluster.workers) {
|
||||
cluster.workers[id].kill();
|
||||
}
|
||||
// exit the master process
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
var cpus = os.cpus().length;
|
||||
if (workers > cpus)
|
||||
workers = cpus;
|
||||
|
||||
for (let i = 0; i < workers; i++) {
|
||||
cluster.fork();
|
||||
}
|
||||
cluster.on('online', function (worker) {
|
||||
console.log('Worker %s is online', worker.process.pid);
|
||||
});
|
||||
cluster.on('exit', (worker, code, signal) => {
|
||||
console.log(`Worker ${worker.process.pid} died. Restarting`);
|
||||
cluster.fork();
|
||||
})
|
||||
} else {
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,13 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { Logger } from "@nestjs/common";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { Pcdotp } from "./pcdotp.entity";
|
||||
import * as config from 'config';
|
||||
|
||||
@EntityRepository(Pcdotp)
|
||||
@Injectable()
|
||||
export class PcdotpRepository extends Repository<Pcdotp>{
|
||||
constructor(private dataSource: DataSource) {
|
||||
super(Pcdotp, dataSource.createEntityManager());
|
||||
}
|
||||
private logger = new Logger('PcdotpRepository'); // for logging
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
export class CommonDto{
|
||||
marquee : string
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
export class reportAuthenticationDto{
|
||||
|
||||
id:number;
|
||||
|
||||
adminUsers:string
|
||||
|
||||
key:number[]
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,62 +1,62 @@
|
||||
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;
|
||||
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;
|
||||
emdFeeType: string;
|
||||
activeYn: string;
|
||||
sendReport : string;
|
||||
bidOpenAddress : 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;
|
||||
emdFeeType: string;
|
||||
activeYn: string;
|
||||
sendReport: string;
|
||||
bidOpenAddress: string
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
import { CommonDto } from 'src/dto/common.dto';
|
||||
import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller';
|
||||
import { CommonService } from './common.service';
|
||||
|
||||
@Controller('common')
|
||||
export class CommonController extends PcdFormGridController<CommonDto>{
|
||||
|
||||
constructor(
|
||||
private commonService: CommonService
|
||||
) {
|
||||
super(commonService);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom";
|
||||
import { Column, Entity, EntityRepository, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity('common')
|
||||
export class Common extends PcdBaseEntity{
|
||||
|
||||
|
||||
@PrimaryGeneratedColumn({
|
||||
name:"id"
|
||||
})
|
||||
id:number
|
||||
|
||||
@Column({
|
||||
name:'marquee',
|
||||
type:"varchar",
|
||||
length:1000,
|
||||
nullable:true
|
||||
})
|
||||
marquee:string
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { CommonController } from './common.controller';
|
||||
import { CommonService } from './common.service';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { commonRepository } from './common.repository';
|
||||
import { Common } from './common.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([Common]),
|
||||
],
|
||||
controllers: [CommonController],
|
||||
providers: [CommonService,commonRepository]
|
||||
})
|
||||
export class CommonModule {}
|
||||
@ -0,0 +1,12 @@
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { Common } from "./common.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@Injectable()
|
||||
export class commonRepository extends Repository<Common>{
|
||||
constructor(
|
||||
private datasource:DataSource
|
||||
){
|
||||
super(Common,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service';
|
||||
import { Common } from './common.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { commonRepository } from './common.repository';
|
||||
|
||||
@Injectable()
|
||||
export class CommonService extends PcdFormGridService<Common>{
|
||||
|
||||
constructor(
|
||||
@InjectRepository(commonRepository)
|
||||
private commonRepository: commonRepository,
|
||||
) {
|
||||
super(commonRepository);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { CoversLov } from "./covers-lov.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(CoversLov)
|
||||
@Injectable()
|
||||
export class CoversLovRepository extends Repository<CoversLov>{
|
||||
|
||||
constructor(
|
||||
private datasource:DataSource
|
||||
){
|
||||
super(CoversLov ,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,11 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { CoverDoc } from "./covers-master.entity";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { CoverDoc } from "./covers-master.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(CoverDoc)
|
||||
export class CoverMasterRepository extends Repository<CoverDoc>{
|
||||
|
||||
}
|
||||
@Injectable()
|
||||
export class CoverMasterRepository extends Repository<CoverDoc>{
|
||||
constructor(private datasource : DataSource){
|
||||
super(CoverDoc, datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { DocumentType } from "./document-type.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(DocumentType)
|
||||
@Injectable()
|
||||
export class DocumentTypeRepository extends Repository<DocumentType>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(DocumentType,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { EmdFeeType } from "./emd-fee-type.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(EmdFeeType)
|
||||
@Injectable()
|
||||
export class EmdFeeTypeRepository extends Repository<EmdFeeType>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(EmdFeeType , datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { FileFormat } from "./file-format-lov.entity";
|
||||
import { Inject, Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(FileFormat)
|
||||
@Injectable()
|
||||
export class FileFormatRepository extends Repository<FileFormat>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(FileFormat , datasource.createEntityManager())
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { FormOfContract } from "./form-of-contract.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(FormOfContract)
|
||||
@Injectable()
|
||||
export class FormOfContractRepository extends Repository<FormOfContract>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(FormOfContract , datasource.createEntityManager())
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom";
|
||||
import { TenderMaster } from "src/tables/tender-master/tender-master.entity";
|
||||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
|
||||
@Entity('payment-instrument')
|
||||
export class paymentInstrument extends PcdBaseEntity{
|
||||
@PrimaryColumn({
|
||||
name:"id"
|
||||
})
|
||||
id:number
|
||||
|
||||
@Column({
|
||||
name:"bank_name",
|
||||
type:"varchar",
|
||||
nullable:true
|
||||
})
|
||||
bankName:string
|
||||
@Column({
|
||||
name:"tender_id",
|
||||
type:"numeric",
|
||||
//length:500,
|
||||
nullable:true
|
||||
})
|
||||
tenderId:number
|
||||
|
||||
@ManyToOne(() => TenderMaster,(tenderMaster)=> tenderMaster.coverDoc)
|
||||
@JoinColumn([{ name: "tender_id", referencedColumnName: "id" }])
|
||||
tenderIdD:TenderMaster
|
||||
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { paymentInstrument } from "./payment-ins.entity";
|
||||
|
||||
@EntityRepository(paymentInstrument)
|
||||
export class paymentInstrumentRepository extends Repository<paymentInstrument>{
|
||||
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { PaymentMaster } from "./payment-master.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(PaymentMaster)
|
||||
@Injectable()
|
||||
export class PaymentMasterRepository extends Repository<PaymentMaster>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(PaymentMaster , datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { PaymentMode } from "./payment-mode.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(PaymentMode)
|
||||
@Injectable()
|
||||
export class PaymentModeRepository extends Repository<PaymentMode>{
|
||||
|
||||
constructor(
|
||||
private dataSource:DataSource
|
||||
){
|
||||
super(PaymentMode,dataSource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { PaymentStatus } from "./payment-status.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(PaymentStatus)
|
||||
@Injectable()
|
||||
export class PaymentStatusRepository extends Repository<PaymentStatus>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(PaymentStatus,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,13 @@
|
||||
import { Logger } from "@nestjs/common";
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { PayuTransactionListEntity } from "./payu-transaction-list.entity";
|
||||
|
||||
@EntityRepository(PayuTransactionListEntity)
|
||||
@Injectable()
|
||||
export class PayuTransactionListRepository extends Repository<PayuTransactionListEntity>{
|
||||
constructor(
|
||||
private datasource:DataSource
|
||||
){
|
||||
super(PayuTransactionListEntity,datasource.createEntityManager());
|
||||
}
|
||||
private logger = new Logger ("SisPayuTransactionListRepository");
|
||||
}
|
||||
@ -1,7 +1,11 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { ProductCategory } from "./product-category.entity";
|
||||
|
||||
@EntityRepository(ProductCategory)
|
||||
import { Inject, Injectable } from "@nestjs/common";
|
||||
@Injectable()
|
||||
export class ProductCategoryRepository extends Repository<ProductCategory>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(ProductCategory,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
import { Controller, Post, Body, UseInterceptors, UploadedFile, UseGuards } from '@nestjs/common';
|
||||
import { reportAuthenticationDto } from 'src/dto/report-authentication.dto';
|
||||
import { PcdFormGridController } from 'src/framework/beans/pcd-form-grid.controller';
|
||||
import { ReportAuthenticationService } from './report-authentication.service';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
|
||||
@UseGuards(AuthGuard())
|
||||
@Controller('report-authentication')
|
||||
export class ReportAuthenticationController extends PcdFormGridController<reportAuthenticationDto> {
|
||||
|
||||
constructor(
|
||||
private reportAuthenticationService: ReportAuthenticationService
|
||||
) {
|
||||
super(reportAuthenticationService);
|
||||
}
|
||||
|
||||
|
||||
@Post('upload-certificate')
|
||||
@UseInterceptors(FileInterceptor('certificate'))
|
||||
async uploadCertificate(
|
||||
@UploadedFile() certificate,
|
||||
@Body() body: { adminUser: string }
|
||||
): Promise<any> {
|
||||
|
||||
return this.reportAuthenticationService.verifyAdmin(certificate, body.adminUser);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
import { PcdBaseEntity } from "src/framework/custom/pcd-entity.custom";
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity('report-authentication')
|
||||
export class reportAuthenticationEntity extends PcdBaseEntity{
|
||||
|
||||
@PrimaryGeneratedColumn({
|
||||
name:"id"
|
||||
})
|
||||
id:number
|
||||
|
||||
@Column({
|
||||
name:'admin_users',
|
||||
type:"varchar",
|
||||
length:50,
|
||||
nullable:true
|
||||
})
|
||||
adminUsers:string
|
||||
|
||||
@Column({
|
||||
type: 'json',
|
||||
nullable: true,
|
||||
})
|
||||
key: number[];
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ReportAuthenticationController } from './report-authentication.controller';
|
||||
import { ReportAuthenticationService } from './report-authentication.service';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { reportAuthenticationEntity } from './report-authentication.entity';
|
||||
import { reportAuthenticationRepository } from './report-authentication.repository';
|
||||
import { AuthModule } from 'src/auth/auth.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([reportAuthenticationEntity]),
|
||||
AuthModule
|
||||
],
|
||||
controllers: [ReportAuthenticationController],
|
||||
providers: [ReportAuthenticationService,reportAuthenticationRepository]
|
||||
})
|
||||
export class ReportAuthenticationModule {}
|
||||
@ -0,0 +1,12 @@
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { reportAuthenticationEntity } from "./report-authentication.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@Injectable()
|
||||
export class reportAuthenticationRepository extends Repository<reportAuthenticationEntity>{
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(reportAuthenticationEntity,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
import { BadRequestException, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { reportAuthenticationDto } from 'src/dto/report-authentication.dto';
|
||||
import { PcdFormGridService } from 'src/framework/beans/pcd-form-grid.service';
|
||||
import { reportAuthenticationRepository } from './report-authentication.repository';
|
||||
import * as fs from 'fs';
|
||||
import * as forge from 'node-forge';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class ReportAuthenticationService extends PcdFormGridService<reportAuthenticationDto>{
|
||||
|
||||
constructor(
|
||||
@InjectRepository(reportAuthenticationRepository)
|
||||
private reportAuthenticationRepository: reportAuthenticationRepository,
|
||||
) {
|
||||
super(reportAuthenticationRepository);
|
||||
}
|
||||
|
||||
async verifyAdmin(certificate, adminUser) {
|
||||
|
||||
const binaryData = certificate.buffer.toString('base64');
|
||||
const pemCert = `-----BEGIN CERTIFICATE-----\n${binaryData}\n-----END CERTIFICATE-----`;
|
||||
const cert = forge.pki.certificateFromPem(pemCert);
|
||||
let validFrom = cert.validity.notBefore
|
||||
let validTo = cert.validity.notAfter
|
||||
let date = new Date()
|
||||
|
||||
const user = await this.reportAuthenticationRepository.findOne({
|
||||
where: { id: adminUser }
|
||||
});
|
||||
|
||||
//Uncomment when we want to add a new public key
|
||||
|
||||
// console.log(cert.publicKey.n.data);
|
||||
// user.adminUsers = cert.publicKey.n.data;
|
||||
// this.reportAuthenticationRepository.save(user);
|
||||
|
||||
if (!user) {
|
||||
throw new BadRequestException('Admin User not found');
|
||||
}
|
||||
|
||||
let certKey = cert.publicKey.n.data.toString()
|
||||
let userKey = user.key.toString()
|
||||
|
||||
if (certKey !== userKey) {
|
||||
throw new BadRequestException('Key Not Matching. Please Try Again');
|
||||
}
|
||||
// else if (validTo < date) {
|
||||
// throw new UnauthorizedException("Digital Signature Expired")
|
||||
// }
|
||||
else {
|
||||
return { message: 'Authentication Successfully Completed'};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { TenderCategory } from "./tender-category.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(TenderCategory)
|
||||
@Injectable()
|
||||
export class TenderCategoryRepository extends Repository<TenderCategory>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(TenderCategory,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { TenderDoc } from "./tender-doc.entity";
|
||||
|
||||
@EntityRepository(TenderDoc)
|
||||
import { Injectable } from "@nestjs/common";
|
||||
@Injectable()
|
||||
export class tenderDocRepository extends Repository<TenderDoc>{
|
||||
|
||||
constructor(private dataSource: DataSource) {
|
||||
super(TenderDoc, dataSource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,10 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, Repository } from "typeorm";
|
||||
import { TenderMaster } from "./tender-master.entity";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@EntityRepository(TenderMaster)
|
||||
export class TenderMasterRepository extends Repository<TenderMaster>{}
|
||||
@Injectable()
|
||||
export class TenderMasterRepository extends Repository<TenderMaster>{
|
||||
constructor(private dataSource: DataSource) {
|
||||
super(TenderMaster, dataSource.createEntityManager());
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,11 @@
|
||||
import { EntityRepository, Repository } from "typeorm";
|
||||
import { DataSource, EntityRepository, Repository } from "typeorm";
|
||||
import { TenderType } from "./tender-type.entity";
|
||||
@EntityRepository(TenderType)
|
||||
import { Injectable } from "@nestjs/common";
|
||||
@Injectable()
|
||||
export class TenderTypeRepository extends Repository<TenderType>{
|
||||
|
||||
constructor(
|
||||
private datasource : DataSource
|
||||
){
|
||||
super(TenderType,datasource.createEntityManager());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue