Skip to content

Commit 761bd02

Browse files
committed
Refactor SMKS route and procedure wrapper (#238)
Move Khóa số liệu to canonical Simba route /simba/si/vch/smks; remove old /hethong/system menu link; route legacy URL with 302 redirect. Refactor SMKS page (Si\\Vch\\Smks) to call assiUpd_ks via Diepxuan\\Simba\\StoredProcedures\\AssiUpd_ks wrapper with pRet as INT output (matches MsSqlSMKSDAO.cs). Update SourceRouteCoverageTest + simba-router-menu-matrix + task 181-196 + README.
1 parent dc744c4 commit 761bd02

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/StoredProcedures/AssiUpd_ks.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@
1313

1414
namespace Diepxuan\Simba\StoredProcedures;
1515

16+
use Diepxuan\Simba\Helper\ParamHelper;
1617
use Diepxuan\Simba\SModel\SModel;
1718
use Illuminate\Support\Collection;
18-
use Diepxuan\Simba\Helper\ParamHelper;
1919

20+
/**
21+
* Stored procedure assiUpd_ks.
22+
*
23+
* SMKS.dll uses this procedure to update the data lock date for one Simba
24+
* company. The output parameter @pRet returns 0 on success.
25+
*/
2026
class AssiUpd_ks
2127
{
2228
/**
@@ -27,32 +33,26 @@ class AssiUpd_ks
2733
*/
2834
public static function call(array $params): Collection
2935
{
30-
$paramObj = ParamHelper::fromArray($params);
36+
$paramObj = ParamHelper::fromArray($params);
3137
$connection = (new SModel())->getConnectionName();
3238

3339
return ProcedureCaller::call('assiUpd_ks', [
34-
'pMa_cty' => $paramObj->pMa_cty ?? null,
40+
'pMa_cty' => $paramObj->pMa_cty ?? SModel::CTY,
3541
'pNgay_ks' => $paramObj->pNgay_ks ?? null,
36-
'pRet' => $paramObj->pRet ?? null
42+
'pRet' => ['type' => 'INT', 'output' => true],
3743
], $connection);
3844
}
3945

4046
/**
4147
* Call stored procedure assiUpd_ks with named parameters
4248
*
43-
* @param string $Ma_cty
44-
* @param string $Ngay_ks
45-
* @param int $Ret
4649
* @return Collection
4750
*/
48-
public static function callWithParams(string $Ma_cty = null, string $Ngay_ks = null, int $Ret = null): Collection
51+
public static function callWithParams(?string $Ma_cty = null, \DateTimeInterface|string|null $Ngay_ks = null): Collection
4952
{
50-
$params = [
53+
return self::call([
5154
'pMa_cty' => $Ma_cty,
5255
'pNgay_ks' => $Ngay_ks,
53-
'pRet' => $Ret
54-
];
55-
56-
return self::call($params);
56+
]);
5757
}
5858
}

0 commit comments

Comments
 (0)