Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Leave: share balance, balance-status and update results between CLI and MCP

未关闭
#95 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp

调研方向

Start with RateLookupResult, LeaveCreateService.ApplyAsync, LeaveCreateResult, and the listed LeaveBalanceLookup, LeaveBalanceStatusResult, LeaveUpdateService.ApplyAsync, and LeaveBalanceImportService entry points. Trace how the CLI commands and MCP handlers currently serialize each result, then use the migration checklist and #62 to define done, including the 0.4.0 contract or PermittedDifferences handling.

由索引模型根据 Issue 内容生成。

描述

Priority: P2 Type: Refactor

Why

Leave create, update and list share services well. The remaining leave reads and the update result are still per-surface, and the difference is visible to agents:

  • GetLeaveBalance: a miss is {"error":"No leave stats found for …"} on MCP but {found:false, empId} with exit 0 on tp leave balance --json. A new starter with no leave history looks like a failure to an agent.
  • GetLeaveBalanceStatus and leave balances status duplicate the LastImportedAt == null → imported:false branch.
  • LeaveUpdateService.ApplyAsync returns nothing, so UpdateCommand and UpdateLeave each hand-build the same {success, leaveId, changes} and dry-run objects.
  • LeaveListService returns the envelope, but both adapters throw away cancelledCount and paging (#62).
  • ImportLeaveBalances adds mayHaveBeenApplied:true on an uncertain import; the CLI emits a plain error for the same case.

Migrate

  • LeaveBalanceLookup returning LeaveBalanceResult { found, empId, daysSinceLastLeave, leaveTakenInLast12Months }, used by leave balance and GetLeaveBalance.
  • LeaveBalanceStatusResult shared by leave balances status and GetLeaveBalanceStatus.
  • LeaveUpdateService.ApplyAsync returns a LeaveUpdateResult; both adapters serialise it.
  • One typed "may have been applied" outcome from LeaveBalanceImportService, rendered the same way on both surfaces.
  • Fold in #62.

How

RateLookupResult for "a miss shares the hit's schema"; LeaveCreateService.ApplyAsync / LeaveCreateResult for the update result.

Contract

The MCP GetLeaveBalance miss and the leave-list envelope change shape: hold for 0.4.0 or declare them in PermittedDifferences until then.

Part of #38.

主要语言
C#
星标
3
派生
0
平均合并
11 分钟
30 天内合并 PR
4

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SSWConsulting/TimePro.Tools 的其他 Issue

查看 SSWConsulting/TimePro.Tools 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。