mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
Add payout modes and production switchover schema
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
||||
import { ClientEntity } from './client.entity';
|
||||
|
||||
@@ -62,6 +62,23 @@ export class ClientService {
|
||||
return await this.clientRepository.count();
|
||||
}
|
||||
|
||||
public async getActiveIds(ids: string[]): Promise<Set<string>> {
|
||||
if (ids.length === 0) {
|
||||
return new Set();
|
||||
}
|
||||
|
||||
const clients = await this.clientRepository.find({
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
where: {
|
||||
id: In(ids),
|
||||
},
|
||||
});
|
||||
|
||||
return new Set(clients.map(client => client.id));
|
||||
}
|
||||
|
||||
public async getByAddress(address: string): Promise<ClientEntity[]> {
|
||||
return await this.clientRepository.find({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user