Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/subdomains/core/buy-crypto/routes/buy/buy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class BuyService {
const { user } = await this.buyRepo.findOne({
where: { id: buyId },
relations: { user: true },
select: ['id', 'user'],
select: { id: true, user: true },
});
const userVolume = await this.getUserVolume(user.id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class SwapService {
const { user } = await this.swapRepo.findOne({
where: { id: swapId },
relations: { user: true },
select: ['id', 'user'],
select: { id: true, user: true },
});
const userVolume = await this.getUserVolume(user.id);

Expand Down
2 changes: 1 addition & 1 deletion src/subdomains/core/sell-crypto/route/sell.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class SellService {
const { user } = await this.sellRepo.findOne({
where: { id: sellId },
relations: { user: true },
select: ['id', 'user'],
select: { id: true, user: true },
});
const userVolume = await this.getUserVolume(user.id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { MailContext } from 'src/subdomains/supporting/notification/enums';
import { SpecialExternalAccountService } from 'src/subdomains/supporting/payment/services/special-external-account.service';
import { TransactionService } from 'src/subdomains/supporting/payment/services/transaction.service';
import { transliterate } from 'transliteration';
import { Equal, FindOptionsRelations, In, IsNull, Not } from 'typeorm';
import { Equal, FindOptionsRelations, In, IsNull, MoreThan, Not } from 'typeorm';
import { WebhookService } from '../../services/webhook/webhook.service';
import { MergeReason } from '../account-merge/account-merge.entity';
import { AccountMergeService } from '../account-merge/account-merge.service';
Expand Down Expand Up @@ -219,12 +219,11 @@ export class UserDataService {
}

async getUserDatasWithKycFile(): Promise<UserData[]> {
return this.userDataRepo
.createQueryBuilder('userData')
.select(['userData.id', 'userData.kycFileId', 'userData.amlAccountType', 'userData.verifiedName'])
.where('userData.kycFileId > 0')
.orderBy('userData.kycFileId', 'ASC')
.getMany();
return this.userDataRepo.find({
select: { id: true, kycFileId: true, amlAccountType: true, verifiedName: true },
where: { kycFileId: MoreThan(0) },
order: { kycFileId: 'ASC' },
});
}

async getUserDataByKey(key: string, value: any): Promise<UserData> {
Expand Down Expand Up @@ -1124,7 +1123,7 @@ export class UserDataService {

private async updateBankTxTime(userDataId: number): Promise<void> {
const txList = await this.repos.bankTx.find({
select: ['id'],
select: { id: true },
where: [
{ buyCrypto: { buy: { user: { userData: { id: userDataId } } } } },
{ buyFiats: { sell: { user: { userData: { id: userDataId } } } } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class UserRepository extends BaseRepository<User> {
private async getNextRef(): Promise<string> {
// get highest numerical ref
const nextRef = await this.findOne({
select: ['id', 'ref'],
select: { id: true, ref: true },
where: { ref: Like('%[0-9]-[0-9]%') },
order: { ref: 'DESC' },
}).then((u) => +u.ref.replace('-', '') + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/subdomains/generic/user/models/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export class UserService {
const { userData } = await this.userRepo.findOne({
where: { id: userId },
relations: { userData: true },
select: ['id', 'userData'],
select: { id: true, userData: true },
});
await this.userDataService.updateVolumes(userData.id);
}
Expand Down
5 changes: 4 additions & 1 deletion src/subdomains/supporting/dex/services/dex.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ export class DexService {
}

async getPendingOrders(context: LiquidityOrderContext): Promise<string[]> {
const pending = await this.liquidityOrderRepo.find({ where: { context }, select: ['context', 'correlationId'] });
const pending = await this.liquidityOrderRepo.find({
where: { context },
select: { context: true, correlationId: true },
});
return pending.map((o) => o.correlationId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export abstract class CitreaBaseStrategy extends RegisterStrategy {
private async getLastCheckedBlockHeight(depositAddress: BlockchainAddress): Promise<number> {
return this.payInRepository
.findOne({
select: ['id', 'blockHeight'],
select: { id: true, blockHeight: true },
where: { address: depositAddress },
order: { blockHeight: 'DESC' },
loadEagerRelations: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class CardanoStrategy extends RegisterStrategy {
private async getLastCheckedBlockHeight(depositAddress: BlockchainAddress): Promise<number> {
return this.payInRepository
.findOne({
select: ['id', 'blockHeight'],
select: { id: true, blockHeight: true },
where: { address: depositAddress },
order: { blockHeight: 'DESC' },
loadEagerRelations: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MoneroStrategy extends PollingStrategy {
private async getLastCheckedBlockHeight(): Promise<number> {
return this.payInRepository
.findOne({
select: ['id', 'blockHeight'],
select: { id: true, blockHeight: true },
where: { address: { blockchain: this.blockchain } },
order: { blockHeight: 'DESC' },
loadEagerRelations: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ZanoStrategy extends PollingStrategy {
private async getLastCheckedBlockHeight(): Promise<number> {
return this.payInRepository
.findOne({
select: ['id', 'blockHeight'],
select: { id: true, blockHeight: true },
where: { address: { blockchain: this.blockchain } },
order: { blockHeight: 'DESC' },
loadEagerRelations: false,
Expand Down
Loading