Skip to content

Commit e6efec5

Browse files
OHRM5X-2144: Add employee leave balances API doc (orangehrm#1672)
* OHRM5X-1995: Improve InstallerCountryListCommand * OHRM5X-2155: Bump REST API version * Fix email queue failing status * [BC Break] Refactor LeaveCommentModel & LeaveRequestCommentModel * OHRM5X-2160: Bump MariaDB max supported version to 10.11
1 parent 2f5a7b5 commit e6efec5

33 files changed

+422
-302
lines changed

.github/workflows/scheduled_test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
paths:
9+
- '.github/workflows/scheduled_test.yml'
710
schedule:
811
- cron: "0 2 * * *"
912

@@ -31,6 +34,7 @@ jobs:
3134
- "mariadb:10.8"
3235
- "mariadb:10.9"
3336
- "mariadb:10.10"
37+
- "mariadb:10.11"
3438

3539
services:
3640
mysql:

installer/Command/InstallerCountryListCommand.php

+22
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use OrangeHRM\Installer\Framework\InstallerCommand;
2323
use OrangeHRM\Installer\Util\InstanceCreationHelper;
2424
use Symfony\Component\Console\Input\InputInterface;
25+
use Symfony\Component\Console\Input\InputOption;
2526
use Symfony\Component\Console\Output\OutputInterface;
2627

2728
class InstallerCountryListCommand extends InstallerCommand
@@ -34,6 +35,14 @@ public function getCommandName(): string
3435
return 'install:country-list';
3536
}
3637

38+
/**
39+
* @inheritDoc
40+
*/
41+
protected function configure(): void
42+
{
43+
$this->addOption('country', 'c', InputOption::VALUE_REQUIRED);
44+
}
45+
3746
/**
3847
* @inheritDoc
3948
*/
@@ -45,6 +54,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4554
);
4655
asort($countries);
4756
$countries = array_map(fn ($country) => strtolower($country), $countries);
57+
58+
$country = $input->getOption('country');
59+
if ($country !== null) {
60+
$countries = array_flip($countries);
61+
$country = $countries[strtolower($country)] ?? null;
62+
if ($country == null) {
63+
$this->getIO()->error('Invalid country');
64+
return self::FAILURE;
65+
}
66+
$this->getIO()->writeln($country);
67+
return self::SUCCESS;
68+
}
69+
4870
$countries = array_map(static function ($k, $v) {
4971
return " <comment>[$k]</comment> $v";
5072
}, array_keys($countries), array_values($countries));

installer/config/system_requirements.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
'mariadbversion' => [
3434
'min' => '5.5',
35-
'max' => '10.10',
35+
'max' => '10.11',
3636
'excludeRange' => [],
3737
],
3838

src/client/src/orangehrmMaintenancePlugin/components/VerifyPassword.vue

-117
This file was deleted.

src/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"require-dev": {
5353
"phpunit/phpunit": "^9.5",
54-
"zircote/swagger-php": "^4.5"
54+
"zircote/swagger-php": "~4.7.9"
5555
},
5656
"autoload": {
5757
"psr-4": {

src/composer.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/config/Config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Config
5252

5353
public const PRODUCT_NAME = 'OrangeHRM OS';
5454
public const PRODUCT_VERSION = '5.4';
55-
public const ORANGEHRM_API_VERSION = '2.2.0';
55+
public const ORANGEHRM_API_VERSION = '2.4.0';
5656
public const PRODUCT_MODE = self::MODE_DEV;
5757
public const REGISTRATION_URL = 'https://ospenguin.orangehrm.com';
5858

src/plugins/orangehrmAdminPlugin/Api/EmailSubscriberAPI.php

+21-21
Original file line numberDiff line numberDiff line change
@@ -260,25 +260,29 @@ public function getValidationRuleForDelete(): ParamRuleCollection
260260
}
261261

262262
/**
263-
*@OA\Get(
263+
* @OA\Get(
264264
* path="/api/v2/admin/email-subscriptions/{emailSubscriptionId}/subscribers/{id}",
265265
* tags={"Admin/Email Configuration"},
266-
* @OA\PathParameter(
267-
* name="id",
268-
* @OA\Schema(type="integer")
269-
* ),
270-
* @OA\Response(
271-
* response="200",
272-
* description="Success",
273-
* @OA\JsonContent(
274-
* @OA\Property(
275-
* property="data",
276-
* ref="#/components/schemas/Admin-EmailSubscriberModel"
277-
* ),
278-
* @OA\Property(property="meta", type="object")
279-
* )
280-
* ),
281-
* @OA\Response(response="404", ref="#/components/responses/RecordNotFound")
266+
* @OA\PathParameter(
267+
* name="emailSubscriptionId",
268+
* @OA\Schema(type="integer")
269+
* ),
270+
* @OA\PathParameter(
271+
* name="id",
272+
* @OA\Schema(type="integer")
273+
* ),
274+
* @OA\Response(
275+
* response="200",
276+
* description="Success",
277+
* @OA\JsonContent(
278+
* @OA\Property(
279+
* property="data",
280+
* ref="#/components/schemas/Admin-EmailSubscriberModel"
281+
* ),
282+
* @OA\Property(property="meta", type="object")
283+
* )
284+
* ),
285+
* @OA\Response(response="404", ref="#/components/responses/RecordNotFound")
282286
* )
283287
*
284288
* @inheritDoc
@@ -329,10 +333,6 @@ public function getValidationRuleForGetOne(): ParamRuleCollection
329333
* name="id",
330334
* @OA\Schema(type="integer")
331335
* ),
332-
* @OA\PathParameter(
333-
* name="id",
334-
* @OA\Schema(type="integer")
335-
* ),
336336
* @OA\RequestBody(
337337
* @OA\JsonContent(
338338
* type="object",

src/plugins/orangehrmAdminPlugin/Api/JobCategoryAPI.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ public function setJobCategoryService(JobCategoryService $jobCategoryService)
7070
}
7171

7272
/**
73-
*@OA\Get(
73+
* @OA\Get(
7474
* path="/api/v2/admin/job-categories/{id}",
7575
* tags={"Admin/Job Category"},
76-
* @OA\PathParameter(
77-
* name="id",
78-
* @OA\Schema(type="integer")
79-
* ),
80-
* @OA\Response(
81-
* response="200",
82-
* description="Success",
83-
* @OA\JsonContent(
84-
* @OA\Property(
85-
* property="data",
86-
* ref="#/components/schemas/Admin-JobCategoryModel"
87-
* ),
88-
* @OA\Property(property="meta", type="object")
89-
* )
90-
* ),
91-
* @OA\Response(response="404", ref="#/components/responses/RecordNotFound")
76+
* @OA\PathParameter(
77+
* name="id",
78+
* @OA\Schema(type="integer")
79+
* ),
80+
* @OA\Response(
81+
* response="200",
82+
* description="Success",
83+
* @OA\JsonContent(
84+
* @OA\Property(
85+
* property="data",
86+
* ref="#/components/schemas/Admin-JobCategoryModel"
87+
* ),
88+
* @OA\Property(property="meta", type="object")
89+
* )
90+
* ),
91+
* @OA\Response(response="404", ref="#/components/responses/RecordNotFound")
9292
* )
9393
*
9494
* @inheritDoc
@@ -125,7 +125,7 @@ public function getValidationRuleForGetOne(): ParamRuleCollection
125125
* name="sortField",
126126
* in="query",
127127
* required=false,
128-
* description="Available values : jc.name"
128+
* @OA\Schema(type="string", enum={"jc.name"})
129129
* ),
130130
* @OA\Parameter(ref="#/components/parameters/sortOrder"),
131131
* @OA\Parameter(ref="#/components/parameters/limit"),

src/plugins/orangehrmAdminPlugin/Api/Model/WorkShiftDetailedModel.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
* @OA\Property(
3939
* property="employees",
4040
* type="array",
41-
* @OA\Items(
42-
* @OA\Property(ref="#/components/schemas/Pim-EmployeeModel"),
43-
* )
41+
* @OA\Items(ref="#/components/schemas/Pim-EmployeeModel")
4442
* )
4543
* )
4644
*/

src/plugins/orangehrmAdminPlugin/Api/PayGradeCurrencyAPI.php

+8
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ public function getValidationRuleForGetAll(): ParamRuleCollection
189189
* @OA\Post(
190190
* path="/api/v2/admin/pay-grades/{payGradeId}/currencies",
191191
* tags={"Admin/Pay Grade"},
192+
* @OA\PathParameter(
193+
* name="payGradeId",
194+
* @OA\Schema(type="integer")
195+
* ),
192196
* @OA\RequestBody(
193197
* @OA\JsonContent(
194198
* type="object",
@@ -301,6 +305,10 @@ public function getValidationRuleForUpdate(): ParamRuleCollection
301305
* @OA\Delete(
302306
* path="/api/v2/admin/pay-grades/{payGradeId}/currencies",
303307
* tags={"Admin/Pay Grade"},
308+
* @OA\PathParameter(
309+
* name="payGradeId",
310+
* @OA\Schema(type="integer")
311+
* ),
304312
* @OA\RequestBody(ref="#/components/requestBodies/DeleteRequestBody"),
305313
* @OA\Response(response="200", ref="#/components/responses/DeleteResponse")
306314
* )

0 commit comments

Comments
 (0)