WebHook Equipment Address (V6.2)

Résumé

Manipulation de l'entité EquipmentAddress (Adresses des équipements) en lecture/écriture/suppression via un objet métier depuis une application externe.

Tables

Les tables utilisées sont :

  • sw_data_equipmentaddress : Table des adresses des équipements

Critères d'activation

WHK_EquipmentAddress est défini dans la gestion des webhooks du studio.

Fonctionnement

settings parameters

"settings": { "correctionConflictLocation": "1", // pour le verb PUT permet de corriger automatiquement les conflits de localisation }

verb: GET

resultType: simple

"equipmentaddress":{ "codeequipmentaddress": "6410000000010", "equipment_ID": "BAL01-201910", "customeraddress_ID": "C0000001-BDX", "startDate": "2024-01-01 00:00:00", "endDate": "2024-12-31 23:59:59" }

verb: GET
resultType: extended

"equipmentaddress":{ "codeequipmentaddress": "6410000000010", "equipment_ID": "BAL01-201910", "customeraddress_ID": "C0000001-BDX", "startDate": "2024-01-01 00:00:00", "endDate": "2024-12-31 23:59:59" }

verb: GET
resultType: extendedRelated
en complément du résultat pour resultType: extended on aura le détail pour les tables equipment et customeraddress

"related":[ { "equipment":{ "codeequipment": "BAL01-201910", "description": "Ballon 300 litres", "equipmenttype_ID": "BALL", "serialNumber": "BAL-169-2", "equipment_ID_parent": "", "location": "Cave", "gpsLongitude": "", "gpsLatitude": "", "gpsAccuracy": "", "gpsUpdateDate_fixed": "", "gpsManual": "", "baseuser_ID_favoriteTechnician": "", "installationDate": "2020-08-04 00:00:00", "equipmentstatus_ID": "CREATED", "customerReference": "", "brand": "", "maker": "", "inServiceDate": "", "terminationDate": "", "replacementDate": "", "product_ID": "", "quantityRepresented": "1", "orderheader_ID": "", "externalID": "DTR 1 C1", "equipmentkind_ID": "DEFAULT", "useModuleCold": "0" }, "customeraddress":{ "codecustomeraddress":"C0000001-BDX", "customer_ID":"C0000001", "name":"C0000001", "address1":"15 Avenue Champollion", "address2":"", "address3":"", "postalCode":"21000 ", "city":"Dijon", "phoneNumber":"03 90 22 75 45", "faxNumber":"03 90 22 75 40", "mobilePhoneNumber":"", "email":"", "generictype_ID_country":"FR", "generictype_ID_province":"", "baseculture_ID":"", "branchoffice_ID":"", "site":"1", "siteCode": "BDX", "siteName": "Entrepôt Dijon", "areaCode":"", "contact":"", "gpsLongitude":"5.06764", "gpsLatitude":"47.33379", "billingAddress":"", "defaultBillingAddress":"", "deliveryAddress":"", "defaultDeliveryAddress":"", "accessCode":"", "floor":"", "apartment":"", "miscInfos":"", "baseuser_ID_favoriteTechnician":"", "erpAddressID":"BDX", "bankholidayparamheader_ID":"", "customercontact_ID": "C0000001-DJ", "registrationNumber": "", "closedDate": "" } }]

verb: PUT

"equipmentaddress":{ "codeequipmentaddress": "", /* Code globalement unique de l'adresse de l'équipement (Varchar (255))*/ "equipment_ID": "BAL01-201910", /* Code de l'équipement (ForeignKey () - sw_data_equipment.codeequipment)*/ "customeraddress_ID": "C0000001-BDX", /* Code de l'adresse (ForeignKey () - sw_data_customeraddress.codecustomeraddress)*/ "startDate": "2024-01-01 00:00:00", /* Date de début de la localisation (DateTime ())*/ "endDate": "2024-12-31 23:59:59" /* Date de fin de la localisation (DateTime ())*/ }

En fonction du settings “correctionConflictLocation“ on aura :

  • Si valeur = 1 : correction automatique des éventuels conflits de localisation

  • Si valeur différente de 1 ou settings non défini : affichage d’un éventuel message d’erreur de conflit de localisation

Un conflit de localisation correspond à un chevauchement de périodes de dates (startDate et endDate) avec un enregistrement existant.

verb: LIST
resultType: simple, extended reprendre les définitions du GET

"filters:" { "codeEquipmentAddress": "value", filter is equal "codeEquipment": "value", filter is equal "codeCustomerAddress": "value", filter is equal "locationDate": "value", filter is (startDate IS NULL OR startDate <= 'value') AND (endDate IS NULL OR endDate >= 'value') }, "orderBy": "value"

Valeurs possibles pour le tri "orderBy" :

  • codeEquipmentAscstartDateDesc : par code équipement ascendant et date de début descendant

  • codeCustomerAddressAscstartDateDesc : par code adresse ascendant et date de début descendant