Workflows

Version Assignment

Offer an interface for users to modify their application version.


Allowing accounts to select versions

The app schema contains versions relevant to the accounts domain. The domains.[session.account.domain_id] is an array of version IDs and their values contain the version information.

// app schema object
{
  ...
  "dom_1234567890": {
    "ver_1234567890": {
      "title": "Basic",
      "description": "Everything needed to get started."
    },
    ...
  },
  ...
}

The following will provide values for a group of radios for allowing selection of the application version.

// extracting app schema values for account versioning options

Object.keys(domains[session.account.domain_id].versions).map((id) => {
  console.log({
    "active": session.account.version_id === id,
    "title": domains[session.account.domain_id].versions[id].title,
    "description": domains[session.account.domain_id].versions[id].description
  });
});

Request

Submit the selected version ID to the API for processing.

POST /v1/account/versions/:version_id

Response

The selected Version object.

// version object
{
  "id": "ver_1234567890",
  "title": "App",
  "description": "Version for the main application.",
  "tag": "v1",
  "is_default": 1,
  "status": "active",
  "features": [
    {
      "id": "fea_1234567890",
      "title": "Account",
      "human_id": "account"
    },
    ...
  ]
}
PropertyTypeDescription
idStringThe version ID.
titleStringThe title of the version.
descriptionStringThe description iof the version.
tagStringThe sort tag associated with the version.
is_defaultBooleanWhether the version is the default when signing up.
statusStringThe status of the version (active or inactive). An inactive version haa no accounts subscribed.
fearuresArrayAn array of features included in the version.
features.idStringThe feature ID.
features.titleStringThe title of the feature.
features.human_idStringThe human-readable ID.
Previous
Signing Up