1- import type { ColumnMapping , MappingConfig } from '../types/schemaTypes' ;
1+ import type { ColumnMapping } from '../types/schemaTypes' ;
2+ import type { IlrMappingConfig } from '../types/ilrMappingTypes' ;
23import type { SchemaRegistry } from '../types/interpreterTypes' ;
34import { mapCsvToSchema } from '../schema/columnMapper' ;
45import { getTransform } from '../transforms/registry' ;
@@ -24,21 +25,21 @@ import { generateUUID } from '../utils/uuid';
2425 */
2526export function mapCsvToSchemaWithAims (
2627 csvRow : Record < string , string > ,
27- config : MappingConfig ,
28+ config : IlrMappingConfig ,
2829 registry : SchemaRegistry
2930) : Record < string , unknown > {
3031 // Separate learner-level and aim-specific mappings
31- const learnerMappings = config . mappings . filter ( ( m ) => ! m . aimNumber ) ;
32- const aimMappings = config . mappings . filter ( ( m ) => m . aimNumber ) ;
32+ const learnerMappings = config . mappings . filter ( ( m ) => ! m . group ) ;
33+ const aimMappings = config . mappings . filter ( ( m ) => m . group ) ;
3334
3435 // Group aim mappings by aim number
3536 const aimGroups = new Map < number , ColumnMapping [ ] > ( ) ;
3637 for ( const mapping of aimMappings ) {
37- if ( ! mapping . aimNumber ) continue ;
38- if ( ! aimGroups . has ( mapping . aimNumber ) ) {
39- aimGroups . set ( mapping . aimNumber , [ ] ) ;
38+ if ( ! mapping . group ) continue ;
39+ if ( ! aimGroups . has ( mapping . group ) ) {
40+ aimGroups . set ( mapping . group , [ ] ) ;
4041 }
41- aimGroups . get ( mapping . aimNumber ) ! . push ( mapping ) ;
42+ aimGroups . get ( mapping . group ) ! . push ( mapping ) ;
4243 }
4344
4445 // Apply learner-level mappings using generic mapper
0 commit comments