PUT | /eaccounting/settings | Create a new settings in e-accounting system; Should be uniques per company; If settings exists, they will be updated instead |
---|
<?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 EAccountingSettingsQueryResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $CompanyId=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var string|null */
public ?string $DefaultArticle6PercentVat=null,
/** @var float */
public float $DefaultArticle12PercentVat=0.0,
/** @var float */
public float $DefaultArticle25PercentVat=0.0,
/** @var string|null */
public ?string $DefaultCreateType=null,
/** @var string|null */
public ?string $DefaultTermsOfPaymentId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['DefaultArticle6PercentVat'])) $this->DefaultArticle6PercentVat = $o['DefaultArticle6PercentVat'];
if (isset($o['DefaultArticle12PercentVat'])) $this->DefaultArticle12PercentVat = $o['DefaultArticle12PercentVat'];
if (isset($o['DefaultArticle25PercentVat'])) $this->DefaultArticle25PercentVat = $o['DefaultArticle25PercentVat'];
if (isset($o['DefaultCreateType'])) $this->DefaultCreateType = $o['DefaultCreateType'];
if (isset($o['DefaultTermsOfPaymentId'])) $this->DefaultTermsOfPaymentId = $o['DefaultTermsOfPaymentId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->DefaultArticle6PercentVat)) $o['DefaultArticle6PercentVat'] = $this->DefaultArticle6PercentVat;
if (isset($this->DefaultArticle12PercentVat)) $o['DefaultArticle12PercentVat'] = $this->DefaultArticle12PercentVat;
if (isset($this->DefaultArticle25PercentVat)) $o['DefaultArticle25PercentVat'] = $this->DefaultArticle25PercentVat;
if (isset($this->DefaultCreateType)) $o['DefaultCreateType'] = $this->DefaultCreateType;
if (isset($this->DefaultTermsOfPaymentId)) $o['DefaultTermsOfPaymentId'] = $this->DefaultTermsOfPaymentId;
return empty($o) ? new class(){} : $o;
}
}
class UpdateEAccountingSettingsQuery implements ICompany, JsonSerializable
{
public function __construct(
/** @description Article id for 25% VAT in e-accounting system */
// @ApiMember(Description="Article id for 25% VAT in e-accounting system")
/** @var string|null */
public ?string $DefaultArticle25PercentVat=null,
/** @description Article id for 12% VAT in e-accounting system */
// @ApiMember(Description="Article id for 12% VAT in e-accounting system")
/** @var string|null */
public ?string $DefaultArticle12PercentVat=null,
/** @description Article id for 6% VAT in e-accounting system */
// @ApiMember(Description="Article id for 6% VAT in e-accounting system")
/** @var string|null */
public ?string $DefaultArticle6PercentVat=null,
/** @description Default invoice create type for invoice creation */
// @ApiMember(Description="Default invoice create type for invoice creation")
/** @var string|null */
public ?string $DefaultCreateType=null,
/** @description Determines wether e-accounting intergration is active or not */
// @ApiMember(Description="Determines wether e-accounting intergration is active or not")
/** @var bool|null */
public ?bool $EAccountingIntegrationActive=null,
/** @description Default terms of payment value for invoice creation */
// @ApiMember(Description="Default terms of payment value for invoice creation")
/** @var string|null */
public ?string $DefaultTermsOfPaymentId=null,
/** @description E-Accounting settings company Id. */
// @ApiMember(Description="E-Accounting settings company Id.")
/** @var string|null */
public ?string $CompanyId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DefaultArticle25PercentVat'])) $this->DefaultArticle25PercentVat = $o['DefaultArticle25PercentVat'];
if (isset($o['DefaultArticle12PercentVat'])) $this->DefaultArticle12PercentVat = $o['DefaultArticle12PercentVat'];
if (isset($o['DefaultArticle6PercentVat'])) $this->DefaultArticle6PercentVat = $o['DefaultArticle6PercentVat'];
if (isset($o['DefaultCreateType'])) $this->DefaultCreateType = $o['DefaultCreateType'];
if (isset($o['EAccountingIntegrationActive'])) $this->EAccountingIntegrationActive = $o['EAccountingIntegrationActive'];
if (isset($o['DefaultTermsOfPaymentId'])) $this->DefaultTermsOfPaymentId = $o['DefaultTermsOfPaymentId'];
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DefaultArticle25PercentVat)) $o['DefaultArticle25PercentVat'] = $this->DefaultArticle25PercentVat;
if (isset($this->DefaultArticle12PercentVat)) $o['DefaultArticle12PercentVat'] = $this->DefaultArticle12PercentVat;
if (isset($this->DefaultArticle6PercentVat)) $o['DefaultArticle6PercentVat'] = $this->DefaultArticle6PercentVat;
if (isset($this->DefaultCreateType)) $o['DefaultCreateType'] = $this->DefaultCreateType;
if (isset($this->EAccountingIntegrationActive)) $o['EAccountingIntegrationActive'] = $this->EAccountingIntegrationActive;
if (isset($this->DefaultTermsOfPaymentId)) $o['DefaultTermsOfPaymentId'] = $this->DefaultTermsOfPaymentId;
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
return empty($o) ? new class(){} : $o;
}
}
PHP UpdateEAccountingSettingsQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /eaccounting/settings HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
DefaultArticle25PercentVat: String,
DefaultArticle12PercentVat: String,
DefaultArticle6PercentVat: String,
DefaultCreateType: String,
EAccountingIntegrationActive: False,
DefaultTermsOfPaymentId: String,
CompanyId: 00000000-0000-0000-0000-000000000000
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { CompanyId: 00000000-0000-0000-0000-000000000000, Active: False, DefaultArticle6PercentVat: String, DefaultArticle12PercentVat: 0, DefaultArticle25PercentVat: 0, DefaultCreateType: String, DefaultTermsOfPaymentId: String }