/** * Copyright (c) 2025-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { OrderSearchStatus, type TerminalProductOrder } from '@finos/legend-server-marketplace'; import { type LegendUser } from '@finos/legend-shared'; export declare enum WorkflowStage { ORDER_PLACED = "Order Placed", MANAGER_APPROVAL = "Privilege Manager Approval", FIRST_APPROVER = "Market Data - First Approver", FULFILLMENT_APPROVER = "Market Data - Fulfillment Approver", BUSINESS_ANALYST_APPROVAL = "Market Data -Business Analyst Approval", PENDING_FULFILLMENT = "Pending Fulfillment", ORDER_FULFILLED = "Order Fulfilled" } export declare enum OrderType { PROVISION = "PROVISION", CANCELLATION = "CANCELLATION" } export declare enum WorkflowCurrentStage { DIRECT_MANAGER = "DIRECT MANAGER", FULFILLMENT_APPROVER = "MARKET DATA FULFILLMENT MANAGER", FIRST_APPROVER = "MARKET DATA FIRST APPROVER", BUSINESS_ANALYST = "BUSINESS ANALYST", RPM = "RPM" } /** * The resolved visual status of a single progress-tracker step. */ export declare enum OrderProgressStatus { COMPLETED = "completed", ACTIVE = "active", REJECTED = "rejected", PENDING = "pending" } /** * A single, ordered step of the progress tracker along with its resolved * visual status, derived from the order's workflow/approval data. */ export interface OrderProgressStep { label: string; status: OrderProgressStatus; } export interface StageActionDetails { actionedBy: string | null; actionedTimestamp: string | null; action: string | null; comment: string | null; } /** * Resolves the ordered list of progress-tracker steps (and each step's * visual status) for an order, based on its `order_type`, `bbg_terminal_flag`, * and workflow/approval action data. */ export declare const getOrderProgressSteps: (order: TerminalProductOrder) => OrderProgressStep[]; export declare const getStageActionDetails: (order: TerminalProductOrder, stageLabel: string) => StageActionDetails | undefined; export interface ClosureInfo { stageLabel: string; reason: string | null; actionedBy: string | null; actionedTimestamp: string | null; comment: string | null; } /** * Resolves the details of the last stage that actually closed a closed * (`workflow_status === COMPLETED`) order - i.e. whichever approval stage * rejected it, or (if every approval stage passed) the fulfillment/RPM stage * that completed it - rather than always assuming the Privilege Manager * stage. Returns `undefined` for orders that aren't closed. */ export declare const getClosureInfo: (order: TerminalProductOrder) => ClosureInfo | undefined; /** * Returns the tracking URL for the order's *current* workflow stage (e.g. the * Privilege Manager's URL while pending manager approval, the Business * Analyst's URL once at that stage, etc.) rather than always the Privilege * Manager's URL. Stages without a trackable URL (e.g. RPM/fulfillment) return * `null`. */ export declare const getCurrentStageTrackingUrl: (order: TerminalProductOrder) => string | null; export declare const getProcessInstanceId: (order: TerminalProductOrder) => string | null; /** * An order can be cancelled at any approval stage; once it reaches RPM * (fulfillment), it can no longer be cancelled. */ export declare const canCancelOrder: (order: TerminalProductOrder) => boolean; export declare const formatOrderDate: (dateString?: string) => string | undefined; export declare const formatTimestamp: (timestamp: string) => string; /** Bound applied by the UI (and mirrored to the backend) when "Show Last (Days)" is left blank. */ export declare const ORDER_SEARCH_DEFAULT_LAST_DAYS = 365; export declare const ORDER_SEARCH_DEFAULT_LIMIT = 100; export declare const ORDER_SEARCH_MIN_LAST_DAYS = 1; export declare const ORDER_SEARCH_MAX_LAST_DAYS = 365; /** Selectable page sizes for the advanced search results pager; `ORDER_SEARCH_DEFAULT_LIMIT` is the initial selection. */ export declare const ORDER_SEARCH_PAGE_SIZE_OPTIONS: readonly [10, 25, 50, 100]; /** * Resolves a human-readable label for a `LegendUser` selected in the advanced * search form (falls back to the raw kerberos id when no display name is * available), or `undefined` if no user was selected. */ export declare const getUserDisplayLabel: (user: LegendUser | undefined) => string | undefined; /** Human-readable label for an `OrderSearchStatus` value, for display in the advanced search form/summary. */ export declare const getOrderSearchStatusLabel: (status: OrderSearchStatus) => string; /** * Parses the raw "Show Last (Days)" text input into a valid integer within * the API's supported `1-365` range, or `undefined` if the input is blank or * out of range (in which case the backend's/UI's default applies instead). */ export declare const parseLastDaysInput: (rawValue: string) => number | undefined; /** * Whether a "Show Last (Days)" value submitted from the advanced search form * falls back to `ORDER_SEARCH_DEFAULT_LAST_DAYS` (i.e. the field was left * blank). Shared by `OrdersStore.searchOrders` (to compute the actual * `last_days` sent to the backend) and the search-summary UI (to decide * whether to render a "defaulted" notice), so the two can't drift apart. */ export declare const isLastDaysSearchDefaulted: (lastDays: number | undefined) => boolean; //# sourceMappingURL=OrderHelpers.d.ts.map