Prepaid: move drawdown maths out of TimeProApiClient; MCP reports a drawdown for non-prepaid invoices
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- api, backend-api-design, cli, testing-qa
Hướng nghiên cứu
Start by reading TimeProApiClient and the WeekCoverageService, CheckEvaluator, and WeekCheckResult pattern. Trace PrepaidStatusService, PrepaidCalculator, PrepaidStatusResult, and both prepaid CLI and MCP surfaces, then run the existing WireMock coverage and add the zero-rate unit test. Done means the prepaid golden remains byte-identical, both surfaces share the result and fetch, and the contract decision for non-prepaid MCP output is resolved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why
Prepaid is the one place where finance rules live in the HTTP client. TimeProApiClient.GetPrepaidStatusSummaryAsync / BuildPrepaidStatusSummary hold the BPP filter, tax-rate normalisation, 3-dp rounding and the credit-note apportioning. Both surfaces call it, but the logic around it has already drifted:
prepaid summaryrefuses a non-prepaid invoice (isPrepaid:false); the MCPGetPrepaidStatustool has no such gate and returns a full drawdown for an ordinary invoice. An agent asked about unspent prepaid credit reports credit that does not exist.- An explicit
SalesTaxPct = 0on a drawdown row is treated as "missing" and replaced with the invoice's rate, so a zero-rated row withSellTotal = 100gains $10 GST. The fallback tests the normalised value against zero instead of testing for null. - The maths can only be tested through WireMock.
Migrate
-
Features/Prepaid/PrepaidStatusServicefor orchestration (invoice, allocated timesheets, credit notes) and a purePrepaidCalculatorfor the maths. - One
PrepaidStatusResult { found, isPrepaid, invoiceId, summary? }used byprepaid summary --jsonandGetPrepaidStatus. -
prepaid statusandGetPrepaidStatusPdfshare the fetch; the adapters only choose file vs base64. - Fix the zero-rate fallback (null means missing, zero means zero) with a unit test.
- Remove the prepaid members from
ITimeProApiClientexcept the raw endpoint calls.
How
Follow WeekCoverageService (fetch) + CheckEvaluator (pure, unit-tested rules) + WeekCheckResult (one document for both surfaces).
Contract
The populated golden (a prepaid invoice) should stay byte-identical. The non-prepaid MCP answer changes shape; ship the gate in a patch only if the old shape can be kept, otherwise hold it for 0.4.0.
Part of #38.
- Ngôn ngữ chính
- C#
- Star
- 3
- Fork
- 0
- Merge trung bình
- 11 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SSWConsulting/TimePro.Tools
-
Priority: P3 Type: Refactor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
SSWConsulting/TimePro.Tools#101 ·
-
Priority: P3 Type: Refactor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
SSWConsulting/TimePro.Tools#100 ·
-
Accounting: share product, SKU, rate, unbilled and recurring reads (unbilled paging is a no-op)Đang mởPriority: P3 Type: Refactor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Priority: P2 Type: Refactor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Priority: P2 Type: Bug Type: Refactor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Tất cả issue của SSWConsulting/TimePro.Tools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno.check#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
weaviate/csharp-client#378 ·
-
agentic-workflows automated testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Azure-Samples/Legacy-Modernization-Agents#194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-encryption area-security p1-recommended technical-debt
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug flaky small
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
hexide-io/HexIDE#1906 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày