test appprove group mapping transaction api

This commit is contained in:
edmondlang
2023-04-29 01:27:54 +08:00
parent 391554fa76
commit b09308d969
2 changed files with 14 additions and 18 deletions
@@ -67,13 +67,14 @@ class UpdateStatementTransactionStatusLogic extends AbstractControllerLogic
$this->updatesBankStatementTransactionOwnerStatus->execute($statementTrasactionOwner, $request->route('status') == 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
if ($request->route('status') == 'approve') {
if ($statementTrasactionOwner->owner->type === StatementTransactionOwnerType::SALES) {
if ($statementTrasactionOwner->owner->status === ApprovalStatus::PENDING_VERIFICATION) {
$this->updatesTransactionStatus->execute($statementTrasactionOwner->owner, ApprovalStatus::APPROVED);
}
}
}
// todo-new: approve payments status, need to check the owner(if system is shipping, need to api with shipping portal)
// if ($request->route('status') == 'approve') {
// if ($statementTrasactionOwner->transaction->type === StatementTransactionOwnerType::SALES) {
// if ($statementTrasactionOwner->owner->status === ApprovalStatus::PENDING_VERIFICATION) {
// $this->updatesTransactionStatus->execute($statementTrasactionOwner->owner, ApprovalStatus::APPROVED);
// }
// }
// }
return $this->resourceResponse(new BankStatementTransactionResource($statementTrasaction));
}