Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Prepaid: move drawdown maths out of TimeProApiClient; MCP reports a drawdown for non-prepaid invoices

Abierto
#93 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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

Priority: P1 Type: Bug Type: Refactor

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 summary refuses a non-prepaid invoice (isPrepaid:false); the MCP GetPrepaidStatus tool 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 = 0 on a drawdown row is treated as "missing" and replaced with the invoice's rate, so a zero-rated row with SellTotal = 100 gains $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/PrepaidStatusService for orchestration (invoice, allocated timesheets, credit notes) and a pure PrepaidCalculator for the maths.
  • One PrepaidStatusResult { found, isPrepaid, invoiceId, summary? } used by prepaid summary --json and GetPrepaidStatus.
  • prepaid status and GetPrepaidStatusPdf share 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 ITimeProApiClient except 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

Abrir en Codespaces

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de SSWConsulting/TimePro.Tools

Todos los issues de SSWConsulting/TimePro.Tools

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.