This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Video Upload</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Video Upload</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as twilio from 'twilio'; | |
import { Injectable } from '@nestjs/common'; | |
import { ResponseUtilsService } from 'src/services/utils-service'; | |
import { | |
TWILIO_ACCOUNT_SID, | |
TWILIO_AUTH_TOKEN, | |
TWILIO_SANDBOX_NUMBER, | |
} from 'src/core'; | |
@Injectable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class TransactionFactoryServices { | |
constructor(public readonly dbUtils: DatabaseUtilsService) {} | |
private mapProperty(source: any, target: any, propertyName: string): void { | |
if (source[propertyName]) { | |
target[propertyName] = source[propertyName]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, OnApplicationShutdown } from '@nestjs/common'; | |
import { FeedbackFactoryServices } from './feedback-factory.service'; | |
import { DataSource } from 'typeorm'; | |
import { IDatabaseServices } from 'src/core'; | |
@Injectable() | |
export class FeedbackServices implements OnApplicationShutdown { | |
constructor( | |
private readonly data: IDatabaseServices, | |
private readonly factory: FeedbackFactoryServices, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** generic repository */ | |
/* eslint-disable @typescript-eslint/no-unused-vars */ | |
import { Model } from 'sequelize'; | |
import { IGenericRepository } from 'src/core'; | |
export class SequelizeGenericRepository<T extends Model> | |
implements IGenericRepository<T> | |
{ | |
private model: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* gets the userId | |
* creates a redis key(identifier) | |
* checks if the key exists | |
* returns the data instead | |
*/ | |
const redisKey = `transactions-v3-${userId}-${JSON.stringify(payload)}`; | |
const redisValue = await this.cache.get(redisKey); | |
if (redisValue) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { data, pagination } = | |
await this.data.transactions.findAllWithPagination( | |
{ | |
...filterQuery, | |
isRevenue: false, | |
reconTransactionType: Not(In(excludedTransactionType)), | |
}, | |
{ | |
relationFields: ['user'], | |
selectFields: this.selectFields, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const selectFields = [ | |
'id', | |
'currency', | |
'currencyType', | |
'amount', | |
'type', | |
'reference', | |
'description', | |
'status', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use @UploadedFile() when uploading a single file/video/image | |
@Post('/upload-file') | |
@UseInterceptors(FileInterceptor('video')) | |
async createCheckedIn( | |
@UploadedFile() file: Express.Multer.File, | |
@Res() res: Response, | |
) {} | |
// use @UploadedFiles() when uploading multiple file/video/images |
NewerOlder