CL$WS Host : D5239-staging-cl

<back to all web services

cr_commandeRequest

The following routes are available for this service:
GET, POST/cr_commande/{id_controleur}/{id_tournee}
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class _cr_commande_ligne implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $num_facture=null,
        /** @var int */
        public int $line_id=0,
        /** @var int */
        public int $article_id=0,
        /** @var int */
        public int $quantite=0,
        /** @var string|null */
        public ?string $date=null,
        /** @var string|null */
        public ?string $qte_uv=null,
        /** @var string|null */
        public ?string $qte_uc=null,
        /** @var string|null */
        public ?string $cdt_uc=null,
        /** @var float|null */
        public ?float $_qte_uv=null,
        /** @var float|null */
        public ?float $_qte_uc=null,
        /** @var float|null */
        public ?float $_cdt_uc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['num_facture'])) $this->num_facture = $o['num_facture'];
        if (isset($o['line_id'])) $this->line_id = $o['line_id'];
        if (isset($o['article_id'])) $this->article_id = $o['article_id'];
        if (isset($o['quantite'])) $this->quantite = $o['quantite'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['qte_uv'])) $this->qte_uv = $o['qte_uv'];
        if (isset($o['qte_uc'])) $this->qte_uc = $o['qte_uc'];
        if (isset($o['cdt_uc'])) $this->cdt_uc = $o['cdt_uc'];
        if (isset($o['_qte_uv'])) $this->_qte_uv = $o['_qte_uv'];
        if (isset($o['_qte_uc'])) $this->_qte_uc = $o['_qte_uc'];
        if (isset($o['_cdt_uc'])) $this->_cdt_uc = $o['_cdt_uc'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->num_facture)) $o['num_facture'] = $this->num_facture;
        if (isset($this->line_id)) $o['line_id'] = $this->line_id;
        if (isset($this->article_id)) $o['article_id'] = $this->article_id;
        if (isset($this->quantite)) $o['quantite'] = $this->quantite;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->qte_uv)) $o['qte_uv'] = $this->qte_uv;
        if (isset($this->qte_uc)) $o['qte_uc'] = $this->qte_uc;
        if (isset($this->cdt_uc)) $o['cdt_uc'] = $this->cdt_uc;
        if (isset($this->_qte_uv)) $o['_qte_uv'] = $this->_qte_uv;
        if (isset($this->_qte_uc)) $o['_qte_uc'] = $this->_qte_uc;
        if (isset($this->_cdt_uc)) $o['_cdt_uc'] = $this->_cdt_uc;
        return empty($o) ? new class(){} : $o;
    }
}

class _cr_commande implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $num_facture=null,
        /** @var string|null */
        public ?string $commentaire=null,
        /** @var int */
        public int $regroupee=0,
        /** @var string|null */
        public ?string $date=null,
        /** @var array<_cr_commande_ligne>|null */
        public ?array $lignes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['num_facture'])) $this->num_facture = $o['num_facture'];
        if (isset($o['commentaire'])) $this->commentaire = $o['commentaire'];
        if (isset($o['regroupee'])) $this->regroupee = $o['regroupee'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['lignes'])) $this->lignes = JsonConverters::fromArray('_cr_commande_ligne', $o['lignes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->num_facture)) $o['num_facture'] = $this->num_facture;
        if (isset($this->commentaire)) $o['commentaire'] = $this->commentaire;
        if (isset($this->regroupee)) $o['regroupee'] = $this->regroupee;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->lignes)) $o['lignes'] = JsonConverters::toArray('_cr_commande_ligne', $this->lignes);
        return empty($o) ? new class(){} : $o;
    }
}

class cr_commandeResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_cr_commande>|null */
        public ?array $cr_commandes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['cr_commandes'])) $this->cr_commandes = JsonConverters::fromArray('_cr_commande', $o['cr_commandes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->cr_commandes)) $o['cr_commandes'] = JsonConverters::toArray('_cr_commande', $this->cr_commandes);
        return empty($o) ? new class(){} : $o;
    }
}

class cr_commandeRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_cr_commande>|null */
        public ?array $cr_commandes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['cr_commandes'])) $this->cr_commandes = JsonConverters::fromArray('_cr_commande', $o['cr_commandes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->cr_commandes)) $o['cr_commandes'] = JsonConverters::toArray('_cr_commande', $this->cr_commandes);
        return empty($o) ? new class(){} : $o;
    }
}

PHP cr_commandeRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /cr_commande/{id_controleur}/{id_tournee} HTTP/1.1 
Host: freemotion-staging.milliet.paris 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id_controleur":"String","id_tournee":"String","cr_commandes":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","commentaire":"String","regroupee":0,"date":"String","lignes":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","line_id":0,"article_id":0,"quantite":0,"date":"String","qte_uv":"String","qte_uc":"String","cdt_uc":"String"}]}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id_controleur":"String","id_tournee":"String","cr_commandes":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","commentaire":"String","regroupee":0,"date":"String","lignes":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","line_id":0,"article_id":0,"quantite":0,"date":"String","qte_uv":"String","qte_uc":"String","cdt_uc":"String"}]}]}