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:
parent
db4db1741d
commit
c5d36bf051
|
|
@ -1,5 +1,6 @@
|
||||||
package com.teterialosjuanjos.tfg.sync_service.integration.dolibarr.dto;
|
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.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
@ -19,8 +20,8 @@ public record DolibarrOrderDto(
|
||||||
String ref,
|
String ref,
|
||||||
/** Thirdparty (customer) internal ID */
|
/** Thirdparty (customer) internal ID */
|
||||||
Integer socid,
|
Integer socid,
|
||||||
/** Order date as UNIX timestamp */
|
/** Order date as UNIX timestamp. POST requires "date"; GET response uses "date_commande". */
|
||||||
@JsonProperty("date_commande") Long dateCommande,
|
@JsonProperty("date") @JsonAlias("date_commande") Long dateCommande,
|
||||||
/** 0 = draft, 1 = validated, 2 = shipped, 3 = canceled */
|
/** 0 = draft, 1 = validated, 2 = shipped, 3 = canceled */
|
||||||
Integer statut,
|
Integer statut,
|
||||||
@JsonProperty("note_public") String notePublic,
|
@JsonProperty("note_public") String notePublic,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue