// This file defines the MambuConfig class and related constants and decorators for configuring the Mambu integration in a NestJS application. // It includes the MambuConfig class that holds the domain and apiKey for the Mambu API, as well as constants for injection tokens and a helper decorator for injecting named Mambu service instances in multi-tenant scenarios. import { Inject } from '@nestjs/common'; export class MambuConfig { domain!: string; apiKey!: string; } export const MAMBU_CONFIG = 'MAMBU_CONFIG'; // Helper to create named tokens for multi-instance support export const getMambuConfigToken = (name: string) => `MAMBU_CONFIG_${name}`; export const getMambuServiceToken = (name: string) => `MAMBU_SERVICE_${name}`; /** * Decorator to inject a named Mambu service instance * @param name - The name used when registering with forFeature() */ export const InjectMambu = (name: string) => Inject(getMambuServiceToken(name));