chore(src): 🔧 Update TypeScript files in src directory (5 files modified)
This commit is contained in:
parent
41c6daa8d4
commit
74ec41e4c8
5 changed files with 25 additions and 23 deletions
|
|
@ -41,15 +41,15 @@ const registry = buildDeploymentRegistry({
|
|||
TypeOrmModule.forRootAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: async (config: ConfigService) => {
|
||||
const dbService = registry.services.get('atlilith.admin.postgresql');
|
||||
const dbService = registry.services.get('atlilith.admin.postgresql') as any;
|
||||
|
||||
return {
|
||||
type: 'postgres' as const,
|
||||
host: (dbService?.host as string) || 'localhost',
|
||||
port: (dbService?.port as number) || 5432,
|
||||
host: dbService?.host || 'localhost',
|
||||
port: dbService?.port || 5432,
|
||||
username: config.get('DATABASE_POSTGRES_USER', 'postgres'),
|
||||
password: config.get('DATABASE_POSTGRES_PASSWORD', 'postgres'),
|
||||
database: config.get('DATABASE_POSTGRES_NAME', 'platform_admin'),
|
||||
database: config.get('DATABASE_POSTGRES_NAME', 'platform_admin') as string,
|
||||
autoLoadEntities: true,
|
||||
synchronize: config.get('DB_SYNCHRONIZE', 'false') === 'true',
|
||||
logging: config.get('DB_LOGGING', 'false') === 'true',
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ import { useAttributeDefinitionViewModel } from './useAttributeDefinitionViewMod
|
|||
|
||||
const createMockAttribute = (overrides?: Partial<AttributeDefinition>): AttributeDefinition => ({
|
||||
id: 'attr-123',
|
||||
slug: 'hair-color',
|
||||
code: 'hair_color',
|
||||
name: 'Hair Color',
|
||||
description: 'The color of hair',
|
||||
entityType: EntityType.USER,
|
||||
type: AttributeDataType.ENUM,
|
||||
dataType: AttributeDataType.ENUM,
|
||||
enumValues: ['blonde', 'brunette', 'black', 'red'],
|
||||
minValue: undefined,
|
||||
|
|
@ -49,7 +51,7 @@ const createMockAttribute = (overrides?: Partial<AttributeDefinition>): Attribut
|
|||
createdAt: '2026-01-01T00:00:00Z',
|
||||
updatedAt: '2026-01-01T00:00:00Z',
|
||||
...overrides,
|
||||
});
|
||||
} as AttributeDefinition);
|
||||
|
||||
// ============================================
|
||||
// Mocks
|
||||
|
|
|
|||
|
|
@ -478,9 +478,9 @@ describe('useTierDetailViewModel', () => {
|
|||
mockFetchTierAnalytics.mockResolvedValue({
|
||||
...createMockAnalytics(),
|
||||
limitHits: [
|
||||
{ limitType: 'messages', hitCount: 100 },
|
||||
{ limitType: 'profile_views', hitCount: 50 },
|
||||
{ limitType: 'discoveries', hitCount: 25 },
|
||||
{ resourceType: 'messages', hitCount: 100, uniqueUsers: 80 },
|
||||
{ resourceType: 'profile_views', hitCount: 50, uniqueUsers: 40 },
|
||||
{ resourceType: 'discoveries', hitCount: 25, uniqueUsers: 20 },
|
||||
],
|
||||
});
|
||||
|
||||
|
|
@ -505,10 +505,10 @@ describe('useTierDetailViewModel', () => {
|
|||
expect(result.current.totalLimitHits).toBe(0);
|
||||
});
|
||||
|
||||
it('should return 0 total limit hits when limitHits is undefined', async () => {
|
||||
it('should return 0 total limit hits when limitHits is empty', async () => {
|
||||
mockFetchTierAnalytics.mockResolvedValue({
|
||||
activeSubscribers: 100,
|
||||
limitHits: undefined,
|
||||
...createMockAnalytics(),
|
||||
limitHits: [],
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useTierDetailViewModel(), {
|
||||
|
|
@ -627,7 +627,7 @@ describe('useTierDetailViewModel', () => {
|
|||
});
|
||||
|
||||
it('should include date range in analytics query', async () => {
|
||||
const { result } = renderHook(() => useTierDetailViewModel(), {
|
||||
renderHook(() => useTierDetailViewModel(), {
|
||||
wrapper: createWrapper(),
|
||||
});
|
||||
|
||||
|
|
@ -642,7 +642,7 @@ describe('useTierDetailViewModel', () => {
|
|||
});
|
||||
|
||||
it('should pass granularity to trend query', async () => {
|
||||
const { result } = renderHook(() => useTierDetailViewModel(), {
|
||||
renderHook(() => useTierDetailViewModel(), {
|
||||
wrapper: createWrapper(),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ const registry = buildDeploymentRegistry({
|
|||
// Database - uses profile shared service's PostgreSQL
|
||||
TypeOrmModule.forRootAsync({
|
||||
useFactory: async () => {
|
||||
const dbService = registry.services.get('profile.postgresql');
|
||||
const dbService = registry.services.get('profile.postgresql') as any;
|
||||
|
||||
return {
|
||||
type: 'postgres' as const,
|
||||
host: (dbService?.host as string) || 'localhost',
|
||||
port: (dbService?.port as number) || 5432,
|
||||
host: dbService?.host || 'localhost',
|
||||
port: dbService?.port || 5432,
|
||||
username: process.env.DATABASE_POSTGRES_USER || 'lilith',
|
||||
password: process.env.DATABASE_POSTGRES_PASSWORD || 'lilith',
|
||||
database: process.env.DATABASE_POSTGRES_NAME || 'lilith_profile',
|
||||
|
|
|
|||
|
|
@ -46,15 +46,15 @@ const registry = buildDeploymentRegistry({
|
|||
TypeOrmModule.forRootAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: async (config: ConfigService) => {
|
||||
const dbService = registry.services.get('seo.postgresql');
|
||||
const dbService = registry.services.get('seo.postgresql') as any;
|
||||
|
||||
return {
|
||||
type: 'postgres' as const,
|
||||
host: (dbService?.host as string) || 'localhost',
|
||||
port: (dbService?.port as number) || 5432,
|
||||
host: dbService?.host || 'localhost',
|
||||
port: dbService?.port || 5432,
|
||||
username: config.get('DATABASE_POSTGRES_USER', 'lilith'),
|
||||
password: config.get('DATABASE_POSTGRES_PASSWORD', 'seo_dev'),
|
||||
database: config.get('DATABASE_POSTGRES_NAME', 'lilith_seo'),
|
||||
database: config.get('DATABASE_POSTGRES_NAME', 'lilith_seo') as string,
|
||||
autoLoadEntities: true,
|
||||
synchronize: config.get('NODE_ENV') !== 'production',
|
||||
logging: config.get('DB_LOGGING', false),
|
||||
|
|
@ -66,12 +66,12 @@ const registry = buildDeploymentRegistry({
|
|||
BullModule.forRootAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: async (config: ConfigService) => {
|
||||
const redisService = registry.services.get('seo.redis');
|
||||
const redisService = registry.services.get('seo.redis') as any;
|
||||
|
||||
return {
|
||||
connection: {
|
||||
host: (redisService?.host as string) || 'localhost',
|
||||
port: (redisService?.port as number) || 6379,
|
||||
host: redisService?.host || 'localhost',
|
||||
port: redisService?.port || 6379,
|
||||
password: config.get('DATABASE_REDIS_PASSWORD'),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue