Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Tag and Category API design #296

Open
3 tasks
yiyione opened this issue May 14, 2021 · 0 comments
Open
3 tasks

Tag and Category API design #296

yiyione opened this issue May 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@yiyione
Copy link
Contributor

yiyione commented May 14, 2021

Introduction

Tags and categories have been the marketplace item's property for a long time.
But when we support UI to add tags to item or filter tags when list item, we need a easy way to list all tags we have (for tag picker suggestion)
same with the category
So here design the Tag and Category API, to support CURD of tags & categories.

Issues / Motivations

Proposals / Solutions

Tags

Definition

{
  id: {
    type: DataTypes.STRING,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
  },
  name: DataTypes.STRING,
  color: DataTypes.STRING,
  description: DataTypes.STRING,
  extras: DataTypes.TEXT,
}

APIs

list: GET /tags
get: GET /tags/<tag id>
create: POST /tags
update: PUT /tags/<tag id>
delete: DELETE /tags/<tag id>

Categories

Definition

{
  id: {
    type: DataTypes.STRING,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
  },
  name: DataTypes.STRING,
  description: DataTypes.STRING,
  extras: DataTypes.TEXT,
}

APIs

list: GET /categories
get: GET /categories/<category id>
create: POST /categories
update: PUT /categories/<category id>
delete: DELETE /categories/<category id>

Permission (need more discussion)

All user with correct token (write permission for any item) can create/list/get tags, and list/get categories.
Only admin can update/delete tags and create/update/delete categories.

Work Plan

Process Check List

  • models/controllers/router

Test cases

  • Test 1
  • Test 2
@yiyione yiyione added the enhancement New feature or request label May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant