import Query from '../query/Query'
import { NormalizedData } from './Contract'
import Normalizer from './Normalizer'
import Attacher from './Attacher'
import Builder from './Builder'
import Incrementer from './Incrementer'

export default class Data {
  /**
   * Normalize the data.
   */
  static normalize (data: any, Query: Query): NormalizedData {
    const normalizedData = Normalizer.normalize(data, Query)

    const attachedData = Attacher.attach(normalizedData, Query)

    return Incrementer.increment(attachedData, Query)
  }

  /**
   * Fill missing records with default value based on model schema.
   */
  static fillAll (data: NormalizedData, Query: Query): NormalizedData {
    return Builder.build(data, Query)
  }
}

import Query from '../query/Query'
import { NormalizedData } from './Contract'
import Normalizer from './Normalizer'
import Attacher from './Attacher'
import Builder from './Builder'
import Incrementer from './Incrementer'

export default class Data {
  /**
   * Normalize the data.
   */
  static normalize (data: any, query: Query): NormalizedData {
    const normalizedData = Normalizer.normalize(data, query)

    const attachedData = Attacher.attach(normalizedData, query)

    return Incrementer.increment(attachedData, query)
  }

  /**
   * Fill missing records with default value based on model schema.
   */
  static fillAll (data: NormalizedData, query: Query): NormalizedData {
    return Builder.build(data, query)
  }
}

Fix some styling in the data class
Fix some styling in the data class
