From 5eabfdb1a4ed475d6705f7d02de82a6408dc86e0 Mon Sep 17 00:00:00 2001 From: masaaki Date: Wed, 23 Aug 2023 00:52:55 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20350:=20=E5=89=B2=E3=82=8A?= =?UTF-8?q?=E5=BD=93=E3=81=A6=E5=8F=AF=E8=83=BD=E3=83=A9=E3=82=A4=E3=82=BB?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B?= =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E3=81=8C=E8=AA=A4=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2468: 割り当て可能ライセンスを取得する検索条件が誤っている](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2468) - 元PBI or タスクへのリンク(内容・目的などはそちらにあるはず) - 何をどう変更したか、追加したライブラリなど - 割り当て可能ライセンスを取得する際の条件について、or条件が独立していた。 WHERE `license`.`account_id` = ? AND `license`.`status` IN (?, ?) AND `license`.`expiry_date` >= ? OR `license`.`expiry_date` IS NULL このため、「`license`.`expiry_date` IS NULL」に合致するレコードが他の条件に関係なく取得されていた。 - このPull Requestでの対象/対象外 - 影響範囲(他の機能にも影響があるか) ## レビューポイント - 特にレビューしてほしい箇所 - 軽微なものや自明なものは記載不要 - 修正範囲が大きい場合などに記載 - 全体的にや仕様を満たしているか等は本当に必要な時のみ記載 - 特にありません ## UIの変更 - 変更なし ## 動作確認状況 - ユニットテスト ## 補足 - 相談、参考資料などがあれば --- .../src/repositories/licenses/licenses.repository.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dictation_server/src/repositories/licenses/licenses.repository.service.ts b/dictation_server/src/repositories/licenses/licenses.repository.service.ts index 51d227c..5bd59b9 100644 --- a/dictation_server/src/repositories/licenses/licenses.repository.service.ts +++ b/dictation_server/src/repositories/licenses/licenses.repository.service.ts @@ -420,7 +420,7 @@ export class LicensesRepositoryService { ], }) .andWhere( - 'license.expiry_date >= :nowDate OR license.expiry_date IS NULL', + '(license.expiry_date >= :nowDate OR license.expiry_date IS NULL)', { nowDate }, ) .orderBy('license.expiry_date IS NULL', 'DESC')