import { DeepPartial, EntityManager } from "typeorm";
import { TransactionBaseService } from "../interfaces";
import { OrderEdit } from "../models";
import { OrderEditRepository } from "../repositories/order-edit";
import { FindConfig, Selector } from "../types/common";
import { AddOrderEditLineItemInput, CreateOrderEditInput } from "../types/order-edit";
import { EventBusService, LineItemAdjustmentService, LineItemService, OrderEditItemChangeService, OrderService, TaxProviderService, TotalsService } from "./index";
declare type InjectedDependencies = {
    manager: EntityManager;
    orderEditRepository: typeof OrderEditRepository;
    orderService: OrderService;
    totalsService: TotalsService;
    lineItemService: LineItemService;
    eventBusService: EventBusService;
    taxProviderService: TaxProviderService;
    lineItemAdjustmentService: LineItemAdjustmentService;
    orderEditItemChangeService: OrderEditItemChangeService;
};
export default class OrderEditService extends TransactionBaseService {
    static readonly Events: {
        CREATED: string;
        UPDATED: string;
        DECLINED: string;
        REQUESTED: string;
        CANCELED: string;
        CONFIRMED: string;
    };
    protected readonly manager_: EntityManager;
    protected transactionManager_: EntityManager | undefined;
    protected readonly orderEditRepository_: typeof OrderEditRepository;
    protected readonly orderService_: OrderService;
    protected readonly totalsService_: TotalsService;
    protected readonly lineItemService_: LineItemService;
    protected readonly eventBusService_: EventBusService;
    protected readonly taxProviderService_: TaxProviderService;
    protected readonly lineItemAdjustmentService_: LineItemAdjustmentService;
    protected readonly orderEditItemChangeService_: OrderEditItemChangeService;
    constructor({ manager, orderEditRepository, orderService, lineItemService, eventBusService, totalsService, orderEditItemChangeService, lineItemAdjustmentService, taxProviderService, }: InjectedDependencies);
    retrieve(orderEditId: string, config?: FindConfig<OrderEdit>): Promise<OrderEdit>;
    listAndCount(selector: Selector<OrderEdit> & {
        q?: string;
    }, config?: FindConfig<OrderEdit>): Promise<[OrderEdit[], number]>;
    list(selector: Selector<OrderEdit>, config?: FindConfig<OrderEdit>): Promise<OrderEdit[]>;
    /**
     * Compute and return the different totals from the order edit id
     * @param orderEditId
     */
    getTotals(orderEditId: string): Promise<{
        shipping_total: number;
        gift_card_total: number;
        gift_card_tax_total: number;
        discount_total: number;
        tax_total: number | null;
        subtotal: number;
        difference_due: number;
        total: number;
    }>;
    create(data: CreateOrderEditInput, context: {
        createdBy: string;
    }): Promise<OrderEdit>;
    update(orderEditId: string, data: DeepPartial<OrderEdit>): Promise<OrderEdit>;
    delete(id: string): Promise<void>;
    decline(orderEditId: string, context: {
        declinedReason?: string;
        declinedBy?: string;
    }): Promise<OrderEdit>;
    /**
     * Create or update order edit item change line item and apply the quantity
     * - If the item change already exists then update the quantity of the line item as well as the line adjustments
     * - If the item change does not exist then create the item change of type update and apply the quantity as well as update the line adjustments
     * @param orderEditId
     * @param itemId
     * @param data
     */
    updateLineItem(orderEditId: string, itemId: string, data: {
        quantity: number;
    }): Promise<void>;
    removeLineItem(orderEditId: string, lineItemId: string): Promise<void>;
    refreshAdjustments(orderEditId: string): Promise<void>;
    decorateTotals(orderEdit: OrderEdit): Promise<OrderEdit>;
    addLineItem(orderEditId: string, data: AddOrderEditLineItemInput): Promise<void>;
    deleteItemChange(orderEditId: string, itemChangeId: string): Promise<void>;
    requestConfirmation(orderEditId: string, context?: {
        requestedBy?: string;
    }): Promise<OrderEdit>;
    cancel(orderEditId: string, context?: {
        canceledBy?: string;
    }): Promise<OrderEdit>;
    confirm(orderEditId: string, context?: {
        confirmedBy?: string;
    }): Promise<OrderEdit>;
    protected retrieveActive(orderId: string, config?: FindConfig<OrderEdit>): Promise<OrderEdit | undefined>;
    protected deleteClonedItems(orderEditId: string): Promise<void>;
    private static isOrderEditActive;
}
export {};
