You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_3 (already cloned)
- Base commit: 40357ae298ac8327b08f6b5c7b1d4f8cfe7c9acb
- Task ID: juspay__hyperswitch-9343
- Version: v1.117.0
TASK DESCRIPTION: Bug: Add invoice table in hyperswitch
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
Description
This PR introduces the
invoicetable along with supporting models, queries, schema definitions, and storage interfaces.
The goal is to enable subscription billing and payment tracking by storing invoices linked to merchants, customers, subscriptions, and connectors.Key Features
- New
Invoicetable with fields for subscription, connector, merchant, customer, amount, currency, status, and metadata. - Added
InvoiceStatusenum to represent invoice lifecycle stages (e.g.,PendingPayment,PaymentSucceeded,InvoicePaid, etc.). - Implemented Diesel models:
InvoiceNew,Invoice,InvoiceUpdate. - Added storage query methods:
- Insert new invoice
- Find invoice by ID
- Find invoice by merchant + invoice ID
- Update invoice entry
- Integrated with router storage interface (
InvoiceInterface). - Added migrations:
up.sql: createsinvoicetable and indexes (payment_intent_id, , ).
Assistant
I'll help you implement the invoice table feature in the hyperswitch repository. Let me start by creating a plan of action and exploring the codebase to understand the structure.
Assistant
Let me first explore the database structure to understand where to place the invoice table and how the existing schema is organized.
Assistant
Now let me examine the existing schema file to understand the structure better and then check how other tables are defined.
Assistant
Let me also check the enums file to understand the existing enum structures, particularly for statuses:
Assistant
Now I'll examine some existing models to understand the pattern better:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.