export type QPilotCoreModelsProcessingCycleStatus = 'Processing' | 'Success' | 'Failed' | 'Retry' | 'Void'; export type QPilotCoreModelsProcessingErrorCode = 99 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 2000 | 2001 | 3000 | 3001 | 3002; export type QPilotCoreModelsPreProcessingValidationResultCode = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256; export type QPilotCoreModelsProcessingLogType = 'ProcessingStart' | 'ProcessingStartManualRetry' | 'ProcessingStartAutomaticRetry' | 'ProcessingError' | 'ProcessingSuccess' | 'ProcessingStartManualContinue' | 'ProcessingInformation'; export type QPilotCoreModelsProcessingStep = 'StartPreProcessing' | 'PreProcessingError' | 'FinishedPreProcessing' | 'StartProcessing' | 'ProcessingError' | 'FinishedProcessing' | 'NotifyingErrorToClientIntegration' | 'NotifyedErrorToClientIntegration' | 'InitializingCouponsAndFeeLines' | 'CouponsAndFeeLinesInitialized' | 'CreatingClientOrder' | 'ClientOrderCreated' | 'UpdatingWooCommerceSiteMetadata' | 'WooCommerceSiteMetadaUpdated' | 'UpdatingProcessingCycleTotals' | 'ProcessingCycleTotalsUpdated' | 'UpdatingProcessingCycleMetadata' | 'ProcessingCycleMetadataUpdated' | 'CreatingPayment' | 'PaymentCreated' | 'ProcessingPayment' | 'PaymentProcessed' | 'AddingChargifyUsage' | 'ChargifyUsageAdded' | 'SendingScheduledOrderProcessedWebhook' | 'ScheduledOrderProcessedWebhookSent' | 'SendingWooCommerceNotification' | 'WooCommerceNotificationSent' | 'ScheduledOrderUpdatingCouponUsage' | 'ScheduledOrderCouponUsageUpdated' | 'ScheduledOrderUpdatingCouponAssignments' | 'ScheduledOrderCouponAssignmentsUpdated' | 'ApplyingMaps' | 'MapsApplied' | 'ScheduledOrderUpdatingItems' | 'ScheduledOrderUpdatedItems' | 'LoggingScheduledOrderFailure' | 'ScheduledOrderFailureLogged' | 'SendingFailureCustomerEmail' | 'CustomerEmailError' | 'FailureCustomerEmailSent' | 'SendingFailureMerchantEmail' | 'FailureMerchantEmailError' | 'FailureMerchantEmailSent' | 'UpdatingClientOrder' | 'ClientOrderUpdated' | 'UpdatingFailedOrder' | 'FailedOrderUpdated'; export type QPilotCoreModelsProcessingStage = 'PreProcessing' | 'ClientOrderCreation' | 'PaymentProcessing' | 'ClientOrderUpdate' | 'OtherProcessingTasks' | 'GenericProcessing'; export type QPilotCoreModelsProcessingLog = {id?: number | undefined, createdUtc: string, type: QPilotCoreModelsProcessingLogType, description: string, processingCycleId: number, processingStep?: QPilotCoreModelsProcessingStep | undefined, processingStage?: QPilotCoreModelsProcessingStage | undefined, isInternal?: boolean | undefined}; export type QPilotCoreServiceBusModelsServiceBusMessageOrigin = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type QPilotCoreModelsDtoEntitiesProcessingCycleDto = {id?: number | undefined, processingId?: (string | null) | undefined, createdUtc?: string | undefined, startDateUtc?: string | undefined, endDateUtc?: (string | null) | undefined, status?: QPilotCoreModelsProcessingCycleStatus | undefined, retryCount?: number | undefined, scheduledOrderId?: number | undefined, currencyIso?: (string | null) | undefined, total?: (number | null) | undefined, chargedTotal?: (number | null) | undefined, chargeTotalDiscount?: (number | null) | undefined, scheduledOrderFailureReason?: (string | null) | undefined, paymentGatewayTransactionId?: (string | null) | undefined, paymentGatewayResponse?: (string | null) | undefined, paymentGatewayErrorDescription?: (string | null) | undefined, paymentGatewayErrorCode?: (string | null) | undefined, clientOrderId?: (string | null) | undefined, clientOrderCreatedDateUtc?: (string | null) | undefined, processingErrorCode?: QPilotCoreModelsProcessingErrorCode | undefined, preProcessingValidationResultCode?: QPilotCoreModelsPreProcessingValidationResultCode | undefined, processingLogs?: (Array | null) | undefined, origin?: QPilotCoreServiceBusModelsServiceBusMessageOrigin | undefined, scheduledOrderTotal?: (number | null) | undefined, scheduledOrderCustomerEmail?: (string | null) | undefined, scheduledOrderLastOccurrenceUtc?: (string | null) | undefined, scheduledOrderNextOccurrenceUtc?: (string | null) | undefined, metadata?: ({[key: string]: unknown} | null) | undefined, metadataJson?: (string | null) | undefined, isRetryable?: boolean | undefined, canBeCompleted?: (boolean | null) | undefined, canBeVoid?: (boolean | null) | undefined, canBeEdited?: (boolean | null) | undefined, paymentSucceeded?: (boolean | null) | undefined}; export type CreateApiNotificationsScheduledOrdersIdNotifyProcessingStatusChangedArgs = {id: number, body: QPilotCoreModelsDtoEntitiesProcessingCycleDto}; export type CreateApiNotificationsScheduledOrdersIdNotifyProcessingStatusChangedOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /Notifications/ScheduledOrders/{id}/NotifyProcessingStatusChanged */ export const createApiNotificationsScheduledOrdersIdNotifyProcessingStatusChanged = async (args: CreateApiNotificationsScheduledOrdersIdNotifyProcessingStatusChangedArgs, options?: CreateApiNotificationsScheduledOrdersIdNotifyProcessingStatusChangedOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/Notifications/ScheduledOrders/${encodeURIComponent(String(args.id))}/NotifyProcessingStatusChanged${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };