diff --git a/vtex-my-subscriptions-3/messages/de.json b/vtex-my-subscriptions-3/messages/de.json index eeb8600a..ed6a106a 100644 --- a/vtex-my-subscriptions-3/messages/de.json +++ b/vtex-my-subscriptions-3/messages/de.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Zahlungsfehler", "details-page.action-bar.text.changePayment": "Bitte ändern Sie Ihre Zahlungsmethode", "details-page.action-bar.button.changePayment": "Veränderung", + "details-page.action-bar.label.orderDispatched": "TODO", + "details-page.action-bar.text.orderDeliveryDate": "TODO", + "details-page.action-bar.text.orderDeliveryDetail": "TODO", + "details-page.action-bar.button.trackOrder": "TODO", + "details-page.action-bar.button.viewOrder": "TODO", + "details-page.action-bar.label.nextPurchase": "TODO", + "details-page.action-bar.text.nextPurchase": "TODO", + "details-page.action-bar.button.nextPurchase": "TODO", + "details-page.action-bar.label.printBankSlip": "TODO", + "details-page.action-bar.text.printBankSlip": "TODO", + "details-page.action-bar.button.printBankSlip": "TODO", "details-page.preferences.title": "Einstellungen", "display-address.label": "Lieferanschrift", "display-address.deleted-error-message": "Ihre Adresse wurde entfernt, bitte wählen Sie eine andere aus.", diff --git a/vtex-my-subscriptions-3/messages/en.json b/vtex-my-subscriptions-3/messages/en.json index dabe7669..a60f8736 100644 --- a/vtex-my-subscriptions-3/messages/en.json +++ b/vtex-my-subscriptions-3/messages/en.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Payment Error", "details-page.action-bar.text.changePayment": "Please, change your payment method", "details-page.action-bar.button.changePayment": "Change", + "details-page.action-bar.label.orderDispatched": "Your order is already on the way", + "details-page.action-bar.text.orderDeliveryDate": "Arrives in until {numberOfDaysNextDelivery, plural, one {1 day} other {# days}}", + "details-page.action-bar.text.orderDeliveryDetail": "See details on the order page", + "details-page.action-bar.button.trackOrder": "Track order", + "details-page.action-bar.button.viewOrder": "View order", + "details-page.action-bar.label.nextPurchase": "Next purchase in {numberOfDaysNextPurchase, plural, one {1 day} other {# days}}", + "details-page.action-bar.text.nextPurchase": "{nextPurchaseDate}", + "details-page.action-bar.button.nextPurchase": "Change date", + "details-page.action-bar.label.printBankSlip": "Bank slip generated", + "details-page.action-bar.text.printBankSlip": "Awaiting payment confirmation", + "details-page.action-bar.button.printBankSlip": "Print bank slip", "details-page.preferences.title": "Preferences", "display-address.label": "Shipping address", "display-address.deleted-error-message": "Your address was removed, please select another one.", diff --git a/vtex-my-subscriptions-3/messages/es.json b/vtex-my-subscriptions-3/messages/es.json index 38b7ce6b..902c9f95 100644 --- a/vtex-my-subscriptions-3/messages/es.json +++ b/vtex-my-subscriptions-3/messages/es.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Error en el pago", "details-page.action-bar.text.changePayment": "Por favor, cambie su método de pago", "details-page.action-bar.button.changePayment": "Cambio", + "details-page.action-bar.label.orderDispatched": "Tu pedido ya está en camino", + "details-page.action-bar.text.orderDeliveryDate": "Llega hasta {numberOfDaysNextDelivery, plural, one {1 día} other {# dias}}", + "details-page.action-bar.text.orderDeliveryDetail": "Ver detalles en la página de pedido", + "details-page.action-bar.button.trackOrder": "Rastrear pedido", + "details-page.action-bar.button.viewOrder": "Ver pedido", + "details-page.action-bar.label.nextPurchase": "Próxima compra en {numberOfDaysNextPurchase, plural, one {1 día} other {# dias}}", + "details-page.action-bar.text.nextPurchase": "{nextPurchaseDate}", + "details-page.action-bar.button.nextPurchase": "Cambiar fecha", + "details-page.action-bar.label.printBankSlip": "Recibo gerado", + "details-page.action-bar.text.printBankSlip": "Esperando la confirmación del pago", + "details-page.action-bar.button.printBankSlip": "Imprimir recibo", "details-page.preferences.title": "Preferencias", "display-address.label": "Dirección de Envío", "display-address.deleted-error-message": "Su dirección fue eliminada, seleccione otra.", diff --git a/vtex-my-subscriptions-3/messages/fr.json b/vtex-my-subscriptions-3/messages/fr.json index 1a993ae8..34956291 100644 --- a/vtex-my-subscriptions-3/messages/fr.json +++ b/vtex-my-subscriptions-3/messages/fr.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Erreur de paiement", "details-page.action-bar.text.changePayment": "Veuillez changer votre mode de paiement", "details-page.action-bar.button.changePayment": "Changer", + "details-page.action-bar.label.orderDispatched": "TODO", + "details-page.action-bar.text.orderDeliveryDate": "TODO", + "details-page.action-bar.text.orderDeliveryDetail": "TODO", + "details-page.action-bar.button.trackOrder": "TODO", + "details-page.action-bar.button.viewOrder": "TODO", + "details-page.action-bar.label.nextPurchase": "TODO", + "details-page.action-bar.text.nextPurchase": "TODO", + "details-page.action-bar.button.nextPurchase": "TODO", + "details-page.action-bar.label.printBankSlip": "TODO", + "details-page.action-bar.text.printBankSlip": "TODO", + "details-page.action-bar.button.printBankSlip": "TODO", "details-page.preferences.title": "Préférences", "display-address.label": "Adresse de livraison", "display-address.deleted-error-message": "Votre adresse a été supprimée, veuillez en sélectionner une autre.", diff --git a/vtex-my-subscriptions-3/messages/it.json b/vtex-my-subscriptions-3/messages/it.json index 29c4a868..161d3a7d 100644 --- a/vtex-my-subscriptions-3/messages/it.json +++ b/vtex-my-subscriptions-3/messages/it.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Errore di pagamento", "details-page.action-bar.text.changePayment": "Per favore, cambia il tuo metodo di pagamento", "details-page.action-bar.button.changePayment": "Modificare", + "details-page.action-bar.label.orderDispatched": "TODO", + "details-page.action-bar.text.orderDeliveryDate": "TODO", + "details-page.action-bar.text.orderDeliveryDetail": "TODO", + "details-page.action-bar.button.trackOrder": "TODO", + "details-page.action-bar.button.viewOrder": "TODO", + "details-page.action-bar.label.nextPurchase": "TODO", + "details-page.action-bar.text.nextPurchase": "TODO", + "details-page.action-bar.button.nextPurchase": "TODO", + "details-page.action-bar.label.printBankSlip": "TODO", + "details-page.action-bar.text.printBankSlip": "TODO", + "details-page.action-bar.button.printBankSlip": "TODO", "details-page.preferences.title": "Preferenze", "display-address.label": "Indirizzo di spedizione", "display-address.deleted-error-message": "Il tuo indirizzo è stato rimosso, selezionane un altro.", diff --git a/vtex-my-subscriptions-3/messages/pt.json b/vtex-my-subscriptions-3/messages/pt.json index 35eb6789..457738a8 100644 --- a/vtex-my-subscriptions-3/messages/pt.json +++ b/vtex-my-subscriptions-3/messages/pt.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Erro de pagamento", "details-page.action-bar.text.changePayment": "Por favor, altere seu método de pagamento", "details-page.action-bar.button.changePayment": "Alterar", + "details-page.action-bar.label.orderDispatched": "Seu pedido já está a caminho", + "details-page.action-bar.text.orderDeliveryDate": "Chega em até {numberOfDaysNextDelivery, plural, one {1 dia} other {# dias}}", + "details-page.action-bar.text.orderDeliveryDetail": "Veja os detalhes na página de pedidos", + "details-page.action-bar.button.trackOrder": "Rastrear pedido", + "details-page.action-bar.button.viewOrder": "Ver pedido", + "details-page.action-bar.label.nextPurchase": "Próxima compra em {numberOfDaysNextPurchase, plural, one {1 dia} other {# dias}}", + "details-page.action-bar.text.nextPurchase": "{nextPurchaseDate}", + "details-page.action-bar.button.nextPurchase": "Alterar data", + "details-page.action-bar.label.printBankSlip": "Boleto gerado", + "details-page.action-bar.text.printBankSlip": "Aguardando confirmação de pagamento", + "details-page.action-bar.button.printBankSlip": "Imprimir boleto", "details-page.preferences.title": "Preferências", "display-address.label": "Endereço de entrega", "display-address.deleted-error-message": "Seu endereço foi removido, por favor selecione outro.", diff --git a/vtex-my-subscriptions-3/messages/ro.json b/vtex-my-subscriptions-3/messages/ro.json index 54b8807f..a2c1f123 100644 --- a/vtex-my-subscriptions-3/messages/ro.json +++ b/vtex-my-subscriptions-3/messages/ro.json @@ -102,6 +102,17 @@ "details-page.action-bar.label.changePayment": "Eroare de plata", "details-page.action-bar.text.changePayment": "Vă rugăm, schimbați metoda de plată", "details-page.action-bar.button.changePayment": "Schimbare", + "details-page.action-bar.label.orderDispatched": "TODO", + "details-page.action-bar.text.orderDeliveryDate": "TODO", + "details-page.action-bar.text.orderDeliveryDetail": "TODO", + "details-page.action-bar.button.trackOrder": "TODO", + "details-page.action-bar.button.viewOrder": "TODO", + "details-page.action-bar.label.nextPurchase": "TODO", + "details-page.action-bar.text.nextPurchase": "TODO", + "details-page.action-bar.button.nextPurchase": "TODO", + "details-page.action-bar.label.printBankSlip": "TODO", + "details-page.action-bar.text.printBankSlip": "TODO", + "details-page.action-bar.button.printBankSlip": "TODO", "details-page.preferences.title": "Preferințe", "display-address.label": "Adresa de transport", "display-address.deleted-error-message": "Adresa dvs. a fost eliminată, vă rugăm să selectați alta.", diff --git a/vtex-my-subscriptions-3/react/components/DetailsPage/ActionBar.tsx b/vtex-my-subscriptions-3/react/components/DetailsPage/ActionBar.tsx index 55ae2344..eabd8acd 100644 --- a/vtex-my-subscriptions-3/react/components/DetailsPage/ActionBar.tsx +++ b/vtex-my-subscriptions-3/react/components/DetailsPage/ActionBar.tsx @@ -43,11 +43,75 @@ defineMessages({ changePaymentButton: { id: 'details-page.action-bar.button.changePayment', }, + orderDispatchedLabel: { + id: 'details-page.action-bar.label.orderDispatched', + }, + orderDeliveryDateBody: { + id: 'details-page.action-bar.text.orderDeliveryDate', + }, + orderDeliveryDetailBody: { + id: 'details-page.action-bar.text.orderDeliveryDetail', + }, + trackOrderButton: { + id: 'details-page.action-bar.button.trackOrder', + }, + viewOrderButton: { + id: 'details-page.action-bar.button.viewOrder', + }, + nextPurchaseLabel: { + id: 'details-page.action-bar.label.nextPurchase', + }, + nextPurchaseText: { + id: 'details-page.action-bar.text.nextPurchase', + }, + nextPurchaseButton: { + id: 'details-page.action-bar.button.nextPurchase', + }, + printBankSlipLabel: { + id: 'details-page.action-bar.label.printBankSlip', + }, + printBankSlipText: { + id: 'details-page.action-bar.text.printBankSlip', + }, + printBankSlipButton: { + id: 'details-page.action-bar.button.printBankSlip', + }, }) class ActionBarContainer extends Component { + private calculateDaysUntilSpecificDate = (specificDate: string) => { + const today = new Date() + const diffTime = Math.abs(+new Date(specificDate) - +today) + const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + + return diffDays + } + + private getOrderDispatchedAction = ( + deliveryDate: string | undefined, + trackingUrl: string | undefined + ) => { + const orderDispatchedBody = deliveryDate + ? 'orderDeliveryDate' + : 'orderDeliveryDetail' + const orderDispatchedButton = trackingUrl ? 'trackOrder' : 'viewOrder' + + return { body: orderDispatchedBody, button: orderDispatchedButton } + } + private getSuggestedAction = () => { - const { status, address, isSkipped, payment, onUpdateAction } = this.props + const { + status, + address, + isSkipped, + payment, + orderStatus, + orderDeliveryDate, + orderTrackingUrl, + nextPurchaseDate, + bankSlipUrl, + onUpdateAction, + } = this.props let action: SubscriptionAction | null = null let buttonVariation: 'primary' | 'secondary' = 'primary' @@ -57,11 +121,18 @@ class ActionBarContainer extends Component { action = 'restore' } else if (!address) { action = 'changeAddress' - } else if (!payment) { + } else if (!payment || orderStatus === 'payment-denied') { action = 'changePayment' } else if (isSkipped) { action = 'unskip' buttonVariation = 'secondary' + } else if (!!orderDeliveryDate || !!orderTrackingUrl) { + action = 'orderDispatched' + } else if (bankSlipUrl) { + action = 'printBankSlip' + } else if (nextPurchaseDate) { + action = 'nextPurchase' + buttonVariation = 'secondary' } if (action === 'changeAddress' || action === 'changePayment') { @@ -71,7 +142,15 @@ class ActionBarContainer extends Component { let onClick if ( action && - ['restore', 'unskip', 'changeAddress', 'changePayment'].includes(action) + [ + 'restore', + 'unskip', + 'changeAddress', + 'changePayment', + 'orderDispatched', + 'nextPurchase', + 'printBankSlip', + ].includes(action) ) { onClick = () => onUpdateAction(action as SubscriptionAction) } @@ -97,12 +176,30 @@ class ActionBarContainer extends Component { displayDanger ? 'c-danger fw5' : 'c-muted-1' }`} > - +
{ day="2-digit" /> ), + nextPurchaseDate: ( + + ), + numberOfDaysNextDelivery: + this.props.orderDeliveryDate && + this.calculateDaysUntilSpecificDate( + this.props.orderDeliveryDate + ), }} />
@@ -134,6 +253,10 @@ type Props = { nextPurchaseDate: string address: Subscription['shippingAddress'] payment: Subscription['purchaseSettings']['paymentMethod'] + orderStatus: string | undefined + orderDeliveryDate: string | undefined + orderTrackingUrl: string | undefined + bankSlipUrl: string | undefined onUpdateAction: (action: SubscriptionAction) => void } diff --git a/vtex-my-subscriptions-3/react/components/DetailsPage/index.tsx b/vtex-my-subscriptions-3/react/components/DetailsPage/index.tsx index 4a0c95fb..57309af1 100644 --- a/vtex-my-subscriptions-3/react/components/DetailsPage/index.tsx +++ b/vtex-my-subscriptions-3/react/components/DetailsPage/index.tsx @@ -96,9 +96,34 @@ class SubscriptionsDetailsContainer extends Component { } private handleUpdateAction = (action: SubscriptionAction) => { + const { history, subscription } = this.props + + const orderPackages = + subscription?.lastExecution?.order?.packageAttachment.packages + const orderTrackingUrl = + orderPackages.length > 0 && orderPackages[0].trackingUrl + + const orderTransactions = + subscription?.lastExecution?.order?.paymentData.transactions + const orderPayments = + orderTransactions.length > 0 && orderTransactions[0].payments + const bankSlipUrl = orderPayments.length > 0 && orderPayments[0].url + if (action === 'changeAddress' || action === 'changePayment') { this.setState({ isEditMode: true }) goToElement({ id: PREFERENCES_ID }) + } else if (action === 'orderDispatched' && !!orderTrackingUrl) { + window.open(orderTrackingUrl) + } else if ( + action === 'orderDispatched' && + !orderTrackingUrl && + subscription?.lastExecution?.order?.orderId + ) { + history.push(`/orders/${subscription.lastExecution.order.orderId}`) + } else if (action === 'nextPurchase') { + this.handleChangeEdit(true) + } else if (action === 'printBankSlip' && !!bankSlipUrl) { + window.open(bankSlipUrl) } else { this.setState({ isModalOpen: true, actionType: action }) } @@ -189,6 +214,13 @@ class SubscriptionsDetailsContainer extends Component { errorMessage, }) + const orderPackages = + subscription.lastExecution?.order?.packageAttachment.packages + const orderLogisticsInfo = + subscription.lastExecution?.order?.shippingData.logisticsInfo + const orderTransactions = + subscription?.lastExecution?.order?.paymentData?.transactions + return (
{ payment={subscription.purchaseSettings.paymentMethod} onUpdateAction={this.handleUpdateAction} nextPurchaseDate={subscription.nextPurchaseDate} + orderStatus={subscription.lastExecution?.order?.status} + orderDeliveryDate={ + subscription.lastExecution?.order?.status === 'invoiced' + ? orderLogisticsInfo.length > 0 && + orderLogisticsInfo[0].shippingEstimateDate + : undefined + } + orderTrackingUrl={ + subscription.lastExecution?.order?.status === 'invoiced' + ? orderPackages.length > 0 && orderPackages[0].trackingUrl + : undefined + } + bankSlipUrl={orderTransactions?.[0].payments?.[0]?.url} /> ) => Promise } & InjectedRuntimeContext & WrappedComponentProps & - ChildProps + ChildProps & + RouteComponentProps type InputProps = RouteComponentProps<{ subscriptionId: string }> diff --git a/vtex-my-subscriptions-3/react/components/DetailsPage/utils.tsx b/vtex-my-subscriptions-3/react/components/DetailsPage/utils.tsx index 25325d85..950091f2 100644 --- a/vtex-my-subscriptions-3/react/components/DetailsPage/utils.tsx +++ b/vtex-my-subscriptions-3/react/components/DetailsPage/utils.tsx @@ -36,6 +36,9 @@ export type SubscriptionAction = | 'orderNow' | 'changeAddress' | 'changePayment' + | 'orderDispatched' + | 'nextPurchase' + | 'printBankSlip' export function retrieveModalConfig({ intl, diff --git a/vtex-my-subscriptions-3/react/graphql/queries/detailsPage.gql b/vtex-my-subscriptions-3/react/graphql/queries/detailsPage.gql index b3ff126c..7f41a2fe 100644 --- a/vtex-my-subscriptions-3/react/graphql/queries/detailsPage.gql +++ b/vtex-my-subscriptions-3/react/graphql/queries/detailsPage.gql @@ -46,6 +46,20 @@ query SubscriptionDetailsPage($id: ID!) { lastExecution { id status + order { + orderId + status + packageAttachment { + packages { + trackingUrl + } + } + shippingData { + logisticsInfo { + shippingEstimateDate + } + } + } } totals { id diff --git a/vtex-my-subscriptions-3/react/graphql/queries/subscriptionExecutions.gql b/vtex-my-subscriptions-3/react/graphql/queries/subscriptionExecutions.gql index 0794e7b2..ab5867a2 100644 --- a/vtex-my-subscriptions-3/react/graphql/queries/subscriptionExecutions.gql +++ b/vtex-my-subscriptions-3/react/graphql/queries/subscriptionExecutions.gql @@ -9,6 +9,27 @@ query Executions($subscriptionId: ID!, $page: Int, $perPage: Int) { id status date + order { + orderId + status + packageAttachment { + packages { + trackingUrl + } + } + shippingData { + logisticsInfo { + shippingEstimateDate + } + } + paymentData { + transactions { + payments { + url + } + } + } + } } } totalCount diff --git a/vtex-my-subscriptions-3/react/mocks/subscriptionFactory.tsx b/vtex-my-subscriptions-3/react/mocks/subscriptionFactory.tsx index 288746b1..77c67503 100644 --- a/vtex-my-subscriptions-3/react/mocks/subscriptionFactory.tsx +++ b/vtex-my-subscriptions-3/react/mocks/subscriptionFactory.tsx @@ -121,6 +121,35 @@ export function generateSubscription({ lastExecution: { id: '3748EAF9A6F44F72B899359C92DF6C81', status: lastExecutionStatus, + order: { + orderId: '1112620108352-01', + status: 'ready-for-handling', + shippingData: { + logisticsInfo: [ + { + shippingEstimateDate: '2021-03-02T14:02:01.8879259+00:00', + }, + ], + }, + packageAttachment: { + packages: [ + { + trackingUrl: 'www.google.com.br', + }, + ], + }, + paymentData: { + transactions: [ + { + payments: [ + { + url: 'www.google.com.br', + }, + ], + }, + ], + }, + }, }, estimatedDeliveryDate, addressId: 'b3665b68c9714441bdea54c35a4d0cd6', diff --git a/vtex-my-subscriptions-3/react/package.json b/vtex-my-subscriptions-3/react/package.json index 0ad40dfd..33b7cd63 100644 --- a/vtex-my-subscriptions-3/react/package.json +++ b/vtex-my-subscriptions-3/react/package.json @@ -39,16 +39,16 @@ "graphql-tag": "^2.10.1", "react-router-dom": "4.x", "typescript": "3.9.7", - "vtex.address-form": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.5/public/_types/react", + "vtex.address-form": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.6/public/_types/react", "vtex.my-account": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.17.1/public/@types/vtex.my-account", "vtex.my-account-commons": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.5.2/public/@types/vtex.my-account-commons", "vtex.my-subscriptions-portal-connector": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-subscriptions-portal-connector@0.1.1/public/@types/vtex.my-subscriptions-portal-connector", "vtex.payment-flags": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.payment-flags@2.5.1/public/@types/vtex.payment-flags", "vtex.render-runtime": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.126.11/public/@types/vtex.render-runtime", "vtex.store-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-graphql@2.138.0/public/@types/vtex.store-graphql", - "vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.1/public/@types/vtex.styleguide", - "vtex.subscriptions-commons": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.1.0/public/@types/vtex.subscriptions-commons", - "vtex.subscriptions-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.9.2/public/@types/vtex.subscriptions-graphql", + "vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.4/public/@types/vtex.styleguide", + "vtex.subscriptions-commons": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.2.1/public/@types/vtex.subscriptions-commons", + "vtex.subscriptions-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.11.0/public/@types/vtex.subscriptions-graphql", "vtex.totalizer-translator": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.totalizer-translator@2.2.0/public/_types/react" }, "version": "3.7.2" diff --git a/vtex-my-subscriptions-3/react/typings/graphql/queries/detailsPage.gql.d.ts b/vtex-my-subscriptions-3/react/typings/graphql/queries/detailsPage.gql.d.ts index 6b107f2b..970f9e12 100644 --- a/vtex-my-subscriptions-3/react/typings/graphql/queries/detailsPage.gql.d.ts +++ b/vtex-my-subscriptions-3/react/typings/graphql/queries/detailsPage.gql.d.ts @@ -7,6 +7,7 @@ declare module '*/detailsPage.gql' { PaymentMethod, QuerySubscriptionArgs as Args, SubscriptionItem, + Order, } from 'vtex.subscriptions-graphql' type Item = Pick @@ -27,7 +28,11 @@ declare module '*/detailsPage.gql' { | 'paymentAccountId' > & { items: Item[] - lastExecution: Pick | null + lastExecution: Pick< + SubscriptionExecution, + 'id' | 'status' | 'order', + Pick + > | null purchaseSettings: { currencyCode: string paymentMethod: PaymentMethod | null diff --git a/vtex-my-subscriptions-3/react/typings/graphql/queries/subscriptionExecutions.gql.d.ts b/vtex-my-subscriptions-3/react/typings/graphql/queries/subscriptionExecutions.gql.d.ts index 5c284277..071caef2 100644 --- a/vtex-my-subscriptions-3/react/typings/graphql/queries/subscriptionExecutions.gql.d.ts +++ b/vtex-my-subscriptions-3/react/typings/graphql/queries/subscriptionExecutions.gql.d.ts @@ -6,6 +6,7 @@ declare module '*/subscriptionExecutions.gql' { id: string status: SubscriptionExecutionStatus date: string + order: Order } interface Result { @@ -18,6 +19,27 @@ declare module '*/subscriptionExecutions.gql' { perPage: number } + interface ItemLogistics { + shippingEstimateDate: string + } + + interface ShippingData { + logisticsInfo: Array + } + interface Package { + trackingUrl: string + } + interface PackageAttachment { + packages: Array + } + + interface Order { + orderId: string + packageAttachment: !PackageAttachment + shippingData: !ShippingData + status: string + } + export { SubscriptionExecution, Result, Args } const value: DocumentNode diff --git a/vtex-my-subscriptions-3/react/yarn.lock b/vtex-my-subscriptions-3/react/yarn.lock index 1f9da069..c4a675f8 100644 --- a/vtex-my-subscriptions-3/react/yarn.lock +++ b/vtex-my-subscriptions-3/react/yarn.lock @@ -6141,9 +6141,9 @@ vtex-tachyons@^3.2.0: resolved "https://registry.yarnpkg.com/vtex-tachyons/-/vtex-tachyons-3.2.2.tgz#e9e39d939778ef7d80a92c476cecf7417f79a6e8" integrity sha512-4M53uuvV+2XEjplVYiPgpBuaI5dtGksVgz/20NNjbZkXklJM7Lwgod/hOoh3PtIn36+95zZVVgXYfs3e6EU8YA== -"vtex.address-form@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.5/public/_types/react": +"vtex.address-form@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.6/public/_types/react": version "0.0.0" - resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.5/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" + resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.6/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" "vtex.my-account-commons@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.5.2/public/@types/vtex.my-account-commons": version "1.5.2" @@ -6169,17 +6169,17 @@ vtex-tachyons@^3.2.0: version "2.138.0" resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-graphql@2.138.0/public/@types/vtex.store-graphql#a802ff0193cfaf1d9bca8d2cf36134977ac1f40e" -"vtex.styleguide@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.1/public/@types/vtex.styleguide": - version "9.135.1" - resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.1/public/@types/vtex.styleguide#ed8d203eff74ed072b6e2f6ddb66d0c92b797ade" +"vtex.styleguide@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.4/public/@types/vtex.styleguide": + version "9.135.4" + resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.4/public/@types/vtex.styleguide#f2143f2cbf61b3b01851be37e188b84edc65eb9a" -"vtex.subscriptions-commons@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.1.0/public/@types/vtex.subscriptions-commons": - version "1.1.0" - resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.1.0/public/@types/vtex.subscriptions-commons#f122e45f2e94c7efdd49cc9cee45c69f9d350535" +"vtex.subscriptions-commons@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.2.1/public/@types/vtex.subscriptions-commons": + version "1.2.1" + resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-commons@1.2.1/public/@types/vtex.subscriptions-commons#2c0893b2254010713e907bd2a0d290856c00c43e" -"vtex.subscriptions-graphql@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.9.2/public/@types/vtex.subscriptions-graphql": - version "3.9.2" - resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.9.2/public/@types/vtex.subscriptions-graphql#ef9d257f171ee0290d024b6345caaaa7dfbc1050" +"vtex.subscriptions-graphql@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.11.0/public/@types/vtex.subscriptions-graphql": + version "3.11.0" + resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.subscriptions-graphql@3.11.0/public/@types/vtex.subscriptions-graphql#1682bd8071241f8aa03f77801fca22d458df0720" "vtex.totalizer-translator@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.totalizer-translator@2.2.0/public/_types/react": version "0.0.0"