Receipt APIs to Support Multi-Tagging Payments
Authors
- SANKET MAL
- SAYAN MUKHERJEE
- RESHMI KARAN
Last Updated Date
2024-09-25
SRS References
Version History
| Version | Date | Changes | Author |
|---|---|---|---|
| 1.0 | 2024-09-25 | Initial draft | SANKET MAL, SAYAN MUKHERJEE, RESHMI KARAN |
Feature Overview
Objective:
The objective is to modify existing receipt-related APIs and the receipt PDF generation to accommodate the new payment procedure, which allows multiple invoices or orders to be tagged to a single payment transaction. The updates ensure correct handling, display, and reporting of multi-invoice and multi-order payments.
The following APIs will be updated:
-
Get All Receipt List API: Retrieve a paginated list of receipts associated with multiple invoices and orders, including support for proper Excel export formatting.
-
Get Receipt Details API: Retrieve the details of a particular receipt and display a summary of all linked invoices/orders for which payments have been made.
-
Get Receipt List for Specific Invoice/Order: Retrieve the list of receipts for payments made against a specific order or invoice.
Scope:
The feature is specifically for Fleeto and Distributors, they can see the paymnet receipt list and details of a receipt.
Dependencies:
Requirements
1. Get Receipt List API Changes:
- Replace
AttachedOrderandAttachedInvoicewithAttachedOrderListandAttachedInvoiceListrespectively due to tagging multiple orders and invoices with a payment for each object of paginated list. - Show the amount paid by primary method and also show the amount paid by wallet for each receipts of the list.
2. Get Receipt Details API Changes:
- Replace
AttachedOrderandAttachedInvoicewithAttachedOrderListandAttachedInvoiceListrespectively due to tagging multiple orders and invoices with a payment. - Show the amount paid by primary method and also show the amount paid by wallet in that amount .
3. GetReceiptsListByInvoiceOrOrder:
- Return list of
ReceiptInfoForOrderOrInvoiceinstead ofReceiptStructureLitedue to tagging multiple orders and invoices with a payment. - For each receipt info of the receipt list have to show the total amount paid in the transaction(
sum of the amount paid by wallet and any other payment method) and the paid amount for that particular invoice or order.
4. Receipt PDF Changes:
-
Receipt PDF Styling and Content Adjustments and don't generate Receipt PDF in case payment type wallet
Design Specifications
-
UI/UX Design:
(Include wireframes, mockups, or links to design files.) -
Data Models:
public record ReceiptStructLite
{
[JsonIgnore]
public long Totalnumber { get; set; }
public Guid TransactionId { get; set; }
public string? RefNumber { get; set; }
public string? ReceiptNumber { get; set; }
public DateTime RefDate { get; set; }
public DateTime? ChequeDate { get; set; }
public Guid ConsumerId { get; set; }
public string? ConsumerName { get; set; }
public string? ConsumerCode { get; set; }
public Address? ConsumerAddress { get; set; }
public PaymentType? PaymentType { get; set; }
public RefundMethod? RefundMethod { get; set; }
public decimal Amount { get; set; }
public string? Notes { get; set; }
public TransactionType TransactionType { get; set; }
public List<InvoiceList>? AttachedInvoiceList { get; set; } // Change
public List<OrderList>? AttachedOrderList { get; set; } //Change
public PaymentList? AttachedPayment { get; set; }
public decimal PaidAmountFromWallet {get; set; } //Add
public PaymentDisplayType? PaymentDisplayType { get; set; }//Add
}
public class ReceiptFilterStruct
{
[JsonIgnore]
public Guid? TransactionId { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public List<Guid>? ListOfConsumerId { get; set; }
public PaymentType? PaymentType { get; set; }
public PaymentDisplayType? PaymentDisplayType { get; set; }//Add
public RefundMethod? RefundType { get; set; }
public TransactionType TransactionType { get; set; } = Common.TransactionType.Payment;
public string? ReceiptNumber { get; set; }
public string? InvoiceNumber { get; set; }
public string? OrderNumber { get; set; }
public int PageNumber { get; set; }
public int RowsPerPage { get; set; }
public bool IsExcel { get; set; }
}
public record ReceiptInfoForOrderOrInvoice
{
public Guid TransactionId { get; init; }
public string? ReceiptNumber { get; init; }
public decimal TotalPaidAmount { get; init; }
public decimal PaidAmountForOrderOrInvoice { get; init; }
public InvoicePaymentStatus PaymentStatusOfOrderOrInvoice { get; init; }
}
public enum PaymentDisplayType
{
None = 0, // When the entire payment is made by wallet or due note.
PrimaryMethod = 1, // In case of combined payment, show only the amount paid by the primary method.
Wallet = 2, // In case of combined payment, show only the amount paid via wallet.
Both = 3 // In case of combined payment, show amounts paid by both wallet and the primary method.
} -
API Interfaces:
Endpoint Method Parameters Response Response Status Codes /api/payment/analytics/receipts/listPOSTReceiptFilterStructPaginated List of ReceiptStructLite200,
400,403,
404,
500/api/payment/analytics/receipt/{transactionId}{transactionType}GETTransactionId,
TransactionTypeReceiptStructLite200,404,403,
500/api/payment/analytics/specificreceipts/listPOSTInvoiceId,
OrderIdList of ReceiptInfoForOrderOrInvoice200,
404,403,500 -
Third-Party Integrations:
-
Workflow:
Development Tasks & Estimates
| No | Task Name | Estimate (Hours) | Dependencies | Notes |
|---|---|---|---|---|
| 1 | Get Receipt List API Changes | 4 hours | ||
| 2 | Backend Testing : Get Receipt List API Changes | 1.5 hours | Dependency 1 | |
| 3 | Get Receipt Details API Changes | 3 hours | ||
| 4 | Backend Testing : Get Receipt Details API Changes | 1 hours | Dependency 3 | |
| 5 | GetReceiptsListByInvoiceOrOrder | 4 hours | ||
| 6 | Backend Testing : Get Receipts List By Invoice Or Order | 1 hours | Dependency 5 | |
| 7 | Receipt PDF Styling and Content Adjustments and don't generate Receipt PDF in case payment type wallet | 1.5 hours | Dependency 2 | |
| 8 | Testing : Receipt PDF Changes | 0.5 hours | Dependency 7 | |
| 9 | Frontend: payment details api structure Changes | 2 hours | ||
| 10 | Frontend: payment details Ui Changes | 3.5 hours | ||
| 11 | Total | 22 hours |
Testing & Quality Assurance
-
Unit Tests:
- Unit test for Get Receipt List API.
- Unit test for Get Receipt Details API.
- Unit test for Get Receipts List By Invoice Or Order API.
-
Integration Tests:
- Test Get Receipt List API.
- Test Get Receipt Details API.
- Test Get Receipts List By Invoice Or Order API.
- Test Receipt PDF.
-
Acceptance Criteria:
-
Testing Tools:
xUnit
Moq
Deployment Considerations
-
Configuration Changes:
-
Rollout Plan:
Risks & Mitigations
| Risk | Impact | Likelihood | Mitigation Strategy |
|---|
Review & Approval
(Include a section for review and approval by stakeholders.)
-
Reviewer:
Abhishak Kumar Roy -
Approval Date:
2024-09-27
Notes
(Add any additional notes or considerations related to the feature development here.)