Skip to main content
Version: Fleeto

Receipt APIs to Support Multi-Tagging Payments

Authors

  • SANKET MAL
  • SAYAN MUKHERJEE
  • RESHMI KARAN

Last Updated Date

2024-09-25


SRS References


Version History

VersionDateChangesAuthor
1.02024-09-25Initial draftSANKET 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 AttachedOrder and AttachedInvoice with AttachedOrderList and AttachedInvoiceList respectively 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 AttachedOrder and AttachedInvoice with AttachedOrderList and AttachedInvoiceList respectively 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 ReceiptInfoForOrderOrInvoice instead of ReceiptStructureLite due 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:

    EndpointMethodParametersResponseResponse Status Codes
    /api/payment/analytics/receipts/listPOSTReceiptFilterStructPaginated List of ReceiptStructLite200,
    400,
    403,
    404,
    500
    /api/payment/analytics/receipt/{transactionId}{transactionType}GETTransactionId,
    TransactionType
    ReceiptStructLite200,
    404,
    403,
    500
    /api/payment/analytics/specificreceipts/listPOSTInvoiceId,
    OrderId
    List of ReceiptInfoForOrderOrInvoice200,
    404,
    403,
    500
  • Third-Party Integrations:

  • Workflow:


Development Tasks & Estimates

NoTask NameEstimate (Hours)DependenciesNotes
1Get Receipt List API Changes4 hours
2Backend Testing : Get Receipt List API Changes1.5 hoursDependency 1
3Get Receipt Details API Changes3 hours
4Backend Testing : Get Receipt Details API Changes1 hoursDependency 3
5GetReceiptsListByInvoiceOrOrder4 hours
6Backend Testing : Get Receipts List By Invoice Or Order1 hoursDependency 5
7Receipt PDF Styling and Content Adjustments and don't generate Receipt PDF in case payment type wallet1.5 hoursDependency 2
8Testing : Receipt PDF Changes0.5 hoursDependency 7
9Frontend: payment details api structure Changes2 hours
10Frontend: payment details Ui Changes3.5 hours
11Total22 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

RiskImpactLikelihoodMitigation 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.)