Skip to content

Commit

Permalink
Merge b2860b0 into ce87ddd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush8923 authored Oct 27, 2024
2 parents ce87ddd + b2860b0 commit 1186660
Show file tree
Hide file tree
Showing 62 changed files with 6,752 additions and 6,608 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ PDF_BINARY=

CA_EMAIL=
CA_NAME=
OPENAI_API_KEY=
OPENAI_ORGANIZATION=

ANALYTICS_DASHBOARD_URL=

INVOICE_GDRIVE_FOLDER_ID=""
INVOICE_GDRIVE_FOLDER_ID=""
4 changes: 2 additions & 2 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP v7.4
- name: Setup PHP v8.2
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.2"
- name: Install composer dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Setup env file
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# cypress setup
- name: Setup PHP v7.4
- name: Setup PHP v8.2
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.2"

- name: Setup unit-testing
uses: actions/checkout@v2
Expand Down
22 changes: 11 additions & 11 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
'blank_line_before_statement' => [
'statements' => ['return'],
],
'braces' => true,
'single_space_around_construct' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'declare_parentheses' => true,
'no_multiple_statements_per_line' => true,
'statement_indentation' => true,
'no_extra_blank_lines' => [
'tokens' => ['extra', 'throw', 'use'],
],
'cast_spaces' => true,
'class_definition' => true,
'class_attributes_separation' => [
Expand All @@ -30,7 +38,6 @@
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
Expand All @@ -45,13 +52,6 @@
'method_argument_space' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
],
],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
Expand All @@ -70,7 +70,7 @@
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'spaces_inside_parentheses' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
Expand All @@ -97,7 +97,7 @@
'short_scalar_cast' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
Expand Down
1 change: 1 addition & 0 deletions Modules/Client/Entities/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public function getBillableAmountForTerm(int $monthsToSubtract, $projects, $peri
public function getTaxAmountForTerm(int $monthsToSubtract, $projects, $periodStartDate = null, $periodEndDate = null)
{
$monthsToSubtract = $monthsToSubtract ?? 1;

// Todo: Implement tax calculation correctly as per the IGST rules
return round($this->getBillableAmountForTerm($monthsToSubtract, $projects, $periodStartDate, $periodEndDate) * ($this->country->initials == 'IN' ? config('invoice.tax-details.igst') : 0), 2);
}
Expand Down
6 changes: 3 additions & 3 deletions Modules/Client/Entities/Scopes/ClientGlobalScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class ClientGlobalScope implements Scope
/**
* Apply the scope to a given Eloquent query builder.
*
* @param \Illuminate\Database\Eloquent\Builder $builder
* @param \Illuminate\Database\Eloquent\Model $model
* @param Builder $builder
* @param Model $model
*
* @return \Illuminate\Database\Eloquent\Builder
* @return Builder
*/
public function apply(Builder $builder, Model $model)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Client/Services/ClientService.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function store($data)
$data['is_billable'] = $data['is_billable'] ?? false;

$newClient = Client::create($data);
$clientAddress = new clientAddress();
$clientAddress = new ClientAddress();
$clientAddress->country_id = $data['country_id'];
$clientAddress->client_id = $newClient->id;
$clientAddress->save();
Expand Down
10 changes: 5 additions & 5 deletions Modules/CodeTrek/Policies/CodetrekApplicantPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CodeTrekApplicantPolicy
/**
* Determine whether the user can view any models.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand All @@ -24,7 +24,7 @@ public function viewAny(User $user)
/**
* Determine whether the user can view the model.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand All @@ -36,7 +36,7 @@ public function view(User $user)
/**
* Determine whether the user can create models.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand All @@ -48,7 +48,7 @@ public function create(User $user)
/**
* Determine whether the user can update the model.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand All @@ -60,7 +60,7 @@ public function update(User $user)
/**
* Determine whether the user can delete the model.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/HR/Entities/ApplicationRound.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function _update($attr)

public function updateOrCreateEvaluation($evaluations = [])
{
foreach ($evaluations as $evaluation) {
foreach ($evaluations as $evaluation) {
if (array_key_exists('option_id', $evaluation)) {
$this->evaluations()->updateOrCreate(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function index()
$attr['universities'] = University::all();
$attr['tags'] = Tag::orderBy('name')->get();
$attr['rounds'] = $hrRoundsCounts;
$attr['roundFilters'] = round::orderBy('name')->get();
$attr['roundFilters'] = Round::orderBy('name')->get();
$attr['assignees'] = User::whereHas('roles', function ($query) {
$query->whereIn('name', ['super-admin', 'admin', 'hr-manager']);
})->orderby('name', 'asc')->get();
Expand Down
6 changes: 3 additions & 3 deletions Modules/HR/Http/Controllers/Recruitment/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function store(JobRequest $request)
/**
* Show the form for editing the specified resource.
*
* @param \Modules\HR\Entities\Job $opportunity
* @param Job $opportunity
*
* @return \Illuminate\View\View
*/
Expand Down Expand Up @@ -126,7 +126,7 @@ public function update(JobRequest $request, Job $opportunity)
/**
* Remove the specified resource from storage.
*
* @param \Modules\HR\Entities\Job $opportunity
* @param Job $opportunity
*/
public function destroy(Job $opportunity)
{
Expand All @@ -139,7 +139,7 @@ public function destroy(Job $opportunity)
/**
* Store a newly created resource in storage.
*
* @param \Modules\HR\Http\Requests\Recruitment\JobDomainRequest $request
* @param JobDomainRequest $request
*/
public function storeJobdomain(JobDomainRequest $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function index()

public function searchBydate(Request $req)
{
$req->report_start_date = $req->report_start_date ?? carbon::now()->startOfMonth() == $req->report_end_date = $req->report_end_date ?? Carbon::today();
$req->report_start_date = $req->report_start_date ?? Carbon::now()->startOfMonth() == $req->report_end_date = $req->report_end_date ?? Carbon::today();

$todayCount = Applicant::whereDate('created_at', '=', Carbon::today())
->count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RoundController extends Controller
* Update the specified resource in storage.
*
* @param RoundRequest $request
* @param \Modules\HR\Entities\Round $round
* @param Round $round
*
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/HR/Jobs/SendHiringMailJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public function __construct($jobHiring)
*/
public function handle()
{
Mail::queue(new sendHiringMail($this->jobHiring));
Mail::queue(new SendHiringMail($this->jobHiring));
}
}
5 changes: 2 additions & 3 deletions Modules/HR/Observers/Recruitment/ApplicationRoundObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
use Modules\HR\Entities\ApplicationRound;
use Modules\HR\Events\ApplicationMovedToNewRound;
use Modules\HR\Events\CustomMailTriggeredForApplication;
use Modules\HR\Jobs\Recruitment\SendApplicationRoundScheduled;

class ApplicationRoundObserver
{
/**
* Listen to the ApplicationRound created event.
*
* @param \Modules\HR\Entities\ApplicationRound $applicationRound
* @param ApplicationRound $applicationRound
* @return void
*/
public function created(ApplicationRound $applicationRound)
Expand Down Expand Up @@ -45,7 +44,7 @@ public function created(ApplicationRound $applicationRound)
/**
* Listen to the ApplicationRound updated event.
*
* @param \Modules\HR\Entities\ApplicationRound $applicationRound
* @param ApplicationRound $applicationRound
* @return void
*/
public function updated(ApplicationRound $applicationRound)
Expand Down
6 changes: 3 additions & 3 deletions Modules/HR/Observers/Recruitment/JobObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JobObserver
/**
* Listen to the Job create event.
*
* @param \Modules\HR\Entities\Job $job
* @param Job $job
* @return void
*/
public function created(Job $job)
Expand Down Expand Up @@ -49,7 +49,7 @@ public function created(Job $job)
/**
* Listen to the Job update event.
*
* @param \Modules\HR\Entities\Job $job
* @param Job $job
* @return void
*/
public function updated(Job $job)
Expand Down Expand Up @@ -78,7 +78,7 @@ public function updated(Job $job)
/**
* Listen to the Job delete event.
*
* @param \Modules\HR\Entities\Job $job
* @param Job $job
* @return void
*/
public function deleted(Job $job)
Expand Down
16 changes: 8 additions & 8 deletions Modules/HR/Policies/Recruitment/JobPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class JobPolicy
/**
* Determine whether the user can view the job.
*
* @param \Modules\User\Entities\User $user
* @param \Modules\HR\Entities\Job $job
* @param User $user
* @param Job $job
*
* @return mixed
*/
Expand All @@ -30,7 +30,7 @@ public function view(User $user, Job $job)
/**
* Determine whether the user can create jobs.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand All @@ -46,8 +46,8 @@ public function create(User $user)
/**
* Determine whether the user can update the job.
*
* @param \Modules\User\Entities\User $user
* @param \Modules\HR\Entities\Job $job
* @param User $user
* @param Job $job
*
* @return mixed
*/
Expand All @@ -63,8 +63,8 @@ public function update(User $user, Job $job)
/**
* Determine whether the user can delete the job.
*
* @param \Modules\User\Entities\User $user
* @param \Modules\HR\Entities\Job $job
* @param User $user
* @param Job $job
*
* @return mixed
*/
Expand All @@ -80,7 +80,7 @@ public function delete(User $user, Job $job)
/**
* Determine whether the user can list jobs.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return mixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class="fa fa-info-circle"></i>&nbsp;</span></span>
@if ($application->latestApplicationRound->scheduled_date &&
$application->latestApplicationRound->round->name != 'Resume Screening')
<p class="ml-3">
{{ $application->latestApplicationRound->scheduled_date->format(config('constants.display_daydatetime_format')) }}
{{ $application ?? $application->latestApplicationRound->scheduled_date->format(config('constants.display_daydatetime_format')) }}
</p>
@endif
</span>
Expand Down
2 changes: 1 addition & 1 deletion Modules/HR/Services/ApplicantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Modules\HR\Services;

use Modules\HR\Entities\ApplicantMeta;
use Modules\HR\Entities\ApplicantMeta;
use Modules\HR\Http\Requests\ApplicantMetaRequest;

class ApplicantService
Expand Down
2 changes: 1 addition & 1 deletion Modules/Invoice/Entities/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function getTotalAmountInInrAttribute()
$conversionRate = app(CurrencyServiceContract::class)->getAllCurrentRatesInINR();
$initial = config('invoice.currency_initials');
switch (strtoupper($this->currency)) {
case $initial['usd']:
case $initial['usd']:
$totalAmount = $this->getTotalAmountAttribute() * round($conversionRate['USDINR'], 2);
break;

Expand Down
Loading

0 comments on commit 1186660

Please sign in to comment.