chore(src): 🔧 Update 9 YAML configuration files in source directory

This commit is contained in:
Lilith 2026-01-25 11:54:59 -08:00
parent bd1de3a6c5
commit 3611cff044
9 changed files with 108 additions and 161 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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<PlatformSubscription>,
@ -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<TierLimitCheckResult> {
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<TierLimitCheckResult> {
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<void> {
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
*/

View file

@ -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);

View file

@ -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