import * as Knex from "knex"; import { Data, AbstractCrudModel } from "./abstract_crud"; import { MapDataType } from "./data_types"; import { Collection, CollectionData } from "./collection"; declare type LocationData = { id: string; name?: string; } & Pick; declare type ItemStatusData = { id: string; name: string; rules?: string; noLoan: boolean; skipStockTake: boolean; } & Pick; export declare enum ItemSource { PURCHASE = 0, GRANT_OR_PRIZE = 1 } export declare type ItemData = Data & { biblioId?: number; callNumber?: string; collection?: CollectionData; itemCode?: string; inventoryCode?: string; receivedDate?: Date; orderNo?: string; location?: LocationData; orderDate?: Date; itemStatus?: ItemStatusData; site?: string; source: ItemSource; invoice?: string; price?: number; priceCurrency?: string; invoiceDate?: Date; uid?: number; }; declare const itemColumns: { readonly id: "item_id"; readonly biblioId: "biblio_id"; readonly callNumber: "call_number"; readonly collection: "coll_type_id"; readonly itemCode: "item_code"; readonly inventoryCode: "inventory_code"; readonly receivedDate: "received_date"; readonly orderNo: "order_no"; readonly location: "location_id"; readonly orderDate: "order_date"; readonly itemStatus: "item_status_id"; readonly site: "site"; readonly source: "source"; readonly invoice: "invoice"; readonly price: "price"; readonly priceCurrency: "price_currency"; readonly invoiceDate: "invoice_date"; readonly uid: "uid"; readonly created: "input_date"; readonly updated: "last_update"; }; declare type TableOverride = { item_id: number; source: number; coll_type_id?: number; location_id?: string; item_status_id?: string; }; declare type RawItemData = MapDataType; declare type Models = { collection: Collection; }; export declare class Item extends AbstractCrudModel { private readonly models; constructor(db: Knex, models: Models); protected toPartialRaw(data: Partial): Promise<{ item_id: number | undefined; biblio_id: number | undefined; coll_type_id: number | undefined; location_id: string | undefined; item_status_id: string | undefined; call_number: string | undefined; item_code: string | undefined; inventory_code: string | undefined; received_date: Date | undefined; order_no: string | undefined; order_date: Date | undefined; site: string | undefined; source: ItemSource | undefined; invoice: string | undefined; price: number | undefined; price_currency: string | undefined; invoice_date: Date | undefined; uid: number | undefined; }>; protected toRaw(data: ItemData): Promise<{ item_id: number | undefined; biblio_id: number | undefined; coll_type_id: number | undefined; location_id: string | undefined; item_status_id: string | undefined; call_number: string | undefined; item_code: string | undefined; inventory_code: string | undefined; received_date: Date | undefined; order_no: string | undefined; order_date: Date | undefined; site: string | undefined; source: ItemSource; invoice: string | undefined; price: number | undefined; price_currency: string | undefined; invoice_date: Date | undefined; uid: number | undefined; input_date: Date; last_update: Date; }>; protected toData(data: RawItemData): Promise<{ id: number; biblioId: number | undefined; collection: import("./abstract_crud").RequiredId | undefined; location: undefined; itemStatus: undefined; callNumber: string | undefined; itemCode: string | undefined; inventoryCode: string | undefined; receivedDate: Date | undefined; orderNo: string | undefined; orderDate: Date | undefined; site: string | undefined; source: number; invoice: string | undefined; price: number | undefined; priceCurrency: string | undefined; invoiceDate: Date | undefined; uid: number | undefined; created: Date | undefined; updated: Date | undefined; }>; } export {};