import { ConfigService } from '@nestjs/config';

export interface StorageConfig {
  endpoint: string;
  port: number;
  accessKey: string;
  secretKey: string;
  bucket: string;
  useSSL: boolean;
}

export const storageConfig = (configService: ConfigService): StorageConfig => ({
  endpoint: configService.get<string>('STORAGE_ENDPOINT', 'localhost'),
  port: configService.get<number>('STORAGE_PORT', 9000),
  accessKey: configService.get<string>('STORAGE_ACCESS_KEY', 'minioadmin'),
  secretKey: configService.get<string>('STORAGE_SECRET_KEY', 'minioadmin'),
  bucket: configService.get<string>('STORAGE_BUCKET', 'pmc-assets'),
  useSSL: configService.get<boolean>('STORAGE_USE_SSL', false),
});
