Skip to content

SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/suggest-improvements-v1-0-1
Draft

SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes#2
Copilot wants to merge 2 commits intomainfrom
copilot/suggest-improvements-v1-0-1

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 19, 2026

Bundles several targeted v1.0.1 improvements across the API and web layers.

API

Global exception filter

Added HttpExceptionFilter (@Catch()) registered in main.ts. All errors now emit a uniform { statusCode, message, error } envelope. Unexpected runtime errors are caught, logged with stack traces via NestJS Logger, and returned as clean 500s.

DTO validation hardening

  • CreateSubscriptionDto: @MaxLength on serviceId (100), planName (150), billingCurrency (3), paymentLast4 (4), notes (1,000); paymentSource tightened from @IsString@IsIn(['card','paypal','gift','other']).
  • UpdateSettingsDto: @Max(365) added to previously unbounded leadTimeDays.
  • EmailIngestPayload: @MaxLength(50000) on body.

Dashboard spend calculation

canceled_pending subscriptions now excluded from monthlyEquivalentSpend and spendByCategory. These are already canceled and were silently inflating ongoing cost totals.

Web

API layer consolidation

subscription-form.tsx was making raw fetch calls with duplicated base-URL resolution. Added updateSubscription(id, payload) to api.ts and refactored the form to use the typed helpers (createSubscription, updateSubscription, deleteSubscription).

Tests

subscriptions.service.spec.ts had two bugs that prevented the suite from running correctly:

  • ServiceCatalogService was missing from the constructor call — would throw TypeError at runtime.
  • Entity fixture used billingAmount: new Prisma.Decimal(15) instead of the actual schema field billingAmountCents: 1500.

All 5 unit tests now pass.

Misc

  • All packages bumped to 1.0.1.
  • docs/release-notes-v1.0.1.md added.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…rd spend fix, API consolidation, test fixes

Co-authored-by: ejames-dev <180847219+ejames-dev@users.noreply.github.com>
Copilot AI changed the title [WIP] Suggest improvements for version 1.0.1 of SubSync SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes Mar 19, 2026
Copilot AI requested a review from ejames-dev March 19, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants