diff --git a/features/platform-admin/backend-api/src/app.module.ts b/features/platform-admin/backend-api/src/app.module.ts index 00b1a3db1..93d6cb255 100755 --- a/features/platform-admin/backend-api/src/app.module.ts +++ b/features/platform-admin/backend-api/src/app.module.ts @@ -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', diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/viewmodels/useAttributeDefinitionViewModel.spec.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/viewmodels/useAttributeDefinitionViewModel.spec.tsx index 1ab1a7059..206130734 100644 --- a/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/viewmodels/useAttributeDefinitionViewModel.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/viewmodels/useAttributeDefinitionViewModel.spec.tsx @@ -31,10 +31,12 @@ import { useAttributeDefinitionViewModel } from './useAttributeDefinitionViewMod const createMockAttribute = (overrides?: Partial): 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): Attribut createdAt: '2026-01-01T00:00:00Z', updatedAt: '2026-01-01T00:00:00Z', ...overrides, -}); +} as AttributeDefinition); // ============================================ // Mocks diff --git a/features/platform-admin/frontend-admin/src/pages/subscriptions/tier-detail/viewmodels/useTierDetailViewModel.spec.tsx b/features/platform-admin/frontend-admin/src/pages/subscriptions/tier-detail/viewmodels/useTierDetailViewModel.spec.tsx index 0a065ec03..07523e4fa 100644 --- a/features/platform-admin/frontend-admin/src/pages/subscriptions/tier-detail/viewmodels/useTierDetailViewModel.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/subscriptions/tier-detail/viewmodels/useTierDetailViewModel.spec.tsx @@ -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(), }); diff --git a/features/profile/backend-api/src/app.module.ts b/features/profile/backend-api/src/app.module.ts index 109775f0e..01a00df1c 100755 --- a/features/profile/backend-api/src/app.module.ts +++ b/features/profile/backend-api/src/app.module.ts @@ -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', diff --git a/features/seo/backend-api/src/app.module.ts b/features/seo/backend-api/src/app.module.ts index f672f5879..ed95d1a66 100755 --- a/features/seo/backend-api/src/app.module.ts +++ b/features/seo/backend-api/src/app.module.ts @@ -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'), }, };