========== Job Events ========== Overview ======== AgriSmart can configure its products to send Job Event messages to Amazon SQS FIFO queues. These events include details about which :ref:`user ` triggered a given event, when the event happened, and the state of the given :doc:`job ` at the time of the event. Customers can use these events to create custom notification logic, to keep other systems synchronized with AgriSmart's products, or for custom reporting needs. .. _job-event-attributes: Event Attributes ================ .. tabularcolumns:: |l|L| ========================== =========== Attribute Description ========================== =========== event The event name. user The :ref:`user ` that triggered the event. The user attributes include the unique AgriSmart ID for the user along with their login, email, and name. job The :ref:`attributes ` for the job the given event applies to. ========================== =========== Sample ------ :: { "event": "Enrolled", "user": { "id": 9999, "login": "kevinsmith", "email": "kevin+cvatest@example.com", "first_name": "Kevin", "last_name": "Smith" }, "job": { "number": 631438, "status": 200, "spray_date": "2016/12/14", "partnership": { "id": 9999, "applicator": { "id": 999, "business_name": "Acme Inc", "address": "123 Any Street", "city": "Omaha", "state": "NE", "zip": "55555", "phone": "", "contact_first_name": "Kevin", "contact_last_name": "Smith", "min_release_window": null }, "retailer": { "id": 9999, "name": "Acme Retailer", "address": "Acme Retailer", "city": "", "state": "Ne", "zip": "", "phone": "", "contact_first_name": "", "contact_last_name": "" } }, "center": { "lat": 40.85421156241485, "lng": -96.58174693905168 }, "legal_state": null, "legal_county": null, "township": null, "legal": null, "total_acres": 109.0, "grower": { "id": 168442, "grower_id": "95674254" }, "job_type": { "id": 2, "description": "Ground Application" }, "job_category": { "id": 101, "description": "Dry - Spinner" }, "purpose": { "id": 4, "description": "Fertility" }, "pest": "", "gpa": 10.0, "release_now": true, "release_start": "2016/12/14", "release_end": "2016/12/18", "display_date": "2016/12/14", "pilot_id": null, "crop": { "id": 1, "name": "Corn" }, "sprayed_completely": false, "processed": null, "fields": [ { "name": "FIELD A", "actual_acres": 49.0, "geom": { "type": "Polygon", "coordinates": [ [ [ -96.58206175621393, 40.85149059279745 ], [ -96.58651251530733, 40.85148331164894 ], [ -96.58648972096138, 40.8523855464387 ], [ -96.58647384661454, 40.85551958373181 ], [ -96.58645619129256, 40.856005770379 ], [ -96.58562654982492, 40.85598839885197 ], [ -96.58427121764575, 40.855971446510615 ], [ -96.58412067143807, 40.855968291872216 ], [ -96.5839567445814, 40.85591909955987 ], [ -96.58391697077613, 40.855769555566944 ], [ -96.58304671571284, 40.855671239469466 ], [ -96.58287986867204, 40.855702059267614 ], [ -96.58290258436443, 40.85632025580802 ], [ -96.58333709217652, 40.85638656115279 ], [ -96.58341111883868, 40.856422430678386 ], [ -96.5833780454732, 40.85696235522233 ], [ -96.58195415688243, 40.856933435875746 ], [ -96.58206175621393, 40.85149059279745 ] ] ] } }, { "name": "", "actual_acres": 30.0, "geom": { "type": "Polygon", "coordinates": [ [ [ -96.57698136279603, 40.85665886251953 ], [ -96.57708907901028, 40.85175540408102 ], [ -96.57779522611384, 40.8516083631159 ], [ -96.57951800517152, 40.85146151710557 ], [ -96.57958922960911, 40.851460769607364 ], [ -96.57953230678423, 40.8567678431781 ], [ -96.57698136279603, 40.85665886251953 ] ] ] } }, { "name": "", "actual_acres": 30.0, "geom": { "type": "Polygon", "coordinates": [ [ [ -96.57953230678423, 40.8567678431781 ], [ -96.57958922960911, 40.851460769607364 ], [ -96.58206175621393, 40.85149059279745 ], [ -96.58195415688243, 40.856933435875746 ], [ -96.5802574152612, 40.85680775368071 ], [ -96.57953230678423, 40.8567678431781 ] ] ] } } ], "products": [ { "name": "12-40-0-10s-1z MESZ (512400)", "code": "512400", "rate": 2.0 }, { "name": "Urea 46-0-0 (500805)", "code": "500805", "rate": 1.0 } ] } } Events ====== .. tabularcolumns:: |l|L| ========================== =========== Event Description ========================== =========== Enrolled Sent when a new job is enrolled. Accepted Sent when a job is accepted. Released Sent when a job is released. Rejected Sent when a job is rejected. Scheduled Sent when a job is scheduled. Pending Sent when a job is marked pending. Partially Sprayed Sent when a job is marked partially sprayed. Sprayed Sent when a job is marked sprayed. Billed Sent when a job is invoiced. Paid Sent when a job is marked paid. Cancelled Sent when a job is cancelled. Deleted Sent when a job is deleted. ========================== ===========