| PUT | /customerarticle/{Id} | Update an existing CustomerArticle. | Update an existing CustomerArticle. |
|---|
"use strict";
export class BaseModel {
constructor(init) { Object.assign(this, init) }
}
export class ArticleServiceRelation extends BaseModel {
/** @param {{CompanyId?:string,Id?:number,ServiceId?:number,ArticleId?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {number} */
ServiceId;
/** @type {number} */
ArticleId;
}
export class ArticleResponse {
/** @param {{CompanyId?:string,Id?:number,Name?:string,ArticleTypeId?:number,Description?:string,ImageUrl?:string,Active?:boolean,Amount?:number,Price?:number,CurrencyId?:string,SortOrder?:number,UpdatedDate?:string,CreatedDate?:string,Duration?:number,Services?:ArticleServiceRelation[],ServiceIds?:number[],PriceSign?:string,VAT?:number,ValidDays?:number,SendNotification?:boolean,NotificationEmail?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {string} */
Name;
/** @type {number} */
ArticleTypeId;
/** @type {string} */
Description;
/** @type {string} */
ImageUrl;
/** @type {boolean} */
Active;
/** @type {number} */
Amount;
/** @type {number} */
Price;
/** @type {string} */
CurrencyId;
/** @type {number} */
SortOrder;
/** @type {string} */
UpdatedDate;
/** @type {string} */
CreatedDate;
/** @type {number} */
Duration;
/** @type {ArticleServiceRelation[]} */
Services = [];
/** @type {number[]} */
ServiceIds = [];
/** @type {string} */
PriceSign;
/** @type {?number} */
VAT;
/** @type {number} */
ValidDays;
/** @type {boolean} */
SendNotification;
/** @type {string} */
NotificationEmail;
}
export class CustomerArticleCustomerResponse {
/** @param {{Id?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
Phone;
}
export class CustomerArticleCompanyResponse {
/** @param {{Id?:string,Name?:string,LogoType?:string,Email?:string,Phone?:string,City?:string,Street1?:string,ZipCode?:string,CountryId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Name;
/** @type {string} */
LogoType;
/** @type {string} */
Email;
/** @type {string} */
Phone;
/** @type {string} */
City;
/** @type {string} */
Street1;
/** @type {string} */
ZipCode;
/** @type {string} */
CountryId;
}
export class PaymentLogResponse {
/** @param {{Id?:number,Amount?:number,AmountCredited?:number,CurrencyId?:string,Comments?:string,Created?:string,Updated?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {?number} */
Amount;
/** @type {?number} */
AmountCredited;
/** @type {string} */
CurrencyId;
/** @type {string} */
Comments;
/** @type {string} */
Created;
/** @type {string} */
Updated;
}
export class CustomerArticleResponse {
/** @param {{Id?:number,CompanyId?:string,ArticleId?:number,Price?:number,VAT?:number,CurrencyId?:string,StatusId?:number,StatusName?:string,CustomerId?:string,CreatedDate?:string,UpdatedDate?:string,Article?:ArticleResponse,Customer?:CustomerArticleCustomerResponse,Company?:CustomerArticleCompanyResponse,PaymentLog?:PaymentLogResponse[],ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
CompanyId;
/** @type {?number} */
ArticleId;
/** @type {?number} */
Price;
/** @type {?number} */
VAT;
/** @type {string} */
CurrencyId;
/** @type {number} */
StatusId;
/** @type {string} */
StatusName;
/** @type {?string} */
CustomerId;
/** @type {string} */
CreatedDate;
/** @type {string} */
UpdatedDate;
/** @type {ArticleResponse} */
Article;
/** @type {CustomerArticleCustomerResponse} */
Customer;
/** @type {CustomerArticleCompanyResponse} */
Company;
/** @type {PaymentLogResponse[]} */
PaymentLog = [];
/** @type {ResponseStatus} */
ResponseStatus;
}
/** @typedef {number} */
export var CustomerArticleStatusEnum;
(function (CustomerArticleStatusEnum) {
CustomerArticleStatusEnum[CustomerArticleStatusEnum["AwaitingPayment"] = 1] = "AwaitingPayment"
CustomerArticleStatusEnum[CustomerArticleStatusEnum["AwaitingPaymentFromProvider"] = 2] = "AwaitingPaymentFromProvider"
CustomerArticleStatusEnum[CustomerArticleStatusEnum["AwaitingPaymentNoTimeLimit"] = 3] = "AwaitingPaymentNoTimeLimit"
CustomerArticleStatusEnum[CustomerArticleStatusEnum["Active"] = 4] = "Active"
CustomerArticleStatusEnum[CustomerArticleStatusEnum["Off"] = 5] = "Off"
})(CustomerArticleStatusEnum || (CustomerArticleStatusEnum = {}));
export class UpdateCustomerArticle {
/** @param {{Id?:number,CompanyId?:string,StatusId?:CustomerArticleStatusEnum,Price?:number,VAT?:number,CurrencyId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The customer article id */
Id;
/**
* @type {?string}
* @description The company id, if empty will use the company id for the user you are logged in with. */
CompanyId;
/**
* @type {?CustomerArticleStatusEnum}
* @description The new status of the customer article */
StatusId;
/**
* @type {?number}
* @description Updated price */
Price;
/**
* @type {?number}
* @description Updated VAT */
VAT;
/**
* @type {string}
* @description Updated currency */
CurrencyId;
}
JavaScript UpdateCustomerArticle 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 /customerarticle/{Id} HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Id: 0,
CompanyId: 00000000-0000-0000-0000-000000000000,
StatusId: 0,
Price: 0,
VAT: 0,
CurrencyId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Id: 0,
ArticleId: 0,
Price: 0,
VAT: 0,
CurrencyId: String,
StatusId: 0,
StatusName: String,
CustomerId: 00000000-0000-0000-0000-000000000000,
Article:
{
Id: 0,
Name: String,
ArticleTypeId: 0,
Description: String,
ImageUrl: String,
Active: False,
Amount: 0,
Price: 0,
CurrencyId: String,
SortOrder: 0,
Duration: 0,
Services:
[
{
Id: 0,
ServiceId: 0,
ArticleId: 0
}
],
ServiceIds:
[
0
],
PriceSign: String,
VAT: 0,
ValidDays: 0,
SendNotification: False,
NotificationEmail: String
},
Customer:
{
Firstname: String,
Lastname: String,
Email: String,
Phone: String
},
Company:
{
Name: String,
LogoType: String,
Email: String,
Phone: String,
City: String,
Street1: String,
ZipCode: String,
CountryId: String
},
PaymentLog:
[
{
Id: 0,
Amount: 0,
AmountCredited: 0,
CurrencyId: String,
Comments: String
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}