CL$WS Host : D5239-staging-cl

<back to all web services

cl_tournee_dechargementRequest

The following routes are available for this service:
GET, DELETE/cl_tournee_dechargement
GET, DELETE/cl_tournee_dechargement/{id_operateur}
POST, DELETE/cl_tournee_dechargement/{id_operateur}/{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 _deconsigne implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $num_facture=null,
        /** @var string|null */
        public ?string $id_deconsigne=null,
        /** @var string|null */
        public ?string $id_client=null,
        /** @var int|null */
        public ?int $quantite=null,
        /** @var float|null */
        public ?float $pu_euro=null,
        /** @var float|null */
        public ?float $montant=null,
        /** @var string|null */
        public ?string $date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        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['id_deconsigne'])) $this->id_deconsigne = $o['id_deconsigne'];
        if (isset($o['id_client'])) $this->id_client = $o['id_client'];
        if (isset($o['quantite'])) $this->quantite = $o['quantite'];
        if (isset($o['pu_euro'])) $this->pu_euro = $o['pu_euro'];
        if (isset($o['montant'])) $this->montant = $o['montant'];
        if (isset($o['date'])) $this->date = $o['date'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        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->id_deconsigne)) $o['id_deconsigne'] = $this->id_deconsigne;
        if (isset($this->id_client)) $o['id_client'] = $this->id_client;
        if (isset($this->quantite)) $o['quantite'] = $this->quantite;
        if (isset($this->pu_euro)) $o['pu_euro'] = $this->pu_euro;
        if (isset($this->montant)) $o['montant'] = $this->montant;
        if (isset($this->date)) $o['date'] = $this->date;
        return empty($o) ? new class(){} : $o;
    }
}

class _encaissement implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $id_client=null,
        /** @var string|null */
        public ?string $id_reglement=null,
        /** @var float|null */
        public ?float $montant=null,
        /** @var string|null */
        public ?string $code_devise=null,
        /** @var string|null */
        public ?string $date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['id_client'])) $this->id_client = $o['id_client'];
        if (isset($o['id_reglement'])) $this->id_reglement = $o['id_reglement'];
        if (isset($o['montant'])) $this->montant = $o['montant'];
        if (isset($o['code_devise'])) $this->code_devise = $o['code_devise'];
        if (isset($o['date'])) $this->date = $o['date'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->id_client)) $o['id_client'] = $this->id_client;
        if (isset($this->id_reglement)) $o['id_reglement'] = $this->id_reglement;
        if (isset($this->montant)) $o['montant'] = $this->montant;
        if (isset($this->code_devise)) $o['code_devise'] = $this->code_devise;
        if (isset($this->date)) $o['date'] = $this->date;
        return empty($o) ? new class(){} : $o;
    }
}

class _incident implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $num_facture=null,
        /** @var string|null */
        public ?string $id_motif=null,
        /** @var string|null */
        public ?string $date=null,
        /** @var string|null */
        public ?string $photo=null,
        /** @var int */
        public int $attente=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        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['id_motif'])) $this->id_motif = $o['id_motif'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['photo'])) $this->photo = $o['photo'];
        if (isset($o['attente'])) $this->attente = $o['attente'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        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->id_motif)) $o['id_motif'] = $this->id_motif;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->photo)) $o['photo'] = $this->photo;
        if (isset($this->attente)) $o['attente'] = $this->attente;
        return empty($o) ? new class(){} : $o;
    }
}

class cl_tournee_dechargementResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_deconsigne>|null */
        public ?array $deconsignes=null,
        /** @var array<_encaissement>|null */
        public ?array $encaissements=null,
        /** @var array<_incident>|null */
        public ?array $incidents=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['deconsignes'])) $this->deconsignes = JsonConverters::fromArray('_deconsigne', $o['deconsignes']);
        if (isset($o['encaissements'])) $this->encaissements = JsonConverters::fromArray('_encaissement', $o['encaissements']);
        if (isset($o['incidents'])) $this->incidents = JsonConverters::fromArray('_incident', $o['incidents']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->deconsignes)) $o['deconsignes'] = JsonConverters::toArray('_deconsigne', $this->deconsignes);
        if (isset($this->encaissements)) $o['encaissements'] = JsonConverters::toArray('_encaissement', $this->encaissements);
        if (isset($this->incidents)) $o['incidents'] = JsonConverters::toArray('_incident', $this->incidents);
        return empty($o) ? new class(){} : $o;
    }
}

class cl_tournee_dechargementRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_deconsigne>|null */
        public ?array $deconsignes=null,
        /** @var array<_encaissement>|null */
        public ?array $encaissements=null,
        /** @var array<_incident>|null */
        public ?array $incidents=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['deconsignes'])) $this->deconsignes = JsonConverters::fromArray('_deconsigne', $o['deconsignes']);
        if (isset($o['encaissements'])) $this->encaissements = JsonConverters::fromArray('_encaissement', $o['encaissements']);
        if (isset($o['incidents'])) $this->incidents = JsonConverters::fromArray('_incident', $o['incidents']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->deconsignes)) $o['deconsignes'] = JsonConverters::toArray('_deconsigne', $this->deconsignes);
        if (isset($this->encaissements)) $o['encaissements'] = JsonConverters::toArray('_encaissement', $this->encaissements);
        if (isset($this->incidents)) $o['incidents'] = JsonConverters::toArray('_incident', $this->incidents);
        return empty($o) ? new class(){} : $o;
    }
}

PHP cl_tournee_dechargementRequest 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 /cl_tournee_dechargement/{id_operateur}/{id_tournee} HTTP/1.1 
Host: freemotion-staging.milliet.paris 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id_operateur":"String","id_tournee":"String","deconsignes":[{"id_operateur":"String","id_tournee":"String","num_facture":"String","id_deconsigne":"String","id_client":"String","quantite":0,"pu_euro":0,"montant":0,"date":"String"}],"encaissements":[{"id_operateur":"String","id_tournee":"String","id_client":"String","id_reglement":"String","montant":0,"code_devise":"String","date":"String"}],"incidents":[{"id_operateur":"String","id_tournee":"String","num_facture":"String","id_motif":"String","date":"String","photo":"String","attente":0}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id_operateur":"String","id_tournee":"String","deconsignes":[{"id_operateur":"String","id_tournee":"String","num_facture":"String","id_deconsigne":"String","id_client":"String","quantite":0,"pu_euro":0,"montant":0,"date":"String"}],"encaissements":[{"id_operateur":"String","id_tournee":"String","id_client":"String","id_reglement":"String","montant":0,"code_devise":"String","date":"String"}],"incidents":[{"id_operateur":"String","id_tournee":"String","num_facture":"String","id_motif":"String","date":"String","photo":"String","attente":0}]}