Proyek Akhir: OpenShop RESTful API

Pengantar

Setiap kriteria dapat bernilai 0 sampai 4 points (pts). Untuk lulus dari submission ini setidaknya Anda harus mendapatkan 2 points dari setiap kriteria. Submission akan ditolak jika masih terdapat kriteria dengan nilai 0 points.

Kriteria 1: RESTful API dapat menyimpan data produk

RESTful API yang dibuat harus mampu menyimpan data dengan ketentuan sebagai berikut.

Berikut adalah ketentuan kriteria 1.

Kriteria 2: RESTful API dapat menampilkan data produk

RESTful API yang dibuat harus mampu menampilkan data dengan ketentuan sebagai berikut.

{
  "products": [
    {
      "id": "590f5c38-e7cf-45c9-8b0a-0937f7de6fa4",
      "name": "Kelas Belajar Python",
      "shop": "Dicoding",
      "price": 1500000,
      "sku": "DCD01",
      "description": "This is a sample description of the product.",
      "location": "Bandung",
      "discount": 0,
      "category": "Course",
      "stock": 1000,
      "is_available": true,
      "picture": "<https://www.shutterstock.com/image-vector/sample-red-square-grunge-stamp-260nw-338250266.jpg>",
      "_links": [
        {
          "rel": "self",
          "href": "<http://localhost:8000/products>",
          "action": "POST",
          "types": [
            "application/json"
          ]
        },
        {
          "rel": "self",
          "href": "<http://localhost:8000/products/75ea4e94-65a1-4c84-b5ab-b15b3af9ffac/>",
          "action": "GET",
          "types": [
            "application/json"
          ]
        },
        {
          "rel": "self",
          "href": "<http://localhost:8000/products/75ea4e94-65a1-4c84-b5ab-b15b3af9ffac/>",
          "action": "PUT",
          "types": [
            "application/json"
          ]
        },
        {
          "rel": "self",
          "href": "<http://localhost:8000/products/75ea4e94-65a1-4c84-b5ab-b15b3af9ffac/>",
          "action": "DELETE",
          "types": [
            "application/json"
          ]
        }
      ]
    }
  ]
}