tvpl.api

<back to all web services

CreateProcurementBatchRequest

Requires Authentication
The following routes are available for this service:
POST/procurement/batch
import 'package:servicestack/servicestack.dart';

class ProcurementBatch implements IConvertible
{
    int? id;
    // @required()
    // @StringLength(500)
    String? title;

    DateTime? deadline;
    String? description;
    int? status;
    DateTime? createdAt;
    int? createdBy;
    DateTime? closedAt;
    int? closedBy;
    bool? isDeleted;
    DateTime? deletedAt;
    int? deletedBy;
    // @ignore()
    String? createdByName;

    // @ignore()
    int? itemCount;

    ProcurementBatch({this.id,this.title,this.deadline,this.description,this.status,this.createdAt,this.createdBy,this.closedAt,this.closedBy,this.isDeleted,this.deletedAt,this.deletedBy,this.createdByName,this.itemCount});
    ProcurementBatch.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        title = json['title'];
        deadline = JsonConverters.fromJson(json['deadline'],'DateTime',context!);
        description = json['description'];
        status = json['status'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        createdBy = json['createdBy'];
        closedAt = JsonConverters.fromJson(json['closedAt'],'DateTime',context!);
        closedBy = json['closedBy'];
        isDeleted = json['isDeleted'];
        deletedAt = JsonConverters.fromJson(json['deletedAt'],'DateTime',context!);
        deletedBy = json['deletedBy'];
        createdByName = json['createdByName'];
        itemCount = json['itemCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'title': title,
        'deadline': JsonConverters.toJson(deadline,'DateTime',context!),
        'description': description,
        'status': status,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'createdBy': createdBy,
        'closedAt': JsonConverters.toJson(closedAt,'DateTime',context!),
        'closedBy': closedBy,
        'isDeleted': isDeleted,
        'deletedAt': JsonConverters.toJson(deletedAt,'DateTime',context!),
        'deletedBy': deletedBy,
        'createdByName': createdByName,
        'itemCount': itemCount
    };

    getTypeName() => "ProcurementBatch";
    TypeContext? context = _ctx;
}

class CreateProcurementBatchRequest implements IConvertible
{
    String? title;
    DateTime? deadline;
    String? description;

    CreateProcurementBatchRequest({this.title,this.deadline,this.description});
    CreateProcurementBatchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        title = json['title'];
        deadline = JsonConverters.fromJson(json['deadline'],'DateTime',context!);
        description = json['description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'title': title,
        'deadline': JsonConverters.toJson(deadline,'DateTime',context!),
        'description': description
    };

    getTypeName() => "CreateProcurementBatchRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'ProcurementBatch': TypeInfo(TypeOf.Class, create:() => ProcurementBatch()),
    'CreateProcurementBatchRequest': TypeInfo(TypeOf.Class, create:() => CreateProcurementBatchRequest()),
});

Dart CreateProcurementBatchRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /procurement/batch HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	title: String,
	description: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	title: String,
	description: String,
	status: 0,
	createdAt: "0001-01-01T00:00:00.0000000+07:06",
	createdBy: 0,
	closedAt: "0001-01-01T00:00:00.0000000+07:06",
	closedBy: 0,
	isDeleted: False,
	deletedAt: "0001-01-01T00:00:00.0000000+07:06",
	deletedBy: 0,
	createdByName: String,
	itemCount: 0
}