-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathInstrumentDataSource.ts
More file actions
100 lines (99 loc) · 3.24 KB
/
Copy pathInstrumentDataSource.ts
File metadata and controls
100 lines (99 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import {
Instrument,
InstrumentsHasProposals,
InstrumentWithAvailabilityTime,
InstrumentWithManagementTime,
} from '../models/Instrument';
import { BasicUserDetails } from '../models/User';
import { ManagementTimeAllocationsInput } from '../resolvers/mutations/AdministrationProposalMutation';
import { CreateInstrumentArgs } from '../resolvers/mutations/CreateInstrumentMutation';
export interface InstrumentDataSource {
create(args: CreateInstrumentArgs): Promise<Instrument>;
getInstrument(instrumentId: number): Promise<Instrument | null>;
getInstrumentsByNames(instrumentNames: string[]): Promise<Instrument[]>;
getInstrumentsByIds(instrumentIds: number[]): Promise<Instrument[]>;
getInstruments(
first?: number,
offset?: number,
agentId?: number
): Promise<{ totalCount: number; instruments: Instrument[] }>;
getUserInstruments(userId: number, agentId?: number): Promise<Instrument[]>;
getInstrumentsByCallId(
callIds: number[],
selectableOnly?: boolean
): Promise<InstrumentWithAvailabilityTime[]>;
getCallsByInstrumentId(
instrumentId: number,
callIds: number[]
): Promise<{ callId: number; instrumentId: number }[]>;
getInstrumentHasProposals(
instrumentId: number,
proposalPks: number[]
): Promise<InstrumentsHasProposals>;
getInstrumentsHasProposal(
instrumentIds: number[],
proposalPk: number,
callId: number
): Promise<InstrumentsHasProposals>;
update(instrument: Instrument): Promise<Instrument>;
delete(instrumentId: number): Promise<Instrument>;
assignProposalToInstrument(
proposalPk: number,
instrumentId: number
): Promise<InstrumentsHasProposals>;
removeProposalsFromInstrument(
proposalPks: number[],
instrumentId?: number
): Promise<boolean>;
assignScientistsToInstrument(
scientistIds: number[],
instrumentId: number
): Promise<boolean>;
removeScientistFromInstrument(
scientistId: number,
instrumentId: number
): Promise<boolean>;
assignScientistToInstruments(
scientistId: number,
instrumentIds: number[]
): Promise<boolean>;
removeScientistFromInstruments(
scientistId: number,
instrumentIds: number[]
): Promise<boolean>;
getInstrumentScientists(instrumentId: number): Promise<BasicUserDetails[]>;
getInstrumentsByProposalPk(
proposalPk: number
): Promise<InstrumentWithManagementTime[]>;
updateProposalInstrumentTimeAllocation(
proposalPk: number,
managementTimeAllocations: ManagementTimeAllocationsInput[]
): Promise<boolean>;
getInstrumentsByFapId(
fapId: number,
callId: number
): Promise<InstrumentWithAvailabilityTime[]>;
setAvailabilityTimeOnInstrument(
callId: number,
instrumentId: number,
availabilityTime: number
): Promise<boolean>;
submitInstrumentInFap(
proposalPks: number[],
instrumentId: number
): Promise<InstrumentsHasProposals>;
unsubmitInstrumentInFap(
proposalPks: number[],
instrumentId: number
): Promise<InstrumentsHasProposals>;
hasInstrumentScientistInstrument(
userId: number,
instrumentId: number
): Promise<boolean>;
hasInstrumentScientistAccess(
userId: number,
instrumentId: number,
proposalPk: number
): Promise<boolean>;
getInstrumentsByFapIds(fapId: number[]): Promise<Instrument[]>;
}