import * as IShared from '../../../shared/interface'; import { DocumentHeader, DocumentHeaderVirtuals, DocumentType, StartDocumentHeaderVirtuals, DocumentLineNote, VatTax } from '../../../shared/entities/stock'; import * as IDocumentType from '../documentType/interfaces'; import * as IPayment from '../payment/interface'; import * as IProjectInfo from '../../integration/projectInfo/interfaces'; export type Entity = Omit; export declare const Route = "documentHeader"; export declare const UpperName = "DocumentHeader"; export declare const LowerName: string; export type IDocumentHeaderVirtuals = DocumentHeaderVirtuals; export type IStartDocumentHeaderVirtuals = StartDocumentHeaderVirtuals; export interface ITaxEntry extends Pick { percentage: number; totalTaxableBase: number; totalTax: number; total: number; } export interface ITaxTable { taxes: ITaxEntry[]; vatTaxZone: string; } export interface IRsaHashData { invoiceDate: string; systemEntryDate: string; invoiceNo: number; grossTotal: number; previousHash: string; } export interface IFindOneBase extends Entity { document_type: IDocumentType.IEntityExtended; } export interface IBasicSearchRequest extends IShared.IPaginationRequest { search_value: string | null; inactive?: boolean; } export interface IBasicSearchResponse { document_type_name: string; number: number; name: string | null; user_number: number; document_line_count: number; document_header_id: string | null; pdf_link: string | null; updated_at: Date; } export interface IFindRequest { owner_id: string; closed?: boolean; document_type_id: number; } export interface ICreateFromHeaderMaturityDate { id: string; name: string; days: number; } export interface ICreateRequest { document_type_id: number; external_id?: string | null; document_set_id: string; pdf_link?: string | null; external_pdf_link?: string | null; google_sheet_id?: string | null; sent?: boolean; chat_document_header_id?: string; owner_id: string; owner_number: number; owner_name: string; reason_for_exemption_id?: string | null; reason_for_exemption?: string | null; billing_persona_id?: string | null; billing_persona_nif?: string | null; billing_persona_name?: string | null; billing_persona_email?: string | null; billing_persona_telephone?: string | null; billing_persona_address_street?: string | null; billing_persona_address_postal_code?: string | null; billing_persona_address_locality?: string | null; billing_persona_address_country_id?: string | null; billing_persona_address_country_name?: string | null; delivery_persona_id?: string | null; delivery_persona_name?: string | null; delivery_persona_email?: string | null; delivery_persona_telephone?: string | null; delivery_persona_address_street?: string | null; delivery_persona_address_postal_code?: string | null; delivery_persona_address_locality?: string | null; delivery_persona_address_country_id?: string | null; delivery_persona_address_country_name?: string | null; payment_method_id?: string | null; payment_method?: string | null; maturity_date?: ICreateFromHeaderMaturityDate; delivery_method_id?: string | null; delivery_method?: string | null; delivery_departure_street?: string | null; delivery_departure_locality?: string | null; delivery_departure_postal_code?: string | null; vehicle_id?: string | null; vehicle?: string | null; commissioner_id?: string | null; commission_percentage?: number; return_reason?: string | null; created_by?: string | null; updated_by?: string | null; } export interface ICreateResponse { id: string; owner_id: string; document_number: number; google_sheet_id: string | null; } export interface IDeliveryAdresses { delivery_departure_street?: string | null; delivery_departure_locality?: string | null; delivery_departure_postal_code?: string | null; delivery_street?: string | null; delivery_locality?: string | null; delivery_postal_code?: string | null; } export interface ICreateFromHeaderRequest { document_type_id: number; emission_date?: Date; account_code?: string | null; from_header: string[]; from_lines: string[]; payments: (IPayment.ICreateRequest | IPayment.ICreateForThisDocumentHeaderRequest)[]; delivery_adresses?: IDeliveryAdresses; delivery_method_id?: string | null; email?: string; maturity_date?: ICreateFromHeaderMaturityDate; return_reason?: string; provider_ref?: string; global_discount?: number; current_account?: boolean; store_operator_id?: string | null; owner_ref_document?: string | null; } export interface IUpdateRequest { external_id?: string | null; external_pdf_link?: string | null; google_sheet_id?: string | null; pdf_link?: string | null; sent?: boolean; chat_document_header_id?: string; owner_id?: string; owner_number?: number; owner_name?: string; reason_for_exemption_id?: string | null; reason_for_exemption?: string | null; billing_persona_id?: string | null; billing_persona_nif?: string | null; billing_persona_name?: string | null; billing_persona_email?: string | null; billing_persona_telephone?: string | null; billing_persona_address_street?: string | null; billing_persona_address_postal_code?: string | null; billing_persona_address_locality?: string | null; billing_persona_address_country_id?: string | null; billing_persona_address_country_name?: string | null; delivery_persona_id?: string | null; delivery_persona_name?: string | null; delivery_persona_email?: string | null; delivery_persona_telephone?: string | null; delivery_persona_address_street?: string | null; delivery_persona_address_postal_code?: string | null; delivery_persona_address_locality?: string | null; delivery_persona_address_country_id?: string | null; delivery_persona_address_country_name?: string | null; payment_method_id?: string | null; payment_method?: string | null; maturity_date_id?: string | null; maturity_date?: string | null; maturity_date_days?: number | null; delivery_method_id?: string | null; delivery_method?: string | null; delivery_departure_street?: string | null; delivery_departure_locality?: string | null; delivery_departure_postal_code?: string | null; vehicle_id?: string | null; vehicle?: string | null; commissioner_id?: string | null; commission_percentage?: number; commission_paid?: boolean; is_archived?: boolean; is_void?: boolean; is_void_reason?: string | null; is_force_adjudicated?: boolean; who_handles?: string | null; warning?: IWarningType; created_by?: string; confirmed?: boolean; confirmed_date?: Date; } export type IGetActionsDocumentType = Pick; export interface IGetActionsResponse { document_type: IGetActionsDocumentType; transition_name: string; document_line_ids: string[]; from_document_headers: { id: string; document_number: string; }[]; } export interface ITransferOwnershipRequest { document_header_id: string; client_id: string; } export interface IFindResponse { chat_document_header_id: string; document_header_id: string; document_label: string; total: number; emission_date: string; line_count: number; is_void: boolean; is_archived: boolean; adjudicado: boolean; tags: string | null; } export type IUpdateManyWithPersona = { id: string; owner_id?: string; owner_name?: string | null; name: string | null; telephone: string | null; email: string | null; street: string | null; postal_code: string | null; locality: string | null; country_id: string | null; country_name: string | null; }; export interface ISendClientNotificationRequest { name: string; email: string; dontSendEmail?: boolean; } export interface IDocumentPdfRequest { token?: string; } export interface IFindByTypeRequest { documentTypeCodes: IDocumentType.IDocumentTypeCodeType[]; } export interface IFindByTypeLine { document_line_id: string; quantity: number; notes: DocumentLineNote[]; total_without_tax: number; total: number; product_id: string | null; designation: string | null; reference: string | null; measure: string | null; thumbnail: string | null; } export interface IFindByTypeResponse { document_header_id: string; document_name: string; pdf_link: string | null; owner_number: number; billing_persona_name: string | null; emission_date: string; created_by: string; lines: IFindByTypeLine[]; } export interface IDocumentListRequest { closed: boolean; } export interface IDocumentListResponse { user_type: IDocumentType.IDocumentTypeUserType; emission_date: Date; virtual_name: string; id: string; billing_persona_name: string | null; billing_persona_nif: string | null; owner_number: number; owner_id: string; quantity: number; stock_in: boolean; stock_out: boolean; cativado: boolean; adjudicated: boolean; } export declare const IWarningEnum: { AvisoTotal: 'AvisoTotal'; AvisoParcial: 'AvisoParcial'; SemAviso: 'SemAviso'; }; export type IWarningType = (typeof IWarningEnum)[keyof typeof IWarningEnum]; export declare const IWarningType: string[]; export interface IFindStartDocumentHeaderSiblingsResponse { next: string | null; previous: string | null; } export interface IRepository { findOne(selector: IShared.IFindByIdRequest): Promise; findStartVirtual(selector: IShared.IFindByIdRequest): Promise; findByType(params: IFindByTypeRequest): Promise; findByBasicSearch(data: IBasicSearchRequest): Promise>; find(params: IFindRequest): Promise; getActions(selector: IShared.IFindByIdRequest): Promise; create(data: ICreateRequest): Promise; createFromHeader(data: ICreateFromHeaderRequest): Promise; update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise; updateManyWithPersona(params: IUpdateManyWithPersona): Promise; transferClientOwnership(params: ITransferOwnershipRequest): Promise; deleteOne(selector: IShared.IFindByIdRequest): Promise; sendClientNotification(selector: IShared.IFindByIdRequest, data: ISendClientNotificationRequest): Promise; markUnsentClientNotification(selector: IShared.IFindByIdRequest): Promise; documentPdf(selector: IShared.IFindByIdRequest, data: IDocumentPdfRequest): Promise; documentThermalPrint(selector: IShared.IFindByIdRequest): Promise; documentList(selector: IShared.IFindByIdRequest, params: IDocumentListRequest): Promise; findStartDocumentHeaderSiblings(params: IShared.IFindByIdRequest): Promise; createSiteProposal(data: IShared.IBrokerTopicPayload[typeof IShared.IBrokerTopic.create_site_proposal]): Promise; } export type IController = IShared.IEntityWithUserToken;