protected function dataForUpdate($record, array $document): array
    {
        $resource = $document['data'] ?? [];

        if ($this->mustValidateExisting($record, $document)) {
            $resource['attributes'] = $this->extractAttributes(
                $record,
                $resource['attributes'] ?? []
            );

            $resource['relationships'] = $this->extractRelationships(
                $record,
                $resource['relationships'] ?? []
            );
        }

        return $resource;
    }