Skip to main content

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 TypeExample URL
POST{{url_base}}/PostAddDiscardReason
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddDiscardReason"

Input Parameters

ParameterTypeRequiredDescription
DiscardReasonNoString(10)NoExternal code of the discard reason
NameString(40)YesDiscard reason description
DiscountEntryBooleanNoFlag indicating if the discard reason is discounted from entry
WeighingBooleanNoFlag indicating if the discard reason performs weighing
ResponsibleResponsibleTypeYesEnumerator with possible values for Responsible Type: rsSlaughterhouse (Slaughterhouse), rsFarm (Farm), rsCatch (Catch) or rsTransport (Transport)
DiscardReasonTypeDiscardReasonTypeNoEnumerator with possible values for Discard Reason Type: drDiscard (Discard) or drNoConformity (Non-conformity)
DiscardTypeDiscardTypeNoEnumerator with possible values for Discard Type: dtBruise (Bruise), dtCondemnation (Condemnation) or dtLoss (Loss)
CondemnationTypeCondemnationTypeNoEnumerator with possible values for Condemnation Type: ctPartial (Partial) or ctTotal (Total)
AllowSettingsChangeBooleanNoFlag indicating if the registration can be changed internally in MIMS
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
DiscardReasonCodeIntegerYesInternal 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

CodeMessage
ARD‑001The provided External Discard Reason Code parameter (DiscardReasonNo) already exists!