Prepaid: move drawdown maths out of TimeProApiClient; MCP reports a drawdown for non-prepaid invoices
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- csharp
- Área
- api, backend-api-design, cli, testing-qa
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 3
- Forks
- 0
- Merge medio
- 6 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SSWConsulting/TimePro.Tools
-
Priority: P3 Type: Refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
SSWConsulting/TimePro.Tools#101 ·
-
Priority: P3 Type: Refactor
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
SSWConsulting/TimePro.Tools#100 ·
-
Accounting: share product, SKU, rate, unbilled and recurring reads (unbilled paging is a no-op)AbiertoPriority: P3 Type: Refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Priority: P2 Type: Refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Priority: P2 Type: Bug Type: Refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Todos los issues de SSWConsulting/TimePro.Tools
Issues similares
-
CI: миграции на пустой PostgresAbiertotrack:release
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusPosiblemente ocupada @leizhiyuan la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/rocketmq-clients#1465 ·
Los mantenedores suelen responder en 2 días
-
fix(testing): HeadlessTerminal disposes services synchronouslyPosiblemente ocupada @zidad la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
RazorConsole/RazorConsole#388 ·
Los mantenedores suelen responder en 1 día
-
A practical example of rulerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
starlinghq/starling#209 ·
Los mantenedores suelen responder en 1 día