fix: use "date" field name for Dolibarr order creation

Dolibarr POST /orders requires field named "date" (not "date_commande").
Add @JsonAlias("date_commande") so GET responses are still deserialized
correctly when the response uses the alternative field name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
luklpz 2026-05-15 08:19:28 +02:00
parent db4db1741d
commit c5d36bf051
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.teterialosjuanjos.tfg.sync_service.integration.dolibarr.dto;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -19,8 +20,8 @@ public record DolibarrOrderDto(
String ref,
/** Thirdparty (customer) internal ID */
Integer socid,
/** Order date as UNIX timestamp */
@JsonProperty("date_commande") Long dateCommande,
/** Order date as UNIX timestamp. POST requires "date"; GET response uses "date_commande". */
@JsonProperty("date") @JsonAlias("date_commande") Long dateCommande,
/** 0 = draft, 1 = validated, 2 = shipped, 3 = canceled */
Integer statut,
@JsonProperty("note_public") String notePublic,