storj/web/multinode/src/payouts/service.ts
NickolaiYurchenko e0f3166343 web/multinode: store and payouts components tests added
WHAT: unit tests for vue components and vuex store and environment for it

WHY: to cover frontend part with tests

Change-Id: I2aeaadb200176d4ba0a1406068304785e95d92cd
2021-05-14 12:45:10 +00:00

36 lines
1016 B
TypeScript

// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
import { PayoutsClient } from '@/api/payouts';
import { PayoutsSummary } from '@/payouts/index';
/**
* exposes all payouts related logic
*/
export class Payouts {
private readonly payouts: PayoutsClient;
public constructor(payouts: PayoutsClient) {
this.payouts = payouts;
}
/**
* fetches of payouts summary information.
*
* @param satelliteId - satellite id.
* @param period - selected period.
*
* @throws {@link BadRequestError}
* This exception is thrown if the input is not a valid.
*
* @throws {@link UnauthorizedError}
* Thrown if the auth cookie is missing or invalid.
*
* @throws {@link InternalError}
* Thrown if something goes wrong on server side.
*/
public async summary(satelliteId: string | null, period: string | null): Promise<PayoutsSummary> {
return await this.payouts.summary(satelliteId, period);
}
}