ApplicationBatchSetStatusBuilder

Object for configuring bulk status updates for app items

The object allows basic configuration of bulk status change:

  • define item search criteria;
  • perform status change.

Type parameters

Hierarchy

  • ApplicationBatchSetStatusBuilder

Methods

all

  • all(): Promise<number>
  • The method changes the status of app items.

    Returns the number of items actually changed according to ApplicationBatchSetStatusBuilder.size, starting from ApplicationBatchSetStatusBuilder.from. By default, the number of processed items is limited to 10 records. If you need to change the status for a larger number of items, use the ApplicationBatchSetStatusBuilder.size.

    const count =  await Application.batch()
        .setStatus (Application.fields.__status.variants.completed, 'Closed automatically')  
        .where((f, g) => g.and ( 
            f.__deletedAt.eq(null), 
             f.__id.neq('019e6d5f-ed0e-7349-8137-fce42c401f8a') 
        )) 
        .all(); 
    

    Returns Promise<number>

from

  • from(n: number): this
  • The method allows you to skip a specified number of items whose status changes.

    Parameters

    • n: number

    Returns this

notify

  • notify(enabled: boolean): this
  • The method configures sending notifications when item statuses change.

    Parameters

    • enabled: boolean

    Returns this

size

  • size(n: number): this
  • The method allows you to set a limit on the number of items whose status is changed.

    Parameters

    • n: number

    Returns this

sort

  • sort(field: keyof TFull, ascending?: undefined | false | true): this
  • The method allows you to sort items whose status changes.

    To sort the results by multiple parameters, you can call the method several times.

    Parameters

    • field: keyof TFull
    • Optional ascending: undefined | false | true

    Returns this

where

  • where(fc: FilterClosure<TFull>): this
  • where(eql: EqlQuery, params?: EqlParams): this
  • The method allows you to define collection item filtering when the status changes.

    Parameters

    • fc: FilterClosure<TFull>

    Returns this

  • The method allows you to define collection item filtering when the status changes.

    Parameters

    • eql: EqlQuery
    • Optional params: EqlParams

    Returns this