UNPKG

pd-api

Version:
50 lines (49 loc) 1.61 kB
import { Observable } from 'rxjs/Observable'; import { Moment } from 'moment'; import { ApiService } from '../api.service'; import { Country } from '../country/country.service'; export interface Buyout { days: BuyoutDay[]; total: BuyoutTotal; } export interface BuyoutDay { date: string; total: BuyoutTotal; } export interface BuyoutTotal { delivered: number; in_progress: number; returned: number; percent_delivered?: number; new_orders?: number; } export interface PartnerBestBuyout { count_delivered: number; diff: number; partner_lm: string; percent_delivered: number; } export interface NewOrdersModel { days: NewOrderDay[]; totalCount: number; } export interface NewOrderDay { date: string; count: number; } export interface RejectReason { name: string; count: number; diff: number; } export declare type PlanFactTemplate = 'total' | 'total_total'; export declare class AnalyticsService { private api; host: string; constructor(api: ApiService); getTopRejectReasons(country: Country, from: Moment, to: Moment, timezone?: string): Observable<RejectReason[]>; getBuyout(country: Country | Country[], from: Moment, to: Moment, timezone?: string): Observable<Buyout>; getNewOrders(country: Country, from: Moment, to: Moment, timezone?: string): Observable<NewOrdersModel>; getPlanFact(country: Country | Country[], from: Moment, to: Moment, template?: PlanFactTemplate, timezone?: string): Observable<any>; getBestBuyout(country: Country, from: Moment, to: Moment): Observable<PartnerBestBuyout[]>; }