-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reports): IN-1 add reports module (#88)
- Loading branch information
1 parent
2171411
commit 9c2cb12
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Reports } from './reports' | ||
|
||
describe('Clients', () => { | ||
it('creates', () => { | ||
expect(new Reports({} as never, {} as never)).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { AxiosInstance } from 'axios' | ||
import { TimelyAppConfig } from '../types' | ||
|
||
export class Reports { | ||
constructor(private readonly http: AxiosInstance, private readonly config: TimelyAppConfig) {} | ||
|
||
async getByExternalId( | ||
externalId: string, | ||
filter: { | ||
group_by?: string[] | ||
project_ids?: number[] | ||
since?: string | ||
until?: string | ||
}, | ||
) { | ||
const { data } = await this.http.post(`/${this.config.accountId}/reports/filter`, filter) | ||
return data | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters