Invoice Microservice
The Invoice microservice manages billing-related data such as customer invoices. It integrates with external services (e.g., Zoho) and provides gRPC endpoints for querying and retrieving invoice data by various identifiers.
Models (invoice.go)
Invoice
Represents a billing invoice with customer and payment details.
| Field | Type | Description |
|---|---|---|
InvoiceID | string | Unique ID of the invoice |
CustomerName | string | Name of the customer |
CustomerID | string | ID of the customer |
Status | string | Invoice status (e.g., paid, unpaid, draft) |
InvoiceNumber | string | Official invoice number |
ReferenceNumber | string | Reference tag or external ID |
Date | string | Invoice issue date |
DueDate | string | Invoice due date |
DueDays | string | Days until due |
ScheduleTime | string | Scheduled time for the invoice (if applicable) |
CurrencyCode | string | Code of the currency used |
CurrencyID | string | Internal currency reference |
Total | float64 | Total invoice amount |
Balance | float64 | Remaining balance due |
CreatedTime | string | Timestamp when the invoice was created |
LastModifiedTime | string | Last time the invoice was modified |
RemindersSent | int | Number of reminders sent |
LastReminderSentDate | string | Timestamp of last reminder sent |
PaymentExpectedDate | string | Expected payment date |
LastPaymentDate | string | Timestamp of last payment |
Zoho Integration Models
ZohoInvoiceResponse: Holds response structure from Zoho's invoice list.ZohoTokenResponse: Holds the access token from Zoho authentication.
gRPC API (invoice.proto)
Defines RPC methods for retrieving and listing invoice data.
Messages
Invoice: Mirrors the Invoice model.InvoiceResponse: Contains a list of invoices and total count.GetInvoiceByIDResponse: Encodes the invoice as raw bytes.ListAllInvoicesRequest: Supports pagination.GetInvoiceByIDRequest,GetInvoiceByUserIDRequest,GetInvoiceByOrgIDRequest: Query filters.CheckResponse: Standard status response format.
Services
ListAllInvoices(ListAllInvoicesRequest) returns (InvoiceResponse)GetInvoiceByID(GetInvoiceByIDRequest) returns (GetInvoiceByIDResponse)GetInvoicesByUserID(GetInvoiceByUserIDRequest) returns (InvoiceResponse)GetInvoicesByOrgID(GetInvoiceByOrgIDRequest) returns (InvoiceResponse)
These services allow the client to retrieve invoice data filtered by ID, user, or organization, with support for pagination.