/**
 * TypeScript types for SmartStack Business Analysis feature.json
 * Copied from SmartStack.cli/src/types/feature-json.d.ts
 */
export type ModuleStatus = 'draft' | 'analysed' | 'specified' | 'approved' | 'rejected' | 'consolidated' | 'handed-off';
export type ApplicationStatus = 'draft' | 'framed' | 'decomposed' | 'specified' | 'consolidated' | 'handed-off';
export type Priority = 'must' | 'should' | 'could';
export type BrCategory = 'VAL' | 'CALC' | 'WF' | 'SEC' | 'DATA';
export type RoleLevel = 'admin' | 'manager' | 'contributor' | 'viewer';
export interface ModuleFeatureJson {
    id: string;
    version: string;
    status: ModuleStatus;
    scope?: 'module';
    metadata: ModuleMetadata;
    applicationContext?: ApplicationContext;
    discovery?: Discovery;
    analysis?: Analysis;
    specification?: Specification;
    validation?: Validation;
    handoff?: Handoff;
    suggestions?: Suggestion[];
    changelog?: ChangelogEntry[];
}
export interface ModuleMetadata {
    createdAt: string;
    updatedAt: string;
    application: string;
    module: string;
    context: 'business';
    language: 'fr' | 'en' | 'it' | 'de';
    featureDescription: string;
    featureType?: string;
    useCase?: string;
    permissionBase?: string;
    previousVersion?: string | null;
    mcpAvailable?: boolean;
    economyMode?: boolean;
    scope?: 'module';
    applicationRef?: string | null;
    applicationPath?: string | null;
    moduleIndex?: number;
    totalModules?: number;
    steps?: Record<string, StepStatus>;
}
export interface StepStatus {
    status: 'pending' | 'in-progress' | 'completed' | 'skipped';
    startedAt?: string | null;
    completedAt?: string | null;
}
export interface ApplicationContext {
    applicationRoles?: ApplicationRole[];
    completedModules?: string[];
    sharedEntities?: SharedEntity[];
}
export interface ApplicationRole {
    role: string;
    description?: string;
    level: RoleLevel;
    permissionPattern?: string;
}
export interface SharedEntity {
    entity: string;
    ownerModule: string;
    sharedFields?: string[];
}
export interface Discovery {
    problem?: string;
    asIs?: string;
    toBe?: string;
    trigger?: string;
    stakeholders?: Stakeholder[];
    scope?: ScopeDefinition;
}
export interface Stakeholder {
    role: string;
    function?: string;
    tasks?: string[];
    frequency?: string;
    painPoints?: string[];
}
export interface ScopeDefinition {
    mustHave?: string[];
    shouldHave?: string[];
    couldHave?: string[];
    outOfScope?: string[];
}
export interface Analysis {
    entities?: Entity[];
    businessRules?: BusinessRule[];
    processFlows?: ProcessFlow[];
}
export interface Entity {
    name: string;
    description?: string;
    type?: 'root-aggregate' | 'child-entity' | 'value-object' | 'lookup' | 'junction';
    attributes?: EntityAttribute[];
    relationships?: EntityRelationship[];
}
export interface EntityAttribute {
    name: string;
    type: string;
    required?: boolean;
    unique?: boolean;
    description?: string;
    businessRule?: string;
}
export interface EntityRelationship {
    target: string;
    type: 'one-to-many' | 'many-to-one' | 'many-to-many' | 'one-to-one';
    description?: string;
    cascadeDelete?: boolean;
}
export interface BusinessRule {
    id: string;
    name: string;
    category: BrCategory;
    statement: string;
    priority: Priority;
    entity?: string;
    validationLogic?: string;
    errorMessage?: string;
}
export interface ProcessFlow {
    id: string;
    name: string;
    steps?: ProcessStep[];
}
export interface ProcessStep {
    order: number;
    action: string;
    actor?: string;
    system?: string;
}
export interface Specification {
    useCases?: UseCase[];
    functionalRequirements?: FunctionalRequirement[];
    apiEndpoints?: ApiEndpoint[];
    permissionMatrix?: PermissionMatrix;
    uiWireframes?: UiWireframe[];
    sections?: Section[];
    dashboards?: Dashboard[];
    lifeCycles?: LifeCycle[];
    seedDataCore?: SeedDataEntry[];
    seedDataBusiness?: SeedDataEntry[];
    extensions?: Record<string, unknown>;
}
export interface LifeCycle {
    entity: string;
    field?: string;
    initialState?: string;
    states: LifeCycleState[];
    transitions?: LifeCycleTransition[];
}
export interface LifeCycleState {
    id: string;
    displayName?: string;
    description?: string;
    color?: 'gray' | 'blue' | 'green' | 'yellow' | 'orange' | 'red' | 'purple';
    allowedTransitions: string[];
    isTerminal?: boolean;
}
export interface LifeCycleTransition {
    from: string;
    to: string;
    action: string;
    label?: I18nLabels;
    permission?: string;
    guards?: string[];
    effects?: TransitionEffect[];
    confirm?: boolean;
}
export interface TransitionEffect {
    type: 'notification' | 'email' | 'webhook' | 'field-update';
    target?: string;
    template?: string;
}
export interface UseCase {
    id: string;
    name: string;
    description?: string;
    primaryActor: string;
    permission: string;
    preconditions?: string[];
    mainScenario: string[];
    alternativeScenarios?: AlternativeScenario[];
    postconditions?: string[];
    linkedRules?: string[];
}
export interface AlternativeScenario {
    name: string;
    steps: string[];
}
export interface FunctionalRequirement {
    id: string;
    statement: string;
    priority: Priority;
    linkedUseCases?: string[];
    linkedRules?: string[];
}
export interface ApiEndpoint {
    method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
    route: string;
    operation: string;
    permission: string;
    requestSchema?: string;
    responseSchema?: string;
    errorCodes?: string[];
    linkedUC?: string;
    module?: string;
}
export interface PermissionMatrix {
    permissions?: Permission[];
    roleAssignments?: RoleAssignment[];
}
export interface Permission {
    path: string;
    description: string;
    scope?: string;
}
export interface RoleAssignment {
    role: string;
    level: RoleLevel;
    permissions: string[];
}
export interface UiWireframe {
    screen: string;
    description?: string;
    mockup?: string;
    layout?: WireframeLayout;
    section?: string;
}
export interface WireframeLayout {
    type: string;
    regions: WireframeRegion[];
}
export interface WireframeRegion {
    id: string;
    position: string;
    span?: number;
    components: WireframeComponent[];
}
export interface WireframeComponent {
    type: string;
    props?: Record<string, unknown>;
    permission?: string;
}
export interface Section {
    code: string;
    name: string;
    description?: string;
    route?: string;
    permission?: string;
    labels?: I18nLabels;
    icon?: string;
    wireframe?: string;
    useCases?: string[];
    businessRules?: string[];
    resources?: Resource[];
}
export interface Resource {
    code: string;
    type: string;
    entity?: string;
    parentEntity?: string;
    permission?: string;
    columns?: string[];
    columnDefs?: ColumnDef[];
    fields?: FormField[];
    actions?: string[];
    rowActions?: RowAction[];
    filters?: string[];
    defaultSort?: {
        field: string;
        direction: 'asc' | 'desc';
    };
    defaultPageSize?: number;
    emptyState?: EmptyState;
    formLayout?: FormLayout;
    kpis?: string[];
    chartType?: string;
    dataSource?: string;
}
export interface ColumnDef {
    field: string;
    label?: I18nLabels;
    format?: 'text' | 'number' | 'currency' | 'percent' | 'date' | 'date-relative' | 'badge' | 'boolean' | 'link';
    sortable?: boolean;
    filterable?: boolean;
    width?: number;
    clickAction?: string;
    colorMap?: string;
    aggregation?: 'sum' | 'avg' | 'count' | 'min' | 'max';
    hidden?: boolean;
}
export interface RowAction {
    action: string;
    icon?: string;
    permission?: string;
    showWhen?: Record<string, unknown>;
    confirm?: boolean | I18nLabels;
}
export interface EmptyState {
    icon?: string;
    message?: I18nLabels;
    createAction?: boolean;
}
export interface FormLayout {
    type?: 'flat' | 'tabs' | 'sections';
    tabs?: FormTab[];
}
export interface FormTab {
    code: string;
    label?: I18nLabels;
    fields: string[];
}
export interface FormField {
    name: string;
    type: string;
    component?: string;
    source?: string;
    required?: boolean;
    validation?: string;
    default?: string | number | boolean | null;
    visibleWhen?: Record<string, unknown>;
    computedValue?: string;
    readOnly?: boolean;
    helpText?: string;
}
export interface I18nLabels {
    fr?: string;
    en?: string;
    it?: string;
    de?: string;
}
export interface Dashboard {
    id: string;
    name: string;
    description?: string;
    kpis?: DashboardKpi[];
    filters?: DashboardFilter[];
}
export interface DashboardKpi {
    id: string;
    label: string;
    metric: string;
    entity?: string;
    chartType?: string;
}
export interface DashboardFilter {
    field: string;
    type: string;
    options?: string[];
}
export interface SeedDataEntry {
    entity: string;
    samples?: string[];
    count?: number;
    source?: string;
}
export interface Validation {
    testCases?: TestCase[];
    semanticChecks?: SemanticCheck[];
    decision?: ValidationDecision;
}
export interface TestCase {
    id: string;
    scenario: string;
    expectedResult: string;
    linkedUC?: string;
}
export interface SemanticCheck {
    check: string;
    status: 'pass' | 'fail' | 'warning';
    details?: string;
}
export interface ValidationDecision {
    approved: boolean;
    reason?: string;
    approvedBy?: string;
    approvedAt?: string;
}
export interface Handoff {
    complexity?: string;
    implementationStrategy?: string;
    filesToCreate?: FilesToCreate;
    brToCodeMapping?: BrToCodeMapping[];
    apiEndpointSummary?: ApiEndpointSummary[];
    prdFile?: string;
    totalFiles?: number;
    totalTasks?: number;
    handedOffAt?: string;
}
export interface FilesToCreate {
    domain?: FileSpec[];
    application?: FileSpec[];
    infrastructure?: FileSpec[];
    api?: FileSpec[];
    frontend?: FileSpec[];
    seedData?: FileSpec[];
    tests?: FileSpec[];
}
export interface FileSpec {
    path: string;
    type: string;
    description?: string;
    linkedFRs?: string[];
    linkedUCs?: string[];
    linkedWireframes?: string[];
}
export interface BrToCodeMapping {
    ruleId: string;
    ruleName?: string;
    targetFile: string;
    targetMethod?: string;
    implementationType?: string;
}
export interface ApiEndpointSummary {
    method: string;
    route: string;
    operation: string;
    permission: string;
    module?: string;
}
export interface Suggestion {
    type: 'module' | 'section' | 'integration' | 'enhancement';
    code: string;
    title?: string;
    reason: string;
    accepted?: boolean | null;
}
export interface ChangelogEntry {
    step?: string;
    version?: string;
    timestamp: string;
    author?: string;
    changes: string[];
    warnings?: string[];
    decision?: string;
}
export interface BaManifest {
    version: string;
    updatedAt: string;
    analyses: BaManifestEntry[];
}
export interface BaManifestEntry {
    appCode: string;
    appName: string;
    moduleCode: string | null;
    moduleName?: string;
    version: string;
    status: string;
    featureDescription: string;
    path: string;
    updatedAt: string;
}
//# sourceMappingURL=featureJson.d.ts.map