@burdenoff/microfe-billing 2026.904.1 → 2026.907.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +40 -34
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +89 -126
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js +25 -6
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +620 -625
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/generated/global-operations.js +256 -263
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -76,8 +76,24 @@ var i = "store-shipping", a = e`
|
|
|
76
76
|
shippingCurrency
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
`, u = e`
|
|
80
|
+
mutation EnsureStoreOrderBillingOrder(
|
|
81
|
+
$storeOrderId: ID!
|
|
82
|
+
$billingAccountId: ID!
|
|
83
|
+
$currency: String
|
|
84
|
+
) {
|
|
85
|
+
ensureStoreOrderBillingOrder(
|
|
86
|
+
storeOrderId: $storeOrderId
|
|
87
|
+
billingAccountId: $billingAccountId
|
|
88
|
+
currency: $currency
|
|
89
|
+
) {
|
|
90
|
+
success
|
|
91
|
+
billingOrderId
|
|
92
|
+
error
|
|
93
|
+
}
|
|
94
|
+
}
|
|
79
95
|
`;
|
|
80
|
-
function
|
|
96
|
+
function d() {
|
|
81
97
|
let { data: e, loading: t, error: n } = r(a, { fetchPolicy: "cache-and-network" });
|
|
82
98
|
return {
|
|
83
99
|
methods: e?.shippingMethods ?? [],
|
|
@@ -85,7 +101,7 @@ function u() {
|
|
|
85
101
|
error: n ?? null
|
|
86
102
|
};
|
|
87
103
|
}
|
|
88
|
-
function
|
|
104
|
+
function f() {
|
|
89
105
|
let { data: e, loading: t, error: n, refetch: i } = r(o, { fetchPolicy: "cache-and-network" });
|
|
90
106
|
return {
|
|
91
107
|
addresses: e?.myShippingAddresses ?? [],
|
|
@@ -94,20 +110,23 @@ function d() {
|
|
|
94
110
|
refetch: i
|
|
95
111
|
};
|
|
96
112
|
}
|
|
97
|
-
function
|
|
113
|
+
function p() {
|
|
98
114
|
let [e, { loading: t }] = n(s);
|
|
99
115
|
return {
|
|
100
116
|
createShippingAddress: async (t) => (await e({ variables: { input: t } })).data?.createShippingAddress ?? null,
|
|
101
117
|
loading: t
|
|
102
118
|
};
|
|
103
119
|
}
|
|
104
|
-
function
|
|
120
|
+
function m() {
|
|
105
121
|
return t(c, { fetchPolicy: "network-only" });
|
|
106
122
|
}
|
|
107
|
-
function
|
|
123
|
+
function h() {
|
|
108
124
|
return n(l);
|
|
109
125
|
}
|
|
126
|
+
function g() {
|
|
127
|
+
return n(u);
|
|
128
|
+
}
|
|
110
129
|
//#endregion
|
|
111
|
-
export { i as STORE_SHIPPING_ITEM_ID,
|
|
130
|
+
export { i as STORE_SHIPPING_ITEM_ID, p as useCreateShippingAddress, g as useEnsureStoreOrderBillingOrder, m as useEstimateOrderShipping, f as useMyShippingAddresses, h as useSetStoreOrderShipping, d as useShippingMethods };
|
|
112
131
|
|
|
113
132
|
//# sourceMappingURL=useStoreShipping.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoreShipping.js","names":[],"sources":["../../../../../src/billing/modules/checkout/hooks/useStoreShipping.ts"],"sourcesContent":["/**\n * Store checkout — shipping operations (physical products only)\n * ============================================================================\n *\n * TRANSITIONAL SHIM. These hooks are hand-written against the STORE subgraph\n * (federated behind the global gateway) using inline `gql` documents, mirroring\n * the existing precedent in `modules/usage/hooks/useUsage.ts`.\n *\n * Why hand-written and not codegen'd?\n * - The canonical GraphQL operations live in\n * `src/operations/global/store/{queries,mutations}/*.graphql` (added in this\n * PR as the backend contract), but the committed schema snapshot\n * (`graphql/global.graphql`) is stale and does NOT yet expose\n * `shippingMethods` / `myShippingAddresses` / `createShippingAddress` /\n * `setStoreOrderShipping`. Running `bun run codegen` offline against the\n * stale schema therefore fails, so the generated hooks\n * (`useShippingMethodsQuery`, `useSetStoreOrderShippingMutation`, ...) do\n * not exist yet.\n * - `setStoreOrderShipping` is a NEW mutation that the global-store-svc order\n * module must add (see the coordinating backend PR). Until it ships, the\n * write is inert at runtime.\n *\n * FOLLOW-UP once the backend + a fresh `bun run schema:pull` land: delete this\n * module and switch the imports in `StoreShippingSection.tsx` / `CheckoutPage.tsx`\n * to the generated hooks in `src/generated/global-operations.ts`.\n *\n * Everything here is scoped to physical STORE-order checkout and is never\n * imported on the digital/plan/addon/credits checkout path.\n */\n\nimport { gql, useQuery, useLazyQuery, useMutation } from '@burdenoff/fe-libs/shared/graphql';\n\n/** Synthetic checkout line-item id used to fold shipping cost into the billing total. */\nexport const STORE_SHIPPING_ITEM_ID = 'store-shipping';\n\n// ============================================================================\n// Types (mirror the STORE subgraph shapes in graphql/global.graphql)\n// ============================================================================\n\nexport interface ShippingMethod {\n id: string;\n name: string;\n code: string;\n carrier?: string | null;\n baseCost: number;\n currency: string;\n estimatedMinDays?: number | null;\n estimatedMaxDays?: number | null;\n availableCountries: string[];\n excludedCountries: string[];\n isActive: boolean;\n displayOrder: number;\n}\n\nexport interface ShippingAddress {\n id: string;\n fullName: string;\n phone?: string | null;\n email?: string | null;\n addressLine1: string;\n addressLine2?: string | null;\n city: string;\n state?: string | null;\n postalCode: string;\n country: string;\n isDefault: boolean;\n label?: string | null;\n instructions?: string | null;\n}\n\nexport interface OrderShippingEstimate {\n orderId: string;\n shippingMethodId: string;\n cost: number;\n currency: string;\n methodName: string;\n carrier?: string | null;\n estimatedMinDays?: number | null;\n estimatedMaxDays?: number | null;\n estimatedDeliveryDate?: string | null;\n}\n\nexport interface CreateShippingAddressInput {\n fullName: string;\n phone?: string;\n email?: string;\n addressLine1: string;\n addressLine2?: string;\n city: string;\n state?: string;\n postalCode: string;\n country: string;\n instructions?: string;\n label?: string;\n isDefault?: boolean;\n}\n\nexport interface OrderShippingEstimateInput {\n orderId: string;\n shippingMethodId: string;\n destinationCountry: string;\n destinationPostalCode?: string;\n}\n\nexport interface SetStoreOrderShippingInput {\n orderId: string;\n shippingMethodId: string;\n shippingAddressId?: string;\n}\n\n// setStoreOrderShipping returns the updated StoreOrder directly (product-only `total`,\n// with the server-computed shipping cost persisted on `shippingCost`/`shippingCurrency`).\nexport interface SetStoreOrderShippingResult {\n id: string;\n total: number;\n shippingCost: number | null;\n shippingCurrency: string | null;\n}\n\n// ============================================================================\n// GraphQL documents\n// ============================================================================\n\nconst SHIPPING_METHODS_QUERY = gql`\n query ShippingMethods {\n shippingMethods {\n id\n name\n code\n carrier\n baseCost\n currency\n estimatedMinDays\n estimatedMaxDays\n availableCountries\n excludedCountries\n isActive\n displayOrder\n }\n }\n`;\n\nconst MY_SHIPPING_ADDRESSES_QUERY = gql`\n query MyShippingAddresses {\n myShippingAddresses {\n id\n fullName\n phone\n email\n addressLine1\n addressLine2\n city\n state\n postalCode\n country\n isDefault\n label\n instructions\n }\n }\n`;\n\nconst CREATE_SHIPPING_ADDRESS_MUTATION = gql`\n mutation CreateShippingAddress($input: CreateShippingAddressInput!) {\n createShippingAddress(input: $input) {\n id\n fullName\n phone\n email\n addressLine1\n addressLine2\n city\n state\n postalCode\n country\n isDefault\n label\n instructions\n }\n }\n`;\n\nconst ESTIMATE_ORDER_SHIPPING_QUERY = gql`\n query EstimateOrderShipping($input: OrderShippingEstimateInput!) {\n estimateOrderShipping(input: $input) {\n orderId\n shippingMethodId\n cost\n currency\n methodName\n carrier\n estimatedMinDays\n estimatedMaxDays\n estimatedDeliveryDate\n }\n }\n`;\n\n// NOTE: blocked on global-store-svc adding this mutation. Inert until then.\nconst SET_STORE_ORDER_SHIPPING_MUTATION = gql`\n mutation SetStoreOrderShipping($input: SetStoreOrderShippingInput!) {\n setStoreOrderShipping(input: $input) {\n id\n total\n shippingCost\n shippingCurrency\n }\n }\n`;\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport function useShippingMethods() {\n const { data, loading, error } = useQuery<{ shippingMethods: ShippingMethod[] }>(\n SHIPPING_METHODS_QUERY,\n { fetchPolicy: 'cache-and-network' }\n );\n return { methods: data?.shippingMethods ?? [], loading, error: error ?? null };\n}\n\nexport function useMyShippingAddresses() {\n const { data, loading, error, refetch } = useQuery<{ myShippingAddresses: ShippingAddress[] }>(\n MY_SHIPPING_ADDRESSES_QUERY,\n { fetchPolicy: 'cache-and-network' }\n );\n return {\n addresses: data?.myShippingAddresses ?? [],\n loading,\n error: error ?? null,\n refetch,\n };\n}\n\nexport function useCreateShippingAddress() {\n const [mutate, { loading }] = useMutation<\n { createShippingAddress: ShippingAddress },\n { input: CreateShippingAddressInput }\n >(CREATE_SHIPPING_ADDRESS_MUTATION);\n\n const createShippingAddress = async (\n input: CreateShippingAddressInput\n ): Promise<ShippingAddress | null> => {\n const result = await mutate({ variables: { input } });\n return result.data?.createShippingAddress ?? null;\n };\n\n return { createShippingAddress, loading };\n}\n\nexport function useEstimateOrderShipping() {\n return useLazyQuery<\n { estimateOrderShipping: OrderShippingEstimate },\n { input: OrderShippingEstimateInput }\n >(ESTIMATE_ORDER_SHIPPING_QUERY, { fetchPolicy: 'network-only' });\n}\n\nexport function useSetStoreOrderShipping() {\n return useMutation<\n { setStoreOrderShipping: SetStoreOrderShippingResult },\n { input: SetStoreOrderShippingInput }\n >(SET_STORE_ORDER_SHIPPING_MUTATION);\n}\n"],"mappings":";;AAiCA,IAAa,IAAyB,kBA0FhC,IAAyB,CAAG;;;;;;;;;;;;;;;;;GAmB5B,IAA8B,CAAG;;;;;;;;;;;;;;;;;;GAoBjC,IAAmC,CAAG;;;;;;;;;;;;;;;;;;GAoBtC,IAAgC,CAAG;;;;;;;;;;;;;;GAiBnC,IAAoC,CAAG
|
|
1
|
+
{"version":3,"file":"useStoreShipping.js","names":[],"sources":["../../../../../src/billing/modules/checkout/hooks/useStoreShipping.ts"],"sourcesContent":["/**\n * Store checkout — shipping operations (physical products only)\n * ============================================================================\n *\n * TRANSITIONAL SHIM. These hooks are hand-written against the STORE subgraph\n * (federated behind the global gateway) using inline `gql` documents, mirroring\n * the existing precedent in `modules/usage/hooks/useUsage.ts`.\n *\n * Why hand-written and not codegen'd?\n * - The canonical GraphQL operations live in\n * `src/operations/global/store/{queries,mutations}/*.graphql` (added in this\n * PR as the backend contract), but the committed schema snapshot\n * (`graphql/global.graphql`) is stale and does NOT yet expose\n * `shippingMethods` / `myShippingAddresses` / `createShippingAddress` /\n * `setStoreOrderShipping`. Running `bun run codegen` offline against the\n * stale schema therefore fails, so the generated hooks\n * (`useShippingMethodsQuery`, `useSetStoreOrderShippingMutation`, ...) do\n * not exist yet.\n * - `setStoreOrderShipping` is a NEW mutation that the global-store-svc order\n * module must add (see the coordinating backend PR). Until it ships, the\n * write is inert at runtime.\n *\n * FOLLOW-UP once the backend + a fresh `bun run schema:pull` land: delete this\n * module and switch the imports in `StoreShippingSection.tsx` / `CheckoutPage.tsx`\n * to the generated hooks in `src/generated/global-operations.ts`.\n *\n * Everything here is scoped to physical STORE-order checkout and is never\n * imported on the digital/plan/addon/credits checkout path.\n */\n\nimport { gql, useQuery, useLazyQuery, useMutation } from '@burdenoff/fe-libs/shared/graphql';\n\n/** Synthetic checkout line-item id used to fold shipping cost into the billing total. */\nexport const STORE_SHIPPING_ITEM_ID = 'store-shipping';\n\n// ============================================================================\n// Types (mirror the STORE subgraph shapes in graphql/global.graphql)\n// ============================================================================\n\nexport interface ShippingMethod {\n id: string;\n name: string;\n code: string;\n carrier?: string | null;\n baseCost: number;\n currency: string;\n estimatedMinDays?: number | null;\n estimatedMaxDays?: number | null;\n availableCountries: string[];\n excludedCountries: string[];\n isActive: boolean;\n displayOrder: number;\n}\n\nexport interface ShippingAddress {\n id: string;\n fullName: string;\n phone?: string | null;\n email?: string | null;\n addressLine1: string;\n addressLine2?: string | null;\n city: string;\n state?: string | null;\n postalCode: string;\n country: string;\n isDefault: boolean;\n label?: string | null;\n instructions?: string | null;\n}\n\nexport interface OrderShippingEstimate {\n orderId: string;\n shippingMethodId: string;\n cost: number;\n currency: string;\n methodName: string;\n carrier?: string | null;\n estimatedMinDays?: number | null;\n estimatedMaxDays?: number | null;\n estimatedDeliveryDate?: string | null;\n}\n\nexport interface CreateShippingAddressInput {\n fullName: string;\n phone?: string;\n email?: string;\n addressLine1: string;\n addressLine2?: string;\n city: string;\n state?: string;\n postalCode: string;\n country: string;\n instructions?: string;\n label?: string;\n isDefault?: boolean;\n}\n\nexport interface OrderShippingEstimateInput {\n orderId: string;\n shippingMethodId: string;\n destinationCountry: string;\n destinationPostalCode?: string;\n}\n\nexport interface SetStoreOrderShippingInput {\n orderId: string;\n shippingMethodId: string;\n shippingAddressId?: string;\n}\n\n// setStoreOrderShipping returns the updated StoreOrder directly (product-only `total`,\n// with the server-computed shipping cost persisted on `shippingCost`/`shippingCurrency`).\nexport interface SetStoreOrderShippingResult {\n id: string;\n total: number;\n shippingCost: number | null;\n shippingCurrency: string | null;\n}\n\n// ============================================================================\n// GraphQL documents\n// ============================================================================\n\nconst SHIPPING_METHODS_QUERY = gql`\n query ShippingMethods {\n shippingMethods {\n id\n name\n code\n carrier\n baseCost\n currency\n estimatedMinDays\n estimatedMaxDays\n availableCountries\n excludedCountries\n isActive\n displayOrder\n }\n }\n`;\n\nconst MY_SHIPPING_ADDRESSES_QUERY = gql`\n query MyShippingAddresses {\n myShippingAddresses {\n id\n fullName\n phone\n email\n addressLine1\n addressLine2\n city\n state\n postalCode\n country\n isDefault\n label\n instructions\n }\n }\n`;\n\nconst CREATE_SHIPPING_ADDRESS_MUTATION = gql`\n mutation CreateShippingAddress($input: CreateShippingAddressInput!) {\n createShippingAddress(input: $input) {\n id\n fullName\n phone\n email\n addressLine1\n addressLine2\n city\n state\n postalCode\n country\n isDefault\n label\n instructions\n }\n }\n`;\n\nconst ESTIMATE_ORDER_SHIPPING_QUERY = gql`\n query EstimateOrderShipping($input: OrderShippingEstimateInput!) {\n estimateOrderShipping(input: $input) {\n orderId\n shippingMethodId\n cost\n currency\n methodName\n carrier\n estimatedMinDays\n estimatedMaxDays\n estimatedDeliveryDate\n }\n }\n`;\n\n// NOTE: blocked on global-store-svc adding this mutation. Inert until then.\nconst SET_STORE_ORDER_SHIPPING_MUTATION = gql`\n mutation SetStoreOrderShipping($input: SetStoreOrderShippingInput!) {\n setStoreOrderShipping(input: $input) {\n id\n total\n shippingCost\n shippingCurrency\n }\n }\n`;\n\nconst ENSURE_STORE_ORDER_BILLING_ORDER_MUTATION = gql`\n mutation EnsureStoreOrderBillingOrder(\n $storeOrderId: ID!\n $billingAccountId: ID!\n $currency: String\n ) {\n ensureStoreOrderBillingOrder(\n storeOrderId: $storeOrderId\n billingAccountId: $billingAccountId\n currency: $currency\n ) {\n success\n billingOrderId\n error\n }\n }\n`;\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport function useShippingMethods() {\n const { data, loading, error } = useQuery<{ shippingMethods: ShippingMethod[] }>(\n SHIPPING_METHODS_QUERY,\n { fetchPolicy: 'cache-and-network' }\n );\n return { methods: data?.shippingMethods ?? [], loading, error: error ?? null };\n}\n\nexport function useMyShippingAddresses() {\n const { data, loading, error, refetch } = useQuery<{ myShippingAddresses: ShippingAddress[] }>(\n MY_SHIPPING_ADDRESSES_QUERY,\n { fetchPolicy: 'cache-and-network' }\n );\n return {\n addresses: data?.myShippingAddresses ?? [],\n loading,\n error: error ?? null,\n refetch,\n };\n}\n\nexport function useCreateShippingAddress() {\n const [mutate, { loading }] = useMutation<\n { createShippingAddress: ShippingAddress },\n { input: CreateShippingAddressInput }\n >(CREATE_SHIPPING_ADDRESS_MUTATION);\n\n const createShippingAddress = async (\n input: CreateShippingAddressInput\n ): Promise<ShippingAddress | null> => {\n const result = await mutate({ variables: { input } });\n return result.data?.createShippingAddress ?? null;\n };\n\n return { createShippingAddress, loading };\n}\n\nexport function useEstimateOrderShipping() {\n return useLazyQuery<\n { estimateOrderShipping: OrderShippingEstimate },\n { input: OrderShippingEstimateInput }\n >(ESTIMATE_ORDER_SHIPPING_QUERY, { fetchPolicy: 'network-only' });\n}\n\nexport function useSetStoreOrderShipping() {\n return useMutation<\n { setStoreOrderShipping: SetStoreOrderShippingResult },\n { input: SetStoreOrderShippingInput }\n >(SET_STORE_ORDER_SHIPPING_MUTATION);\n}\n\nexport interface EnsureStoreOrderBillingOrderResult {\n success: boolean;\n billingOrderId?: string | null;\n error?: string | null;\n}\n\nexport interface EnsureStoreOrderBillingOrderInput {\n storeOrderId: string;\n billingAccountId: string;\n currency?: string;\n}\n\nexport function useEnsureStoreOrderBillingOrder() {\n return useMutation<\n { ensureStoreOrderBillingOrder: EnsureStoreOrderBillingOrderResult },\n EnsureStoreOrderBillingOrderInput\n >(ENSURE_STORE_ORDER_BILLING_ORDER_MUTATION);\n}\n"],"mappings":";;AAiCA,IAAa,IAAyB,kBA0FhC,IAAyB,CAAG;;;;;;;;;;;;;;;;;GAmB5B,IAA8B,CAAG;;;;;;;;;;;;;;;;;;GAoBjC,IAAmC,CAAG;;;;;;;;;;;;;;;;;;GAoBtC,IAAgC,CAAG;;;;;;;;;;;;;;GAiBnC,IAAoC,CAAG;;;;;;;;;GAWvC,IAA4C,CAAG;;;;;;;;;;;;;;;;;AAsBrD,SAAgB,IAAqB;CACnC,IAAM,EAAE,SAAM,YAAS,aAAU,EAC/B,GACA,EAAE,aAAa,oBAAoB,CACrC;CACA,OAAO;EAAE,SAAS,GAAM,mBAAmB,CAAC;EAAG;EAAS,OAAO,KAAS;CAAK;AAC/E;AAEA,SAAgB,IAAyB;CACvC,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EACxC,GACA,EAAE,aAAa,oBAAoB,CACrC;CACA,OAAO;EACL,WAAW,GAAM,uBAAuB,CAAC;EACzC;EACA,OAAO,KAAS;EAChB;CACF;AACF;AAEA,SAAgB,IAA2B;CACzC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAG5B,CAAgC;CASlC,OAAO;EAAE,8BANP,OAGO,MADc,EAAO,EAAE,WAAW,EAAE,SAAM,EAAE,CAAC,GACtC,MAAM,yBAAyB;EAGf;CAAQ;AAC1C;AAEA,SAAgB,IAA2B;CACzC,OAAO,EAGL,GAA+B,EAAE,aAAa,eAAe,CAAC;AAClE;AAEA,SAAgB,IAA2B;CACzC,OAAO,EAGL,CAAiC;AACrC;AAcA,SAAgB,IAAkC;CAChD,OAAO,EAGL,CAAyC;AAC7C"}
|