Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions generated/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions internal/handler/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func toDomainFCMToken(req api.FCMTokenRequest) domain.FCMToken {
}

func toAPINotification(n domain.Notification) api.Notification {
targetUsers := make([]api.NotificationTargetUser, 0, len(n.TargetUserIDs))
for _, uid := range n.TargetUserIDs {
targetUsers = append(targetUsers, api.NotificationTargetUser{UserId: uid})
}
return api.Notification{
Id: n.ID,
Title: n.Title,
Expand All @@ -98,8 +102,7 @@ func toAPINotification(n domain.Notification) api.Notification {
Url: n.URL,
NotifyAfter: n.NotifyAfter,
NotifyBefore: n.NotifyBefore,
IsNotified: n.IsNotified,
TargetUserIds: n.TargetUserIDs,
TargetUsers: targetUsers,
}
}

Expand Down
27 changes: 19 additions & 8 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,7 @@ components:
- body
- notifyAfter
- notifyBefore
- isNotified
- targetUserIds
- targetUsers
properties:
id:
type: string
Expand Down Expand Up @@ -482,14 +481,11 @@ components:
type: string
format: date-time
description: 通知送信期限日時(この時刻を過ぎた場合は送信しない)
isNotified:
type: boolean
description: 通知が送信されたかどうか
targetUserIds:
targetUsers:
type: array
items:
type: string
description: 対象ユーザーIDのリスト
$ref: '#/components/schemas/NotificationTargetUser'
description: 対象ユーザーのリスト
Comment on lines +484 to +488
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response Notification schema no longer includes an isNotified field, but the /v1/notifications list endpoint still accepts the isNotified query parameter for filtering. This makes it impossible for clients to distinguish notified/unnotified items when no filter is applied; consider either reintroducing a per-notification status field (or a replacement such as a timestamp) or removing the filter parameter to keep the contract consistent.

Copilot uses AI. Check for mistakes.
NotificationRequest:
type: object
required:
Expand Down Expand Up @@ -556,6 +552,21 @@ components:
items:
type: string
description: 対象ユーザーIDのリスト
NotificationTargetUser:
type: object
required:
- userId
properties:
userId:
type: string
description: ユーザーID
notifiedAt:
type: string
format: date-time
description: |-
通知送信日時

通知が送信された日時。送信前は null
Comment on lines +563 to +569
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotificationTargetUser.notifiedAt is documented as "送信前は null" but the schema currently defines it as type: string only. In OpenAPI 3.1 (JSON Schema), this forbids null values; either update the schema to allow null (e.g., union with null) or adjust the description to indicate the field is omitted when not sent.

Copilot uses AI. Check for mistakes.
User:
type: object
required:
Expand Down
Loading