import type {BaseQuery} from '@/types/base';
import {ProjectGroup} from "@/pages/Deploy/ProjectGroup/List/types";

export enum DevelopmentLanguageTypeEnum {
    JAVA = 'JAVA',
    NODE_JS = 'NODE_JS',
    PYTHON = 'PYTHON',
    GO = 'GO'
}

export interface Application {
    id: number;
    appCode: string;
    appName: string;
    appDesc?: string;
    repoUrl: string;
    language: DevelopmentLanguageTypeEnum;
    enabled: boolean;
    sort: number;
    projectGroup: ProjectGroup;
}

export interface CreateApplicationRequest {
    projectGroupId: number;
    appCode: string;
    appName: string;
    appDesc?: string;
    repoUrl: string;
    language: DevelopmentLanguageTypeEnum;
    enabled: boolean;
    sort: number;
}

export interface UpdateApplicationRequest extends CreateApplicationRequest {
    id: number;
}

export interface ApplicationQuery extends BaseQuery {
    projectGroupId?: number;
    appCode?: string;
    appName?: string;
    enabled?: boolean;
    language?: string;
}

export interface DevelopmentLanguageType {
    code: string;
    name: string;
}
