TripReviewSection\types\index.ts

mail@pastecode.io avatar
unknown
typescript
15 days ago
2.4 kB
3
Indexable
Never
export interface tripReviewStates {
  startDate: string
  endDate: string
  inputLocomotiveId: string
  selectedCompanyId: string
  inputCrewId: string
  inputTrainId: string
  inputUser: string
  page: string
  userList: string[]
  trainIdList: string[]
  crewIdList: string[]
  locomotiveIdList: string[]
  fromDetail: boolean
}

export enum tripReviewActions {
  INITIALIZE_STATES = 'INITIALIZE_STATES',
  ON_CHANGE_START_DATE = 'ON_CHANGE_START_DATE',
  ON_CHANGE_END_DATE = 'ON_CHANGE_END_DATE',
  ON_CHANGE_LOCOMOTIVE_ID = 'ON_CHANGE_LOCOMOTIVE_ID',
  ON_CHANGE_USER = 'ON_CHANGE_USER',
  ON_CHANGE_TRAIN_ID = 'ON_CHANGE_TRAIN_ID',
  ON_CHANGE_CREW_ID = 'ON_CHANGE_CREW_ID',
  ON_CHANGE_PAGE = 'ON_CHANGE_PAGE',
  ON_CHANGE_FROM_DETAIL = 'ON_CHANGE_FROM_DETAIL',
  ON_POPULATE_TRAIN_AND_CREW_IDS = 'ON_POPULATE_TRAIN_AND_CREW_IDS',
  ON_CLICK_CLEAR_FILTER = 'ON_CLICK_CLEAR_FILTER'
}

export interface reducerActionProps {
  type:
    | tripReviewActions.INITIALIZE_STATES
    | tripReviewActions.ON_CHANGE_START_DATE
    | tripReviewActions.ON_CHANGE_END_DATE
    | tripReviewActions.ON_CHANGE_LOCOMOTIVE_ID
    | tripReviewActions.ON_CHANGE_USER
    | tripReviewActions.ON_CHANGE_TRAIN_ID
    | tripReviewActions.ON_CHANGE_CREW_ID
    | tripReviewActions.ON_CHANGE_PAGE
    | tripReviewActions.ON_CHANGE_FROM_DETAIL
    | tripReviewActions.ON_POPULATE_TRAIN_AND_CREW_IDS
    | tripReviewActions.ON_CLICK_CLEAR_FILTER
  payload: any
}

export interface actionCreatorsProps {
  onInitStates: (latestDate: string) => void
  onChangeStartDate: (startDate: string) => void
  onChangeEndDate: (endDate: string) => void
  onChangeLocomotiveId: ({
    selectedLocoId,
    trips
  }: {
    selectedLocoId: string
    trips: object[]
  }) => void
  onChangeUser: ({
    selectedUser,
    trips
  }: {
    selectedUser: string
    trips: object[]
  }) => void
  onChangeTrainID: ({
    selectedTrainId,
    trips
  }: {
    selectedTrainId: string
    trips: object[]
  }) => void
  onChangeCrewID: ({
    selectedCrewId,
    trips
  }: {
    selectedCrewId: string
    trips: object[]
  }) => void
  onChangePage: (selectedPage: string) => void
  onChangeFromDetail: (value: boolean) => void
  onPopulateTrainAndCrewIds: (trips: object[]) => void
  onClearFilter: () => void
}
Leave a Comment