use of gov.ca.cwds.rest.api.domain.cms.CmsNSReferral in project API by ca-cwds.
the class CmsNSReferralService method create.
/**
* {@inheritDoc}
*
* @see gov.ca.cwds.rest.services.CrudsService#create(gov.ca.cwds.rest.api.Request)
*/
@Override
public Response create(Request request) {
assert request instanceof CmsReferral;
CmsNSReferral cmsReferral = (CmsNSReferral) request;
CmsNSHelper helper = new CmsNSHelper(cmsSessionFactory, nsSessionFactory);
Map<CrudsService, Request> cmsRequest = new HashMap<>();
Map<CrudsService, Request> nsRequest = new HashMap<>();
cmsRequest.put(referralService, cmsReferral.getReferral());
nsRequest.put(personService, cmsReferral.getPerson());
Map<String, Map<CrudsService, Response>> response = helper.handleResponse(cmsRequest, nsRequest);
return new PostedCmsNSReferral((PostedReferral) response.get("cms").get(referralService), (PostedPerson) response.get("ns").get(personService));
}
Aggregations