// Test to reproduce the name: 1 issue

console.log('Testing name concatenation scenarios...');

// Test case 1: Normal strings
const child1 = { first_name: 'Emma', last_name: 'Johnson' };
const name1 = `${child1.first_name} ${child1.last_name}`;
console.log('Normal case:', name1, typeof name1);

// Test case 2: What if first_name is a number?
const child2 = { first_name: 1, last_name: 'Johnson' };
const name2 = `${child2.first_name} ${child2.last_name}`;
console.log('Numeric first_name:', name2, typeof name2);

// Test case 3: What if last_name is a number?
const child3 = { first_name: 'Emma', last_name: 1 };
const name3 = `${child3.first_name} ${child3.last_name}`;
console.log('Numeric last_name:', name3, typeof name3);

// Test case 4: What if one is null?
const child4 = { first_name: null, last_name: 'Johnson' };
const name4 = `${child4.first_name} ${child4.last_name}`;
console.log('Null first_name:', name4, typeof name4);

// Test case 5: What if one is undefined?
const child5 = { first_name: undefined, last_name: 'Johnson' };
const name5 = `${child5.first_name} ${child5.last_name}`;
console.log('Undefined first_name:', name5, typeof name5);

// Test case 6: What if both are numbers?
const child6 = { first_name: 1, last_name: 2 };
const name6 = `${child6.first_name} ${child6.last_name}`;
console.log('Both numeric:', name6, typeof name6);

// Test case 7: What if first_name is empty string and last_name is number?
const child7 = { first_name: '', last_name: 1 };
const name7 = `${child7.first_name} ${child7.last_name}`;
console.log('Empty first_name, numeric last_name:', name7, typeof name7);

// Test case 8: What if we have just a number as first_name and null last_name?
const child8 = { first_name: 1, last_name: null };
const name8 = `${child8.first_name} ${child8.last_name}`;
console.log('Numeric first_name, null last_name:', name8, typeof name8);

// Test case 9: What if we try to reproduce the exact issue?
const child9 = { first_name: 1, last_name: undefined };
const name9 = `${child9.first_name} ${child9.last_name}`;
console.log('Numeric first_name, undefined last_name:', name9, typeof name9);

// Test case 10: What if the database returns numbers instead of strings?
const child10 = { id: 51, first_name: 1, last_name: null };
const result10 = {
  id: child10.id,
  name: `${child10.first_name} ${child10.last_name}`
};
console.log('Exact reproduction attempt:', result10);
console.log('Name type:', typeof result10.name);

// Test with explicit string conversion
const child11 = { id: 51, first_name: 1, last_name: null };
const result11 = {
  id: child11.id,
  name: `${String(child11.first_name)} ${String(child11.last_name)}`
};
console.log('With explicit String():', result11);
console.log('Name type:', typeof result11.name);
