CsrNote

class q2_sdk.hq.db.csr_note.CsrNoteRow[source]

Bases: RepresentationRowBase

CsrNoteID: IntElement = 'CsrNoteID'
CreatedAt: StringElement = 'CreatedAt'
CreatedByAdminUserLogonID: IntElement = 'CreatedByAdminUserLogonID'
CustomerID: IntElement = 'CustomerID'
UserID: IntElement = 'UserID'
Note: StringElement = 'Note'
FraudIndicator: BoolElement = 'FraudIndicator'
DeletedAt: StringElement = 'DeletedAt'
DeletedByAdminUserLoginID: IntElement = 'DeletedByAdminUserLoginID'
class q2_sdk.hq.db.csr_note.CsrNote(logger, hq_credentials=None, ret_table_obj=None)[source]

Bases: DbObject

Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.

Parameters:
  • logger – Reference to calling request’s logger (self.logger in your extension)

  • hq_credentials (Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)

  • ret_table_obj (Optional[bool]) – Flag to return list of LXML elements if False or TableRow objects from DB calls if True (Defaults to settings file)

NAME = 'CsrNote'
REPRESENTATION_ROW_CLASS

alias of CsrNoteRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(page_number=1, page_size=100, csr_note_id=None, customer_id=None, user_id=None, created_by_admin_user_logon='', include_deleted=False, serialize_for_cli=False)[source]

Retrieves CSR Note information by CSR note id, customer id, and/or user id paginated.

Parameters:
  • page_number (int) – the starting point for pagination. Defaults to 1

  • page_size (int) – The number of notes to get per page. Defaults to 100

  • id (csr note) – The csr note id tied to the note

  • customer_id (Optional[int]) – The customer id tied to the note

  • user_id (Optional[int]) – The user id tied to the note

  • created_by_admin_user_logon (str) – The login name of the admin that created the note

  • include_deleted (bool) – Boolean indicator of whether deleted entries should be returned. Defaults to False

Return type:

List[CsrNoteRow]

async create(customer_id, note, fraud_indicator=False, user_id=None, created_by_admin_user_logon='')[source]

Creates a CSR Note.

Parameters:
  • customer_id (int) – The customer id tied to the note

  • note (str) – The message to add as a note

  • fraud_indicator (bool) – Boolean assessor of whether potential fraudulent activity has occurred

  • user_id (Optional[int]) – The user id tied to the note. If provided, the note will be created and appear at the user and customer level in Q2 Console

  • created_by_admin_user_logon (str) – The login name of the admin that is creating the note. If not provided, this information will be retrieved from the HQ Credentials CSR User

Return type:

List[CsrNoteRow]

async delete(csr_note_ids, deleted_by_admin_user_logon=None)[source]

Marks a CSR Note as deleted and registers the admin who deleted the note.

Parameters:
  • id (csr note) – A list of csr note ids to delete

  • deleted_by_admin_user_logon (Optional[str]) – The login name of the admin that is deleting the note. If not provided, this information will be retrieved from the HQ Credentials CSR User

Return type:

List[CsrNoteRow]