feat(PointLog): 添加获取病人姓名的方法并更新相关代码

- 在 PointLog 类中添加 patientName属性和 getPatientName() 方法
- 更新 PointLogRepo 类,从数据库中获取并设置 patient_name 字段
This commit is contained in:
李东云
2025-09-06 03:06:43 +08:00
parent 7354abb99a
commit 3b12216344
2 changed files with 8 additions and 0 deletions

View File

@@ -25,11 +25,17 @@ final class PointLog extends AggregateRoot
private readonly string $source,
private readonly string $operator,
private readonly string $description,
private readonly string $patientName,
private readonly Carbon $date,
private readonly bool $invoiceable,
private readonly ?InvoiceRecord $invoiceRecord,
) {}
public function getPatientName(): string
{
return $this->patientName;
}
public function getDescription(): string
{
return $this->description;

View File

@@ -44,6 +44,7 @@ final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface
source: $item['source'],
operator: $item['operator'],
description: $item['description'],
patientName: $item['patient_name'],
date: new Carbon($item['date']),
invoiceable: $item['invoiceable'],
invoiceRecord: isset($item['invoice_record'])
@@ -74,6 +75,7 @@ final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface
source: $result['source'],
operator: $result['operator'],
description: $result['description'],
patientName: $result['patient_name'],
date: new Carbon($result['date']),
invoiceable: $result['invoiceable'],
invoiceRecord: isset($result['invoice_record'])