import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import type { CallContext, CallOptions } from "nice-grpc-common";
import type { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors";
import { Any } from "../../google/protobuf/any";
import { BillingAddress, ShippingAddress } from "./address";
import { Amount } from "./amount";
import { Attribute } from "./attribute";
import { Subject } from "./auth";
import { CustomerType } from "./customer";
import { FulfillmentInvoiceSection, FulfillmentListResponse, FulfillmentResponse } from "./fulfillment";
import { FulfillmentSolutionListResponse, Preferences } from "./fulfillment_product";
import { InvoiceListResponse, InvoiceResponse } from "./invoice";
import { Meta } from "./meta";
import { Price } from "./price";
import { DeleteRequest, DeleteResponse, ReadRequest } from "./resource_base";
import { OperationStatus, Status, StatusListResponse } from "./status";
export declare const protobufPackage = "io.restorecommerce.order";
export declare enum OrderState {
    PENDING = "PENDING",
    SUBMITTED = "SUBMITTED",
    COMPLETED = "COMPLETED",
    CANCELLED = "CANCELLED",
    WITHDRAWN = "WITHDRAWN",
    INVALID = "INVALID",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function orderStateFromJSON(object: any): OrderState;
export declare function orderStateToJSON(object: OrderState): string;
export declare function orderStateToNumber(object: OrderState): number;
export declare enum FulfillmentInvoiceMode {
    INCLUDE = "INCLUDE",
    EXCLUDE = "EXCLUDE",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function fulfillmentInvoiceModeFromJSON(object: any): FulfillmentInvoiceMode;
export declare function fulfillmentInvoiceModeToJSON(object: FulfillmentInvoiceMode): string;
export declare function fulfillmentInvoiceModeToNumber(object: FulfillmentInvoiceMode): number;
export interface Event {
    id?: string | undefined;
    code?: number | undefined;
    message?: string | undefined;
    timestamp?: Date | undefined;
    state?: OrderState | undefined;
    attibutes?: Attribute[] | undefined;
}
export interface Item {
    id?: string | undefined;
    product_id?: string | undefined;
    variant_id?: string | undefined;
    parent_item_id?: string | undefined;
    quantity?: number | undefined;
    /** Set by service */
    unit_price?: Price | undefined;
    /** Set by service */
    amount?: Amount | undefined;
}
/** Database Entity */
export interface Order {
    id?: string | undefined;
    meta?: Meta | undefined;
    user_id?: string | undefined;
    customer_id?: string | undefined;
    shop_id?: string | undefined;
    items?: Item[] | undefined;
    /** Set by service */
    order_state?: OrderState | undefined;
    /** Set by service --- repeated in case of variant currency? */
    total_amounts?: Amount[] | undefined;
    shipping_address?: ShippingAddress | undefined;
    billing_address?: BillingAddress | undefined;
    notification_email?: string | undefined;
    customer_order_nr?: string | undefined;
    customer_remark?: string | undefined;
    customer_type?: CustomerType | undefined;
    customer_vat_id?: string | undefined;
    packaging_preferences?: Preferences | undefined;
    payment_method_id?: string | undefined;
    history?: Event[] | undefined;
}
export interface OrderIdList {
    ids?: string[] | undefined;
    subject?: Subject | undefined;
}
export interface OrderList {
    items?: Order[] | undefined;
    total_count?: number | undefined;
    subject?: Subject | undefined;
}
export interface OrderSubmitListResponse {
    orders?: OrderResponse[] | undefined;
    fulfillments?: FulfillmentResponse[] | undefined;
    invoices?: InvoiceResponse[] | undefined;
    operation_status?: OperationStatus | undefined;
}
export interface OrderListResponse {
    items?: OrderResponse[] | undefined;
    total_count?: number | undefined;
    operation_status?: OperationStatus | undefined;
}
export interface OrderResponse {
    payload?: Order | undefined;
    status?: Status | undefined;
}
export interface Deleted {
    id?: string | undefined;
}
export interface FulfillmentRequest {
    order_id?: string | undefined;
    export_type?: string | undefined;
    export_description?: string | undefined;
    invoice_number?: string | undefined;
    sender_address?: ShippingAddress | undefined;
    /** select all on empty */
    selected_items?: string[] | undefined;
    data?: Any | undefined;
}
export interface FulfillmentRequestList {
    items?: FulfillmentRequest[] | undefined;
    total_count?: number | undefined;
    subject?: Subject | undefined;
}
export interface OrderingInvoiceSection {
    order_id?: string | undefined;
    /** select all on empty */
    selected_items?: string[] | undefined;
    fulfillment_mode?: FulfillmentInvoiceMode | undefined;
    /** includes all on empty */
    selected_fulfillments?: FulfillmentInvoiceSection[] | undefined;
}
export interface OrderingInvoiceRequest {
    /** if given */
    invoice_number?: string | undefined;
    payment_hints?: string[] | undefined;
    sections?: OrderingInvoiceSection[] | undefined;
}
export interface OrderingInvoiceRequestList {
    items?: OrderingInvoiceRequest[] | undefined;
    total_count?: number | undefined;
    subject?: Subject | undefined;
}
export declare const Event: MessageFns<Event>;
export declare const Item: MessageFns<Item>;
export declare const Order: MessageFns<Order>;
export declare const OrderIdList: MessageFns<OrderIdList>;
export declare const OrderList: MessageFns<OrderList>;
export declare const OrderSubmitListResponse: MessageFns<OrderSubmitListResponse>;
export declare const OrderListResponse: MessageFns<OrderListResponse>;
export declare const OrderResponse: MessageFns<OrderResponse>;
export declare const Deleted: MessageFns<Deleted>;
export declare const FulfillmentRequest: MessageFns<FulfillmentRequest>;
export declare const FulfillmentRequestList: MessageFns<FulfillmentRequestList>;
export declare const OrderingInvoiceSection: MessageFns<OrderingInvoiceSection>;
export declare const OrderingInvoiceRequest: MessageFns<OrderingInvoiceRequest>;
export declare const OrderingInvoiceRequestList: MessageFns<OrderingInvoiceRequestList>;
export type OrderServiceDefinition = typeof OrderServiceDefinition;
export declare const OrderServiceDefinition: {
    readonly name: "OrderService";
    readonly fullName: "io.restorecommerce.order.OrderService";
    readonly methods: {
        readonly read: {
            readonly name: "Read";
            readonly requestType: typeof ReadRequest;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        readonly create: {
            readonly name: "Create";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly update: {
            readonly name: "Update";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly upsert: {
            readonly name: "Upsert";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly evaluate: {
            readonly name: "Evaluate";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        readonly submit: {
            readonly name: "Submit";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof OrderSubmitListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly withdraw: {
            readonly name: "Withdraw";
            readonly requestType: typeof OrderIdList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly cancel: {
            readonly name: "Cancel";
            readonly requestType: typeof OrderIdList;
            readonly requestStream: false;
            readonly responseType: typeof OrderListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly delete: {
            readonly name: "Delete";
            readonly requestType: typeof DeleteRequest;
            readonly requestStream: false;
            readonly responseType: typeof DeleteResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Requires Notification Service - (re)sends current order state as email notification. */
        readonly notify: {
            readonly name: "Notify";
            readonly requestType: typeof OrderIdList;
            readonly requestStream: false;
            readonly responseType: typeof StatusListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Requires Fulfillment Service */
        readonly queryFulfillmentSolution: {
            readonly name: "QueryFulfillmentSolution";
            readonly requestType: typeof FulfillmentRequestList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentSolutionListResponse;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        /**
         * Requires Fulfillment Service
         * Evaluates plausibility of the Fulfillment that would result from given order.
         */
        readonly evaluateFulfillment: {
            readonly name: "EvaluateFulfillment";
            readonly requestType: typeof OrderList;
            readonly requestStream: false;
            readonly responseType: typeof StatusListResponse;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        /** Requires Fulfillment Service */
        readonly createFulfillment: {
            readonly name: "CreateFulfillment";
            readonly requestType: typeof FulfillmentRequestList;
            readonly requestStream: false;
            readonly responseType: typeof FulfillmentListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Requires Invoice Service */
        readonly createInvoice: {
            readonly name: "CreateInvoice";
            readonly requestType: typeof OrderingInvoiceRequestList;
            readonly requestStream: false;
            readonly responseType: typeof InvoiceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
    };
};
export interface OrderServiceImplementation<CallContextExt = {}> {
    read(request: ReadRequest, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    create(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    update(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    upsert(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    evaluate(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    submit(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderSubmitListResponse>>;
    withdraw(request: OrderIdList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    cancel(request: OrderIdList, context: CallContext & CallContextExt): Promise<DeepPartial<OrderListResponse>>;
    delete(request: DeleteRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DeleteResponse>>;
    /** Requires Notification Service - (re)sends current order state as email notification. */
    notify(request: OrderIdList, context: CallContext & CallContextExt): Promise<DeepPartial<StatusListResponse>>;
    /** Requires Fulfillment Service */
    queryFulfillmentSolution(request: FulfillmentRequestList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentSolutionListResponse>>;
    /**
     * Requires Fulfillment Service
     * Evaluates plausibility of the Fulfillment that would result from given order.
     */
    evaluateFulfillment(request: OrderList, context: CallContext & CallContextExt): Promise<DeepPartial<StatusListResponse>>;
    /** Requires Fulfillment Service */
    createFulfillment(request: FulfillmentRequestList, context: CallContext & CallContextExt): Promise<DeepPartial<FulfillmentListResponse>>;
    /** Requires Invoice Service */
    createInvoice(request: OrderingInvoiceRequestList, context: CallContext & CallContextExt): Promise<DeepPartial<InvoiceListResponse>>;
}
export interface OrderServiceClient<CallOptionsExt = {}> {
    read(request: DeepPartial<ReadRequest>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    create(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    update(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    upsert(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    evaluate(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    submit(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<OrderSubmitListResponse>;
    withdraw(request: DeepPartial<OrderIdList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    cancel(request: DeepPartial<OrderIdList>, options?: CallOptions & CallOptionsExt): Promise<OrderListResponse>;
    delete(request: DeepPartial<DeleteRequest>, options?: CallOptions & CallOptionsExt): Promise<DeleteResponse>;
    /** Requires Notification Service - (re)sends current order state as email notification. */
    notify(request: DeepPartial<OrderIdList>, options?: CallOptions & CallOptionsExt): Promise<StatusListResponse>;
    /** Requires Fulfillment Service */
    queryFulfillmentSolution(request: DeepPartial<FulfillmentRequestList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentSolutionListResponse>;
    /**
     * Requires Fulfillment Service
     * Evaluates plausibility of the Fulfillment that would result from given order.
     */
    evaluateFulfillment(request: DeepPartial<OrderList>, options?: CallOptions & CallOptionsExt): Promise<StatusListResponse>;
    /** Requires Fulfillment Service */
    createFulfillment(request: DeepPartial<FulfillmentRequestList>, options?: CallOptions & CallOptionsExt): Promise<FulfillmentListResponse>;
    /** Requires Invoice Service */
    createInvoice(request: DeepPartial<OrderingInvoiceRequestList>, options?: CallOptions & CallOptionsExt): Promise<InvoiceListResponse>;
}
type ProtoMetaMessageOptions = {
    options?: {
        [key: string]: any;
    };
    fields?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    oneof?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    nested?: {
        [key: string]: ProtoMetaMessageOptions;
    };
};
export interface ProtoMetadata {
    fileDescriptor: FileDescriptorProto1;
    references: {
        [key: string]: any;
    };
    dependencies?: ProtoMetadata[];
    options?: {
        options?: {
            [key: string]: any;
        };
        services?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                methods?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
        messages?: {
            [key: string]: ProtoMetaMessageOptions;
        };
        enums?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                values?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
    };
}
export declare const protoMetadata: ProtoMetadata;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
    encode(message: T, writer?: BinaryWriter): BinaryWriter;
    decode(input: BinaryReader | Uint8Array, length?: number): T;
    fromJSON(object: any): T;
    toJSON(message: T): unknown;
    create(base?: DeepPartial<T>): T;
    fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=order.d.ts.map