Skip to main content

Hold Summary Invoice API

Introduction​

Stores the user’s current summary-invoice line selection in an in-memory map (TmsConstants.summaryInvoiceSelectionList) keyed by lower-case username. This lets the server remember which Invoicing rows were selected before a follow-up action (for example generating or confirming a summary invoice). The branch field is read from JSON but is not used in the handler body beyond parsing.

Source: InvoiceHomePageAPI.holdSummaryInvoice (@Path("invoicehome")).

See also: Invoice Home — all endpoints.


HTTP Endpoint​

PropertyValue
URL/rest/invoicehome/holdSummaryInvoice
MethodPOST
ConsumesRaw JSON body (clients typically send application/json)
Producestext/plain (entity is a JSON string)

Request Body (JSON)​

FieldTypeRequiredDescription
userNameStringYesUsername; used for auth and as the cache key (stored as userName.toLowerCase()).
authKeyStringYesSession/auth key.
branchStringYesPresent in the contract; not referenced after parse in current code.
invoicedataArrayYesJSON array of Invoicing objects deserialised with Gson (ArrayList<Invoicing>).

Authentication​

ConditionHTTP status
Invalid userName / authKey401 Unauthorized (Access-Control-Allow-Origin: *)
Success200 OK

Behaviour​

  1. Parses the body with JsonParser / JsonObject.
  2. Validates userName and authKey.
  3. Deserialises invoicedata into List<Invoicing>.
  4. Executes TmsConstants.summaryInvoiceSelectionList.put(userName.toLowerCase(), summaryInvoiceList).

Note: This is server-side volatile state (typically a static map). It is not persisted to the database by this call alone and may be lost on JVM restart.


Success Response​

Code: 200 OK

Body (JSON string):

{"data":true}

Headers: Access-Control-Allow-Origin: *


Example Request​

POST /rest/invoicehome/holdSummaryInvoice HTTP/1.1
Host: {base}
Content-Type: application/json

{
"userName": "alice",
"authKey": "secretAuthKey",
"branch": "default",
"invoicedata": [
{ "id": 1, "bookingId": "BK-1", "invoiceNumber": "TEMP-1", "...": "..." }
]
}