lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

operational_listing_build_draft.v1.json (4397B)


      1 {
      2   "suite": "operational_listing",
      3   "contract_version": "1.0.0",
      4   "vectors": [
      5     {
      6       "id": "operational_listing_build_draft_victoria_carrots_001",
      7       "kind": "operational_listing.build_draft",
      8       "input": {
      9         "listing": {
     10           "d_tag": "AAAAAAAAAAAAAAAAAAAAAg",
     11           "published_at": 1700000000,
     12           "farm": {
     13             "pubkey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
     14             "d_tag": "AAAAAAAAAAAAAAAAAAAAAA"
     15           },
     16           "product": {
     17             "key": "carrot-nantes",
     18             "title": "Nantes Carrots",
     19             "category": "produce",
     20             "summary": "Fresh bunches harvested in Saanich"
     21           },
     22           "primary_bin_id": "bunch",
     23           "bins": [
     24             {
     25               "bin_id": "bunch",
     26               "quantity": {
     27                 "amount": "1",
     28                 "unit": "each"
     29               },
     30               "price_per_canonical_unit": {
     31                 "amount": {
     32                   "amount": "4",
     33                   "currency": "CAD"
     34                 },
     35                 "quantity": {
     36                   "amount": "1",
     37                   "unit": "each"
     38                 }
     39               }
     40             }
     41           ],
     42           "inventory_available": "24",
     43           "availability": {
     44             "kind": "status",
     45             "amount": {
     46               "status": {
     47                 "kind": "active"
     48               }
     49             }
     50           },
     51           "delivery_method": {
     52             "kind": "pickup"
     53           },
     54           "location": {
     55             "primary": "Saanich Peninsula",
     56             "city": "Victoria",
     57             "region": "BC",
     58             "country": "CA",
     59             "geohash": "c28hr"
     60           }
     61         }
     62       },
     63       "expected": {
     64         "wire_parts": {
     65           "kind": 30402,
     66           "content": "# Nantes Carrots\n\nFresh bunches harvested in Saanich",
     67           "tags": [
     68             [
     69               "d",
     70             "AAAAAAAAAAAAAAAAAAAAAg"
     71             ],
     72             [
     73               "p",
     74               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
     75             ],
     76             [
     77               "a",
     78             "30340:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:AAAAAAAAAAAAAAAAAAAAAA"
     79             ],
     80             [
     81               "key",
     82               "carrot-nantes"
     83             ],
     84             [
     85               "title",
     86               "Nantes Carrots"
     87             ],
     88             [
     89               "category",
     90               "produce"
     91             ],
     92             [
     93               "summary",
     94               "Fresh bunches harvested in Saanich"
     95             ],
     96             [
     97               "published_at",
     98               "1700000000"
     99             ],
    100             [
    101               "radroots:primary_bin",
    102               "bunch"
    103             ],
    104             [
    105               "radroots:bin",
    106               "bunch",
    107               "1",
    108               "each"
    109             ],
    110             [
    111               "radroots:price",
    112               "bunch",
    113               "4",
    114               "CAD",
    115               "1",
    116               "each"
    117             ],
    118             [
    119               "price",
    120               "4",
    121               "CAD"
    122             ],
    123             [
    124               "inventory",
    125               "24"
    126             ],
    127             [
    128               "status",
    129               "active"
    130             ],
    131             [
    132               "delivery",
    133               "pickup"
    134             ],
    135             [
    136               "location",
    137               "Saanich Peninsula",
    138               "Victoria",
    139               "BC",
    140               "CA"
    141             ],
    142             [
    143               "g",
    144             "c28hr"
    145             ]
    146           ]
    147         }
    148       }
    149     },
    150     {
    151       "id": "operational_listing_build_draft_empty_bins_002",
    152       "kind": "operational_listing.build_draft",
    153       "input": {
    154         "listing": {
    155           "d_tag": "AAAAAAAAAAAAAAAAAAAAAw",
    156           "farm": {
    157             "pubkey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    158             "d_tag": "AAAAAAAAAAAAAAAAAAAAAA"
    159           },
    160           "product": {
    161             "key": "carrot-nantes",
    162             "title": "Nantes Carrots",
    163             "category": "produce"
    164           },
    165           "primary_bin_id": "bunch",
    166           "bins": []
    167         }
    168       },
    169       "expected": {
    170         "error": {
    171           "code": "empty_required_field",
    172           "field": "bins"
    173         }
    174       }
    175     }
    176   ]
    177 }