refactor(backend): extract UserConfig to tradingUserTypes
Made-with: Cursor
This commit is contained in:
parent
12cedd12da
commit
72ec663125
@ -38,22 +38,9 @@ export type {
|
|||||||
StaleOrderScope,
|
StaleOrderScope,
|
||||||
VirtualOpenPosition
|
VirtualOpenPosition
|
||||||
} from './tradingPersistenceTypes.js';
|
} from './tradingPersistenceTypes.js';
|
||||||
|
import type { UserConfig } from './tradingUserTypes.js';
|
||||||
|
|
||||||
export interface UserConfig {
|
export type { UserConfig } from './tradingUserTypes.js';
|
||||||
user_id: string;
|
|
||||||
first_name: string;
|
|
||||||
last_name: string;
|
|
||||||
email: string;
|
|
||||||
ALPACA_API_KEY: string;
|
|
||||||
ALPACA_SECRET_KEY: string;
|
|
||||||
REAL_ALPACA_API_KEY: string;
|
|
||||||
REAL_ALPACA_SECRET_KEY: string;
|
|
||||||
role: string;
|
|
||||||
trade_enable: boolean;
|
|
||||||
drop_threshold_for_buy: number;
|
|
||||||
gain_threshold_for_sell: number;
|
|
||||||
market_poll_interval_in_seconds: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SupabaseService {
|
class SupabaseService {
|
||||||
private client: SupabaseClient | null = null;
|
private client: SupabaseClient | null = null;
|
||||||
|
|||||||
19
backend/src/services/tradingUserTypes.ts
Normal file
19
backend/src/services/tradingUserTypes.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Trading user row shape shared by Cosmos `trading_users` documents and legacy Postgres `users` table.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface UserConfig {
|
||||||
|
user_id: string;
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
email: string;
|
||||||
|
ALPACA_API_KEY: string;
|
||||||
|
ALPACA_SECRET_KEY: string;
|
||||||
|
REAL_ALPACA_API_KEY: string;
|
||||||
|
REAL_ALPACA_SECRET_KEY: string;
|
||||||
|
role: string;
|
||||||
|
trade_enable: boolean;
|
||||||
|
drop_threshold_for_buy: number;
|
||||||
|
gain_threshold_for_sell: number;
|
||||||
|
market_poll_interval_in_seconds: number;
|
||||||
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
import { getContainer } from '@bytelyst/cosmos';
|
import { getContainer } from '@bytelyst/cosmos';
|
||||||
import { config } from '../config/index.js';
|
import { config } from '../config/index.js';
|
||||||
import logger from '../utils/logger.js';
|
import logger from '../utils/logger.js';
|
||||||
import type { UserConfig } from './SupabaseService.js';
|
|
||||||
import { supabaseService } from './SupabaseService.js';
|
import { supabaseService } from './SupabaseService.js';
|
||||||
|
import type { UserConfig } from './tradingUserTypes.js';
|
||||||
|
|
||||||
const USER_PROFILE_CONTAINER = 'trading_users';
|
const USER_PROFILE_CONTAINER = 'trading_users';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user