Summary
BillingService.deduct, deductBulk and getByRequestId in src/services/billing.ts carry long inline comments but no TSDoc describing parameters, returned flags, thrown errors and concurrency guarantees.
Why this matters
Callers such as the deduct and bulk routes interpret result flags differently, which leads to bugs like reporting pending rows as successes.
Scope
Add TSDoc to each public method and exported helper (parseUsdcToContractUnits, formatContractUnitsToUsdc, isTransientSorobanError) with @PARAM, @returns, @throws and examples.
Relevant code in CalloraOrg/Callora-Backend:
src/services/billing.ts
docs/billing-idempotency.md
Priority
Low
Acceptance criteria
- Each public BillingService method has TSDoc
- Result flags are described consistently with docs/billing-idempotency.md
- Exported helpers document precision rules
npm run lint passes
Validation
Run npm run lint and npm run typecheck.
Non-goals
- Typo-only, formatting-only, or cosmetic changes.
- Unrelated refactors, dependency upgrades, or broad rewrites.
- Removing safeguards or weakening validation to make tests pass.
Contributor application
Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.
PR requirements
Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.
Quality review
A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.
Generated by Claude Code
Summary
BillingService.deduct, deductBulk and getByRequestId in src/services/billing.ts carry long inline comments but no TSDoc describing parameters, returned flags, thrown errors and concurrency guarantees.
Why this matters
Callers such as the deduct and bulk routes interpret result flags differently, which leads to bugs like reporting pending rows as successes.
Scope
Add TSDoc to each public method and exported helper (parseUsdcToContractUnits, formatContractUnitsToUsdc, isTransientSorobanError) with @PARAM, @returns, @throws and examples.
Relevant code in CalloraOrg/Callora-Backend:
src/services/billing.tsdocs/billing-idempotency.mdPriority
Low
Acceptance criteria
npm run lintpassesValidation
Run
npm run lintandnpm run typecheck.Non-goals
Contributor application
Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.
PR requirements
Use a feature branch and include
Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.Quality review
A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.
Generated by Claude Code