/**
 * Default-value helpers for the `pickModel` call emitted in generated frontend form components.
 * Kept standalone so the upcoming signalforms migration can evolve initial-value semantics
 * without touching validator generation. Renaming `getPickModelDefault` requires updating the
 * call site in the detail component template (signalforms cutover boundary).
 */
/**
 * Initial value literal for `property` inside the emitted `pickModel({...})` call.
 * Returned as a code string (e.g. `"''"`, `'false'`, `'null'`), not the value itself.
 */
export function getPickModelDefault(property) {
    // Many-to-many relationship — FormControl carries `string[]` of FK ids.
    if (property.relationship?.type === 'many-to-many') {
        return '[]';
    }
    switch (property.type) {
        case 'array': {
            return '[]';
        }
        case 'bigint':
        case 'date':
        case 'decimal':
        case 'enum':
        case 'float':
        case 'int':
        case 'smallint':
        case 'timestamp': {
            return 'null';
        }
        case 'boolean': {
            return 'false';
        }
        case 'char':
        case 'password':
        case 'text':
        case 'varchar': {
            return "''";
        }
        case 'id': {
            return 'null';
        }
        default: {
            return 'null';
        }
    }
}
