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
| Field | Type | Required | Description |
|---|---|---|---|
id | long | Yes | The unique identifier of the book register to update |
depositAccountId | long | Yes | The ID of the deposit account (cannot be changed) |
bookType | integer | Yes | Type of book (1=Cheque, 2=DepositSlip, 3=WithdrawalSlip) |
bookReference | string | No | Optional reference number for the book |
startSerialNumber | string | Yes | First serial number in the book |
endSerialNumber | string | Yes | Last serial number in the book |
numberOfLeaves | integer | Yes | Total number of leaves/pages in the book |
issuedDate | string | Yes | Date the book is issued (YYYY-MM-DD) |
remarks | string | No | Optional 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
-
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
-
Blocked Books
- Blocked book registers cannot be updated
- Must unblock (if possible) before updating
-
Status Preservation
- Update does not change the book's status (Active/Inactive/Blocked)
- Use activate/deactivate commands to change status
Best Practices
-
Document Changes
- Always update the
remarksfield to explain why changes were made - Reference ticket numbers or approval documents
- Always update the
-
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
-
Audit Trail
- Updates are automatically logged with user and timestamp
- Previous values are preserved in audit logs
-
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
Related Commands
- Retrieve Book Register By ID - Get current book details
- Create Book Register - Issue a new book
- Activate Book Register - Activate an inactive book
- Deactivate Book Register - Deactivate a book
- Block Book Register - Block a book for security