Skip to main content

Update Book Register

Overview​

The UpdateBookRegisterCommand modifies details of an existing book register. This is typically used to correct reference numbers or update remarks.

API Endpoint​

POST /api/bpm/cmd

Headers​

Content-Type: application/json
Authorization: Bearer {access_token}
X-Tenant-ID: {tenant_id}

Request Structure​

{
"cmd": "UpdateBookRegisterCommand",
"data": {
"id": 789,
"depositAccountId": 12345,
"bookType": 1,
"bookReference": "CHQ-2024-001-REVISED",
"startSerialNumber": "0001001",
"endSerialNumber": "0001050",
"numberOfLeaves": 50,
"issuedDate": "2024-12-01",
"remarks": "Updated reference number"
}
}

Request Fields​

FieldTypeRequiredDescription
idlongYesThe unique identifier of the book register to update
depositAccountIdlongYesThe ID of the deposit account (cannot be changed)
bookTypeintegerYesType of book (1=Cheque, 2=DepositSlip, 3=WithdrawalSlip)
bookReferencestringNoOptional reference number for the book
startSerialNumberstringYesFirst serial number in the book
endSerialNumberstringYesLast serial number in the book
numberOfLeavesintegerYesTotal number of leaves/pages in the book
issuedDatestringYesDate the book is issued (YYYY-MM-DD)
remarksstringNoOptional notes about the update

What Can Be Updated​

✅ Allowed Changes:

  • Book reference number
  • Remarks
  • Serial number range (with validation)
  • Number of leaves (must match serial range)
  • Issued date (with validation)

❌ Cannot Be Changed:

  • The deposit account ID
  • Book type (Cheque to Deposit Slip, etc.)
  • The issuing branch

Sample Requests​

1. Update Book Reference​

{
"cmd": "UpdateBookRegisterCommand",
"data": {
"id": 789,
"depositAccountId": 12345,
"bookType": 1,
"bookReference": "CHQ-2024-001-REV2",
"startSerialNumber": "0001001",
"endSerialNumber": "0001050",
"numberOfLeaves": 50,
"issuedDate": "2024-12-01",
"remarks": "Corrected reference number per request #12345"
}
}

2. Correct Serial Number Range​

{
"cmd": "UpdateBookRegisterCommand",
"data": {
"id": 456,
"depositAccountId": 67890,
"bookType": 2,
"bookReference": "DS-2024-Q4",
"startSerialNumber": "DS-002001",
"endSerialNumber": "DS-002100",
"numberOfLeaves": 100,
"issuedDate": "2024-10-01",
"remarks": "Corrected serial number prefix"
}
}

3. Update Remarks​

{
"cmd": "UpdateBookRegisterCommand",
"data": {
"id": 321,
"depositAccountId": 54321,
"bookType": 1,
"bookReference": "CHQ-CORP-001",
"startSerialNumber": "0005001",
"endSerialNumber": "0005050",
"numberOfLeaves": 50,
"issuedDate": "2024-11-15",
"remarks": "Book issued to finance department - approved by CFO"
}
}

Response Structure​

Success Response​

{
"isSuccessful": true,
"message": "Book register updated successfully.",
"statusCode": "00",
"data": {
"id": 789,
"bookType": 1,
"bookTypeDescription": "Cheque",
"bookReference": "CHQ-2024-001-REVISED",
"depositAccountId": 12345,
"accountNumber": "1234567890",
"startSerialNumber": "0001001",
"endSerialNumber": "0001050",
"numberOfLeaves": 50,
"issuedDate": "2024-12-01T00:00:00Z",
"status": 1,
"statusDescription": "ACTIVE",
"remarks": "Updated reference number",
"updatedAt": "2024-12-05T14:30:00Z",
"updatedBy": "admin@bank.com"
}
}

Error Responses​

Book Not Found​

{
"isSuccessful": false,
"message": "Book register not found.",
"statusCode": "99",
"data": null
}

Validation Error​

{
"isSuccessful": false,
"message": "New serial number range overlaps with existing book register.",
"statusCode": "99",
"data": null
}

Blocked Book​

{
"isSuccessful": false,
"message": "Cannot update a blocked book register.",
"statusCode": "99",
"data": null
}

Validation Rules​

  1. Serial Number Changes

    • Must not overlap with other books for the same account
    • Start serial must be less than end serial
    • Number of leaves must match the serial range
  2. Blocked Books

    • Blocked book registers cannot be updated
    • Must unblock (if possible) before updating
  3. Status Preservation

    • Update does not change the book's status (Active/Inactive/Blocked)
    • Use activate/deactivate commands to change status

Best Practices​

  1. Document Changes

    • Always update the remarks field to explain why changes were made
    • Reference ticket numbers or approval documents
  2. Serial Number Updates

    • Only update serial numbers if there was a data entry error
    • Avoid changing serial numbers for books already in use
    • Verify no cheques/slips have been issued before changing
  3. Audit Trail

    • Updates are automatically logged with user and timestamp
    • Previous values are preserved in audit logs
  4. Validation

    • Verify the book exists before attempting to update
    • Check current status (avoid updating blocked books)
    • Validate serial number uniqueness

Notes​

  • The issuing branch cannot be changed after creation
  • The deposit account cannot be reassigned to a different account
  • Book type cannot be changed (would require creating a new book)
  • Cache is automatically invalidated after successful update
  • Status changes require specific activate/deactivate/block commands