OpenCannabis: Menu Extension

  • Version 1.0
  • Status: RAW

Status of this Memo

This specification's current status is considered RAW, i.e. pre-DRAFT. Distribution of this memo is unlimited.

Abstract

This document describes an extension to the OpenCannabis Specification, version 1, that introduces menu- related definitions structures, and services that compose, create and reference menus.

"Menu" in this context, refers to:

  • The contents of a dispensary's products
  • The product categories and their respective names
  • The status of the "Menu"
  • The channel through which the "Menu" is displayed to customers

Table of Contents


Protocol Definition

opencannabis.menu

Specifies a menu, menu data structure, contents, products and so on.

Menu metadata:Metadata payload:SectionedMenu menu:StaticMenu MenuSettings full:bool keys_only:bool snapshot:opencannabis.crypto.primitives.integrity.Hash fingerprint:opencannabis.crypto.primitives.integrity.Hash section:section.Section

Metadata scope:string version:uint64 status:Status flags:Flag published:opencannabis.temporal.Instant settings:MenuSettings SectionData count:int32 section:section.SectionSpec product:MenuProduct SectionedMenu count:int32 payload:SectionData

StaticMenu apothecary:StaticMenu.ApothecaryEntry cartridges:StaticMenu.CartridgesEntry edibles:StaticMenu.EdiblesEntry extracts:StaticMenu.ExtractsEntry flowers:StaticMenu.FlowersEntry merchandise:StaticMenu.MerchandiseEntry prerolls:StaticMenu.PrerollsEntry plants:StaticMenu.PlantsEntry StaticMenu.ApothecaryEntry key:string value:opencannabis.products.Apothecary

StaticMenu.CartridgesEntry key:string value:opencannabis.products.Cartridge StaticMenu.EdiblesEntry key:string value:opencannabis.products.Edible StaticMenu.ExtractsEntry key:string value:opencannabis.products.Extract StaticMenu.FlowersEntry key:string value:opencannabis.products.Flower StaticMenu.MerchandiseEntry key:string value:opencannabis.products.Merchandise StaticMenu.PrerollsEntry key:string value:opencannabis.products.Preroll StaticMenu.PlantsEntry key:string value:opencannabis.products.Plant Flag DRAFT:0 PRIVATE:1 OUT_OF_DATE:2 Status UNPUBLISHED:0 LIVE:1

Holds a full specification for a revision of menu data, segmented into sections, by the categories member products are filed in. Categories are enumerated in menu.Section.

Field Type Label Description
metadata Metadata Metadata for the menu.
payload SectionedMenu Data payloads attached to this menu.
menu StaticMenu Specifies a static menu, where each section is specified as a typed map, with keys mapped to products.

Specifies settings used to generate a menu, or used as input when generating menus.

Field Type Label Description
full bool Flag indicating a full menu, including hidden/out-of-stock items.
keys_only bool Only include menu keys, no detail data.
snapshot opencannabis.crypto.primitives.integrity.Hash Don't return the menu if it's identical to this fingerprint.
fingerprint opencannabis.crypto.primitives.integrity.Hash Bloom filter to consider when returning or processing menu items.
section section.Section repeated Sections to include in the menu. If unspecified, include all sections.

Metadata

Specifies metadata for a package of menu data.

Field Type Label Description
scope string Partner location that owns this menu data.
version uint64 Version number, or publish timestamp, of this data.
status Status Status of this menu data.
flags Flag repeated Flags attached to this menu data.
published opencannabis.temporal.Instant When this menu data was published.
settings MenuSettings Settings that produced this menu data.

SectionData

Specifies an inner menu payload which contains menu data for a given menu section.

Field Type Label Description
count int32 Count of products included in this menu section data.
section section.SectionSpec Section that this data is attached to.
product MenuProduct repeated Menu products attached to this section.

SectionedMenu

Specifies a menu split into section-level chunks.

Field Type Label Description
count int32 Count of all products included in this menu, all sections considered.
payload SectionData repeated Specifies a payload of sectioned menu data.

StaticMenu

Specifies an inner menu payload which contains mapped data, where each map key is a section name, lowercased, and each map value is itself a product, and each map is addressed at a typed property name.

Field Type Label Description
apothecary StaticMenu.ApothecaryEntry repeated Specifies APOTHECARY products attached to this menu.
cartridges StaticMenu.CartridgesEntry repeated Specifies CARTRIDGE products attached to this menu.
edibles StaticMenu.EdiblesEntry repeated Specifies EDIBLE products attached to this menu.
extracts StaticMenu.ExtractsEntry repeated Specifies EXTRACT products attached to this menu.
flowers StaticMenu.FlowersEntry repeated Specifies FLOWER products attached to this menu.
merchandise StaticMenu.MerchandiseEntry repeated Specifies MERCHANDISE products attached to this menu.
plants StaticMenu.PlantsEntry repeated Specifies PLANT products attached to this menu.
prerolls StaticMenu.PrerollsEntry repeated Specifies PREROLL products attached to this menu.

StaticMenu.ApothecaryEntry

Field Type Label Description
key string
value opencannabis.products.Apothecary

StaticMenu.CartridgesEntry

Field Type Label Description
key string
value opencannabis.products.Cartridge

StaticMenu.EdiblesEntry

Field Type Label Description
key string
value opencannabis.products.Edible

StaticMenu.ExtractsEntry

Field Type Label Description
key string
value opencannabis.products.Extract

StaticMenu.FlowersEntry

Field Type Label Description
key string
value opencannabis.products.Flower

StaticMenu.MerchandiseEntry

Field Type Label Description
key string
value opencannabis.products.Merchandise

StaticMenu.PlantsEntry

Field Type Label Description
key string
value opencannabis.products.Plant

StaticMenu.PrerollsEntry

Field Type Label Description
key string
value opencannabis.products.Preroll

Flag

Enumerates flags that can be set on a menu.

Name Number Description
DRAFT 0 Indicates that this entire menu is considered a draft.
PRIVATE 1 Indicates that the underlying menu data is currently private and should not be exposed publicly.
OUT_OF_DATE 2 Indicates that the underlying menu data is known to be out-of-date.

Status

Enumerates statuses a menu may assume.

Name Number Description
UNPUBLISHED 0 Indicates that a menu revision is not yet published.
LIVE 1 Indicates that a menu revision has been published and is considered live.

results matching ""

    No results matching ""