All files / realm/blong-gateway/adapter/dbTest customerGet.ts

66.66% Statements 14/21
100% Branches 1/1
0% Functions 0/1
66.66% Lines 14/21

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 221x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x               1x  
import {type IMeta, handler} from '@feasibleone/blong';
 
/**
 * Demo metered API: `customer.get` (test-only handler).
 *
 * Lives in `adapter/dbTest/` so it is only loaded in the `dev` intent
 * (the db adapter imports `.dbTest` handler groups only under `dev`). Never
 * loaded in production. Routed via the `customer` namespace and metered by the
 * 'Customer' bundle (route config `{bundle: 'Customer API', creditCost: 1}`).
 */
export default handler(
    () =>
        async function customerGet(
            // eslint-disable-next-line @typescript-eslint/no-unused-vars
            _params: {customerId?: string},
            // eslint-disable-next-line @typescript-eslint/no-unused-vars
            _$meta: IMeta,
        ): Promise<{success: boolean; customer: string}> {
            return {success: true, customer: 'demo'};
        },
);