'Create the core document structure for a block.
:param block_fields: the settings and children scoped fields as a dict or son
:param definition_id: the pointer to the content scoped fields
:param new_id: the structure\'s version id
:param raw: true if this block already has all references serialized
:param asides: dict information related to the connected xblock asides'

@contract(returns=BlockData)
def _new_block(self, user_id, category, block_fields, definition_id, new_id, raw=False, asides=None, block_defaults=None):

    if (not raw):
        block_fields = self._serialize_fields(category, block_fields)
    if (not asides):
        asides = {}
    document = {'block_type': category, 'definition': definition_id, 'fields': block_fields, 'asides': asides, 'edit_info': {'edited_on': datetime.datetime.now(UTC), 'edited_by': user_id, 'previous_version': None, 'update_version': new_id}}
    if block_defaults:
        document['defaults'] = block_defaults
    return BlockData(**document)
