Converting Nested to Flat Struct with Schema

I have a nested struct on one and, and a flat struct on the other, like this:
type Input = {
  property: {
    address: string
    area: number
  }
  finance: {
    loan: boolean
    totalPrice: number
  }
}

type Output = {
  address: string
  area: number
  loan: boolean
  totalPrice: number
}

How should I go about converting between these with Schema?
Was this page helpful?