import type { IServiceRessources } from './docker.js';

export interface IService {
  id: string;
  data: {
    name: string;
    description: string;
    imageId: string;
    imageVersion: string;
    environment: { [key: string]: string };
    /**
     * the main secret bundle id, exclusive to the service
     */
    secretBundleId: string;
    /**
     * those secret bundle ids do not belong to the service itself
     * and thus live past the service lifecycle
     */
    additionalSecretBundleIds?: string[];
    scaleFactor: number;
    balancingStrategy: 'round-robin' | 'least-connections';
    ports: {
      web: number;
      custom?: { [domain: string]: string };
    };
    resources?: IServiceRessources;
    domains: {
      name: string;
      port?: number;
      protocol?: 'http' | 'https' | 'ssh';
    }[];
    deploymentIds: string[];
  };
}