Example #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");
   }
 }
Example #2
0
 public DocumentBuilder receipt(final Entity locationTo) {
   document.setField(DocumentFields.LOCATION_TO, locationTo);
   document.setField(DocumentFields.TYPE, DocumentType.RECEIPT.getStringValue());
   return this;
 }