thachyyy / Retail-Store-Chain-Management-System

0 stars 0 forks source link

Update Product #12

Open vuonghoang010100 opened 7 months ago

vuonghoang010100 commented 7 months ago

-API:

Thêm vào response:

GET /products -> tất cả product

POST: 
{
  "product_name": "string", -> require
  "description": "string",
  "categories": "?",  -> id
  "brand": "string", 
  "unit": "string", -> require
  "last_purchase_price": 0, -> don't care
  "sale_price": 0, -> require
  "status": "EMPTY",  -> require
  "barcode": "number" -> require -> UNIQUE
  "note": "string",
  "contract_id": "string", -> don't care
  "promotion_id": "string", -> don't care
  "batch_id": "string", -> don't care
  "has_promotion": false -> don't care
}
thachyyy commented 7 months ago

GET /products:

Filter : status= -> str (nullable = True) price=[low, high] -> low_price : int (nullable = True); high_price: int (nullable = True); categories: (1 nhóm) -> str (nullable = True) Paging: limit offset

vuonghoang010100 commented 7 months ago
thachyyy commented 7 months ago
thachyyy commented 7 months ago
vuonghoang010100 commented 7 months ago
ChauNhan0201 commented 7 months ago
  • Xử lý khóa ngoại của product với categories:

    • Giả sử
      product {
        "id": "SP01"
        "categories": "NHOM01",
        ...
      }
    • Xóa category NHOM01: chưa xử lý product bị ảnh hưởng hoặc ko cho xóa

Đã báo lỗi Dữ liệu đã được sử dụng. Screenshot from 2024-03-23 11-16-04

vuonghoang010100 commented 7 months ago