Ejemplo n.º 1
0
 private void createResources(Entity savedDocument) {
   DocumentType documentType = DocumentType.of(savedDocument);
   if (DocumentType.RECEIPT.equals(documentType)
       || DocumentType.INTERNAL_INBOUND.equals(documentType)) {
     resourceManagementService.createResourcesForReceiptDocuments(savedDocument);
   } else if (DocumentType.INTERNAL_OUTBOUND.equals(documentType)
       || DocumentType.RELEASE.equals(documentType)) {
     resourceManagementService.updateResourcesForReleaseDocuments(savedDocument);
   } else if (DocumentType.TRANSFER.equals(documentType)) {
     resourceManagementService.moveResourcesForTransferDocument(savedDocument);
   } else {
     throw new IllegalStateException("Unsupported document type");
   }
 }
Ejemplo n.º 2
0
 public DocumentBuilder transfer(Entity locationTo, Entity locationFrom) {
   document.setField(DocumentFields.LOCATION_TO, locationTo);
   document.setField(DocumentFields.LOCATION_FROM, locationFrom);
   document.setField(DocumentFields.TYPE, DocumentType.TRANSFER.getStringValue());
   return this;
 }