Skip to content

document: search にフィルタフラグを追加#19

Merged
buty4649 merged 8 commits intomainfrom
feature/document-search-filters
Apr 17, 2026
Merged

document: search にフィルタフラグを追加#19
buty4649 merged 8 commits intomainfrom
feature/document-search-filters

Conversation

@buty4649
Copy link
Copy Markdown
Contributor

Summary

  • xp document search に件名/フォーム/申請者/日付のフィルタフラグを追加し、--body を書かずに簡易検索できるようにする
  • 新規フラグ:
    • --title 件名部分一致
    • --form-name / --form-id / --form-group-id フォーム・フォームグループ指定
    • --writer / --writer-group(repeatable)申請者指定
    • --me 自分が申請者の書類(XPOINT_USER / --xpoint-user を利用)
    • --since / --until 新規更新日(cr_dt)の範囲(YYYY-MM-DD)
  • --body とフィルタフラグの併用はエラー

Test plan

  • go test ./...
  • xp document search --title 経費 で件名部分一致検索ができること
  • xp document search --me で自分の申請書類が取れること
  • xp document search --since 2024-01-01 --until 2024-12-31 で期間検索ができること
  • xp document search --body '{...}' --title x でエラーになること

🤖 Generated with Claude Code

--title / --form-name / --form-id / --form-group-id / --writer /
--writer-group / --me / --since / --until を追加し、--body を書かずに
簡易検索できるようにする。--body とフィルタフラグの併用はエラー。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@buty4649 buty4649 self-assigned this Apr 17, 2026
buty4649 and others added 6 commits April 17, 2026 16:02
XPOINT_USER(もしくは --xpoint-user)が設定されていればそれを使い、未設定時は
/scim/v2/{domain_code}/Me を呼んで認証ユーザの userName を取得するようにする。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
--xpoint-domain-code / XPOINT_DOMAIN_CODE が未設定でも `xp auth login` で
キーリングに保存された domain_code をフォールバックとして使うように
resolveDomainCode を追加。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
/scim/v2/{domain_code}/Me は application/json では 406 Not Acceptable
を返すため、do を doAccept に分けて呼び出し側で Accept を指定可能にし、
GetSelfInfo は application/scim+json を送るようにする。
X-point の writer_list には userName(ログイン名、例: ykky)ではなく
ユーザコード(例: 326)を渡す必要があり、従来実装では SCIM の
userName を使っていたため writer_list が効かず結果が絞れていなかった。
SCIM レスポンスの urn:atled:scim:schemas:1.0:User.userCode を読み、
そちらを writer_list.code に送るようにする。

また --body 利用時のリクエストボディをデバッグ出力に追加し、調査時に
送信内容が確認できるようにする。
xp me で GET /scim/v2/{domain_code}/Me を呼び、ログイン名
(userName)・表示名・X-point ユーザコード (atled 拡張 userCode) を
テーブル/JSON で表示する。writer_list に渡すべきユーザコードを
手元で確認したいケースを想定。
…ch-filters

# Conflicts:
#	README.md
#	internal/xpoint/client.go
#	internal/xpoint/client_test.go
@buty4649 buty4649 enabled auto-merge (squash) April 17, 2026 07:34
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@buty4649 buty4649 merged commit 30cfe0e into main Apr 17, 2026
2 checks passed
@buty4649 buty4649 deleted the feature/document-search-filters branch April 17, 2026 07:36
@pepabo-pr-maker pepabo-pr-maker Bot mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant