Create() [ServiceRequestManager]
Create a service request
Description
This method is used to create a service request record.
AP services must provided a valid ServiceStandardId
Package Details
Interface
IServiceRequestManager
Syntax
ServiceRequestManager.Create(int userId, int serviceId, string englishName, string frenchName);
ServiceRequestManager.Create(int userId, int serviceId, int? organizationId, string englishName, string frenchName)
ServiceRequestManager.Create(int userId, int serviceId, int? organizationId, string englishName, string frenchName, ServiceRequestStatus serviceRequestStatus, int serviceStandardId)
ServiceRequestManager.Create(ServiceRequestCreationDTO serviceRequest)
Returns
Task<int>
API Endpoint
[POST] /api/v1/servicerequests
Returns
200 - Ok
Example
using MTOA.BLL.Interfaces;
int myServiceId = 123;
string requestNameEnglish = "12345";
string requestNameFrench = "12345";
ServiceRequestStatus serviceRequestStatus = ServiceRequestStatus.InProgress;
int serviceRequestId = await _serviceRequestManager.Create(CurrentUser.Id, myServiceId, requestNameEnglish, null, requestNameFrench, serviceRequestStatus );
API Endpoint
[POST] /api/v2/servicerequests
using MTOA.BLL.Interfaces;
var serviceRequestDto = new ServiceRequestCreationDTO
{
UserId = 3912,
ServiceId = 236,
Status = "Draft"
OrganizationId = null,
EnglishDisplayName = "Englist_text",
FrenchDisplayName = "French_text",
Comment = "Comment",
Status = ServiceRequestStatus.Draft,
PlaceOfSupply = "ON",
ServiceStandardId = 50
}
int serviceRequestId = await _serviceRequestManager.Create(serviceRequestDto );