@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
27 lines (26 loc) • 1.46 kB
TypeScript
import ReportStoreService from '../../../../services/reportStoreService';
import UserDataStore from '../../../../data/reportDataStore';
import { StoredReportData, SubscribedReport } from '../../../../types/UserReports';
import { ServiceFeatureConfig } from '../../../../types/DprConfig';
export default class SubscriptionStoreService extends ReportStoreService {
enabled: boolean;
constructor(userDataStore: UserDataStore, serviceFeatureConfig: ServiceFeatureConfig);
private getSubscriptionsState;
getAllReports(userId: string): Promise<SubscribedReport[]>;
getReportByExecutionId(id: string, userId: string): Promise<StoredReportData | undefined>;
getReportByTableId(id: string, userId: string): Promise<StoredReportData | undefined>;
addReport(userId: string, reportStateData: SubscribedReport): Promise<void>;
removeReport(userId: string, reportId: string, id: string): Promise<void>;
isSubscribed(reportId: string, id: string, userId: string): Promise<boolean>;
getSubscription(reportId: string, id: string, userId: string): Promise<StoredReportData | undefined>;
updateTimestamps(tsDataArray: {
tableId: string;
createdAt: string;
addedAt: string;
}[], userId: string): Promise<StoredReportData[]>;
updateRefreshedTimestamp(tsData: {
tableId: string;
createdAt: string;
addedAt: string;
}, subscriptions: StoredReportData[]): StoredReportData[];
}