redundant tags, improved product indexing

This commit is contained in:
gzuuus 2024-04-09 17:56:28 +02:00
parent 14032e70d9
commit e529213ef9

30
15.md
View File

@ -47,7 +47,6 @@ A merchant can publish these events:
```json
{
"id": <string, id generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"name": <string, stall name>,
"description": <string (optional), stall description>,
"currency": <string, currency used>,
@ -75,11 +74,11 @@ Fields that are not self-explanatory:
```json
{
"tags": [["d", <string, id of stall]],
"tags": [["d", <string, id of the stall>]],
...
}
```
- the `d` tag is required, its value MUST be the same as the stall `id`. (NOTE: What is the reason for having the same value of `id` in the content, and `d` tag? Can we get rid of the `id` and just have the `d` tag?)
- the `d` tag is required and represents the stall id.
### Event `30018`: Create or update a product
@ -87,8 +86,7 @@ Fields that are not self-explanatory:
```json
{
"id": <string, id generated by the merchant (sequential ids are discouraged)>,
"stall_id": <string, id of the stall to which this product belong to>,
// "stall_id": <string, id of the stall to which this product belong to>,
"name": <string, product name>,
"type": <simple | variable | variation>,
"description": <string (optional), product description>,
@ -128,7 +126,8 @@ Fields that are not self-explanatory:
```json
"tags": [
["d", <string, id of product],
["d", <string, id of product>],
["a", <event coordinate (naddr) of the stall to which the product belongs>],
["a", <event coordinate (naddr) of the variable product (optional, only for variations)>],
["t", <string (optional), product category],
["t", <string (optional), product category],
@ -137,8 +136,9 @@ Fields that are not self-explanatory:
...
```
- The `d` tag is required, its value MUST be the same as the product `id`.(NOTE: What is the reason for having the same value of `id` in the content, and `d` tag? Can we get rid of the `id` and just have the `d` tag?)
- The `d` tag is required.
- The `t` tag is as searchable tag, it represents different categories that the product can be part of (`food`, `fruits`). Multiple `t` tags can be present.
- The `a` tag is used to link the product to the stall to which it belongs.
- The `a` tag is used in variation products. It is used to link products that belong to a variable product.
## Checkout events
@ -273,8 +273,7 @@ This event leverages naddr to enable comprehensive customization and sharing of
**Event Content**:
```json
{
"id": <String, UUID generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"stall_id": <String, UUID of the stall to which this product belong to>,
// "stall_id": <String, UUID of the stall to which this product belong to>,
"name": <String, product name>,
"description": <String (optional), product description>,
"images": <[String], array of image URLs, optional>,
@ -300,6 +299,19 @@ This event leverages naddr to enable comprehensive customization and sharing of
* The auction runs for an initial number of seconds after the `start_date`, specified by `duration`.
```json
"tags": [
["d", <string, id of product auction>],
["a", <event coordinate (naddr) of the stall to which the product belongs>]
["t", <string (optional), product category],
["t", <string (optional), product category],
...
],
...
```
- The `d` tag is required.
### Event `1021`: Bid
```json