# Supplier

# Add/Remove/Edit Supplier

Sử dụng API này để thêm/xóa/sửa nhà bán

# Endpoint

# Parameters

Name Type Description Required
items Object ✔️

# Note

Các params có trong object của items khi thêm/xóa/sửa nhà bán

Name Type Description Required
$add Array ✔️
$remove Array ✔️
$update Array ✔️
$delete Array ✔️

Các params có trong mảng $add khi thêm nhà bán

Name Type Description Required
name String ✔️
address String ✔️
email Number ✔️
phone Number ✔️
company String ✔️
taxCode String ✔️
code String
shortDesc String
desc String
type String
icon String
warrantyPolicy String
banner Number
content Number

Các params có trong mảng $update khi chỉnh sửa nhà bán

Name Type Description Required
id Number ✔️
name String ✔️
address String ✔️
email Number ✔️
phone Number ✔️
company String ✔️
taxCode String ✔️
code String
shortDesc String
desc String
type String
icon String
warrantyPolicy String
banner Number
content Number

Các params có trong mảng $remove khi xóa vĩnh viễn nhà bán

Name Type Description Required
id Number ✔️

Các params có trong mảng $delete khi xóa tạm thời nhà bán

Name Type Description Required
id Number ✔️

# Response

{
    "status": true,
    "items": {
        "$rltAdd": [{
            "id": 111,
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }],
        "$rltUpdate": [{
            "id": 111,
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }],
        "$rltRemove": [{
            "id": 111,
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }],
        "$rltDelete": [{
            "id": 111,
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }]
    }
}
curl -X POST http://localhost:3000/quotation/add \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
  --data '{
    "items": {
        $add: [{
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }],
        $update: [{
            "id": "111",
            "name": "New Sup",
            "address": "address",
            "email": "email",
            "phone": "0123123123",
            "company": "company",
            "taxCode": "taxCode",
            "code": "code",
            "shortDesc": "shortDesc",
            "desc": "desc",
            "type": "type",
            "icon": "icon",
            "warrantyPolicy": "warrantyPolicy",
            "banner": "banner",
            "content": "content",
        }],
        $remove: [{
            "id": "111"
        }],
        $delete: [{
            "id": "111"
        }],
    }
  }'

# Get list Paging

Sử dụng API này để lấy danh sách nhà bán sản phẩm

# Endpoint

# Parameters

Name Type Description Required
keyword String ✔️

# Response

{
    "status": true,
    "message": "success",
    "totalRows": 1,
    "rows": [{
        "id": "111",
        "name": "New Sup",
        "address": "address",
        "email": "email",
        "phone": "0123123123",
        "company": "company",
        "taxCode": "taxCode",
        "code": "code",
        "shortDesc": "shortDesc",
        "desc": "desc",
        "type": "type",
        "icon": "icon",
        "warrantyPolicy": "warrantyPolicy",
        "banner": "banner",
        "content": "content",
    }]
}
curl -X POST http://localhost:3000/quotation/add \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
  --data '{
      "keyword": "name"
    }
  }'