# Quotation

# Add Quotation

Sử dụng API này để thêm một báo giá, khi user đăng nhập

# Endpoint

# Parameters

Name Type Description Required
customerId Number ✔️
BDInChargeId Number BD in charge of EI
salesInChargeId Number sales in charge of EI
quotationStatusId Number
shippingMethodId Number shipping method
note Number
personInChargeId Number person in charge of customer
representativeId Number representative of EI/Customer
quotationDetailArray Array
tax Number
isImportant Bool
customerAddressId Number

# Note

Các params có trong một object của mảng quotationDetailArray

Name Type Description Required
productId Number ✔️
quantity Number
unitPrice Number
weight Number
tax Number
note String

# Response

{
    "status": true,
    "messageCode": "",
    "messageContent": "",
    "data": {
        "items": {
            "createdAt": {
                "val": "CURRENT_TIMESTAMP(3)"
            },
            "updatedAt": {
                "val": "CURRENT_TIMESTAMP(3)"
            },
            "cancelReason": null,
            "deleted": false,
            "id": 5,
            "customerId": 1,
            "code": "QUO-0208-00001",
            "total": 22000,
            "userInChargeId": 1,
            "quotationStatusId": 1,
            "note": "ghi chú",
            "personInChargeId": 1,
            "representativeId": 1,
            "tax": 10,
            "updatedBy": 3,
            "createdBy": 3
        }
    }
}
curl -X POST http://localhost:3000/quotation/add \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
  --data '{
    "customerId": 13,
    "userInChargeId": 1,
    "quotationStatusId": 1,
    "note": "ghi chú",
    "personInChargeId": 1,
    "representativeId": 1,
    "quotationDetailArray": [
        {
        "productId": 1,
        "quantity": 1,
        "unitPrice": 20000,
        "note": "ghi chú sp"
        }
    ],
    "tax": "10"
  }'