Actual data structures for main entities

Hello, guys!

I try to understand VueStorefront basics and I am looking for actual data structure for Category, Product, Customer, Address, Sale and other entities. Data is the most important part of any application and there are many methods to describe data structure (POJO, XML, DDL, JSON Schema, Elasticsearch mapping, …). I suppose that every large project should have a definitions of the main data structures been used in the project (stored and/or transferred).

I found that VSF creates indexes in Elasticsearch v7 using JSON files with ES meta data (under vue-storefront-api/config/ folder).

Is it an actual data structure for the main entities (models)? It seems like the data structures definition that I am looking for. Maybe, there is other place with data definition or, perhaps, there are different data structures for front & api parts?

Thanks,

Alex.

I’ve analyzed VSF code and I’ve found following data structures seem to be an actual for the moment.

attribute:

{
  "properties": {
    "attribute_code": {"type": "keyword"},
    "attribute_id": {"type": "long"},
    "frontend_input": {"type": "text"},
    "frontend_label": {"type": "text"},
    "is_comparable": {"type": "boolean"},
    "is_user_defined": {"type": "boolean"},
    "is_visible": {"type": "boolean"},
    "is_visible_on_front": {"type": "boolean"},
    "options": {
      "properties": {
        "label": {"type": "text"},
        "value": {"type": "long"}
      }
    }
  }
}

category:

{
  "properties": {
    "children_count": {"type": "integer"},
    "children_data": {"type": "nested"},
    "id": {"type": "integer"},
    "is_active": {"type": "boolean"},
    "level": {"type": "integer"},
    "meta_description": {"type": "text"},
    "meta_title": {"type": "text"},
    "name": {"type": "text"},
    "parent_id": {"type": "integer"},
    "path": {"type": "text"},
    "position": {"type": "integer"},
    "product_count": {"type": "integer"},
    "slug": {"type": "keyword"},
    "url_key": {"type": "keyword"},
    "url_path": {"type": "keyword"}
  }
}

product:

{
  "properties": {
    "category_ids": {"type": "long"},
    "created_at": {
      "type": "date",
      "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
    },
    "description": {"type": "text"},
    "id": {"type": "long"},
    "image": {"type": "text"},
    "is_in_stock": {"type": "boolean"},
    "meta_description": {"type": "text"},
    "meta_title": {"type": "text"},
    "name": {"type": "text"},
    "price": {"type": "float"},
    "price_incl_tax": {"type": "float"},
    "qty": {"type": "float"},
    "sku": {"type": "keyword"},
    "slug": {"type": "keyword"},
    "special_price": {"type": "float"},
    "status": {"type": "integer"},
    "type_id": {"type": "text"},
    "updated_at": {
      "type": "date",
      "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
    },
    "url_path": {"type": "keyword"},
    "visibility": {"type": "integer"}
  }
}

category.children_data contains set of sub-categories with own children nested (deep to catalog full depth). I have no configurable and bundled products yet, so product entity should have more attributes. Also I don’t completely analyze product prices & stock info (special price, tier price, MSI qty).

Custom product attributes from Magento are additional and should not be included in the core attributes scheme I suppose. Its will be created by Elasticsearch on fact when product document is indexed.