From 74889a71fe687dda74f2a687653122327807af36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jun 2017 09:45:46 +0200 Subject: Reorganize model files --- server/models/request-interface.ts | 47 -------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 server/models/request-interface.ts (limited to 'server/models/request-interface.ts') diff --git a/server/models/request-interface.ts b/server/models/request-interface.ts deleted file mode 100644 index 4bbd79966..000000000 --- a/server/models/request-interface.ts +++ /dev/null @@ -1,47 +0,0 @@ -import * as Sequelize from 'sequelize' - -import { PodInstance, PodAttributes } from './pod-interface' - -export type RequestsGrouped = { - [ podId: number ]: { - request: RequestInstance, - pod: PodInstance - }[] -} - -export namespace RequestMethods { - export type CountTotalRequestsCallback = (err: Error, total: number) => void - export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void - - export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsGrouped) => void - export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback: ListWithLimitAndRandomCallback) => void - - export type RemoveWithEmptyToCallback = (err: Error) => void - export type RemoveWithEmptyTo = (callback: RemoveWithEmptyToCallback) => void - - export type RemoveAllCallback = (err: Error) => void - export type RemoveAll = (callback: RemoveAllCallback) => void -} - -export interface RequestClass { - countTotalRequests: RequestMethods.CountTotalRequests - listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom - removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo - removeAll: RequestMethods.RemoveAll -} - -export interface RequestAttributes { - request: object - endpoint: string -} - -export interface RequestInstance extends RequestClass, RequestAttributes, Sequelize.Instance { - id: number - createdAt: Date - updatedAt: Date - - setPods: Sequelize.HasManySetAssociationsMixin - Pods: PodInstance[] -} - -export interface RequestModel extends RequestClass, Sequelize.Model {} -- cgit v1.2.3