All files / src/Batch MailstepGetEshopListBatch.ts

100% Statements 34/34
100% Branches 6/6
100% Functions 5/5
100% Lines 34/34

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10122x 22x   22x   22x   22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x     22x 22x 22x 22x 22x 22x     22x 22x 22x 22x 22x 22x     22x                 22x       1x                                                                                              
import { NAME as APPLICATION_NAME } from '../MailstepApplication';
import AMailstepListBatch from './AMailstepListBatch';
 
export const NAME = `${APPLICATION_NAME}-get-eshop-list-batch`;
 
export const LAST_RUN_KEY = 'eshop/list';
 
export enum Select {
    ID = 'id',
    NAME = 'name', // eslint-disable-line @typescript-eslint/no-shadow
    URL_SLUG = 'urlSlug',
    ORGANISATION = 'organisation',
    DEFAULT_WAREHOUSE = 'defaultWarehouse',
    WAREHOUSES = 'warehouses',
    ACTIVE = 'active',
    CREATED_AT = 'createdAt',
    PARTNERS = 'partners',
    SALES_CHANNEL_ID = 'salesChannelId',
    WAIT_BEFORE_PROCESSING = 'waitBeforeProcessing',
    EDIT_BEFORE_PROCESSING = 'editBeforeProcessing',
    INTEGRATION_TYPE = 'integrationType',
    CHANGED_AT = 'changedAt',
}
 
export enum Filter {
    ID = 'id',
    NAME = 'name', // eslint-disable-line @typescript-eslint/no-shadow
    ORGANISATION = 'organisation',
    DEFAULT_WAREHOUSE = 'defaultWarehouse',
    ACTIVE = 'active'
}
 
export enum Sorter {
    NAME = 'name', // eslint-disable-line @typescript-eslint/no-shadow
    URL_SLUG = 'urlSlug',
    CREATED_AT = 'createdAt',
    INTEGRATION_TYPE = 'integrationType',
    CHANGED_AT = 'changedAt'
}
 
export default class MailstepGetEshopListBatch extends AMailstepListBatch<
    unknown,
    IOutput,
    Select,
    Filter,
    Sorter
> {
 
    public getName(): string {
        return NAME;
    }
 
    protected getUrl(): string {
        return LAST_RUN_KEY;
    }
 
}
 
export interface IOutput {
    id: string;
    name: string;
    urlSlug: string;
    organisation: string;
    defaultWarehouse: string;
    warehouses: string[];
    active: boolean;
    createdAt: string;
    partners: {
        id: string;
        eshop: string;
        code: number;
        name: string;
        companyName: string;
        firstName: string;
        lastName: string;
        degree: string;
        degree2: string;
        street: string;
        houseNr: string;
        city: string;
        zip: number;
        country: string;
        phone: string;
        email: string;
        registrationNumber: number;
        vatNumber: string;
        note: string;
        active: boolean;
        createdAt: string;
        ref1: string;
        ref2: string;
        ref3: string;
        changedAt: string;
    }[];
    salesChannelId: string;
    waitBeforeProcessing: boolean;
    editBeforeProcessing: boolean;
    integrationType: string;
    changedAt: string;
}