| PUT | /customerarticle/{Id} | Update an existing CustomerArticle. | Update an existing CustomerArticle. |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using BokaMera.API.ServiceModel.Enums;
using BokaMera.API.ServiceModel.Db;
namespace BokaMera.API.ServiceModel.Db
{
public partial class ArticleServiceRelation
: BaseModel
{
[Required]
public virtual Guid CompanyId { get; set; }
public virtual int Id { get; set; }
[Required]
public virtual int ServiceId { get; set; }
[Required]
public virtual int ArticleId { get; set; }
}
public partial class BaseModel
{
}
}
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class ArticleResponse
{
public virtual Guid CompanyId { get; set; }
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual int ArticleTypeId { get; set; }
public virtual string Description { get; set; }
public virtual string ImageUrl { get; set; }
public virtual bool Active { get; set; }
public virtual int Amount { get; set; }
public virtual double Price { get; set; }
public virtual string CurrencyId { get; set; }
public virtual int SortOrder { get; set; }
public virtual DateTime UpdatedDate { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual int Duration { get; set; }
public virtual List<ArticleServiceRelation> Services { get; set; } = [];
public virtual List<int> ServiceIds { get; set; } = [];
public virtual string PriceSign { get; set; }
public virtual decimal? VAT { get; set; }
public virtual int ValidDays { get; set; }
public virtual bool SendNotification { get; set; }
public virtual string NotificationEmail { get; set; }
}
public partial class CustomerArticleCompanyResponse
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual string LogoType { get; set; }
public virtual string Email { get; set; }
public virtual string Phone { get; set; }
public virtual string City { get; set; }
public virtual string Street1 { get; set; }
public virtual string ZipCode { get; set; }
public virtual string CountryId { get; set; }
}
public partial class CustomerArticleCustomerResponse
{
public virtual Guid Id { get; set; }
public virtual string Firstname { get; set; }
public virtual string Lastname { get; set; }
public virtual string Email { get; set; }
public virtual string Phone { get; set; }
}
public partial class CustomerArticleResponse
{
public virtual int Id { get; set; }
public virtual Guid CompanyId { get; set; }
public virtual int? ArticleId { get; set; }
public virtual decimal? Price { get; set; }
public virtual decimal? VAT { get; set; }
public virtual string CurrencyId { get; set; }
public virtual int StatusId { get; set; }
public virtual string StatusName { get; set; }
public virtual Guid? CustomerId { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime UpdatedDate { get; set; }
public virtual ArticleResponse Article { get; set; }
public virtual CustomerArticleCustomerResponse Customer { get; set; }
public virtual CustomerArticleCompanyResponse Company { get; set; }
public virtual List<PaymentLogResponse> PaymentLog { get; set; } = [];
public virtual ResponseStatus ResponseStatus { get; set; }
}
public partial class PaymentLogResponse
{
public virtual int Id { get; set; }
public virtual double? Amount { get; set; }
public virtual double? AmountCredited { get; set; }
public virtual string CurrencyId { get; set; }
public virtual string Comments { get; set; }
public virtual DateTime Created { get; set; }
public virtual DateTime Updated { get; set; }
}
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
[ValidateRequest("IsAuthenticated")]
public partial class UpdateCustomerArticle
: ICompany
{
///<summary>
///The customer article id
///</summary>
[ApiMember(Description="The customer article id", IsRequired=true, ParameterType="path")]
public virtual int Id { get; set; }
///<summary>
///The company id, if empty will use the company id for the user you are logged in with.
///</summary>
[ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")]
public virtual Guid? CompanyId { get; set; }
///<summary>
///The new status of the customer article
///</summary>
[ApiMember(Description="The new status of the customer article")]
public virtual CustomerArticleStatusEnum? StatusId { get; set; }
///<summary>
///Updated price
///</summary>
[ApiMember(Description="Updated price")]
public virtual decimal? Price { get; set; }
///<summary>
///Updated VAT
///</summary>
[ApiMember(Description="Updated VAT")]
public virtual decimal? VAT { get; set; }
///<summary>
///Updated currency
///</summary>
[ApiMember(Description="Updated currency")]
public virtual string CurrencyId { get; set; }
}
}
namespace BokaMera.API.ServiceModel.Enums
{
public enum CustomerArticleStatusEnum
{
AwaitingPayment = 1,
AwaitingPaymentFromProvider = 2,
AwaitingPaymentNoTimeLimit = 3,
Active = 4,
Off = 5,
}
}
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
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: application/json
Content-Type: application/json
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: application/json
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"}}}