Skip to content

@mbanq/core-sdk-js v0.50.0


@mbanq/core-sdk-js / commands / CreateNote

Function: CreateNote() ​

CreateNote(params, data): Command<{ data: { action: ActionType; note: string; }; params: { resourceId: number; resourceType: ResourceType; }; }, { actionType: string; entityType: string; id: string; resourceId: number; }>

Defined in: src/commands/rest/note.ts:58

Create a note for a resource

Creates a note for a specific resource with an associated action type. Notes can be attached to various resource types like clients, accounts, loans, etc. and can be associated with different actions performed on those resources.

Parameters ​

params ​

Path parameters including resource type and resource ID

resourceId ​

number = ...

The unique identifier of the resource

resourceType ​

ResourceType = ...

The type of resource (e.g., 'clients', 'savingsaccount', 'loans')

data ​

Request body data including action and note content

action ​

ActionType = ...

The action type associated with the note (e.g., 'create', 'update', 'approve')

note ​

string = ...

The note content to create

Returns ​

Command<{ data: { action: ActionType; note: string; }; params: { resourceId: number; resourceType: ResourceType; }; }, { actionType: string; entityType: string; id: string; resourceId: number; }>

Command object that executes the API request and returns the created note details

Example ​

typescript
// Create a note for a client
const command = CreateNote({
  resourceType: 'clients',
  resourceId: 123
}, {
  action: 'update',
  note: 'Client information updated'
});
const result = await client.request(command);

// Create a note for a savings account
const accountNote = CreateNote({
  resourceType: 'savingsaccount',
  resourceId: 456
}, {
  action: 'block',
  note: 'Account blocked due to suspicious activity'
});
const accountResult = await client.request(accountNote);

Released under the MIT License.