Skip to content

Commit

Permalink
fix distinguish type of process
Browse files Browse the repository at this point in the history
  • Loading branch information
afiqiqmal committed May 17, 2018
1 parent a025cff commit 9f3a15b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Tracker/BaseTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ protected function distinguishProcess($process, $isFirstPosition = false)
}

$process = strtolower($process);

if (preg_match('(counter|outbound|transhipment|collection|collected|picked up)', $process)) {
return "item_received";
}
Expand All @@ -105,6 +106,10 @@ protected function distinguishProcess($process, $isFirstPosition = false)
return "facility_process";
}

if (preg_match('(unsuccessful|failed)', $process)) {
return "delivery_failed";
}

if (preg_match('(delivery|with courier)', $process)) {
return "out_for_delivery";
}
Expand Down

0 comments on commit 9f3a15b

Please sign in to comment.