import { Observable } from 'rxjs'; import { Destination, DestinationType, Equipment } from '../models'; import { DestinationBuilder } from '../builders'; import { Destinations } from '../api'; import { EquipmentService } from './equipment.service'; import { LocationService } from './location.service'; import { MemberService } from './member.service'; /** * Destination Service * ============================================================================= * A Destination is a union of * * - Equipment: Put a wrench in a toolkit. * - Location: Put the toolkit on a shelf. * - Member: Give the toolkit to a member. * * When searching, DestinationService searches for destinations by merging * queries to multiple endpoints: * * - GET /team/members?name=$QUERY * - GET /team/equipment?barcode=$QUERY * - GET /team/equipment?ref=$QUERY * - GET /team/locations?title=$QUERY */ export declare class DestinationService { private readonly builder; private readonly equipmentService; private readonly locationService; private readonly memberService; constructor(builder: DestinationBuilder, equipmentService: EquipmentService, locationService: LocationService, memberService: MemberService); /** * Query Many Entities of Given Type * =========================================================================== */ index(type: DestinationType, params?: Destinations.Query): Observable>; /** * Fetch Given Destination Entity * =========================================================================== */ show({ id, type }: { id: number; type: DestinationType; }): Observable; /** * Fetch Equipment Destination by Barcode * =========================================================================== */ barcode(barcode: string): Observable; /** * Fetch the Equipment Contents of Given Entity * =========================================================================== * All of equipment, locations and members may have equipment items. */ contents({ id, type }: { id: number; type: DestinationType; }): Observable>; /** * Search Destination for Gear Item * =========================================================================== */ set(gearId: number, { id, type }: { id: number; type: DestinationType; }): Observable; /** * Search Destinations by Text String * =========================================================================== * When given DestinationType.All, search all types, else search given type. */ search(type: DestinationType, query: string, params?: Destinations.Query): Observable>; /** * Context/Query Query Params * =========================================================================== * Per the issue linked below, the below combination should yield only direct * child equipment of the member or location. For example, if a member has a * toolkit with tools asssigned, the query would only return the toolkit, not * its tools. * * - location: { location_id: number, parent_id: null } * - member: { member: number, parent_id: null } * * @see https://github.com/D4H/decisions-project/issues/4180 */ private params; }