| POST | /Enquiries/Create |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateEnquiryGradesViewModel:
id: Optional[int] = None
deleted: bool = False
product_id: Optional[int] = None
version_id: Optional[int] = None
grade_id: Optional[int] = None
specification_comments: Optional[str] = None
volume_from: Optional[int] = None
volume_to: Optional[int] = None
unit_id: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EnquiryCreate:
account_id: Optional[int] = None
agent: Optional[str] = None
buyer_email_address: Optional[str] = None
buyer_company: Optional[str] = None
credit_term_days: Optional[int] = None
date_from: Optional[datetime.datetime] = None
date_to: Optional[datetime.datetime] = None
delivery_method_id: Optional[int] = None
general_comments: Optional[str] = None
port_id: Optional[int] = None
requested_terms_type: Optional[str] = None
vessel_id: Optional[int] = None
supply_desk_entity_contact_id: Optional[int] = None
selected_entity_contact_ids: Optional[List[str]] = None
enquiry_grades: Optional[List[CreateEnquiryGradesViewModel]] = None
class SavingResultStatus(str, Enum):
SUCCESS = 'Success'
ERROR = 'Error'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SavingResultErrors:
error: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SavingResult:
id: Optional[int] = None
guid_id: Optional[str] = None
status: Optional[SavingResultStatus] = None
errors: Optional[List[SavingResultErrors]] = None
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.
POST /Enquiries/Create HTTP/1.1
Host: internal.thebunkerbridge.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
AccountId: 0,
Agent: String,
BuyerEmailAddress: String,
BuyerCompany: String,
CreditTermDays: 0,
DateFrom: 0001-01-01,
DateTo: 0001-01-01,
DeliveryMethodId: 0,
GeneralComments: String,
PortId: 0,
RequestedTermsType: String,
VesselId: 0,
SupplyDeskEntityContactId: 0,
SelectedEntityContactIds:
[
String
],
EnquiryGrades:
[
{
Id: 0,
Deleted: False,
ProductId: 0,
VersionId: 0,
GradeId: 0,
SpecificationComments: String,
VolumeFrom: 0,
VolumeTo: 0,
UnitId: 0
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Id: 0,
GuidId: 00000000000000000000000000000000,
Status: Success,
Errors:
[
{
Error: String
}
]
}