Discard Reason
The PostAddDiscardReason endpoint is responsible for registering a new discard reason in the MIMS system and can be viewed on screen CAD140.
How to register a discard reason
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddDiscardReason |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddDiscardReason" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| DiscardReasonNo | String(10) | No | External code of the discard reason |
| Name | String(40) | Yes | Discard reason description |
| DiscountEntry | Boolean | No | Flag indicating if the discard reason is discounted from entry |
| Weighing | Boolean | No | Flag indicating if the discard reason performs weighing |
| Responsible | ResponsibleType | Yes | Enumerator with possible values for Responsible Type: rsSlaughterhouse (Slaughterhouse), rsFarm (Farm), rsCatch (Catch) or rsTransport (Transport) |
| DiscardReasonType | DiscardReasonType | No | Enumerator with possible values for Discard Reason Type: drDiscard (Discard) or drNoConformity (Non-conformity) |
| DiscardType | DiscardType | No | Enumerator with possible values for Discard Type: dtBruise (Bruise), dtCondemnation (Condemnation) or dtLoss (Loss) |
| CondemnationType | CondemnationType | No | Enumerator with possible values for Condemnation Type: ctPartial (Partial) or ctTotal (Total) |
| AllowSettingsChange | Boolean | No | Flag indicating if the registration can be changed internally in MIMS |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| DiscardReasonCode | Integer | Yes | Internal Discard Reason code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddDiscardReason"' \
--header 'Content-Type: application/json' \
--data '{
"DiscardReasonNo": "DSC-001",
"Name": "Condenação por contusão",
"DiscountEntry": false,
"Weighing": true,
"Responsible": "rsSlaughterhouse",
"DiscardReasonType": "drDiscard",
"DiscardType": "dtBruise",
"CondemnationType": "ctPartial",
"AllowSettingsChange": true,
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"DiscardReasonCode": 197
}
🐞 Possible Errors
| Code | Message |
|---|---|
| ARD‑001 | The provided External Discard Reason Code parameter (DiscardReasonNo) already exists! |