referral rule API

This commit is contained in:
sayliraut
2024-07-22 17:53:12 +05:30
parent e061d3f670
commit 05dec2db37
4 changed files with 44 additions and 2 deletions

View File

@@ -38,4 +38,27 @@ class RulesControllerAPI extends Controller
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
/**
* Created By : sayli Raut
* Created at : 22 Jully 2024
* Use : To get referral rules and regulation.
*/
public function getReferralRules()
{
try {
$token = readHeaderToken();
if ($token) {
$customerIamId = $token['sub'];
$response = $this->RulesApiServices->getReferralRules();
return jsonResponseWithSuccessMessageApi(__('success.data_fetched_successfully'), $response, 200);
} else {
return jsonResponseWithErrorMessageApi(__('auth.user_deleted'), 409);
}
} catch (\Exception $e) {
Log::error('Referral rules get data controller function failed: ' . $e->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
}