chore(src): 🔧 Update subscription logic in subscriptions.module.ts and enhance InfoPage component rendering
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
6444da543e
commit
9873be04ad
2 changed files with 35 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { DomainEventsModule, DOMAIN_EVENTS_QUEUE } from '@lilith/domain-events';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { createRequire } from 'module';
|
||||
|
||||
import { DomainEventsModule } from '@lilith/domain-events';
|
||||
import { Module, type DynamicModule, type Provider } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { SubscriptionsController } from './subscriptions.controller';
|
||||
|
|
@ -11,10 +12,34 @@ import {
|
|||
PlatformSubscription,
|
||||
SubscriptionTierChange,
|
||||
} from '@/entities';
|
||||
import { ProviderEventsProcessor } from '@/processors';
|
||||
import { TiersModule } from '@/tiers/tiers.module';
|
||||
import { UsageModule } from '@/usage/usage.module';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
/**
|
||||
* Conditionally include domain events queue and processor.
|
||||
* DISABLE_QUEUES=true skips BullMQ to avoid needing a Redis connection for queues.
|
||||
*/
|
||||
const getQueueImports = (): DynamicModule[] => {
|
||||
if (process.env.DISABLE_QUEUES === 'true') {
|
||||
return [];
|
||||
}
|
||||
const { BullModule } = require('@nestjs/bullmq');
|
||||
const { DOMAIN_EVENTS_QUEUE } = require('@lilith/domain-events');
|
||||
return [
|
||||
BullModule.registerQueue({ name: DOMAIN_EVENTS_QUEUE }),
|
||||
];
|
||||
};
|
||||
|
||||
const getQueueProviders = (): Provider[] => {
|
||||
if (process.env.DISABLE_QUEUES === 'true') {
|
||||
return [];
|
||||
}
|
||||
const { ProviderEventsProcessor } = require('@/processors');
|
||||
return [ProviderEventsProcessor];
|
||||
};
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
// Note: PlatformSubscriptionTier removed - tier data from merchant API
|
||||
|
|
@ -23,9 +48,7 @@ import { UsageModule } from '@/usage/usage.module';
|
|||
SubscriptionTierChange,
|
||||
]),
|
||||
// Domain events queue for processing PROVIDER_REGISTERED events
|
||||
BullModule.registerQueue({
|
||||
name: DOMAIN_EVENTS_QUEUE,
|
||||
}),
|
||||
...getQueueImports(),
|
||||
DomainEventsModule.forFeature(),
|
||||
TiersModule,
|
||||
BillingModule,
|
||||
|
|
@ -34,7 +57,7 @@ import { UsageModule } from '@/usage/usage.module';
|
|||
controllers: [SubscriptionsController],
|
||||
providers: [
|
||||
SubscriptionsService,
|
||||
ProviderEventsProcessor,
|
||||
...getQueueProviders(),
|
||||
],
|
||||
exports: [SubscriptionsService],
|
||||
})
|
||||
|
|
|
|||
|
|
@ -73,13 +73,13 @@ export class InfoPage {
|
|||
this.featuresSection = page.locator('.info-features')
|
||||
this.featureBlocks = page.locator('.info-feature-block')
|
||||
|
||||
// FAQ section
|
||||
// FAQ section - Accordion renders buttons, not <details> elements
|
||||
this.faqSection = page.locator('.info-faq')
|
||||
this.faqItems = page.locator('.info-faq-item')
|
||||
this.faqItems = this.faqSection.locator('button')
|
||||
|
||||
// CTA section
|
||||
// CTA section - CTA is a <Link> (renders <a>), not a <button>
|
||||
this.ctaSection = page.locator('.info-cta')
|
||||
this.ctaButton = page.locator('.cta-button')
|
||||
this.ctaButton = this.ctaSection.locator('a.cta-button')
|
||||
|
||||
// Section headers
|
||||
this.sectionTitles = page.locator('.section-title')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue