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
@@ -73,17 +73,12 @@ class ApproveDuplicateBankStatementDetailsStatusLogic extends AbstractController
$this->updatesBankStatementTransactionOwnerStatus->execute($bankSatementDetails, ApprovalStatus::APPROVED);
dump($bankSatementDetails);
dd($bankSatementDetails->transaction);
if ($bankSatementDetails->owner) {
if ($bankSatementDetails->owner->type === StatementTransactionOwnerType::SALES) {
if ($bankSatementDetails->owner->status === ApprovalStatus::PENDING_VERIFICATION) {
$this->updatesTransactionStatus->execute($bankSatementDetails->owner, ApprovalStatus::APPROVED);
}
}
}
// todo-new: approve payments status, need to check the owner(if system is shipping, need to api with shipping portal)
// if ($bankSatementDetails->transaction->type === StatementTransactionOwnerType::SALES) {
// if ($bankSatementDetails->owner->status === ApprovalStatus::PENDING_VERIFICATION) {
// $this->updatesTransactionStatus->execute($bankSatementDetails->owner, ApprovalStatus::APPROVED);
// }
// }
$rejectedBankSatementDetails = $this->listsBankStatementDetails->execute(['id_not' => $request->route('id'), 'owner_id' => $bankSatementDetails->owner_id]);
@@ -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));
}