All files / src/Batch APohodaGetInvoiceListBatch.ts

91.66% Statements 11/12
100% Branches 4/4
83.33% Functions 5/6
91.66% Lines 11/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43  18x   18x 18x 18x     18x                 4x       2x         2x                       18x 18x 18x    
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
import APohodaListBatch from './APohodaListBatch';
 
export enum Filter {
    LAST_CHANGES = 'lastChanges',
    DATE_FROM = 'dateFrom',
}
 
export default abstract class APohodaGetInvoiceListBatch<IInvoiceOutput> extends APohodaListBatch<
    unknown,
    IInvoiceOutput,
    Filter
> {
 
    protected abstract getType(): InvoiceType;
 
    protected getKey(): string {
        return 'invoice';
    }
 
    protected getSchema(): string {
        return 'http://www.stormware.cz/schema/version_2/list.xsd';
    }
 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/require-await
    protected async getCustomListRequestAttributes(dto: BatchProcessDto): Promise<object> {
        return {
            '@_invoiceType': this.getType(),
        };
    }
 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/require-await
    protected async getLastRunKey(dto: BatchProcessDto): Promise<string> {
        return this.getType();
    }
 
}
 
export enum InvoiceType {
    ISSUED = 'issuedInvoice',
    RECEIVED = 'receivedInvoice',
}