# POST SendResultData Request ## Overview The system must process POST requests sent to the `/sendresultdata` endpoint to create materials in MES based on the information contained in the `MARKINGRETURN` object. The `CONTENT` field contains the panel and board identifiers, while `BAD_MARK` is used to identify X-OUT boards. The system processes POST requests received at the `/sendresultdata` endpoint, validating the lot, resource, product BOM, and remaining quantity. If validation succeeds, the materials are created in MES using the returned identifiers and X-OUT information. ## How To Configure ### Relevant Artifacts The following table lists the entities relevant to the implementation of this requirement: | Name | Type | Is Mandatory | Description | | :-------------------------- | :--------- | :----------- | :------------------------------------------------------------------------ | | IoTMetaDataDefinition | SmartTable | Yes | Smart Table used to configure REST server addresses and ports. | | SMTNutekCreateMaterials | DEE | Yes | DEE used to perform validations and create panel and board identifiers. | ## How It Works 1. The host receives a POST request at the `/sendresultdata` endpoint. 2. By default, the system invokes the `SMTNutekCreateMaterials` DEE, or another DEE configured in *IoTMetaDataDefinition* under `SendResultDataDEE`. 3. After all validations are completed, the DEE creates the panel and board materials in MES: - `VARIABLE="BRD"` is used to create the panel. - `VARIABLE="PCB"` is used to create the boards. - If `BAD_MARK` within `MARKINGRETURN` is set to `true`, the corresponding board is created as an X-OUT. 4. After receiving the DEE response, the response payload is generated. 5. The system returns an HTTP 200 response containing the generated payload. 6. In case of an error, a dedicated error payload is generated and returned. ## Assumptions - The `/sendresultdata` endpoint is accessible and correctly configured. ## Example Payload ### Request ```json{ "MESSAGEID": 23, "MACHINEID": "LASER01", "USERNAME": "OPERATOR01", "WORKORDER": "123456", "MARKINGRETURN": [ { "VARIABLE": "BRD", "INDEX": 0, "X": "10", "Y": "20", "CONTENT": "1234567", "TOPORBOT": "TOP", "SCANRESULT": "SCAN_PASS", "GRADING1": "0.3372549;D", "GRADING2": "-0.05820614;A", "GRADING3": "0;Off", "GRADING4": "0.8333333;A", "GRA_OVERALL": "B", "LASER_POW": 40, "BAD_MARK": false, "MARK_PLACE": "FirstPosition", "DATETIME": "2025-04-15T22:27:24.791+03:00" } ] } ... ``` ### Reply ```json{ "STATUS": "OK", "REASON": "", "DATA": [ { "RESULT": "0", "MSG": "OK" } ] } ```