code: def get_compulsory_fields(layer_purpose, layer_subcategory=None):
      
      if not layer_subcategory:
          if layer_purpose == 'hazard':
              return hazard_value_field
          elif layer_purpose == 'exposure':
              return exposure_type_field
          elif layer_purpose == 'aggregation':
              return aggregation_name_field
          else:
              return None
      else:
          return definition(layer_subcategory).get('compulsory_fields')[0]
docs: Get compulsory field based on layer_purpose and layer_subcategory
  
      :param layer_purpose: The layer purpose.
      :type layer_purpose: str
  
      :param layer_subcategory: Exposure or hazard value.
      :type layer_subcategory: str
  
      :returns: Compulsory field
      :rtype: dict