sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

commit f897d5f60f5238969ec97276075d4354bc240ae9
parent 0441b208b04245dffd66e85f8f0d3b92ff22301a
Author: triesap <tyson@radroots.org>
Date:   Fri, 19 Jun 2026 20:48:42 -0700

sdk: prune stale trade lifecycle bindings

- remove trade payment, settlement, receipt, and fulfillment binding models
- keep TypeScript order status and workflow projections agreement-only
- regenerate events and trade binding package outputs from xtask
- validate source boundary, order runtime, and generated package checks

Diffstat:
Mcrates/events_bindings/src/model.rs | 134-------------------------------------------------------------------------------
Mcrates/trade_bindings/src/model.rs | 59-----------------------------------------------------------
Mpackages/events-bindings/src/generated/types.ts | 28++++------------------------
Mpackages/trade-bindings/src/generated/types.ts | 18++++++------------
4 files changed, 10 insertions(+), 229 deletions(-)

diff --git a/crates/events_bindings/src/model.rs b/crates/events_bindings/src/model.rs @@ -49,17 +49,6 @@ pub fn types_module() -> ts::TsModule { ]), ), ts::type_alias( - "RadrootsActiveTradeFulfillmentState", - ts::union(vec![ - ts::string_literal("accepted_not_fulfilled"), - ts::string_literal("preparing"), - ts::string_literal("ready_for_pickup"), - ts::string_literal("out_for_delivery"), - ts::string_literal("delivered"), - ts::string_literal("seller_cancelled"), - ]), - ), - ts::type_alias( "RadrootsActiveTradeMessageType", ts::union(vec![ ts::string_literal("TradeOrderRequested"), @@ -67,10 +56,6 @@ pub fn types_module() -> ts::TsModule { ts::string_literal("TradeOrderRevisionProposed"), ts::string_literal("TradeOrderRevisionDecision"), ts::string_literal("TradeOrderCancelled"), - ts::string_literal("TradeFulfillmentUpdated"), - ts::string_literal("TradeBuyerReceipt"), - ts::string_literal("TradePaymentRecorded"), - ts::string_literal("TradeSettlementDecision"), ]), ), ts::type_alias( @@ -778,18 +763,6 @@ pub fn types_module() -> ts::TsModule { ts::object(vec![ts::field("question_id", ts::string())]), ), ts::type_alias( - "RadrootsTradeBuyerReceipt", - ts::object(vec![ - ts::field("order_id", ts::string()), - ts::field("listing_addr", ts::string()), - ts::field("buyer_pubkey", ts::string()), - ts::field("seller_pubkey", ts::string()), - ts::field("received", ts::boolean()), - ts::optional_field("issue", ts::union(vec![ts::string(), ts::null()])), - ts::field("received_at", ts::bigint()), - ]), - ), - ts::type_alias( "RadrootsTradeDiscountDecision", ts::union(vec![ ts::object(vec![ @@ -864,39 +837,6 @@ pub fn types_module() -> ts::TsModule { ]), ), ts::type_alias( - "RadrootsTradeFulfillmentStatus", - ts::union(vec![ - ts::object(vec![ts::field("kind", ts::string_literal("preparing"))]), - ts::object(vec![ts::field("kind", ts::string_literal("shipped"))]), - ts::object(vec![ts::field( - "kind", - ts::string_literal("ready_for_pickup"), - )]), - ts::object(vec![ts::field("kind", ts::string_literal("delivered"))]), - ts::object(vec![ts::field("kind", ts::string_literal("cancelled"))]), - ]), - ), - ts::type_alias( - "RadrootsTradeFulfillmentUpdate", - ts::object(vec![ts::field( - "status", - ts::reference("RadrootsTradeFulfillmentStatus"), - )]), - ), - ts::type_alias( - "RadrootsTradeFulfillmentUpdated", - ts::object(vec![ - ts::field("order_id", ts::string()), - ts::field("listing_addr", ts::string()), - ts::field("buyer_pubkey", ts::string()), - ts::field("seller_pubkey", ts::string()), - ts::field( - "status", - ts::reference("RadrootsActiveTradeFulfillmentState"), - ), - ]), - ), - ts::type_alias( "RadrootsTradeInventoryCommitment", ts::object(vec![ ts::field("bin_id", ts::string()), @@ -1097,14 +1037,6 @@ pub fn types_module() -> ts::TsModule { ts::field("kind", ts::string_literal("cancel")), ts::field("amount", ts::reference("RadrootsTradeListingCancel")), ]), - ts::object(vec![ - ts::field("kind", ts::string_literal("fulfillment_update")), - ts::field("amount", ts::reference("RadrootsTradeFulfillmentUpdate")), - ]), - ts::object(vec![ - ts::field("kind", ts::string_literal("receipt")), - ts::field("amount", ts::reference("RadrootsTradeReceipt")), - ]), ]), ), ts::type_alias( @@ -1124,8 +1056,6 @@ pub fn types_module() -> ts::TsModule { ts::string_literal("discount_accept"), ts::string_literal("discount_decline"), ts::string_literal("cancel"), - ts::string_literal("fulfillment_update"), - ts::string_literal("receipt"), ]), ), ts::type_alias( @@ -1347,36 +1277,6 @@ pub fn types_module() -> ts::TsModule { ts::string_literal("accepted"), ts::string_literal("declined"), ts::string_literal("cancelled"), - ts::string_literal("fulfilled"), - ts::string_literal("completed"), - ]), - ), - ts::type_alias( - "RadrootsTradePaymentMethod", - ts::union(vec![ - ts::string_literal("cash"), - ts::string_literal("manual_transfer"), - ts::string_literal("other"), - ]), - ), - ts::type_alias( - "RadrootsTradePaymentRecorded", - ts::object(vec![ - ts::field("order_id", ts::string()), - ts::field("listing_addr", ts::string()), - ts::field("buyer_pubkey", ts::string()), - ts::field("seller_pubkey", ts::string()), - ts::field("root_event_id", ts::string()), - ts::field("previous_event_id", ts::string()), - ts::field("agreement_event_id", ts::string()), - ts::field("quote_id", ts::string()), - ts::field("quote_version", ts::number()), - ts::field("economics_digest", ts::string()), - ts::field("amount", ts::reference("RadrootsCoreDecimal")), - ts::field("currency", ts::reference("RadrootsCoreCurrency")), - ts::field("method", ts::reference("RadrootsTradePaymentMethod")), - ts::optional_field("reference", ts::union(vec![ts::string(), ts::null()])), - ts::optional_field("paid_at", ts::union(vec![ts::number(), ts::null()])), ]), ), ts::type_alias( @@ -1388,40 +1288,6 @@ pub fn types_module() -> ts::TsModule { ts::object(vec![ts::field("question_id", ts::string())]), ), ts::type_alias( - "RadrootsTradeReceipt", - ts::object(vec![ - ts::field("acknowledged", ts::boolean()), - ts::field("at", ts::bigint()), - ]), - ), - ts::type_alias( - "RadrootsTradeSettlementDecision", - ts::union(vec![ - ts::string_literal("accepted"), - ts::string_literal("rejected"), - ]), - ), - ts::type_alias( - "RadrootsTradeSettlementDecisionEvent", - ts::object(vec![ - ts::field("order_id", ts::string()), - ts::field("listing_addr", ts::string()), - ts::field("seller_pubkey", ts::string()), - ts::field("buyer_pubkey", ts::string()), - ts::field("root_event_id", ts::string()), - ts::field("previous_event_id", ts::string()), - ts::field("agreement_event_id", ts::string()), - ts::field("payment_event_id", ts::string()), - ts::field("quote_id", ts::string()), - ts::field("quote_version", ts::number()), - ts::field("economics_digest", ts::string()), - ts::field("amount", ts::reference("RadrootsCoreDecimal")), - ts::field("currency", ts::reference("RadrootsCoreCurrency")), - ts::field("decision", ts::reference("RadrootsTradeSettlementDecision")), - ts::optional_field("reason", ts::union(vec![ts::string(), ts::null()])), - ]), - ), - ts::type_alias( "RadrootsTradeTransportLane", ts::union(vec![ ts::string_literal("service"), diff --git a/crates/trade_bindings/src/model.rs b/crates/trade_bindings/src/model.rs @@ -179,38 +179,6 @@ pub fn types_module() -> ts::TsModule { ]), ), ts::type_alias( - "RadrootsTradeFulfillmentException", - ts::object(vec![ - ts::field("code", ts::string()), - ts::field( - "severity", - ts::reference("RadrootsTradeFulfillmentExceptionSeverity"), - ), - ts::field( - "status", - ts::reference("RadrootsTradeFulfillmentExceptionStatus"), - ), - ts::optional_field("source", ts::union(vec![ts::string(), ts::null()])), - ts::optional_field("notes", ts::union(vec![ts::string(), ts::null()])), - ]), - ), - ts::type_alias( - "RadrootsTradeFulfillmentExceptionSeverity", - ts::union(vec![ - ts::string_literal("notice"), - ts::string_literal("warning"), - ts::string_literal("blocking"), - ]), - ), - ts::type_alias( - "RadrootsTradeFulfillmentExceptionStatus", - ts::union(vec![ - ts::string_literal("open"), - ts::string_literal("monitoring"), - ts::string_literal("resolved"), - ]), - ), - ts::type_alias( "RadrootsTradeListing", ts::object(vec![ ts::field("listing_id", ts::string()), @@ -526,8 +494,6 @@ pub fn types_module() -> ts::TsModule { ts::string_literal("discount_accept"), ts::string_literal("discount_decline"), ts::string_literal("cancel"), - ts::string_literal("fulfillment_update"), - ts::string_literal("receipt"), ]), ), ts::type_alias( @@ -571,10 +537,6 @@ pub fn types_module() -> ts::TsModule { "moderation_flags", ts::array(ts::reference("RadrootsTradeModerationFlag")), ), - ts::field( - "fulfillment_exceptions", - ts::array(ts::reference("RadrootsTradeFulfillmentException")), - ), ]), ), ts::type_alias( @@ -589,10 +551,6 @@ pub fn types_module() -> ts::TsModule { "has_open_moderation_flags", ts::union(vec![ts::boolean(), ts::null()]), ), - ts::optional_field( - "has_open_fulfillment_exceptions", - ts::union(vec![ts::boolean(), ts::null()]), - ), ]), ), ts::type_alias( @@ -615,7 +573,6 @@ pub fn types_module() -> ts::TsModule { ), ts::field("requires_review", ts::boolean()), ts::field("open_moderation_flag_count", ts::number()), - ts::field("open_fulfillment_exception_count", ts::number()), ]), ), ts::type_alias( @@ -681,8 +638,6 @@ pub fn types_module() -> ts::TsModule { ts::string_literal("accepted"), ts::string_literal("declined"), ts::string_literal("cancelled"), - ts::string_literal("fulfilled"), - ts::string_literal("completed"), ]), ), ts::type_alias( @@ -736,18 +691,6 @@ pub fn types_module() -> ts::TsModule { "accepted_discount", ts::union(vec![ts::reference("RadrootsCoreDiscountValue"), ts::null()]), ), - ts::optional_field( - "last_fulfillment_status", - ts::union(vec![ - ts::reference("RadrootsTradeFulfillmentStatus"), - ts::null(), - ]), - ), - ts::optional_field( - "receipt_acknowledged", - ts::union(vec![ts::boolean(), ts::null()]), - ), - ts::optional_field("receipt_at", ts::union(vec![ts::number(), ts::null()])), ts::optional_field("last_reason", ts::union(vec![ts::string(), ts::null()])), ts::optional_field( "last_discount_decline_reason", @@ -761,8 +704,6 @@ pub fn types_module() -> ts::TsModule { ts::field("discount_accept_count", ts::number()), ts::field("discount_decline_count", ts::number()), ts::field("cancellation_count", ts::number()), - ts::field("fulfillment_update_count", ts::number()), - ts::field("receipt_count", ts::number()), ts::field( "last_message_type", ts::reference("RadrootsTradeMessageType"), diff --git a/packages/events-bindings/src/generated/types.ts b/packages/events-bindings/src/generated/types.ts @@ -21,9 +21,7 @@ export type RadrootsAccountClaim = { username: string, pubkey: string, nip05?: s export type RadrootsActiveTradeEnvelope<T> = { version: number, domain: RadrootsTradeDomain, type: RadrootsActiveTradeMessageType, order_id: string, listing_addr: string, payload: T, }; -export type RadrootsActiveTradeFulfillmentState = "accepted_not_fulfilled" | "preparing" | "ready_for_pickup" | "out_for_delivery" | "delivered" | "seller_cancelled"; - -export type RadrootsActiveTradeMessageType = "TradeOrderRequested" | "TradeOrderDecision" | "TradeOrderRevisionProposed" | "TradeOrderRevisionDecision" | "TradeOrderCancelled" | "TradeFulfillmentUpdated" | "TradeBuyerReceipt" | "TradePaymentRecorded" | "TradeSettlementDecision"; +export type RadrootsActiveTradeMessageType = "TradeOrderRequested" | "TradeOrderDecision" | "TradeOrderRevisionProposed" | "TradeOrderRevisionDecision" | "TradeOrderCancelled"; export type RadrootsAppData = { d_tag: string, content: string, }; @@ -141,8 +139,6 @@ export type RadrootsSeal = { content: string, }; export type RadrootsTradeAnswer = { question_id: string, }; -export type RadrootsTradeBuyerReceipt = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, received: boolean, issue?: string | null, received_at: bigint, }; - export type RadrootsTradeDiscountDecision = { kind: "accept", amount: { value: RadrootsCoreDiscountValue, }, } | { kind: "decline", amount: { reason?: string | null, }, }; export type RadrootsTradeDiscountOffer = { discount_id: string, value: RadrootsCoreDiscountValue, }; @@ -159,12 +155,6 @@ export type RadrootsTradeEconomicLineKind = "listing_discount" | "basket_adjustm export type RadrootsTradeEnvelope<T> = { version: number, domain: RadrootsTradeDomain, type: RadrootsTradeMessageType, order_id?: string | null, listing_addr: string, payload: T, }; -export type RadrootsTradeFulfillmentStatus = { kind: "preparing", } | { kind: "shipped", } | { kind: "ready_for_pickup", } | { kind: "delivered", } | { kind: "cancelled", }; - -export type RadrootsTradeFulfillmentUpdate = { status: RadrootsTradeFulfillmentStatus, }; - -export type RadrootsTradeFulfillmentUpdated = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, status: RadrootsActiveTradeFulfillmentState, }; - export type RadrootsTradeInventoryCommitment = { bin_id: string, bin_count: number, }; export type RadrootsTradeListingCancel = { reason?: string | null, }; @@ -177,9 +167,9 @@ export type RadrootsTradeListingValidateResult = { valid: boolean, errors: Array export type RadrootsTradeListingValidationError = { kind: "invalid_kind", amount: { kind: number, }, } | { kind: "missing_listing_id", } | { kind: "listing_event_not_found", amount: { listing_addr: string, }, } | { kind: "listing_event_fetch_failed", amount: { listing_addr: string, }, } | { kind: "parse_error", amount: { error: RadrootsTradeListingParseError, }, } | { kind: "invalid_seller", } | { kind: "missing_farm_profile", } | { kind: "missing_farm_record", } | { kind: "missing_title", } | { kind: "missing_description", } | { kind: "missing_product_type", } | { kind: "missing_bins", } | { kind: "missing_primary_bin", } | { kind: "invalid_bin", } | { kind: "missing_price", } | { kind: "invalid_price", } | { kind: "missing_inventory", } | { kind: "invalid_inventory", } | { kind: "missing_availability", } | { kind: "missing_location", } | { kind: "missing_delivery_method", }; -export type RadrootsTradeMessagePayload = { kind: "listing_validate_request", amount: RadrootsTradeListingValidateRequest, } | { kind: "listing_validate_result", amount: RadrootsTradeListingValidateResult, } | { kind: "trade_order_requested", amount: RadrootsTradeOrderRequested, } | { kind: "order_response", amount: RadrootsTradeOrderResponse, } | { kind: "order_revision", amount: RadrootsTradeOrderRevision, } | { kind: "order_revision_accept", amount: RadrootsTradeOrderRevisionResponse, } | { kind: "order_revision_decline", amount: RadrootsTradeOrderRevisionResponse, } | { kind: "question", amount: RadrootsTradeQuestion, } | { kind: "answer", amount: RadrootsTradeAnswer, } | { kind: "discount_request", amount: RadrootsTradeDiscountRequest, } | { kind: "discount_offer", amount: RadrootsTradeDiscountOffer, } | { kind: "discount_accept", amount: RadrootsTradeDiscountDecision, } | { kind: "discount_decline", amount: RadrootsTradeDiscountDecision, } | { kind: "cancel", amount: RadrootsTradeListingCancel, } | { kind: "fulfillment_update", amount: RadrootsTradeFulfillmentUpdate, } | { kind: "receipt", amount: RadrootsTradeReceipt, }; +export type RadrootsTradeMessagePayload = { kind: "listing_validate_request", amount: RadrootsTradeListingValidateRequest, } | { kind: "listing_validate_result", amount: RadrootsTradeListingValidateResult, } | { kind: "trade_order_requested", amount: RadrootsTradeOrderRequested, } | { kind: "order_response", amount: RadrootsTradeOrderResponse, } | { kind: "order_revision", amount: RadrootsTradeOrderRevision, } | { kind: "order_revision_accept", amount: RadrootsTradeOrderRevisionResponse, } | { kind: "order_revision_decline", amount: RadrootsTradeOrderRevisionResponse, } | { kind: "question", amount: RadrootsTradeQuestion, } | { kind: "answer", amount: RadrootsTradeAnswer, } | { kind: "discount_request", amount: RadrootsTradeDiscountRequest, } | { kind: "discount_offer", amount: RadrootsTradeDiscountOffer, } | { kind: "discount_accept", amount: RadrootsTradeDiscountDecision, } | { kind: "discount_decline", amount: RadrootsTradeDiscountDecision, } | { kind: "cancel", amount: RadrootsTradeListingCancel, }; -export type RadrootsTradeMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel" | "fulfillment_update" | "receipt"; +export type RadrootsTradeMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel"; export type RadrootsTradeOrderCancelled = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, reason: string, }; @@ -213,20 +203,10 @@ export type RadrootsTradeOrderRevisionProposed = { revision_id: string, order_id export type RadrootsTradeOrderRevisionResponse = { accepted: boolean, reason?: string | null, }; -export type RadrootsTradeOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled" | "fulfilled" | "completed"; - -export type RadrootsTradePaymentMethod = "cash" | "manual_transfer" | "other"; - -export type RadrootsTradePaymentRecorded = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, root_event_id: string, previous_event_id: string, agreement_event_id: string, quote_id: string, quote_version: number, economics_digest: string, amount: RadrootsCoreDecimal, currency: RadrootsCoreCurrency, method: RadrootsTradePaymentMethod, reference?: string | null, paid_at?: number | null, }; +export type RadrootsTradeOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled"; export type RadrootsTradePricingBasis = "listing_event"; export type RadrootsTradeQuestion = { question_id: string, }; -export type RadrootsTradeReceipt = { acknowledged: boolean, at: bigint, }; - -export type RadrootsTradeSettlementDecision = "accepted" | "rejected"; - -export type RadrootsTradeSettlementDecisionEvent = { order_id: string, listing_addr: string, seller_pubkey: string, buyer_pubkey: string, root_event_id: string, previous_event_id: string, agreement_event_id: string, payment_event_id: string, quote_id: string, quote_version: number, economics_digest: string, amount: RadrootsCoreDecimal, currency: RadrootsCoreCurrency, decision: RadrootsTradeSettlementDecision, reason?: string | null, }; - export type RadrootsTradeTransportLane = "service" | "public"; diff --git a/packages/trade-bindings/src/generated/types.ts b/packages/trade-bindings/src/generated/types.ts @@ -39,12 +39,6 @@ export type RadrootsListingStatus = { kind: "active", } | { kind: "sold", } | { export type RadrootsTradeFacetCount = { key: string, count: number, }; -export type RadrootsTradeFulfillmentException = { code: string, severity: RadrootsTradeFulfillmentExceptionSeverity, status: RadrootsTradeFulfillmentExceptionStatus, source?: string | null, notes?: string | null, }; - -export type RadrootsTradeFulfillmentExceptionSeverity = "notice" | "warning" | "blocking"; - -export type RadrootsTradeFulfillmentExceptionStatus = "open" | "monitoring" | "resolved"; - export type RadrootsTradeListing = { listing_id: string, listing_addr: string, seller_pubkey: string, title: string, description: string, product_type: string, primary_bin_id: string, bin_quantity: RadrootsCoreQuantity, unit: RadrootsCoreUnit, unit_price: RadrootsCoreMoney, inventory_available: RadrootsCoreDecimal, availability: RadrootsListingAvailability, location: RadrootsListingLocation, delivery_method: RadrootsListingDeliveryMethod, listing: RadrootsListing, }; export type RadrootsTradeListingBackofficeOverlay = { listing_addr: string, review_queue?: RadrootsTradeReviewQueueEntry | null, moderation_flags: Array<RadrootsTradeModerationFlag>, }; @@ -75,7 +69,7 @@ export type RadrootsTradeMarketplaceListingSummary = { listing_addr: string, sel export type RadrootsTradeMarketplaceOrderSummary = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, status: RadrootsTradeOrderStatus, last_message_type: RadrootsTradeMessageType, item_count: number, total_bin_count: number, has_requested_discounts: boolean, last_reason?: string | null, }; -export type RadrootsTradeMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel" | "fulfillment_update" | "receipt"; +export type RadrootsTradeMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel"; export type RadrootsTradeModerationFlag = { code: string, severity: RadrootsTradeModerationSeverity, status: RadrootsTradeModerationStatus, source?: string | null, reason?: string | null, }; @@ -83,11 +77,11 @@ export type RadrootsTradeModerationSeverity = "notice" | "warning" | "block"; export type RadrootsTradeModerationStatus = "open" | "snoozed" | "resolved"; -export type RadrootsTradeOrderBackofficeOverlay = { order_id: string, review_queue?: RadrootsTradeReviewQueueEntry | null, moderation_flags: Array<RadrootsTradeModerationFlag>, fulfillment_exceptions: Array<RadrootsTradeFulfillmentException>, }; +export type RadrootsTradeOrderBackofficeOverlay = { order_id: string, review_queue?: RadrootsTradeReviewQueueEntry | null, moderation_flags: Array<RadrootsTradeModerationFlag>, }; -export type RadrootsTradeOrderBackofficeQuery = { order: RadrootsTradeOrderQuery, requires_review?: boolean | null, has_open_moderation_flags?: boolean | null, has_open_fulfillment_exceptions?: boolean | null, }; +export type RadrootsTradeOrderBackofficeQuery = { order: RadrootsTradeOrderQuery, requires_review?: boolean | null, has_open_moderation_flags?: boolean | null, }; -export type RadrootsTradeOrderBackofficeView = { order: RadrootsTradeOrderWorkflowProjection, marketplace: RadrootsTradeMarketplaceOrderSummary, overlay?: RadrootsTradeOrderBackofficeOverlay | null, requires_review: boolean, open_moderation_flag_count: number, open_fulfillment_exception_count: number, }; +export type RadrootsTradeOrderBackofficeView = { order: RadrootsTradeOrderWorkflowProjection, marketplace: RadrootsTradeMarketplaceOrderSummary, overlay?: RadrootsTradeOrderBackofficeOverlay | null, requires_review: boolean, open_moderation_flag_count: number, }; export type RadrootsTradeOrderFacets = { buyer_pubkeys: Array<RadrootsTradeFacetCount>, seller_pubkeys: Array<RadrootsTradeFacetCount>, listing_addrs: Array<RadrootsTradeFacetCount>, statuses: Array<RadrootsTradeFacetCount>, }; @@ -97,11 +91,11 @@ export type RadrootsTradeOrderSort = { field: RadrootsTradeOrderSortField, direc export type RadrootsTradeOrderSortField = "order_id" | "listing_addr" | "buyer_pubkey" | "seller_pubkey" | "status" | "last_message_type" | "total_bin_count"; -export type RadrootsTradeOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled" | "fulfilled" | "completed"; +export type RadrootsTradeOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled"; export type RadrootsTradeOrderWorkflowMessage = { event_id: string, actor_pubkey: string, counterparty_pubkey: string, listing_addr: string, order_id?: string | null, listing_event?: RadrootsNostrEventPtr | null, root_event_id?: string | null, prev_event_id?: string | null, payload: RadrootsTradeMessagePayload, }; -export type RadrootsTradeOrderWorkflowProjection = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, items: Array<RadrootsTradeOrderItem>, requested_discounts?: Array<RadrootsTradeOrderEconomicLine> | null, status: RadrootsTradeOrderStatus, listing_snapshot?: RadrootsNostrEventPtr | null, root_event_id: string, last_event_id: string, last_discount_request?: RadrootsCoreDiscountValue | null, last_discount_offer?: RadrootsCoreDiscountValue | null, accepted_discount?: RadrootsCoreDiscountValue | null, last_fulfillment_status?: RadrootsTradeFulfillmentStatus | null, receipt_acknowledged?: boolean | null, receipt_at?: number | null, last_reason?: string | null, last_discount_decline_reason?: string | null, question_count: number, answer_count: number, revision_count: number, discount_request_count: number, discount_offer_count: number, discount_accept_count: number, discount_decline_count: number, cancellation_count: number, fulfillment_update_count: number, receipt_count: number, last_message_type: RadrootsTradeMessageType, last_actor_pubkey: string, }; +export type RadrootsTradeOrderWorkflowProjection = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, items: Array<RadrootsTradeOrderItem>, requested_discounts?: Array<RadrootsTradeOrderEconomicLine> | null, status: RadrootsTradeOrderStatus, listing_snapshot?: RadrootsNostrEventPtr | null, root_event_id: string, last_event_id: string, last_discount_request?: RadrootsCoreDiscountValue | null, last_discount_offer?: RadrootsCoreDiscountValue | null, accepted_discount?: RadrootsCoreDiscountValue | null, last_reason?: string | null, last_discount_decline_reason?: string | null, question_count: number, answer_count: number, revision_count: number, discount_request_count: number, discount_offer_count: number, discount_accept_count: number, discount_decline_count: number, cancellation_count: number, last_message_type: RadrootsTradeMessageType, last_actor_pubkey: string, }; export type RadrootsTradeReviewPriority = "low" | "normal" | "high" | "critical";