diff --git a/@deployments/atlilith.admin/services.yaml b/@deployments/atlilith.admin/services.yaml index 89cce3d2b..d422df6d6 100644 --- a/@deployments/atlilith.admin/services.yaml +++ b/@deployments/atlilith.admin/services.yaml @@ -10,6 +10,22 @@ deployment: domain: admin.atlilith.com description: Platform administration dashboard +# Orchestration (./run dev:admin) +orchestration: + dependencies: + - atlilith.status + entryPoints: + - atlilith.admin.frontend + docker: + profiles: [core, platform] + runSeeds: false + lifecycle: + keepAlive: true + autostart: true + urls: + - url: http://admin.atlilith.local + description: Platform Admin + services: - id: frontend type: frontend diff --git a/@deployments/atlilith.status/services.yaml b/@deployments/atlilith.status/services.yaml index eb0af7baf..0fc845eff 100644 --- a/@deployments/atlilith.status/services.yaml +++ b/@deployments/atlilith.status/services.yaml @@ -10,6 +10,22 @@ deployment: domain: status.atlilith.com description: Platform health monitoring and public status page +# Orchestration (./run dev:status) +orchestration: + dependencies: [] + entryPoints: + - atlilith.status.api + - atlilith.status.frontend + docker: + profiles: [core, platform] + runSeeds: false + lifecycle: + keepAlive: true + autostart: true + urls: + - url: http://status.atlilith.local + description: Status Dashboard + services: - id: frontend type: frontend diff --git a/@deployments/atlilith.www/services.yaml b/@deployments/atlilith.www/services.yaml index 43dc86b5e..a39636964 100644 --- a/@deployments/atlilith.www/services.yaml +++ b/@deployments/atlilith.www/services.yaml @@ -11,6 +11,27 @@ deployment: domain: atlilith.com description: Public marketing site and platform hub +# Orchestration (./run dev:atlilith) +orchestration: + dependencies: + - atlilith.status + - atlilith.admin + - seo + entryPoints: + - atlilith.www.frontend + - webmap.router + docker: + profiles: [core, platform, feature-dbs] + runSeeds: true + lifecycle: + keepAlive: true + autostart: true + urls: + - url: http://www.atlilith.local + description: Atlilith Landing Site + - url: http://www.atlilith.local/_/ + description: SEO & Metadata + services: - id: frontend type: frontend diff --git a/@deployments/spoiledbabes.www/services.yaml b/@deployments/spoiledbabes.www/services.yaml index d9dacdae1..c4fd411c0 100644 --- a/@deployments/spoiledbabes.www/services.yaml +++ b/@deployments/spoiledbabes.www/services.yaml @@ -11,6 +11,26 @@ deployment: domain: spoiledbabes.com description: Sugar dating marketplace +# Orchestration (./run dev:spoiledbabes) +orchestration: + dependencies: + - atlilith.status + - atlilith.admin + - seo + entryPoints: + - spoiledbabes.www.frontend + docker: + profiles: [core, platform, feature-dbs] + runSeeds: true + lifecycle: + keepAlive: true + autostart: true + urls: + - url: http://www.spoiledbabes.local + description: SpoiledBabes Marketplace + - url: http://www.spoiledbabes.local/_/ + description: SEO & Metadata + services: - id: frontend type: frontend diff --git a/@deployments/trustedmeet.www/services.yaml b/@deployments/trustedmeet.www/services.yaml index 4f71918da..ff3390335 100644 --- a/@deployments/trustedmeet.www/services.yaml +++ b/@deployments/trustedmeet.www/services.yaml @@ -11,6 +11,26 @@ deployment: domain: trustedmeet.com description: Adult services marketplace - escorts, massage, BDSM verticals +# Orchestration (./run dev:trustedmeet) +orchestration: + dependencies: + - atlilith.status + - atlilith.admin + - seo + entryPoints: + - trustedmeet.www.frontend + docker: + profiles: [core, platform, feature-dbs] + runSeeds: true + lifecycle: + keepAlive: true + autostart: true + urls: + - url: http://www.trustedmeet.local + description: TrustedMeet Marketplace + - url: http://www.trustedmeet.local/_/ + description: SEO & Metadata + services: - id: frontend type: frontend diff --git a/features/conversation-assistant/shared/src/index.ts b/features/conversation-assistant/shared/src/index.ts index 5844e6faa..03e7703dc 100755 --- a/features/conversation-assistant/shared/src/index.ts +++ b/features/conversation-assistant/shared/src/index.ts @@ -64,37 +64,3 @@ export { CONVERSATION_ASSISTANT_API, } from '@lilith/types'; -// Legacy exports for backwards compatibility -// @deprecated Use CONVERSATION_ASSISTANT_API instead -export const API_ROUTES = { - DEVICES: { - REGISTER: '/api/devices/register', - VERIFY: '/api/devices/verify', - LIST: '/api/devices', - GET: '/api/devices/:id', - DEACTIVATE: '/api/devices/:id/deactivate', - }, - SYNC: { - MESSAGES: '/api/sync/messages', - CONTACTS: '/api/sync/contacts', - LAST_SYNC: '/api/sync/last', - }, - CONVERSATIONS: { - LIST: '/api/conversations', - GET: '/api/conversations/:id', - MESSAGES: '/api/conversations/:id/messages', - }, - RESPONSES: { - GENERATE: '/api/responses/generate', - GET: '/api/responses/:id', - ACTION: '/api/responses/:id/action', - LIST: '/api/responses', - }, - TRAINING: { - SAMPLES: '/api/training/samples', - JOBS: '/api/training/jobs', - START: '/api/training/start', - STATUS: '/api/training/jobs/:id', - CANCEL: '/api/training/jobs/:id/cancel', - }, -} as const; diff --git a/features/marketplace/backend-api/src/tiers/tier-enforcement.service.ts b/features/marketplace/backend-api/src/tiers/tier-enforcement.service.ts index c22098f32..9989b4252 100755 --- a/features/marketplace/backend-api/src/tiers/tier-enforcement.service.ts +++ b/features/marketplace/backend-api/src/tiers/tier-enforcement.service.ts @@ -1,4 +1,4 @@ -import { Injectable, ForbiddenException, Logger } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; @@ -6,47 +6,27 @@ import { TiersService, SubscriptionTier } from './tiers.service'; import { PlatformSubscription, PlatformSubscriptionStatus, ClientTierFeatures } from '@/entities'; -/** - * Result of a tier limit check - */ -export interface TierLimitCheckResult { - allowed: boolean; - currentCount: number; - maxAllowed: number; - tierName: string; - message?: string; -} - /** * TierEnforcementService * - * Provides methods for checking tier-based features and limits for CLIENT subscriptions. + * Provides methods for checking tier-based features for CLIENT subscriptions. * * Note: This service is for CLIENT tiers (what clients can do on the platform). * Provider tiers would be a separate system if needed. * - * ⚠️ IMPORTANT: For USAGE enforcement (messages, searches, profile views), use - * UsageTrackingService from the UsageModule instead. UsageTrackingService: - * - Tracks actual usage in the database - * - Handles rollover from previous periods - * - Handles provider message gifts - * - Returns proper 429 responses with upgrade prompts - * * Use THIS service for: * - Tier feature checks (advancedFilters, instantBooking, etc.) * - Getting user's tier information - * - Simple limit checks (without tracking) + * - Getting tier-specific config (rollover policy, memory periods) * - * Use UsageTrackingService for: - * - Enforcing message limits (useMessage, enforceMessageLimit) - * - Enforcing profile discovery limits (processSearchResults) - * - Enforcing profile view limits (useProfileView, enforceProfileViewLimit) - * - Getting usage summary with rollover + * Use UsageTrackingService for ALL usage enforcement: + * - Message limits (canSendMessage, enforceMessageLimit) + * - Profile discovery limits (processSearchResults) + * - Profile view limits (canViewProfile, enforceProfileViewLimit) + * - Usage summary with rollover */ @Injectable() export class TierEnforcementService { - private readonly logger = new Logger(TierEnforcementService.name); - constructor( @InjectRepository(PlatformSubscription) private readonly subscriptionRepo: Repository, @@ -83,100 +63,6 @@ export class TierEnforcementService { return tier.features[feature]; } - /** - * Check if user can send more messages based on their tier's monthly limit - * - * @deprecated Use UsageTrackingService.canSendMessage() instead - it handles - * rollover, gifted messages, and tracks usage automatically. - * - * @param userId - The user ID to check - * @param currentMessageCount - Messages sent this billing period - * @returns TierLimitCheckResult with allowed status and details - */ - async checkMessageLimit( - userId: string, - currentMessageCount: number, - ): Promise { - const tier = await this.getUserTier(userId); - const messagesPerMonth = tier.features.messagesPerMonth; - - // -1 means unlimited - if (messagesPerMonth === -1) { - return { - allowed: true, - currentCount: currentMessageCount, - maxAllowed: -1, - tierName: tier.name, - message: 'Unlimited messages', - }; - } - - const allowed = currentMessageCount < messagesPerMonth; - - return { - allowed, - currentCount: currentMessageCount, - maxAllowed: messagesPerMonth, - tierName: tier.name, - message: allowed - ? `Can send ${messagesPerMonth - currentMessageCount} more messages this month` - : `Message limit reached (${messagesPerMonth}). Upgrade for more messages.`, - }; - } - - /** - * Check if user can view more profiles based on their tier's monthly limit - * - * @deprecated Use UsageTrackingService.canViewProfile() instead - it handles - * rollover and tracks usage automatically. - */ - async checkProfileViewLimit( - userId: string, - currentViewCount: number, - ): Promise { - const tier = await this.getUserTier(userId); - const profileViewsPerMonth = tier.features.profileViewsPerMonth; - - if (profileViewsPerMonth === -1) { - return { - allowed: true, - currentCount: currentViewCount, - maxAllowed: -1, - tierName: tier.name, - message: 'Unlimited profile views', - }; - } - - const allowed = currentViewCount < profileViewsPerMonth; - - return { - allowed, - currentCount: currentViewCount, - maxAllowed: profileViewsPerMonth, - tierName: tier.name, - message: allowed - ? `Can view ${profileViewsPerMonth - currentViewCount} more profiles this month` - : `Profile view limit reached (${profileViewsPerMonth}). Upgrade for more.`, - }; - } - - /** - * Enforce message limit - throws ForbiddenException if limit exceeded - * - * @deprecated Use UsageTrackingService.enforceMessageLimit() instead - it handles - * rollover, gifted messages, and returns proper 429 responses with upgrade prompts. - */ - async enforceMessageLimit(userId: string, currentMessageCount: number): Promise { - const result = await this.checkMessageLimit(userId, currentMessageCount); - - if (!result.allowed) { - this.logger.warn( - `User ${userId} hit message limit: ${result.currentCount}/${result.maxAllowed} (${result.tierName})`, - ); - throw new ForbiddenException(result.message); - } - } - /** * Get user's discovery memory period */ diff --git a/features/media/backend-api/src/app.module.ts b/features/media/backend-api/src/app.module.ts index 96309d833..de67dd1c4 100644 --- a/features/media/backend-api/src/app.module.ts +++ b/features/media/backend-api/src/app.module.ts @@ -6,11 +6,12 @@ import { Module } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { TypeOrmModule } from '@nestjs/typeorm'; +import { MediaFile } from '@/entities/media-file.entity'; + import { HealthController } from './health.controller'; import { MediaController } from './media.controller'; import { MediaService } from './media.service'; -import { MediaFile } from '@/entities/media-file.entity'; // Build deployment registry for service configuration const __filename = fileURLToPath(import.meta.url); diff --git a/features/media/backend-api/src/media.controller.ts b/features/media/backend-api/src/media.controller.ts index daf5edcfd..fea085e12 100644 --- a/features/media/backend-api/src/media.controller.ts +++ b/features/media/backend-api/src/media.controller.ts @@ -21,16 +21,17 @@ import { import { FileInterceptor } from '@nestjs/platform-express'; -import { MediaService } from './media.service'; - -import type { Request as ExpressRequest, Response } from 'express'; - import { UploadMediaDto, MediaFileResponseDto, ListMediaQueryDto, } from '@/dto/upload-media.dto'; +import { MediaService } from './media.service'; + +import type { Request as ExpressRequest, Response } from 'express'; + + // JWT auth guard placeholder - should use shared auth