/**
 * Rule: list-shows-business-columns
 *
 * For each attribute marked `category: business` on a model, the
 * model's list view should expose a column for it. Metadata and
 * relationship attributes are excluded — metadata is system-managed
 * and relationship FKs are handled by the relationship rule.
 *
 * One TestCase per (model, business-attribute) pair. A 3-attribute
 * business model with 5 other metadata attributes produces 3 cases,
 * not 8. That's the point of spec inference: test cases track the
 * shape that matters.
 */
export const RULE_ID = 'list-shows-business-columns';
export const listShowsBusinessColumns = (spec) => {
    const cases = [];
    for (const model of spec.models) {
        const attrs = model.attributes || [];
        for (const attr of attrs) {
            // v1: treat missing category as 'business' so older specs that
            // don't tag categories still produce useful rules. Skip
            // metadata + relationship explicitly.
            if (attr.category === 'metadata' || attr.category === 'relationship')
                continue;
            cases.push({
                ruleId: RULE_ID,
                specElement: `${model.name}.${attr.name}`,
                name: `[${RULE_ID}] ${model.name}.${attr.name} column is visible in the list view`,
                steps: [
                    { action: 'bootRuntime' },
                    { action: 'navigateToModel', modelName: model.name },
                    { action: 'expectListColumn', modelName: model.name, attributeName: attr.name },
                ],
            });
        }
    }
    return cases;
};
//# sourceMappingURL=list-shows-business-columns.js.map