POST | /eaccounting/articles | Create a new article in e-accounting system |
---|
import 'package:servicestack/servicestack.dart';
class BaseArticleDto implements IConvertible
{
String? ArticleId;
double? ArticlePrice;
String? ArticleName;
DateTime? CreatedDate;
BaseArticleDto({this.ArticleId,this.ArticlePrice,this.ArticleName,this.CreatedDate});
BaseArticleDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ArticleId = json['ArticleId'];
ArticlePrice = JsonConverters.toDouble(json['ArticlePrice']);
ArticleName = json['ArticleName'];
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ArticleId': ArticleId,
'ArticlePrice': ArticlePrice,
'ArticleName': ArticleName,
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!)
};
getTypeName() => "BaseArticleDto";
TypeContext? context = _ctx;
}
class EAccountingArticleQueryResponse extends BaseArticleDto implements IConvertible
{
String? UnitId;
String? CodingId;
String? VatRate;
String? VatRatePercent;
String? CurrencySign;
EAccountingArticleQueryResponse({this.UnitId,this.CodingId,this.VatRate,this.VatRatePercent,this.CurrencySign});
EAccountingArticleQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
UnitId = json['UnitId'];
CodingId = json['CodingId'];
VatRate = json['VatRate'];
VatRatePercent = json['VatRatePercent'];
CurrencySign = json['CurrencySign'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'UnitId': UnitId,
'CodingId': CodingId,
'VatRate': VatRate,
'VatRatePercent': VatRatePercent,
'CurrencySign': CurrencySign
});
getTypeName() => "EAccountingArticleQueryResponse";
TypeContext? context = _ctx;
}
class CreateEAccountingArticle extends BaseArticleDto implements ICompany, IConvertible
{
int? ServiceId;
String? CompanyId;
CreateEAccountingArticle({this.ServiceId,this.CompanyId});
CreateEAccountingArticle.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ServiceId = json['ServiceId'];
CompanyId = json['CompanyId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ServiceId': ServiceId,
'CompanyId': CompanyId
});
getTypeName() => "CreateEAccountingArticle";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'BaseArticleDto': TypeInfo(TypeOf.Class, create:() => BaseArticleDto()),
'EAccountingArticleQueryResponse': TypeInfo(TypeOf.Class, create:() => EAccountingArticleQueryResponse()),
'CreateEAccountingArticle': TypeInfo(TypeOf.Class, create:() => CreateEAccountingArticle()),
});
Dart CreateEAccountingArticle DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /eaccounting/articles HTTP/1.1
Host: api.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ServiceId":0,"CompanyId":"00000000-0000-0000-0000-000000000000","ArticlePrice":0,"ArticleName":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"UnitId":"String","CodingId":"String","VatRate":"String","VatRatePercent":"String","CurrencySign":"String","ArticlePrice":0,"ArticleName":"String"}