public function assemble($document, Schema $schema)
    {
        $entityClass = $schema->entityClass;
        $model = Ioc::make($entityClass);

        foreach ($document as $field => $value) {
            $fieldType = $schema->fields[$field] ?? null;

            if ($fieldType && 'schema.' == substr($fieldType, 0, 7)) {
                $value = $this->assembleDocumentsRecursively($value, substr($fieldType, 7));
            }

            $model->$field = $value;
        }

        $entity = $this->morphingTime($model);

        return $this->prepareOriginalAttributes($entity);
    }