{"version":3,"file":"g2-common-invoice-repository.mjs","sources":["../../../projects/invoice-repository/src/lib/invoice.model.ts","../../../projects/invoice-repository/src/lib/http.service.ts","../../../projects/invoice-repository/src/lib/invoice.service.ts","../../../projects/invoice-repository/src/lib/invoice.repository.ts","../../../projects/invoice-repository/src/lib/invoice.module.ts","../../../projects/invoice-repository/src/public-api.ts","../../../projects/invoice-repository/src/g2-common-invoice-repository.ts"],"sourcesContent":["import { CbmSalePriceModel } from '@g2-common/sale-price-repository';\r\n\r\nexport namespace CbmInvoiceModel {\r\n  // #region common\r\n  export type DetailType = 'item' | 'service' | 'kit' | 'outsourcing_service';\r\n\r\n  export enum EPaymentTerm {\r\n    CREDIT = 'credit',\r\n    DEBIT = 'debit',\r\n  }\r\n\r\n  export enum EInvoiceType {\r\n    GENERAL = 'general',\r\n    EXPORT = 'export',\r\n  }\r\n\r\n  export namespace EPaymentTerm {\r\n    export function fromString(value: string): EPaymentTerm {\r\n      switch (value) {\r\n        case 'credit':\r\n          return EPaymentTerm.CREDIT;\r\n        case 'debit':\r\n          return EPaymentTerm.DEBIT;\r\n        default:\r\n          throw new Error(`Invalid value ${value}`);\r\n      }\r\n    }\r\n\r\n    export function toString(value: EPaymentTerm): TPaymentTerm {\r\n      switch (value) {\r\n        case EPaymentTerm.CREDIT:\r\n          return 'credit';\r\n        case EPaymentTerm.DEBIT:\r\n          return 'debit';\r\n        default:\r\n          throw new Error(`Invalid value ${value}`);\r\n      }\r\n    }\r\n  }\r\n\r\n  export type TPaymentTerm = `${EPaymentTerm}`;\r\n  export type TInvoiceType = `${EInvoiceType}`;\r\n\r\n  // #region list\r\n  export interface ListParams {\r\n    page: number;\r\n    size: number;\r\n    reverse_status?: boolean;\r\n    company_branch_id?: string;\r\n    user_id?: string;\r\n    to_date?: number;\r\n    from_date?: number;\r\n    enabled?: boolean;\r\n    export?: boolean;\r\n    invoice_type?: TInvoiceType;\r\n    sequential?: string;\r\n    invoice_number?: string;\r\n    state?: string;\r\n    client_branch_id?: string;\r\n    client_id?: string;\r\n    seller_id?: string;\r\n    payment_term?: TPaymentTerm;\r\n  }\r\n\r\n  export interface ListResponse {\r\n    success: boolean;\r\n    pageNum: number;\r\n    pageSize: number;\r\n    pages: number;\r\n    total: number;\r\n    items: ListResponse.Item[];\r\n  }\r\n\r\n  export namespace ListResponse {\r\n    export interface Item {\r\n      _id: string;\r\n      company_id: string;\r\n      company_branch_id: string;\r\n      client_id: string;\r\n      client_category_id: string;\r\n      contact_id: string;\r\n      seller_id: string;\r\n      document_date: number;\r\n      document_nomenclature: string;\r\n      document_sequence: string;\r\n      document_number: string;\r\n      SRI_state: string;\r\n      document_state: string;\r\n      document_branch_identification_number: string;\r\n      document_emission_point_id?: string;\r\n      document_emission_point_number: string;\r\n      document_correlative: string;\r\n      authorization_number: string;\r\n      payment_term: string;\r\n      tax_base: number;\r\n      discount: number;\r\n      service: number;\r\n      commentary: string;\r\n      total: number;\r\n      price_type: string;\r\n      client_document_number: string;\r\n      client_document_code?: string;\r\n      client_trade_name: string;\r\n      client_business_name: string;\r\n      client_phone_code: string;\r\n      client_address: string;\r\n      client_cellphone: string;\r\n      client_email: string;\r\n      client_category_name?: string;\r\n      client_province_id?: string;\r\n      client_canton_id?: string;\r\n      client_parish_id?: string;\r\n      client_province_code?: string;\r\n      client_province_name?: string;\r\n      client_canton_code?: string;\r\n      client_canton_name?: string;\r\n      client_parish_code?: string;\r\n      client_parish_name?: string;\r\n      seller_full_name: string;\r\n      seller_identification_number: string;\r\n      seller_address: string;\r\n      seller_email: string[];\r\n      seller_cellphone: string;\r\n      company_NIF: string;\r\n      company_address: string;\r\n      company_trade_name: string;\r\n      company_business_name: string;\r\n      company_branch_identification_number: string;\r\n      company_branch_trade_name: string;\r\n      company_branch_logo: string;\r\n      company_branch_address: string;\r\n      company_branch_email: string;\r\n      company_branch_cellphone: string;\r\n      company_branch_phone: string;\r\n      client_branch_id: string;\r\n      client_branch_code: string;\r\n      client_branch_name: string;\r\n      client_branch_address: string;\r\n      client_branch_email: string;\r\n      client_branch_cellphone: string;\r\n      client_branch_phone: string;\r\n      client_branch_phone_code: string;\r\n      contact_identification_number: string;\r\n      contact_full_name: string;\r\n      contact_phone_code: string;\r\n      contact_cellphone: string;\r\n      contact_email: string;\r\n      default_price_list_id?: string;\r\n      default_price_list_name?: string;\r\n      default_price_list_type?: string;\r\n      default_cost_center_id?: string;\r\n      default_cost_center_code?: string;\r\n      default_cost_center_name?: string;\r\n      default_cost_center_father_code?: string;\r\n      default_cost_center_father_name?: string;\r\n      default_discount_rate?: number;\r\n      event_module_origin?: string;\r\n      collection_origin_name?: string;\r\n      collection_origin_id?: string;\r\n      document_origin_name?: string;\r\n      document_origin_number?: string;\r\n      document_origin_date?: number;\r\n      document_type?: string;\r\n      environment?: number;\r\n      SRI_identificator?: string;\r\n      SRI_message?: string;\r\n      SRI_aditional_information?: string;\r\n      SRI_response?: object;\r\n      url_authorized_document?: string;\r\n      SRI_authorization_date?: number;\r\n      credit_SRI_payment_term_id?: string;\r\n      credit_SRI_payment_term_code?: string;\r\n      enabled: boolean;\r\n      disabled_reason?: string;\r\n      created_at: number;\r\n      created_user: string;\r\n      updated_at: number;\r\n      updated_user: string;\r\n      reverse_status: boolean;\r\n      reverse_reason?: string;\r\n      reverse_at?: number;\r\n      reverse_user?: string;\r\n      invoice_credit?: number;\r\n      invoice_debit?: number;\r\n      invoice_retention?: number;\r\n      invoice_credit_note?: number;\r\n      invoice_return?: number;\r\n      invoice_balance?: number;\r\n\r\n      // this fields don't come from the server but are added by Ariel ⬇️\r\n      addItems: boolean;\r\n      checked?: boolean;\r\n    }\r\n  }\r\n\r\n  // #region get one\r\n  export interface GetOneResponse {\r\n    success: boolean;\r\n    data: GetOneResponse.Data;\r\n  }\r\n\r\n  export namespace GetOneResponse {\r\n    export interface Data {\r\n      _id?: string;\r\n      company_id?: string;\r\n      company_branch_id?: string;\r\n      client_id?: string;\r\n      client_category_id: string;\r\n      client_branch_id?: string;\r\n      contact_id?: string;\r\n      seller_id?: string;\r\n      type?: string;\r\n      document_date?: number;\r\n      document_nomenclature?: string;\r\n      document_number?: string;\r\n      SRI_state?: string;\r\n      document_state?: string;\r\n      document_branch_identification_number?: string;\r\n      document_emission_point_number?: string;\r\n      document_emission_point_id?: string;\r\n      document_sequence?: string;\r\n      authorization_number?: string;\r\n      payment_term?: string;\r\n      tax_base?: number;\r\n      tax_iva?: number;\r\n      discount?: number;\r\n      service?: number;\r\n      total?: number;\r\n      commentary?: string;\r\n      client_document_number?: string;\r\n      client_document_code?: string;\r\n      client_trade_name?: string;\r\n      client_business_name?: string;\r\n      client_phone_code?: string;\r\n      client_category_name?: string;\r\n      client_address?: string;\r\n      client_cellphone?: string;\r\n      client_email?: string;\r\n      client_branch_code?: string;\r\n      client_branch_name?: string;\r\n      client_branch_address?: string;\r\n      client_branch_email?: string;\r\n      client_branch_cellphone?: string;\r\n      client_branch_phone?: string;\r\n      client_branch_phone_code?: string;\r\n      client_province_id?: string;\r\n      client_canton_id?: string;\r\n      client_parish_id?: string;\r\n      client_province_code?: string;\r\n      client_province_name?: string;\r\n      client_canton_code?: string;\r\n      client_canton_name?: string;\r\n      client_parish_code?: string;\r\n      client_parish_name?: string;\r\n      contact_identification_number?: string;\r\n      contact_full_name?: string;\r\n      contact_phone_code?: string;\r\n      contact_cellphone?: string;\r\n      contact_email?: string;\r\n      seller_full_name?: string;\r\n      seller_identification_number?: string;\r\n      seller_address: string;\r\n      seller_email: string[];\r\n      seller_cellphone: string;\r\n      company_NIF?: string;\r\n      company_address?: string;\r\n      company_trade_name?: string;\r\n      company_business_name?: string;\r\n      company_branch_identification_number?: string;\r\n      company_branch_trade_name?: string;\r\n      company_branch_logo?: string;\r\n      company_branch_address?: string;\r\n      company_branch_email?: string;\r\n      company_branch_cellphone?: string;\r\n      company_branch_phone?: string;\r\n      default_price_list_id?: string;\r\n      default_price_list_name?: string;\r\n      default_price_list_type?: string;\r\n      default_cost_center_id?: string;\r\n      default_cost_center_code?: string;\r\n      default_cost_center_name?: string;\r\n      default_cost_center_father_code?: string;\r\n      default_cost_center_father_name?: string;\r\n      default_discount_rate?: number;\r\n      export?: boolean;\r\n      invoice_type?: TInvoiceType;\r\n      export_data?: Data.ExportData;\r\n      event_module_origin?: string;\r\n      collection_origin_name?: string;\r\n      collection_origin_id?: string;\r\n      document_origin_name?: string;\r\n      document_origin_number?: string;\r\n      document_origin_date?: number;\r\n      document_type?: string;\r\n      environment?: number;\r\n      SRI_identificator?: string;\r\n      SRI_message?: string;\r\n      SRI_aditional_information?: string;\r\n      SRI_response?: object;\r\n      url_authorized_document?: string;\r\n      SRI_authorization_date?: number;\r\n      credit_SRI_payment_term_id?: string;\r\n      credit_SRI_payment_term_code?: string;\r\n      enabled?: boolean;\r\n      disabled_reason?: string;\r\n      deleted?: boolean;\r\n      created_at?: number;\r\n      created_user?: string;\r\n      updated_at?: number;\r\n      updated_user?: string;\r\n      reverse_status: boolean;\r\n      reverse_reason?: string;\r\n      reverse_at?: number;\r\n      reverse_user?: string;\r\n      invoice_summary_article?: Data.SummaryArticle[];\r\n      invoice_detail?: Data.Detail[];\r\n      invoice_tax?: Data.Tax[];\r\n      invoice_payment_term?: Data.PaymentTerm[];\r\n      credit_management_installment?: Data.CreditManagementInstallment[];\r\n      credit_management_balance: number;\r\n      additional_information?: Data.AdditionaInformation[];\r\n      invoice_tax_declaration?: Data.TaxDeclaration[];\r\n      income_id?: Data.Income[];\r\n      related_documents?: Data.RelatedDocument[];\r\n    }\r\n\r\n    export namespace Data {\r\n      export interface SummaryArticle {\r\n        code: string;\r\n        name: string;\r\n        amount: number;\r\n        sequence: string;\r\n      }\r\n\r\n      export interface RelatedDocument {\r\n        collection_origin_id: string;\r\n        collection_origin_name: string;\r\n        document_number: string;\r\n        secuencial: string;\r\n        date: number;\r\n        total: number;\r\n        _id: string;\r\n      }\r\n      export interface TaxDeclaration {\r\n        _id: string;\r\n        configuration_id: string;\r\n        raw_code?: string;\r\n        net_code?: string;\r\n        tax_code?: string;\r\n        raw_value?: number;\r\n        net_value?: number;\r\n        tax_value?: number;\r\n        description: string;\r\n      }\r\n      export interface Income {\r\n        _id?: string;\r\n        income_id?: string;\r\n        credit_management_id?: string;\r\n        credit_management_detail_id?: string;\r\n        client_id?: string;\r\n        client_branch_id?: string;\r\n        seller_id?: string;\r\n        cost_center_id?: string;\r\n        installment?: string;\r\n        credit_document_nomenclature?: string;\r\n        credit_document_number?: string;\r\n        paid?: number;\r\n        previous_balance?: number;\r\n        subsequent_balance?: number;\r\n        client_document_number?: string;\r\n        client_trade_name?: string;\r\n        client_business_name?: string;\r\n        client_phone_code?: string;\r\n        client_address?: string;\r\n        client_cellphone?: string;\r\n        client_email?: string;\r\n        seller_identification_number?: string;\r\n        seller_full_name?: string;\r\n        seller_document_number?: string;\r\n        seller_address?: string;\r\n        seller_email?: string[];\r\n        seller_cellphone?: string;\r\n        cost_center_code?: string;\r\n        cost_center_name?: string;\r\n        client_branch_code?: string;\r\n        client_branch_name?: string;\r\n        client_branch_address?: string;\r\n        client_branch_cellphone?: string;\r\n        client_branch_phone_code?: string;\r\n        created_user?: string;\r\n        created_at?: number;\r\n      }\r\n      export interface ExportData {\r\n        export_foreign_trade: string;\r\n        export_buyer_address: string;\r\n        export_country_origin_id: string;\r\n        export_country_origin_name: string;\r\n        export_country_origin_code: string;\r\n        export_origin_port: string;\r\n        export_country_destination_id: string;\r\n        export_country_destination_name: string;\r\n        export_country_destination_code: string;\r\n        export_destination_port: string;\r\n        export_incoterm_place: string;\r\n        export_incoterm_invoice_id: string;\r\n        export_incoterm_invoice_code: string;\r\n        export_incoterm_invoice_name: string;\r\n        export_incoterm_without_taxes_id: string;\r\n        export_incoterm_without_taxes_code: string;\r\n        export_incoterm_without_taxes_name: string;\r\n        export_international_freight: number;\r\n        export_international_insurance: number;\r\n        export_customs_expenditures: number;\r\n        export_transportation_expenses: number;\r\n        export_dae?: string;\r\n        export_mawb?: string;\r\n        export_forwarder?: string;\r\n        export_cr?: string;\r\n      }\r\n\r\n      export interface PaymentTerm {\r\n        _id: string;\r\n        payment_term_id: string;\r\n        account_id?: string;\r\n        SRI_payment_term_id: string;\r\n        SRI_payment_term_code: string;\r\n        financial_bank_id?: string;\r\n        date: number;\r\n        value: number;\r\n        financial_bank_name?: string;\r\n        card_type?: string;\r\n        batch_code?: string;\r\n        bank_cheque?: string;\r\n        account_name?: string;\r\n        account_code?: string;\r\n        payment_term_code: string;\r\n        payment_term_name: string;\r\n        operation_number?: string;\r\n      }\r\n\r\n      export interface Detail {\r\n        _id: string;\r\n        invoice_id?: string;\r\n        item_id?: string;\r\n        category_id?: string;\r\n        cost_center_id?: string;\r\n        price_list_id?: string;\r\n        tax_iva_id?: string;\r\n        tax_irbpn_id?: string;\r\n        tax_ice_id?: string;\r\n        unit_measure_id?: string;\r\n        amount?: number;\r\n        amount_free?: number;\r\n        sequence?: string;\r\n        price_base?: number;\r\n        total_price?: number;\r\n        discount_rate?: number;\r\n        unit_discount?: number;\r\n        total_discount?: number;\r\n        replace_item_name?: string;\r\n        commentary_item?: string;\r\n        tax_iva_rate?: number;\r\n        item_code?: string;\r\n        item_barcode?: string;\r\n        item_name?: string;\r\n        item_balance_referal_guide?: number;\r\n        item_balance?: number;\r\n        unit_measure_name?: string;\r\n        unit_measure_abbreviation?: string;\r\n        unit_measure_group_abbreviation?: string;\r\n        unit_measure_group_id?: string;\r\n        unit_measure_group_name?: string;\r\n        unit_measure_type?: string;\r\n        unit_measure_quantity?: number;\r\n        stock_afected?: number;\r\n        in_stock?: number;\r\n        manage_by?: string;\r\n        category_name?: string;\r\n        cost_center_code?: string;\r\n        cost_center_name?: string;\r\n        cost_center_father_code?: string;\r\n        cost_center_father_name?: string;\r\n        price_list_name?: string;\r\n        type?: DetailType;\r\n        price_type?: CbmSalePriceModel.TName;\r\n        price_type_description?: string;\r\n        price_type_id?: string;\r\n        deleted?: boolean;\r\n        created_at?: number;\r\n        created_user?: string;\r\n        updated_at?: number;\r\n        updated_user?: string;\r\n        invoice_detail_tax?: Detail.Tax[];\r\n        tax_iva_code?: string;\r\n        tax_iva?: Detail.TaxIva;\r\n        outsourcing_service_data?: Detail.OutsourcingServiceData;\r\n      }\r\n\r\n      export namespace Detail {\r\n        export interface OutsourcingServiceData {\r\n          outsourcing_service_movements_id: string;\r\n          code_outsourcing_service: string;\r\n          name_outsourcing_service: string;\r\n          date_purchase_receipt: number;\r\n          structured_document_number: string;\r\n          provider_document_number: string;\r\n          provider_business_name: string;\r\n          cost: number;\r\n        }\r\n        export interface Tax {\r\n          _id: string;\r\n          invoice_detail_id: string;\r\n          type: string;\r\n          description: string;\r\n          tax_code: string;\r\n          tax_rate: number;\r\n          tax_base: number;\r\n          tax_value: number;\r\n        }\r\n\r\n        export interface TaxIva {\r\n          _id: string;\r\n          country_id?: string;\r\n          code?: string;\r\n          percentage?: number;\r\n          description?: string;\r\n          enabled?: boolean;\r\n          created_user?: string;\r\n          created_at?: number;\r\n          updated_user?: string;\r\n          updated_at?: number;\r\n        }\r\n      }\r\n\r\n      export interface Tax {\r\n        _id: string;\r\n        invoice_id: string;\r\n        description: string;\r\n        type: string;\r\n        tax_code: string;\r\n        tax_rate: number;\r\n        tax_base: number;\r\n        tax_value: number;\r\n        created_at: number;\r\n        created_user: string;\r\n        updated_at: number;\r\n        updated_user: string;\r\n      }\r\n\r\n      export interface CreditManagementInstallment {\r\n        _id: string;\r\n        credit_management_id?: string;\r\n        installment: string;\r\n        date: number;\r\n        expired_in?: number;\r\n        period?: number;\r\n        credit: number;\r\n        debit?: number;\r\n        retention?: number;\r\n        credit_note?: number;\r\n        return?: number;\r\n        balance?: number;\r\n        created_at: number;\r\n        created_user: string;\r\n        updated_at?: number;\r\n        updated_user?: string;\r\n      }\r\n\r\n      export interface AdditionaInformation {\r\n        description: string;\r\n        value: string;\r\n        type: string;\r\n      }\r\n    }\r\n  }\r\n\r\n  // #region save\r\n  export interface SaveBody {\r\n    invoice_type?: TInvoiceType;\r\n    client_id: string;\r\n    client_category_id: string;\r\n    client_branch_id?: string;\r\n    contact_id?: string;\r\n    seller_id: string;\r\n    document_type: string;\r\n    document_emission_point_number: string;\r\n    document_emission_point_id: string;\r\n    payment_term: string;\r\n    tax_base: number;\r\n    discount: number;\r\n    service: number;\r\n    total: number;\r\n    commentary: string;\r\n    client_document_number: string;\r\n    client_document_code: string;\r\n    client_trade_name: string;\r\n    client_business_name: string;\r\n    client_phone_code: string;\r\n    client_address: string;\r\n    client_cellphone: string;\r\n    client_email: string;\r\n    client_category_name: string;\r\n    seller_full_name: string;\r\n    seller_identification_number: string;\r\n    seller_address: string;\r\n    seller_email: string[];\r\n    seller_cellphone: string;\r\n    company_branch_id: string;\r\n    company_NIF: string;\r\n    company_address: string;\r\n    company_trade_name: string;\r\n    company_business_name: string;\r\n    company_required_accounting: boolean;\r\n    company_retention_agent: string;\r\n    company_special_taxpayer: string;\r\n    company_taxpayer_type: string;\r\n    company_branch_identification_number: string;\r\n    company_branch_trade_name: string;\r\n    company_branch_logo: string;\r\n    company_branch_address: string;\r\n    company_branch_email: string;\r\n    company_branch_cellphone: string;\r\n    company_branch_phone: string;\r\n    company_branch_artisanal_qualification: string;\r\n    client_branch_code?: string;\r\n    client_branch_name?: string;\r\n    client_branch_address?: string;\r\n    client_branch_email?: string;\r\n    client_branch_cellphone?: string;\r\n    client_branch_phone?: string;\r\n    client_branch_phone_code?: string;\r\n    client_province_id?: string;\r\n    client_canton_id?: string;\r\n    client_parish_id?: string;\r\n    client_province_code?: string;\r\n    client_province_name?: string;\r\n    client_canton_code?: string;\r\n    client_canton_name?: string;\r\n    client_parish_code?: string;\r\n    client_parish_name?: string;\r\n    contact_identification_number?: string;\r\n    contact_full_name?: string;\r\n    contact_phone_code?: string;\r\n    contact_cellphone?: string;\r\n    contact_email?: string;\r\n    order_id?: string;\r\n    environment: number;\r\n    default_price_list_id?: string;\r\n    default_price_list_name?: string;\r\n    default_price_list_type?: string;\r\n    default_cost_center_id?: string;\r\n    default_cost_center_code?: string;\r\n    default_cost_center_name?: string;\r\n    default_cost_center_father_code?: string;\r\n    default_cost_center_father_name?: string;\r\n    default_discount_rate?: number;\r\n    tax_base_iva: number;\r\n    tax_base_iva_rate_0: number;\r\n    tax_base_iva_exempt: number;\r\n    tax_base_iva_not_subject: number;\r\n    tax_base_irbpnr: number;\r\n    tax_base_ice: number;\r\n    tax_iva: number;\r\n    tax_irbpnr: number;\r\n    tax_ice: number;\r\n    export?: boolean;\r\n    export_data?: SaveBody.ExportData;\r\n    event_module_origin?: string;\r\n    collection_origin_name?: string;\r\n    collection_origin_id?: string;\r\n    document_origin_name?: string;\r\n    document_origin_number?: string;\r\n    document_origin_date?: number;\r\n    credit_SRI_payment_term_id?: string;\r\n    credit_SRI_payment_term_code?: string;\r\n    union_of_order_id?: string;\r\n    union_of_order_document_nomenclature?: string;\r\n    union_of_order_document_number?: string;\r\n    union_of_order_date?: number;\r\n    split_order_id?: string;\r\n    split_order_document_nomenclature?: string;\r\n    split_order_document_number?: string;\r\n    split_order_date?: number;\r\n    invoice_summary_article?: SaveBody.SummaryArticle[];\r\n    invoice_detail: SaveBody.Detail[];\r\n    invoice_tax: SaveBody.Tax[];\r\n    invoice_installment: SaveBody.Installment[];\r\n    invoice_payment_term?: SaveBody.PaymentTerm[];\r\n    additional_information?: SaveBody.AdditionaInformation[];\r\n    invoice_tax_declaration: SaveBody.TaxDeclaration[];\r\n  }\r\n\r\n  export namespace SaveBody {\r\n    export interface SummaryArticle {\r\n      code: string;\r\n      name: string;\r\n      amount: number;\r\n      sequence: string;\r\n    }\r\n    export interface ExportData {\r\n      export_foreign_trade: string;\r\n      export_buyer_address: string;\r\n      export_country_origin_id: string;\r\n      export_country_origin_name: string;\r\n      export_country_origin_code: string;\r\n      export_origin_port: string;\r\n      export_country_destination_id: string;\r\n      export_country_destination_name: string;\r\n      export_country_destination_code: string;\r\n      export_destination_port: string;\r\n      export_incoterm_place: string;\r\n      export_incoterm_invoice_id: string;\r\n      export_incoterm_invoice_code: string;\r\n      export_incoterm_invoice_name: string;\r\n      export_incoterm_without_taxes_id: string;\r\n      export_incoterm_without_taxes_code: string;\r\n      export_incoterm_without_taxes_name: string;\r\n      export_international_freight: number;\r\n      export_international_insurance: number;\r\n      export_customs_expenditures: number;\r\n      export_transportation_expenses: number;\r\n      export_dae?: string;\r\n      export_mawb?: string;\r\n      export_forwarder?: string;\r\n      export_cr?: string;\r\n    }\r\n\r\n    export interface Detail {\r\n      item_id: string;\r\n      category_id: string;\r\n      cost_center_id?: string;\r\n      price_list_id: string;\r\n      tax_iva_id: string;\r\n      tax_iva_code: string;\r\n      tax_irbpn_id?: string;\r\n      tax_ice_id?: string;\r\n      unit_measure_id?: string;\r\n      amount: number;\r\n      amount_free?: number;\r\n      sequence?: string;\r\n      price_base: number;\r\n      total_price: number;\r\n      discount_rate: number;\r\n      unit_discount: number;\r\n      total_discount: number;\r\n      commentary_item?: string | null;\r\n      replace_item_name?: string | null;\r\n      tax_iva_rate: number;\r\n      item_code: string;\r\n      item_barcode?: string;\r\n      item_name: string;\r\n      unit_measure_abbreviation?: string;\r\n      unit_measure_group_abbreviation?: string;\r\n      unit_measure_name?: string;\r\n      unit_measure_group_id?: string;\r\n      unit_measure_group_name?: string;\r\n      unit_measure_type?: string;\r\n      unit_measure_quantity?: number;\r\n      stock_afected?: number;\r\n      in_stock?: number;\r\n      manage_by?: string;\r\n      category_name: string;\r\n      cost_center_code?: string;\r\n      cost_center_name?: string;\r\n      cost_center_father_code?: string;\r\n      cost_center_father_name?: string;\r\n      price_list_name: string;\r\n      type: DetailType;\r\n      price_type?: CbmSalePriceModel.TName;\r\n      price_type_description?: string;\r\n      price_type_id?: string;\r\n      invoice_detail_tax: Detail.Tax[];\r\n      outsourcing_service_data?: Detail.OutsourcingServiceData;\r\n    }\r\n\r\n    export interface TaxDeclaration {\r\n      configuration_id: string;\r\n      raw_code?: string;\r\n      net_code?: string;\r\n      tax_code?: string;\r\n      raw_value?: number;\r\n      net_value?: number;\r\n      tax_value?: number;\r\n      description: string;\r\n    }\r\n\r\n    export interface AdditionaInformation {\r\n      description: string;\r\n      value?: string;\r\n      type: string;\r\n    }\r\n\r\n    export namespace Detail {\r\n      export interface OutsourcingServiceData {\r\n        outsourcing_service_movements_id: string;\r\n        code_outsourcing_service: string;\r\n        name_outsourcing_service: string;\r\n        date_purchase_receipt: number;\r\n        structured_document_number: string;\r\n        provider_document_number: string;\r\n        provider_business_name: string;\r\n        cost: number;\r\n      }\r\n      export interface Tax {\r\n        type: string;\r\n        description: string;\r\n        tax_code: string;\r\n        tax_rate: number;\r\n        tax_base: number;\r\n        tax_value: number;\r\n      }\r\n    }\r\n\r\n    export interface Tax {\r\n      type: string;\r\n      description: string;\r\n      tax_code: string;\r\n      tax_rate: number;\r\n      tax_base: number;\r\n      tax_value: number;\r\n    }\r\n\r\n    export interface Installment {\r\n      installment: string;\r\n      date: number;\r\n      expired_in: number;\r\n      period: number;\r\n      credit: number;\r\n    }\r\n\r\n    export interface PaymentTerm {\r\n      payment_term_id: string;\r\n      account_id?: string;\r\n      SRI_payment_term_id: string;\r\n      SRI_payment_term_code: string;\r\n      financial_bank_id?: string;\r\n      date: number;\r\n      value: number;\r\n      financial_bank_name?: string;\r\n      card_type?: string;\r\n      batch_code?: string;\r\n      account_name?: string;\r\n      account_code?: string;\r\n      bank_cheque?: string;\r\n      payment_term_code: string;\r\n      payment_term_name: string;\r\n      operation_number?: string;\r\n    }\r\n  }\r\n\r\n  // #region download excel\r\n  export interface DownloadExcelParams {\r\n    payment_term?: TPaymentTerm;\r\n    to_date?: number;\r\n    from_date?: number;\r\n    enabled?: boolean;\r\n    sequential?: string;\r\n    invoice_number?: string;\r\n    state?: string;\r\n    client_branch_id?: string;\r\n    client_id?: string;\r\n    export?: boolean;\r\n    invoice_type?: TInvoiceType;\r\n    reverse_status?: boolean;\r\n  }\r\n\r\n  // #region list last movements\r\n\r\n  export interface ListLastMovementsParams {\r\n    page: number;\r\n    size: number;\r\n    client_id: string;\r\n    item_id: string;\r\n  }\r\n\r\n  export interface ListLastMovementsResponse {\r\n    success: boolean;\r\n    pageNum: number;\r\n    pageSize: number;\r\n    pages: number;\r\n    total: number;\r\n    items: ListLastMovementsResponse.Item[];\r\n    totalAmount: ListLastMovementsResponse.TotalAmount;\r\n  }\r\n\r\n  export namespace ListLastMovementsResponse {\r\n    export interface TotalAmount {\r\n      _id: string;\r\n      sum_amount: number;\r\n      sum_price_base: number;\r\n      sum_total_price: number;\r\n      sum_discount_rate: number;\r\n      sum_unit_discount: number;\r\n      sum_total_discount: number;\r\n    }\r\n    export interface Item {\r\n      _id: string;\r\n      collection_origin_name: string;\r\n      collection_origin_id: string;\r\n      company_id: string;\r\n      company_branch_id: string;\r\n      country_id: string;\r\n      item_id: string;\r\n      category_id: string;\r\n      cost_center_id: string;\r\n      price_list_id: string;\r\n      tax_iva_id: string;\r\n      unit_measure_id: string;\r\n      type: string;\r\n      manage_by: string;\r\n      amount: number;\r\n      price_base: number;\r\n      total_price: number;\r\n      discount_rate: number;\r\n      unit_discount: number;\r\n      total_discount: number;\r\n      commentary_item: null;\r\n      replace_item_name: null;\r\n      tax_iva_code: string;\r\n      tax_iva_rate: number;\r\n      item_code: string;\r\n      item_barcode: string;\r\n      item_name: string;\r\n      unit_measure_type: string;\r\n      unit_measure_abbreviation: string;\r\n      unit_measure_name: string;\r\n      unit_measure_quantity: number;\r\n      stock_afected: number;\r\n      category_name: string;\r\n      cost_center_code: string;\r\n      cost_center_name: string;\r\n      cost_center_father_code: string;\r\n      cost_center_father_name: string;\r\n      price_list_name: string;\r\n      price_type: string;\r\n      price_type_description: string;\r\n      price_type_id: string;\r\n      returned_items: number;\r\n      item_balance: number;\r\n      item_balance_referal_guide: number;\r\n      deleted: boolean;\r\n      created_at: number;\r\n      created_user: string;\r\n      document_nomenclature: string;\r\n      document_number: string;\r\n      document_branch_identification_number: string;\r\n      document_emission_point_number: string;\r\n      document_sequence: string;\r\n      client_document_code: string;\r\n      client_document_number: string;\r\n      client_trade_name: string;\r\n      client_business_name: string;\r\n      client_phone_code: string;\r\n      client_address: string;\r\n      client_cellphone: string;\r\n      client_email: string;\r\n      client_category_name: string;\r\n    }\r\n  }\r\n\r\n  // #region list without retention\r\n  export interface ListWithoutRetentionParams {\r\n    page: number;\r\n    size: number;\r\n    client_id: string;\r\n    date_end?: number;\r\n    date_begin?: number;\r\n    invoice_number?: string;\r\n    payment_term?: string;\r\n    branch_emission_point_sequence?: string;\r\n    nomenclature_number?: string;\r\n  }\r\n\r\n  export interface ListWithoutRetentionResponse {\r\n    success: boolean;\r\n    pageNum: number;\r\n    pageSize: number;\r\n    pages: number;\r\n    total: number;\r\n    items: ListWithoutRetentionResponse.Item[];\r\n  }\r\n\r\n  export namespace ListWithoutRetentionResponse {\r\n    export interface Item {\r\n      _id: string;\r\n      company_id: string;\r\n      company_branch_id: string;\r\n      client_id: string;\r\n      client_branch_id: string;\r\n      contact_id: string;\r\n      seller_id: string;\r\n      document_nomenclature: string;\r\n      document_number: string;\r\n      document_date: number;\r\n      SRI_state: string;\r\n      document_branch_identification_number: string;\r\n      document_emission_point_number: string;\r\n      document_sequence: string;\r\n      authorization_number: string;\r\n      payment_term: string;\r\n      tax_base: number;\r\n      discount: number;\r\n      service: number;\r\n      commentary: string;\r\n      tax_base_iva: number;\r\n      tax_base_iva_rate_0: number;\r\n      tax_base_iva_exempt: number;\r\n      tax_base_iva_not_subject: number;\r\n      tax_base_irbpnr: number;\r\n      rate_iva: number;\r\n      tax_base_ice: number;\r\n      tax_iva: number;\r\n      code_iva: string;\r\n      tax_irbpnr: number;\r\n      tax_ice: number;\r\n      total: number;\r\n      price_type: string;\r\n      export?: boolean;\r\n      company_NIF: string;\r\n      company_address: string;\r\n      company_trade_name: string;\r\n      company_business_name: string;\r\n      company_branch_identification_number: string;\r\n      company_branch_trade_name: string;\r\n      company_branch_logo: string;\r\n      company_branch_address: string;\r\n      company_branch_email: string;\r\n      company_branch_cellphone: string;\r\n      company_branch_phone: string;\r\n      client_document_number: string;\r\n      client_trade_name: string;\r\n      client_business_name: string;\r\n      client_phone_code: string;\r\n      client_address: string;\r\n      client_cellphone: string;\r\n      client_email: string;\r\n      client_branch_code: string;\r\n      client_branch_name: string;\r\n      client_branch_address: string;\r\n      client_branch_email: string;\r\n      client_branch_cellphone: string;\r\n      client_branch_phone: string;\r\n      client_branch_phone_code: string;\r\n      client_category_name: string;\r\n      client_province_id?: string;\r\n      client_canton_id?: string;\r\n      client_parish_id?: string;\r\n      client_province_code?: string;\r\n      client_province_name?: string;\r\n      client_canton_code?: string;\r\n      client_canton_name?: string;\r\n      client_parish_code?: string;\r\n      client_parish_name?: string;\r\n      contact_identification_number: string;\r\n      contact_full_name: string;\r\n      contact_phone_code: string;\r\n      contact_cellphone: string;\r\n      contact_email: string;\r\n      seller_identification_number: string;\r\n      seller_full_name: string;\r\n      seller_address: string;\r\n      seller_email: string[];\r\n      seller_cellphone: string;\r\n      enabled: boolean;\r\n      created_at: number;\r\n      created_user: string;\r\n      reverse_status: boolean;\r\n      deleted_at: number;\r\n      default_price_list_id?: string;\r\n      default_price_list_name?: string;\r\n      default_price_list_type?: string;\r\n      default_cost_center_id?: string;\r\n      default_cost_center_code?: string;\r\n      default_cost_center_name?: string;\r\n      default_cost_center_father_code?: string;\r\n      default_cost_center_father_name?: string;\r\n      default_warehouse_id: string;\r\n      default_discount_rate: number;\r\n      credit_management: Item.CreditManagement;\r\n    }\r\n\r\n    export namespace Item {\r\n      export interface CreditManagement {\r\n        _id: string;\r\n        client_id: string;\r\n        invoice_id: string;\r\n        credit: number;\r\n        debit: number;\r\n        retention: number;\r\n        return: number;\r\n        balance: number;\r\n      }\r\n    }\r\n  }\r\n\r\n  // #region send email\r\n  export interface SendEmailParams {\r\n    timezone: string;\r\n    locale: string;\r\n    emails?: string;\r\n  }\r\n\r\n  // #region change status\r\n  export interface ChangeStatusBody {\r\n    enabled: boolean;\r\n    disabled_reason?: string;\r\n  }\r\n\r\n  // #region confirm\r\n  export interface ConfirmResponse {\r\n    success: boolean;\r\n    message: string;\r\n    data?: any;\r\n  }\r\n\r\n  // #region download individual pdf\r\n  export interface DownloadIndividualPdfParams {\r\n    timezone: string;\r\n    locale: string;\r\n  }\r\n\r\n  // #region download individual excel\r\n  export interface DownloadIndividualExcelParams {\r\n    timezone: string;\r\n    locale: string;\r\n  }\r\n\r\n  // #region create xml\r\n  export interface CreateXmlParams {\r\n    timezone: string;\r\n    locale: string;\r\n  }\r\n}\r\n","import {\r\n  HttpBackend,\r\n  HttpClient,\r\n  HttpErrorResponse,\r\n  HttpEvent,\r\n  HttpHandler,\r\n  HttpInterceptor,\r\n  HttpRequest,\r\n} from '@angular/common/http';\r\nimport { Inject, Injectable, InjectionToken, Injector } from '@angular/core';\r\nimport { Observable, catchError } from 'rxjs';\r\nimport {\r\n  ICbmInvoiceModuleConfig,\r\n  INVOICE_MODULE_CONFIG,\r\n} from './invoice.module';\r\nimport { Router } from '@angular/router';\r\n\r\nclass InvoiceHttpInterceptorHandler implements HttpHandler {\r\n  constructor(\r\n    private next: HttpHandler,\r\n    private interceptor: HttpInterceptor,\r\n  ) {}\r\n\r\n  handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\r\n    return this.interceptor.intercept(req, this.next);\r\n  }\r\n}\r\n\r\nclass InvoiceHandlerService implements HttpHandler {\r\n  private chain: HttpHandler | null = null;\r\n\r\n  constructor(\r\n    private backend: HttpBackend,\r\n    private injector: Injector,\r\n    private interceptors: InjectionToken<HttpInterceptor[]>,\r\n  ) {}\r\n\r\n  handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\r\n    if (this.chain === null) {\r\n      const interceptors = this.injector.get(this.interceptors, []);\r\n\r\n      this.chain = interceptors.reduceRight(\r\n        (next, interceptor) =>\r\n          new InvoiceHttpInterceptorHandler(next, interceptor),\r\n        this.backend,\r\n      );\r\n    }\r\n\r\n    return this.chain.handle(req);\r\n  }\r\n}\r\n\r\nexport const INVOICE_HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>(\r\n  'INVOICE_HTTP_INTERCEPTORS',\r\n);\r\n\r\n@Injectable()\r\nexport class InvoiceHttpService extends HttpClient {\r\n  constructor(\r\n    backend: HttpBackend,\r\n    private injector: Injector,\r\n  ) {\r\n    super(\r\n      new InvoiceHandlerService(backend, injector, INVOICE_HTTP_INTERCEPTORS),\r\n    );\r\n  }\r\n}\r\n\r\n@Injectable()\r\nexport class InvoiceAuthInterceptor implements HttpInterceptor {\r\n  constructor(\r\n    @Inject(INVOICE_MODULE_CONFIG)\r\n    private moduleConfig: ICbmInvoiceModuleConfig,\r\n    private router: Router,\r\n  ) {}\r\n\r\n  intercept(\r\n    req: HttpRequest<any>,\r\n    next: HttpHandler,\r\n  ): Observable<HttpEvent<any>> {\r\n    const authToken = localStorage.getItem('tokenGlobal');\r\n    const { baseUrl } = this.moduleConfig;\r\n\r\n    const update: Parameters<typeof req.clone>[0] = {\r\n      url: `${baseUrl}/${req.url}`,\r\n    };\r\n\r\n    if (authToken) {\r\n      update.headers = req.headers.set('Authorization', `Bearer ${authToken}`);\r\n    }\r\n\r\n    const authReq = req.clone(update);\r\n\r\n    return next.handle(authReq).pipe(\r\n      catchError((error) => {\r\n        if (error instanceof HttpErrorResponse && error.status === 401) {\r\n          this.router.navigate(['auth', 'login']);\r\n        }\r\n\r\n        throw error;\r\n      }),\r\n    );\r\n  }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { InvoiceHttpService } from './http.service';\r\nimport { CbmInvoiceModel } from './invoice.model';\r\nimport { Observable } from 'rxjs';\r\nimport { HttpResponse } from '@angular/common/http';\r\n\r\n@Injectable()\r\nexport class CbmInvoiceService {\r\n  constructor(private http: InvoiceHttpService) {}\r\n\r\n  list(params: CbmInvoiceModel.ListParams): Observable<CbmInvoiceModel.ListResponse> {\r\n    return this.http.get<CbmInvoiceModel.ListResponse>('', {\r\n      params: params as any,\r\n    });\r\n  }\r\n\r\n  getOne(id: string): Observable<CbmInvoiceModel.GetOneResponse> {\r\n    return this.http.get<CbmInvoiceModel.GetOneResponse>(id);\r\n  }\r\n\r\n  save(data: CbmInvoiceModel.SaveBody): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.http.post<CbmInvoiceModel.ConfirmResponse>('', data);\r\n  }\r\n\r\n  changeStatus(\r\n    id: string,\r\n    data: CbmInvoiceModel.ChangeStatusBody,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.http.put<CbmInvoiceModel.ConfirmResponse>(`change-status/${id}`, data);\r\n  }\r\n\r\n  downloadExcel(params: CbmInvoiceModel.DownloadExcelParams): Observable<HttpResponse<Blob>> {\r\n    return this.http.get<Blob>('download/excel', {\r\n      params: params as any,\r\n      observe: 'response',\r\n      responseType: 'blob' as 'json',\r\n    });\r\n  }\r\n\r\n  downloadIndividualPdf(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualPdfParams,\r\n  ): Observable<HttpResponse<Blob>> {\r\n    return this.http.get<Blob>(`download/pdf/individual/${id}`, {\r\n      params: params as any,\r\n      observe: 'response',\r\n      responseType: 'blob' as 'json',\r\n    });\r\n  }\r\n\r\n  downloadIndividualExcel(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualExcelParams,\r\n  ): Observable<HttpResponse<Blob>> {\r\n    return this.http.get<Blob>(`download/excel/individual/${id}`, {\r\n      params: params as any,\r\n      observe: 'response',\r\n      responseType: 'blob' as 'json',\r\n    });\r\n  }\r\n\r\n  sendEmail(\r\n    id: string,\r\n    params?: CbmInvoiceModel.SendEmailParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.http.get<CbmInvoiceModel.ConfirmResponse>(`sent-email/${id}`, {\r\n      params: params as any,\r\n    });\r\n  }\r\n\r\n  listWithoutRetention(\r\n    params: CbmInvoiceModel.ListWithoutRetentionParams,\r\n  ): Observable<CbmInvoiceModel.ListWithoutRetentionResponse> {\r\n    return this.http.get<CbmInvoiceModel.ListWithoutRetentionResponse>(\r\n      'list/invoice-for-retention',\r\n      {\r\n        params: params as any,\r\n      },\r\n    );\r\n  }\r\n\r\n  listLastMovements(\r\n    params: CbmInvoiceModel.ListLastMovementsParams,\r\n  ): Observable<CbmInvoiceModel.ListLastMovementsResponse> {\r\n    return this.http.get<CbmInvoiceModel.ListLastMovementsResponse>('last-movement/inventory', {\r\n      params: params as any,\r\n    });\r\n  }\r\n\r\n  generateOrRegenerateSeat(invoiceId: string): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.http.get<CbmInvoiceModel.ConfirmResponse>(\r\n      `generate-or-regenerate-seat/${invoiceId}`,\r\n    );\r\n  }\r\n\r\n  createXml(\r\n    id: string,\r\n    params: CbmInvoiceModel.CreateXmlParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.http.get<CbmInvoiceModel.ConfirmResponse>(`create-xml/${id}`, {\r\n      params: params as any,\r\n    });\r\n  }\r\n\r\n  downloadXml(id: string): Observable<HttpResponse<Blob>> {\r\n    return this.http.get<Blob>(`download-xml/${id}`, {\r\n      observe: 'response',\r\n      responseType: 'blob' as 'json',\r\n    });\r\n  }\r\n}\r\n","import { Observable } from 'rxjs';\r\nimport { CbmInvoiceModel } from './invoice.model';\r\nimport { HttpResponse } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { CbmInvoiceService } from './invoice.service';\r\n\r\nexport interface ICbmInvoiceRepository {\r\n  list(params: CbmInvoiceModel.ListParams): Observable<CbmInvoiceModel.ListResponse>;\r\n\r\n  getOne(id: string): Observable<CbmInvoiceModel.GetOneResponse>;\r\n\r\n  save(data: CbmInvoiceModel.SaveBody): Observable<CbmInvoiceModel.ConfirmResponse>;\r\n\r\n  changeStatus(\r\n    id: string,\r\n    data: CbmInvoiceModel.ChangeStatusBody,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse>;\r\n\r\n  downloadExcel(params: CbmInvoiceModel.DownloadExcelParams): Observable<HttpResponse<Blob>>;\r\n\r\n  downloadIndividualPdf(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualPdfParams,\r\n  ): Observable<HttpResponse<Blob>>;\r\n\r\n  downloadIndividualExcel(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualExcelParams,\r\n  ): Observable<HttpResponse<Blob>>;\r\n\r\n  sendEmail(\r\n    id: string,\r\n    params: CbmInvoiceModel.SendEmailParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse>;\r\n\r\n  listWithoutRetention(\r\n    params: CbmInvoiceModel.ListWithoutRetentionParams,\r\n  ): Observable<CbmInvoiceModel.ListWithoutRetentionResponse>;\r\n\r\n  listLastMovements(\r\n    params: CbmInvoiceModel.ListLastMovementsParams,\r\n  ): Observable<CbmInvoiceModel.ListLastMovementsResponse>;\r\n\r\n  generateOrRegenerateSeat(invoiceId: string): Observable<CbmInvoiceModel.ConfirmResponse>;\r\n\r\n  createXml(\r\n    id: string,\r\n    params: CbmInvoiceModel.CreateXmlParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse>;\r\n\r\n  downloadXml(id: string): Observable<HttpResponse<Blob>>;\r\n}\r\n\r\n@Injectable()\r\nexport class CbmInvoiceRepository implements ICbmInvoiceRepository {\r\n  constructor(private service: CbmInvoiceService) {}\r\n\r\n  list(params: CbmInvoiceModel.ListParams): Observable<CbmInvoiceModel.ListResponse> {\r\n    return this.service.list(params);\r\n  }\r\n\r\n  getOne(id: string): Observable<CbmInvoiceModel.GetOneResponse> {\r\n    return this.service.getOne(id);\r\n  }\r\n\r\n  save(data: CbmInvoiceModel.SaveBody): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.service.save(data);\r\n  }\r\n\r\n  changeStatus(\r\n    id: string,\r\n    data: CbmInvoiceModel.ChangeStatusBody,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.service.changeStatus(id, data);\r\n  }\r\n\r\n  downloadExcel(params: CbmInvoiceModel.DownloadExcelParams): Observable<HttpResponse<Blob>> {\r\n    return this.service.downloadExcel(params);\r\n  }\r\n\r\n  downloadIndividualPdf(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualPdfParams,\r\n  ): Observable<HttpResponse<Blob>> {\r\n    return this.service.downloadIndividualPdf(id, params);\r\n  }\r\n\r\n  downloadIndividualExcel(\r\n    id: string,\r\n    params: CbmInvoiceModel.DownloadIndividualExcelParams,\r\n  ): Observable<HttpResponse<Blob>> {\r\n    return this.service.downloadIndividualExcel(id, params);\r\n  }\r\n\r\n  sendEmail(\r\n    id: string,\r\n    params?: CbmInvoiceModel.SendEmailParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.service.sendEmail(id, params);\r\n  }\r\n\r\n  listWithoutRetention(\r\n    params: CbmInvoiceModel.ListWithoutRetentionParams,\r\n  ): Observable<CbmInvoiceModel.ListWithoutRetentionResponse> {\r\n    return this.service.listWithoutRetention(params);\r\n  }\r\n\r\n  listLastMovements(\r\n    params: CbmInvoiceModel.ListLastMovementsParams,\r\n  ): Observable<CbmInvoiceModel.ListLastMovementsResponse> {\r\n    return this.service.listLastMovements(params);\r\n  }\r\n\r\n  generateOrRegenerateSeat(invoiceId: string): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.service.generateOrRegenerateSeat(invoiceId);\r\n  }\r\n\r\n  createXml(\r\n    id: string,\r\n    params: CbmInvoiceModel.CreateXmlParams,\r\n  ): Observable<CbmInvoiceModel.ConfirmResponse> {\r\n    return this.service.createXml(id, params);\r\n  }\r\n\r\n  downloadXml(id: string): Observable<HttpResponse<Blob>> {\r\n    return this.service.downloadXml(id);\r\n  }\r\n}\r\n","import { HttpClientModule } from '@angular/common/http';\r\nimport { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\r\nimport {\r\n  INVOICE_HTTP_INTERCEPTORS,\r\n  InvoiceAuthInterceptor,\r\n  InvoiceHttpService,\r\n} from './http.service';\r\nimport { CbmInvoiceService } from './invoice.service';\r\nimport { CbmInvoiceRepository } from './invoice.repository';\r\n\r\nexport interface ICbmInvoiceModuleConfig {\r\n  baseUrl: string;\r\n}\r\n\r\nexport const INVOICE_MODULE_CONFIG =\r\n  new InjectionToken<ICbmInvoiceModuleConfig>('INVOICE_MODULE_CONFIG');\r\n\r\n@NgModule({\r\n  imports: [HttpClientModule],\r\n})\r\nexport class CbmInvoiceModule {\r\n  static forRoot(\r\n    config: ICbmInvoiceModuleConfig,\r\n  ): ModuleWithProviders<CbmInvoiceModule> {\r\n    return {\r\n      ngModule: CbmInvoiceModule,\r\n      providers: [\r\n        InvoiceAuthInterceptor,\r\n        {\r\n          provide: INVOICE_MODULE_CONFIG,\r\n          useValue: config,\r\n        },\r\n        {\r\n          provide: INVOICE_HTTP_INTERCEPTORS,\r\n          useClass: InvoiceAuthInterceptor,\r\n          multi: true,\r\n        },\r\n        InvoiceHttpService,\r\n        CbmInvoiceService,\r\n        CbmInvoiceRepository,\r\n      ],\r\n    };\r\n  }\r\n}\r\n","/*\r\n * Public API Surface of invoice-repository\r\n */\r\n\r\nexport * from './lib/index';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.InvoiceHttpService","i1.CbmInvoiceService"],"mappings":";;;;;;;AAEM,IAAW;AAAjB,CAAA,UAAiB,eAAe,EAAA;AAI9B,IAAA,IAAY,YAGX;AAHD,IAAA,CAAA,UAAY,YAAY,EAAA;AACtB,QAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,QAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,KAAC,EAHW,YAAY,GAAZ,eAAY,CAAA,YAAA,KAAZ,4BAAY,GAGvB,EAAA,CAAA,CAAA;AAED,IAAA,IAAY,YAGX;AAHD,IAAA,CAAA,UAAY,YAAY,EAAA;AACtB,QAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,QAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,KAAC,EAHW,YAAY,GAAZ,eAAY,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