DocumentaçãoDocumentationDocumentaciónOne Conecta
ÍndiceIndexÍndice
Baixar .mdDownload .mdBajar .md
Feature · Entregas do diaFeature · Deliveries of the dayFeature · Entregas del día

Entregas do diaDeliveries of the dayEntregas del día

A lista das entregas do dia do representante de vendas — os pedidos já faturados e separados (pick-listed) que devem ser entregues. Diferente da Lista de pedidos, aqui o representante age sobre cada entrega: confirma, rejeita ou reagenda. The sales rep's list of the day's deliveries — orders already invoiced and picked (pick-listed) that must be delivered. Unlike the Order list, here the rep acts on each delivery: confirms, rejects or reschedules it. La lista de las entregas del día del representante de ventas — los pedidos ya facturados y separados (pick-listed) que deben entregarse. A diferencia de la Lista de pedidos, aquí el representante actúa sobre cada entrega: confirma, rechaza o reagenda.

PúblicoAudiencePúblico
Representante · QA · Suporte · DevRep · QA · Support · DevRepresentante · QA · Soporte · Dev
Onde ficaWhereDónde
Home → atalho "Entregas do dia"Home → "Deliveries of the day" shortcutHome → atajo "Entregas del día"
RelacionadoRelatedRelacionado
Orders · Order Detail
AtualizadoUpdatedActualizado
22/07/20262026-07-22
Disponível emAvailable inDisponible en BR CL
01

O que é e para que serveWhat it is and what it's forQué es y para qué sirve

As Entregas do dia mostram, numa lista única, os pedidos que já viraram entrega — aqueles cuja nota fiscal está separada para entrega (pick-listed). O representante usa esta tela para dar baixa nas entregas do dia e responde três perguntas: Deliveries of the day shows, in one list, the orders that became deliveries — those whose invoice is picked for delivery (pick-listed). The rep uses this screen to close out the day's deliveries and answers three questions: Las Entregas del día muestran, en una lista única, los pedidos que ya son entrega — aquellos cuya factura está separada para entrega (pick-listed). El representante usa esta pantalla para dar de baja las entregas del día y responde tres preguntas:

Quais entregas há hoje?Which deliveries today?¿Qué entregas hay hoy?

Um card por entrega, com varejo, nota fiscal, data e os produtos separados.One card per delivery, with retail, invoice, date and the picked products.Una tarjeta por entrega, con punto de venta, factura, fecha y los productos separados.

Em que estado estão?What state are they in?¿En qué estado están?

Cada entrega tem uma tag: pendente, entregue, rejeitada ou reagendada.Each delivery has a tag: pending, delivered, rejected or rescheduled.Cada entrega tiene una etiqueta: pendiente, entregada, rechazada o reagendada.

O que fazer com uma?What to do with one?¿Qué hacer con una?

Confirmar, rejeitar (com motivo) ou reagendar para outra data.Confirm, reject (with a reason) or reschedule to another date.Confirmar, rechazar (con motivo) o reagendar a otra fecha.

Escreve, não só consultaWrites, not just readsEscribe, no solo consulta Esta tela as entregas do cache de pedidos e escreve pelo Dispatcher: confirmar/rejeitar/reagendar disparam transações gRPC. Não é somente leitura. This screen reads deliveries from the orders cache and writes via the Dispatcher: confirm/reject/reschedule fire gRPC transactions. It is not read-only. Esta pantalla lee las entregas del caché de pedidos y escribe por el Dispatcher: confirmar/rechazar/reagendar disparan transacciones gRPC. No es solo lectura.

De onde vem a listaWhere the list comes fromDe dónde viene la lista As entregas não têm RPC próprio: são derivadas da Lista de pedidos — o mesmo cache de Order, filtrado por invoice.isPickListed == true. Deliveries have no dedicated RPC: they are derived from the Order list — the same Order cache, filtered by invoice.isPickListed == true. Las entregas no tienen RPC propio: se derivan de la Lista de pedidos — el mismo caché de Order, filtrado por invoice.isPickListed == true.

02

Como acessarHow to openCómo acceder

  1. Pela HomeFrom HomeDesde el HomeNa grade de atalhos do representante (módulo rep_actions), toque no card Entregas do dia. É o único ponto de entrada.In the rep shortcut grid (rep_actions module), tap the Deliveries of the day card. It's the only entry point.En la grilla de atajos del representante (módulo rep_actions), toque la tarjeta Entregas del día. Es el único punto de entrada.
  2. A tela abre empurradaThe screen opens pushedLa pantalla abre empujadaCom seta de voltar no topo (não é uma aba base, não tem menu lateral).With a back arrow at the top (not a base tab, no side drawer).Con flecha de volver arriba (no es una pestaña base, sin menú lateral).
  3. A lista carregaThe list loadsLa lista cargaAbre na aba Todas, ordenada por status e depois por data de entrega.Opens on the All tab, sorted by status then by delivery date.Abre en la pestaña Todas, ordenada por estado y luego por fecha de entrega.

Só onde habilitadoOnly where enabledSolo donde está habilitado O atalho aparece só nos mercados cujo End Market Configuration lista deliveries_of_the_day em rep_actions — hoje BR e CL. Fora deles não há como abrir a tela. The shortcut appears only in markets whose End Market Configuration lists deliveries_of_the_day under rep_actions — today BR and CL. Elsewhere there is no way to open the screen. El atajo aparece solo en los mercados cuyo End Market Configuration lista deliveries_of_the_day bajo rep_actions — hoy BR y CL. Fuera de ellos no hay forma de abrir la pantalla.

03

Estrutura da telaScreen structureEstructura de la pantalla

CabeçalhoHeaderEncabezado
Data da última sincronização (DataLoadInfo) e o título "Entregas do dia" com o ícone de caminhão.The last sync date (DataLoadInfo) and the "Deliveries of the day" title with the truck icon.La fecha de última sincronización (DataLoadInfo) y el título "Entregas del día" con el ícono de camión.
AbasTabsPestañas
Todas, Abertas, Executadas e Reagendadas. Cada aba filtra a lista por grupo de status de entrega.All, Open, Executed and Rescheduled. Each tab filters the list by delivery-status group.Todas, Abiertas, Ejecutadas y Reagendadas. Cada pestaña filtra la lista por grupo de estado de entrega.
Cards de entregaDelivery cardsTarjetas de entrega
Um por entrega: varejo, número da nota, data e tag de status. Um rádio à esquerda aparece só nas entregas pendentes. Tocar no card expande os produtos separados, agrupados por categoria (mais bonificação) e o total de itens.One per delivery: retail, invoice number, date and status tag. A radio on the left shows only on pending deliveries. Tapping the card expands the picked products, grouped by category (plus bonification) and the item total.Una por entrega: punto de venta, número de factura, fecha y etiqueta de estado. Un radio a la izquierda aparece solo en las entregas pendientes. Tocar la tarjeta expande los productos separados, agrupados por categoría (más bonificación) y el total de ítems.
Swipe de reagendarReschedule swipeSwipe de reagendar
Nas entregas pendentes, arrastar o card revela a ação Reagendar.On pending deliveries, swiping the card reveals the Reschedule action.En las entregas pendientes, arrastrar la tarjeta revela la acción Reagendar.
Barra de açõesAction barBarra de acciones
Fixa no rodapé: Rejeitar (contornado) e Confirmar (preenchido). Só ficam ativos quando há uma entrega pendente selecionada pelo rádio.Pinned at the bottom: Reject (outlined) and Confirm (filled). Enabled only when a pending delivery is selected via the radio.Fija al pie: Rechazar (contorneado) y Confirmar (relleno). Activos solo cuando hay una entrega pendiente seleccionada por el radio.
Lista vaziaEmpty listLista vacía
Cada aba sem itens mostra o CustomEmptyState com o ícone de caminhão.Each tab with no items shows CustomEmptyState with the truck icon.Cada pestaña sin ítems muestra CustomEmptyState con el ícono de camión.
04

Status de entregaDelivery statusesEstados de entrega

Cada entrega tem um status de entrega (distinto do status do pedido). A tag do card tem cor por status; a lista completa está na seção técnica Enums:Each delivery has a delivery status (distinct from the order status). The card tag is colored per status; the full list is in the technical Enums section:Cada entrega tiene un estado de entrega (distinto del estado del pedido). La etiqueta de la tarjeta tiene color por estado; la lista completa está en la sección técnica Enums:

statuso que significawhat it meansqué significacorcolorcolor
pendingaguardando ação — a única em que o rádio, o swipe e as ações aparecemawaiting action — the only one where radio, swipe and actions appearesperando acción — la única con radio, swipe y accionesinfo
notDelivered"not delivered" — não entregue (agrupada com pendente)"not delivered" (grouped with pending)"not delivered" — no entregada (agrupada con pendiente)info
deliveredconfirmada como entregueconfirmed as deliveredconfirmada como entregadasuccess
rescheduledreagendada para outra datarescheduled to another datereagendada a otra fechawarning
rejectedrejeitada com motivorejected with a reasonrechazada con motivoerror
unknownvalor vazio/desconhecido — a tag someempty/unknown value — the tag disappearsvalor vacío/desconocido — la etiqueta desapareceonSurfaceTertiary

As abas mapeiam os status assim: Abertas = pending + notDelivered; Executadas = delivered + rejected; Reagendadas = rescheduled; Todas = tudo.Tabs map statuses as: Open = pending + notDelivered; Executed = delivered + rejected; Rescheduled = rescheduled; All = everything.Las pestañas mapean los estados así: Abiertas = pending + notDelivered; Ejecutadas = delivered + rejected; Reagendadas = rescheduled; Todas = todo.

05

AçõesActionsAcciones

Todas as ações valem só para entregas pendentes. Selecione uma entrega no rádio para habilitar a barra inferior.All actions apply only to pending deliveries. Select a delivery via the radio to enable the bottom bar.Todas las acciones valen solo para entregas pendientes. Seleccione una entrega en el radio para habilitar la barra inferior.

ConfirmarConfirmConfirmar

Toca em Confirmar → modal de confirmação → a entrega vira delivered. Dispara a transação de status de entrega e mostra um aviso verde de sucesso.Tap Confirm → confirmation modal → the delivery becomes delivered. Fires the delivery-status transaction and shows a green success notice.Toque Confirmar → modal de confirmación → la entrega pasa a delivered. Dispara la transacción de estado de entrega y muestra un aviso verde de éxito.

RejeitarRejectRechazar

Toca em Rejeitar → modal com um dropdown de motivos (carregados do reference data) → a entrega vira rejected, com o código do motivo (delResCode) no payload.Tap Reject → modal with a reasons dropdown (loaded from reference data) → the delivery becomes rejected, carrying the reason code (delResCode) in the payload.Toque Rechazar → modal con un dropdown de motivos (cargados del reference data) → la entrega pasa a rejected, con el código del motivo (delResCode) en el payload.

ReagendarRescheduleReagendar

Arraste o card pendente → ação Reagendar → calendário (a partir do próximo dia útil, janela de 60 dias, fins de semana bloqueados) → a entrega vira rescheduled na nova data. Reagendar dispara duas transações: status de entrega + folha de rota (trip sheet).Swipe the pending card → Reschedule action → calendar (from the next business day, 60-day window, weekends blocked) → the delivery becomes rescheduled on the new date. Reschedule fires two transactions: delivery status + trip sheet.Arrastre la tarjeta pendiente → acción Reagendar → calendario (desde el próximo día hábil, ventana de 60 días, fines de semana bloqueados) → la entrega pasa a rescheduled en la nueva fecha. Reagendar dispara dos transacciones: estado de entrega + hoja de ruta (trip sheet).

06

Arquitetura e fluxo de dadosArchitecture & data flowArquitectura y flujo de datos

Clean Architecture + Riverpod + Freezed. A feature tem leitura e escrita distintas, em dois grafos. A leitura é derivada e cache-first: não há RPC próprio — o GetDeliveriesOfTheDayUseCase chama o OrderRepository.getOrders e filtra os pedidos com invoice.isPickListed == true.Clean Architecture + Riverpod + Freezed. The feature has distinct read and write paths, in two graphs. The read is derived and cache-first: there's no dedicated RPC — GetDeliveriesOfTheDayUseCase calls OrderRepository.getOrders and filters orders with invoice.isPickListed == true.Clean Architecture + Riverpod + Freezed. La feature tiene lectura y escritura distintas, en dos grafos. La lectura es derivada y cache-first: no hay RPC propio — GetDeliveriesOfTheDayUseCase llama a OrderRepository.getOrders y filtra los pedidos con invoice.isPickListed == true.

Leitura — deriva do cache de pedidos:Read — derives from the orders cache:Lectura — deriva del caché de pedidos:

  • OrderRepository.getOrderscache-first (§ Orders)
    • OrdersEntityGetDeliveriesOfTheDayUseCasefilter isPickListed
      • DeliveriesOfTheDayEntityDeliveriesOfTheDayNotifier + State
        • → UIDeliveriesOfTheDayPage

Escrita — confirmar/rejeitar/reagendar via DeliveryOrchestrator + Dispatcher, com update otimista no cache de pedidos:Write — confirm/reject/reschedule via DeliveryOrchestrator + Dispatcher, with an optimistic update to the orders cache:Escritura — confirmar/rechazar/reagendar vía DeliveryOrchestrator + Dispatcher, con update optimista al caché de pedidos:

  • Notifier.confirm / reject / reschedule
    • updateDeliveryDeliveryOrchestratorbuilds envelope(s)
      • Build…PayloadUseCaseDispatcherEnvelopestatus update (+ trip sheet)
        • SubmitDeliveryUseCaseDispatcherOrchestrator.dispatchgRPC sendTransaction
          • on ackoptimistic updateOrderRepository.saveOrders
            • stateNotifier _applyUpdatedOrder
07

Modelo de dadosData modelModelo de datos

Entregas do dia não tem proto, DTO nem Model próprios. Ela reusa o modelo de Order (as quatro camadas Proto→DTO→Model→Entity estão documentadas na Lista de pedidos) e monta, em tempo de execução, estruturas de domínio por cima: um container e um agrupamento de produtos calculado. As transações de escrita têm seus próprios inputs Freezed. A seguir: de onde vem cada estrutura, e o detalhe campo-a-campo de cada uma.Deliveries of the day has no own proto, DTO or Model. It reuses the Order model (the four layers Proto→DTO→Model→Entity are documented in the Order list) and builds, at runtime, domain structures on top: a container and a computed product grouping. The write transactions have their own Freezed inputs. Next: where each structure comes from, and the field-by-field detail of each.Entregas del día no tiene proto, DTO ni Model propios. Reusa el modelo de Order (las cuatro capas Proto→DTO→Model→Entity están documentadas en la Lista de pedidos) y arma, en tiempo de ejecución, estructuras de dominio encima: un container y una agrupación de productos calculada. Las transacciones de escritura tienen sus propios inputs Freezed. A continuación: de dónde viene cada estructura, y el detalle campo a campo de cada una.

Fontes de dadosData sourcesFuentes de datos

EstruturaStructureEstructuraOrigemOriginOrigenComo é obtidaHow it's obtainedCómo se obtiene
DeliveriesOfTheDayEntitydomínio (container)domain (container)dominio (container)montado no UseCase a partir de OrdersEntity, filtrando invoice.isPickListed; lastSyncAt vem do container de pedidos.assembled in the UseCase from OrdersEntity, filtering invoice.isPickListed; lastSyncAt comes from the orders container.armado en el UseCase desde OrdersEntity, filtrando invoice.isPickListed; lastSyncAt viene del container de pedidos.
OrderEntityOrders (reuso)Orders (reused)Orders (reuso)a entrega é um Order; os 52 campos e sub-estruturas vivem na doc de Orders.a delivery is an Order; the 52 fields and sub-structures live in the Orders doc.la entrega es un Order; los 52 campos y sub-estructuras están en la doc de Orders.
DeliveryProductGroupEntitydomínio (calculado)domain (computed)dominio (calculado)derivado de order.invoice.lineItems pela extension OrderDeliveryX.deliveryProductGroups — agrupa por CategoryGroup, separa bonificação (isFreeOfCharge).derived from order.invoice.lineItems by the OrderDeliveryX.deliveryProductGroups extension — groups by CategoryGroup, splits bonification (isFreeOfCharge).derivado de order.invoice.lineItems por la extension OrderDeliveryX.deliveryProductGroups — agrupa por CategoryGroup, separa bonificación (isFreeOfCharge).
DeliveryCancelReasonEntityreference_datacarregado do agregado ReferenceDataEntity.deliveryCancelReasons (via GetDeliveryCancelReasonsUseCase) no modal de rejeição.loaded from the ReferenceDataEntity.deliveryCancelReasons aggregate (via GetDeliveryCancelReasonsUseCase) in the reject modal.cargado del agregado ReferenceDataEntity.deliveryCancelReasons (vía GetDeliveryCancelReasonsUseCase) en el modal de rechazo.
DeliveryStatusUpdateDispatcherPayloadInputdomínio (input de escrita)domain (write input)dominio (input de escritura)montado no DeliveryOrchestrator com a Order crua + ação + relógio; convertido em payload no builder.assembled in DeliveryOrchestrator with the raw Order + action + clock; turned into a payload in the builder.armado en DeliveryOrchestrator con la Order cruda + acción + reloj; convertido en payload en el builder.
DeliveryTripSheetDispatcherPayloadInputdomínio (input de escrita)domain (write input)dominio (input de escritura)só no reagendamento; carrega Order + Resource + nova data.reschedule only; carries Order + Resource + new date.solo en el reagendamiento; lleva Order + Resource + nueva fecha.

Estruturas de dadosData structuresEstructuras de datos

Estruturas de domínio (Freezed) — uma coluna de tipo, pois não cruzam as quatro camadas. As sub-estruturas de Order (OrderInvoice, InvoiceLineItem…) estão na doc de Orders.Domain structures (Freezed) — a single type column, since they don't cross the four layers. Order's sub-structures (OrderInvoice, InvoiceLineItem…) are in the Orders doc.Estructuras de dominio (Freezed) — una columna de tipo, pues no cruzan las cuatro capas. Las sub-estructuras de Order (OrderInvoice, InvoiceLineItem…) están en la doc de Orders.

  • DeliveriesOfTheDay container 2 campos2 fields2 campos
    CampoEntitynotanotenota
    lastSyncAtDateTimeherdado de OrdersEntity.lastSyncAt; DateTimeUtils.now() se o cache está vazioinherited from OrdersEntity.lastSyncAt; DateTimeUtils.now() if cache is emptyheredado de OrdersEntity.lastSyncAt; DateTimeUtils.now() si el caché está vacío
    deliveriesList<OrderEntity>os pedidos pick-listed; default []the pick-listed orders; default []los pedidos pick-listed; default []
    • DeliveryProductGroup calculado por cardcomputed per cardcalculado por tarjeta 3 campos3 fields3 campos
      CampoEntitynotanotenota
      categoryCategoryGroupgrupo da categoria; default unknowncategory group; default unknowngrupo de categoría; default unknown
      isBonificationbooltrue no grupo de itens isFreeOfCharge; default falsetrue for the isFreeOfCharge items group; default falsetrue en el grupo de ítems isFreeOfCharge; default false
      itemsList<InvoiceLineItemEntity>itens da nota daquele grupo; default []that group's invoice items; default []ítems de factura de ese grupo; default []
    • DeliveryCancelReason reference_data 2 campos2 fields2 campos
      CampoEntitynotanotenota
      codeStringvai para delResCode no payload de rejeiçãogoes to delResCode in the reject payloadva a delResCode en el payload de rechazo
      reasonStringlabel exibido no dropdownlabel shown in the dropdownlabel mostrado en el dropdown
    • DeliveryStatusUpdateDispatcherPayloadInput input de escritawrite inputinput de escritura 5 campos5 fields5 campos
      CampoEntitynotanotenota
      orderOrderEntitya entrega cruathe raw deliveryla entrega cruda
      actionDeliveryActionconfirm / reject / reschedule
      submittedAtDateTimerelógio (DateTimeUtils.now())clock (DateTimeUtils.now())reloj (DateTimeUtils.now())
      rescheduleDateDateTime?só no reschedulereschedule onlysolo en reschedule
      rejectionReasonDeliveryCancelReasonEntity?só no rejectreject onlysolo en reject
    • DeliveryTripSheetDispatcherPayloadInput input de escrita · reschedulewrite input · rescheduleinput de escritura · reschedule 4 campos4 fields4 campos
      CampoEntitynotanotenota
      orderOrderEntity
      resourceResourceEntityrepresentante (vai como ResID)rep (goes as ResID)representante (va como ResID)
      rescheduleDateDateTimenova datanew datenueva fecha
      submittedAtDateTimerelógioclockreloj

Notas do modeloModel notesNotas del modelo

  • sem proto/DTO/Model próprios — reusa Order e monta estruturas de domínio em runtimeno own proto/DTO/Model — reuses Order and builds domain structures at runtimesin proto/DTO/Model propios — reusa Order y arma estructuras de dominio en runtime
  • DeliveryProductGroup é calculado por card (não persistido)is computed per card (not persisted)se calcula por tarjeta (no persistido)
  • status de entrega tipado só na Entity (OrderEntity.deliveryStatusType, de deliveryStatus:String)delivery status typed only in the Entity (OrderEntity.deliveryStatusType, from deliveryStatus:String)estado de entrega tipado solo en la Entity (OrderEntity.deliveryStatusType, de deliveryStatus:String)
  • os inputs do Dispatcher carregam entities cruas; o payload wire nasce só no build() (CLAUDE.md §36)the Dispatcher inputs carry raw entities; the wire payload is born only in build() (CLAUDE.md §36)los inputs del Dispatcher llevan entities crudas; el payload wire nace solo en build() (CLAUDE.md §36)
08

Repository

A feature não tem repository próprio. Consome dois repositórios existentes: o OrderRepository (leitura das entregas + persistência do update otimista) e o ReferenceDataRepository (motivos de rejeição). Os métodos usados:The feature has no own repository. It consumes two existing repositories: OrderRepository (reading deliveries + persisting the optimistic update) and ReferenceDataRepository (rejection reasons). The methods used:La feature no tiene repository propio. Consume dos repositorios existentes: OrderRepository (lectura de entregas + persistencia del update optimista) y ReferenceDataRepository (motivos de rechazo). Los métodos usados:

OrderRepository.getOrders({source}) → Orders

RetornaReturnsDevuelve Result<OrdersEntity?, Failure>

Fonte da lista de entregas. Decide a fonte por source + flags (mock/local/remoto com fallback) e grava no cache. Detalhe completo na doc de Orders.Source of the delivery list. Picks the source by source + flags (mock/local/remote with fallback) and writes to cache. Full detail in the Orders doc.Fuente de la lista de entregas. Elige la fuente por source + flags (mock/local/remoto con fallback) y graba en caché. Detalle completo en la doc de Orders.

OrderRepository.getCachedOrders() local

RetornaReturnsDevuelve Result<OrdersEntity?, Failure>

Usado pelo DeliveryOrchestrator._persistToCache para reler o cache antes de aplicar o update otimista.Used by DeliveryOrchestrator._persistToCache to re-read the cache before applying the optimistic update.Usado por DeliveryOrchestrator._persistToCache para releer el caché antes de aplicar el update optimista.

OrderRepository.saveOrders({entity}) local

RetornaReturnsDevuelve Result<void, Failure>

Regrava o cache de pedidos com a entrega atualizada (status/data), para a UI refletir a ação sem novo fetch.Rewrites the orders cache with the updated delivery (status/date), so the UI reflects the action without a new fetch.Regraba el caché de pedidos con la entrega actualizada (estado/fecha), para que la UI refleje la acción sin nuevo fetch.

ReferenceDataRepository.getReferenceData({source}) → ReferenceData

RetornaReturnsDevuelve Result<ReferenceDataEntity, Failure>

Agregado de dados de referência; dele o GetDeliveryCancelReasonsUseCase extrai deliveryCancelReasons para o modal de rejeição.Reference-data aggregate; from it GetDeliveryCancelReasonsUseCase extracts deliveryCancelReasons for the reject modal.Agregado de datos de referencia; de él GetDeliveryCancelReasonsUseCase extrae deliveryCancelReasons para el modal de rechazo.

09

Datasources

A feature não tem datasources próprios. A leitura passa pelos datasources de Order (Mock JSON / Local ObjectBox / Remote gRPC) e a escrita pelo transporte do Dispatcher. Resumo do que ela toca:The feature has no own datasources. Reads go through Order's datasources (Mock JSON / Local ObjectBox / Remote gRPC) and writes go through the Dispatcher transport. Summary of what it touches:La feature no tiene datasources propios. La lectura pasa por los datasources de Order (Mock JSON / Local ObjectBox / Remote gRPC) y la escritura por el transporte del Dispatcher. Resumen de lo que toca:

Order datasources Mock · Local · Remote reusoreusedreuso

A lista de entregas é servida pelos mesmos datasources da Lista de pedidos — o filtro isPickListed acontece no UseCase, depois do datasource. Detalhe de envio/retorno/erro na doc de Orders (§09).The delivery list is served by the same datasources as the Order list — the isPickListed filter happens in the UseCase, after the datasource. Send/return/error detail is in the Orders doc (§09).La lista de entregas se sirve con los mismos datasources que la Lista de pedidos — el filtro isPickListed ocurre en el UseCase, después del datasource. Detalle de envío/retorno/error en la doc de Orders (§09).

Dispatcher transport DispatcherOrchestrator gRPC
EnvioSendsEnvío
o SubmitDeliveryUseCase delega ao DispatcherOrchestrator.dispatch(envelope), que serializa o payload em InboxTransactionRequest.message e chama sendTransaction (RPC genérico do Dispatcher).SubmitDeliveryUseCase delegates to DispatcherOrchestrator.dispatch(envelope), which serializes the payload into InboxTransactionRequest.message and calls sendTransaction (the Dispatcher's generic RPC).SubmitDeliveryUseCase delega a DispatcherOrchestrator.dispatch(envelope), que serializa el payload en InboxTransactionRequest.message y llama sendTransaction (RPC genérico del Dispatcher).
RetornoReturnRetorno
Result<DispatcherAck, Failure>
Fluxo de usoUsage flowFlujo de uso
confirmar/rejeitar → 1 envelope (DispatcherType.order); reagendar → 2 envelopes (order + deliveryReschedule), verificados em sequência.confirm/reject → 1 envelope (DispatcherType.order); reschedule → 2 envelopes (order + deliveryReschedule), checked in sequence.confirmar/rechazar → 1 envelope (DispatcherType.order); reagendar → 2 envelopes (order + deliveryReschedule), verificados en secuencia.
Tratamento de erroError handlingManejo de errores
ack não-sucesso vira UnknownFailure; qualquer Failure aborta antes do update otimista. O widget mostra ConectaNotice.error.a non-success ack becomes UnknownFailure; any Failure aborts before the optimistic update. The widget shows ConectaNotice.error.un ack sin éxito pasa a UnknownFailure; cualquier Failure aborta antes del update optimista. El widget muestra ConectaNotice.error.
10

Enums e labelsEnums & labelsEnums y labels

Enums próprios da feature (em core/enums/delivery/) mais o CategoryGroup usado no agrupamento de produtos. Lista completa:The feature's own enums (in core/enums/delivery/) plus the CategoryGroup used in product grouping. Full list:Los enums propios de la feature (en core/enums/delivery/) más el CategoryGroup usado en el agrupamiento de productos. Lista completa:

DeliveryStatus 6 · value (wire)6 · value (wire)6 · value (wire)
casevaluecorcolorcolor
pending"pending"info
notDelivered"not delivered"info
delivered"delivered"success
rescheduled"rescheduled"warning
rejected"rejected"error
unknown""onSurfaceTertiary

Resolvido de OrderEntity.deliveryStatus (String) via DeliveryStatus.fromWire (case-insensitive; sem match → unknown). Labels traduzidos por DeliveryStatusUx.label.Resolved from OrderEntity.deliveryStatus (String) via DeliveryStatus.fromWire (case-insensitive; no match → unknown). Labels translated by DeliveryStatusUx.label.Resuelto de OrderEntity.deliveryStatus (String) vía DeliveryStatus.fromWire (case-insensitive; sin match → unknown). Labels traducidos por DeliveryStatusUx.label.

DeliveryTab 4 · accepts(status)4 · accepts(status)4 · accepts(status)
caseaceita os statusaccepts statusesacepta los estados
alltodosalltodos
openpending, notDelivered
executeddelivered, rejected
rescheduledrescheduled
DeliveryAction 3 · writeStatus3 · writeStatus3 · writeStatus
casewriteStatusvira o statusbecomes statuspasa al estado
confirm"Delivered"delivered
reject"Unsuccessful"rejected
reschedule"Rescheduled"rescheduled

writeStatus é o valor enviado ao backend em OrderHeader.deliveryStatus; distinto do DeliveryStatus.value local.writeStatus is the value sent to the backend in OrderHeader.deliveryStatus; distinct from the local DeliveryStatus.value.writeStatus es el valor enviado al backend en OrderHeader.deliveryStatus; distinto del DeliveryStatus.value local.

CategoryGroup 8 · agrupamento8 · grouping8 · agrupamiento
casevalue
fmc"fmc"
nc"nc"
modi"modi"
oral"oral"
otp"otp"
partnership"partnership"
other"other"
unknown""

Cabeçalho de cada grupo de produtos; label via CategoryGroupUx.labelForRawValue (i18n, fallback = valor em maiúsculas). Itens isFreeOfCharge vão para um grupo bonificação à parte.Header of each product group; label via CategoryGroupUx.labelForRawValue (i18n, fallback = uppercased value). isFreeOfCharge items go to a separate bonification group.Encabezado de cada grupo de productos; label vía CategoryGroupUx.labelForRawValue (i18n, fallback = valor en mayúsculas). Los ítems isFreeOfCharge van a un grupo bonificación aparte.

11

UseCases

A leitura tem um UseCase próprio; a escrita passa por um orchestrator de domínio (DeliveryOrchestrator) que monta payloads com dois builders e submete via SubmitDeliveryUseCase. Um dropdown por peça, com método · retorna · uso.The read has its own UseCase; the write goes through a domain orchestrator (DeliveryOrchestrator) that builds payloads with two builders and submits via SubmitDeliveryUseCase. One dropdown per piece, with method · returns · use.La lectura tiene su propio UseCase; la escritura pasa por un orchestrator de dominio (DeliveryOrchestrator) que arma payloads con dos builders y envía vía SubmitDeliveryUseCase. Un dropdown por pieza, con método · devuelve · uso.

GetDeliveriesOfTheDayUseCase 1 · a listathe listla lista
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
execute({source = local})Result<DeliveriesOfTheDayEntity, Failure>chama OrderRepository.getOrders(source) e filtra invoice.isPickListed == true; cache vazio → container só com lastSyncAt.calls OrderRepository.getOrders(source) and filters invoice.isPickListed == true; empty cache → container with only lastSyncAt.llama OrderRepository.getOrders(source) y filtra invoice.isPickListed == true; caché vacío → container solo con lastSyncAt.
GetDeliveryCancelReasonsUseCase 1
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
execute({source = local})Result<List<DeliveryCancelReasonEntity>, Failure>extrai deliveryCancelReasons do ReferenceDataEntity; alimenta o dropdown do modal de rejeição.extracts deliveryCancelReasons from ReferenceDataEntity; feeds the reject-modal dropdown.extrae deliveryCancelReasons del ReferenceDataEntity; alimenta el dropdown del modal de rechazo.
DeliveryOrchestrator domínio · escritadomain · writedominio · escritura
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
updateDelivery({order, action, resource, rescheduleDate?, rejectionReason?})Result<OrderEntity, Failure>monta e submete o envelope de status; no reschedule submete também o trip sheet; em sucesso aplica o update otimista e persiste no cache de pedidos.builds and submits the status envelope; on reschedule also submits the trip sheet; on success applies the optimistic update and persists to the orders cache.arma y envía el envelope de estado; en reschedule envía también el trip sheet; en éxito aplica el update optimista y persiste en el caché de pedidos.
SubmitDeliveryUseCase 1
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
submit({envelope})Result<DispatcherAck, Failure>delega ao DispatcherOrchestrator.dispatch (transporte gRPC compartilhado).delegates to DispatcherOrchestrator.dispatch (shared gRPC transport).delega a DispatcherOrchestrator.dispatch (transporte gRPC compartido).
BuildDeliveryStatusUpdateDispatcherPayloadUseCase builder · orderbuilder · orderbuilder · order
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
build({input})DispatcherEnvelopeDispatcherType.order (MobileorderAPI). Payload OrderHeader[] com deliveryStatus = action.writeStatus, delResCode (rejeição), DeliveryDate (reschedule), proofOfDelivery: "slRep".DispatcherType.order (MobileorderAPI). OrderHeader[] payload with deliveryStatus = action.writeStatus, delResCode (reject), DeliveryDate (reschedule), proofOfDelivery: "slRep".DispatcherType.order (MobileorderAPI). Payload OrderHeader[] con deliveryStatus = action.writeStatus, delResCode (rechazo), DeliveryDate (reschedule), proofOfDelivery: "slRep".
BuildDeliveryTripSheetDispatcherPayloadUseCase builder · reschedulebuilder · reschedulebuilder · reschedule
MétodoMethodMétodoRetornaReturnsDevuelveUsoUseUso
build({input})DispatcherEnvelopeDispatcherType.deliveryReschedule (TripsheetUploadAPI). Payload tripSheet[] com orderPONum, ResID, e as datas do reagendamento. Só chamado no reschedule.DispatcherType.deliveryReschedule (TripsheetUploadAPI). tripSheet[] payload with orderPONum, ResID, and the reschedule dates. Called only on reschedule.DispatcherType.deliveryReschedule (TripsheetUploadAPI). Payload tripSheet[] con orderPONum, ResID, y las fechas del reagendamiento. Solo en reschedule.
12

Notifier & State

O DeliveriesOfTheDayNotifier (@riverpod, with AsyncGuard<DeliveriesOfTheDayState>) é o cérebro da tela. O build() observa o GetDeliveriesOfTheDayUseCase e o DeliveryOrchestrator e retorna guardedBuild(_load). O State (Freezed) é a fonte única de verdade: guarda o container de entregas e o estado de cliente (aba, seleção). A filtragem/ordenação por aba é client-side, em getters do State. As ações de escrita delegam ao orchestrator e aplicam o resultado no State.The DeliveriesOfTheDayNotifier (@riverpod, with AsyncGuard<DeliveriesOfTheDayState>) is the screen's brain. build() watches GetDeliveriesOfTheDayUseCase and DeliveryOrchestrator and returns guardedBuild(_load). The State (Freezed) is the single source of truth: it holds the delivery container and client state (tab, selection). Filtering/sorting per tab is client-side, in State getters. Write actions delegate to the orchestrator and apply the result to the State.El DeliveriesOfTheDayNotifier (@riverpod, with AsyncGuard<DeliveriesOfTheDayState>) es el cerebro de la pantalla. build() observa GetDeliveriesOfTheDayUseCase y DeliveryOrchestrator y retorna guardedBuild(_load). El State (Freezed) es la fuente única de verdad: guarda el container de entregas y el estado de cliente (pestaña, selección). El filtrado/orden por pestaña es client-side, en getters del State. Las acciones de escritura delegan al orchestrator y aplican el resultado en el State.

MétodosMethodsMétodos

_load({source = local}) private

RetornoReturnRetorno Future<DeliveriesOfTheDayState>

Dono único da montagem: _getDeliveriesUseCase.execute(source)getOrThrow()State(data). Chamado pelo build() e pelo refresh().Sole owner of building: _getDeliveriesUseCase.execute(source)getOrThrow()State(data). Called by build() and refresh().Dueño único del armado: _getDeliveriesUseCase.execute(source)getOrThrow()State(data). Llamado por build() y refresh().

refresh({source = remote}) pull-to-refresh

RetornoReturnRetorno Future<void>

Recarrega via _load(remote) e preserva a aba e a seleção (selectedTab, selectedDeliverySfid). Envolvido em runGuarded (AsyncGuard).Reloads via _load(remote) and preserves tab and selection (selectedTab, selectedDeliverySfid). Wrapped in runGuarded (AsyncGuard).Recarga vía _load(remote) y preserva la pestaña y la selección (selectedTab, selectedDeliverySfid). Envuelto en runGuarded (AsyncGuard).

selectTab({tab})

RetornoReturnRetorno void

Troca a aba ativa e limpa a seleção (selectedDeliverySfid = null).Switches the active tab and clears the selection (selectedDeliverySfid = null).Cambia la pestaña activa y limpia la selección (selectedDeliverySfid = null).

toggleSelection({sfid})

RetornoReturnRetorno void

Marca/desmarca o rádio — para entregas pending (ignora as demais). Tocar na já selecionada limpa a seleção.Checks/unchecks the radio — only for pending deliveries (ignores the rest). Tapping the selected one clears it.Marca/desmarca el radio — solo para entregas pending (ignora las demás). Tocar la ya seleccionada limpia la selección.

confirmSelected()

RetornoReturnRetorno Future<Failure?>

Ação confirm sobre a entrega selecionada (sem seleção → UnknownFailure). Delega a _runAction.confirm action on the selected delivery (no selection → UnknownFailure). Delegates to _runAction.Acción confirm sobre la entrega seleccionada (sin selección → UnknownFailure). Delega a _runAction.

rejectSelected({reason})

RetornoReturnRetorno Future<Failure?>

Ação reject com o DeliveryCancelReasonEntity escolhido no modal.reject action with the DeliveryCancelReasonEntity chosen in the modal.Acción reject con el DeliveryCancelReasonEntity elegido en el modal.

rescheduleDelivery({order, date})

RetornoReturnRetorno Future<Failure?>

Ação reschedule na order passada (não depende da seleção — vem do swipe do card) para a nova date.reschedule action on the given order (not tied to the selection — comes from the card swipe) to the new date.Acción reschedule en la order pasada (no depende de la selección — viene del swipe de la tarjeta) para la nueva date.

_runAction(...) · _applyUpdatedOrder(...) private

_runAction resolve o currentResourceProvider, chama _orchestrator.updateDelivery e, em sucesso, aplica _applyUpdatedOrder: substitui a order na lista do State e limpa a seleção se era ela. Erro → devolve o Failure ao widget (que mostra ConectaNotice)._runAction resolves currentResourceProvider, calls _orchestrator.updateDelivery and, on success, applies _applyUpdatedOrder: replaces the order in the State list and clears the selection if it was the one. Error → returns the Failure to the widget (which shows ConectaNotice)._runAction resuelve currentResourceProvider, llama _orchestrator.updateDelivery y, en éxito, aplica _applyUpdatedOrder: reemplaza la order en la lista del State y limpia la selección si era ella. Error → devuelve el Failure al widget (que muestra ConectaNotice).

State disponível para a PageState available to the PageState disponible para la Page

DeliveriesOfTheDayState campos + gettersfields + getterscampos + getters
campotipodefault
dataDeliveriesOfTheDayEntity
selectedTabDeliveryTaball
selectedDeliverySfidString?null

Getters: visibleDeliveries (aba atual), deliveriesForTab(tab) (filtra por tab.accepts + ordena: Todas por status→data, Reagendadas por data), selectedDelivery, hasSelection, lastSyncAt (= data.lastSyncAt).Getters: visibleDeliveries (current tab), deliveriesForTab(tab) (filters by tab.accepts + sorts: All by status→date, Rescheduled by date), selectedDelivery, hasSelection, lastSyncAt (= data.lastSyncAt).Getters: visibleDeliveries (pestaña actual), deliveriesForTab(tab) (filtra por tab.accepts + ordena: Todas por estado→fecha, Reagendadas por fecha), selectedDelivery, hasSelection, lastSyncAt (= data.lastSyncAt).

13

Page e widgetsPage & widgetsPage y widgets

A DeliveriesOfTheDayPage (ConsumerWidget) observa o deliveriesOfTheDayProvider dentro de um AppPageShell (com voltar, sem drawer). Loading e erro são globais (when); o conteúdo vive num _DeliveriesBody statefull que controla o TabController. Árvore de composição (modais aninhados sob quem os abre):DeliveriesOfTheDayPage (ConsumerWidget) watches deliveriesOfTheDayProvider inside an AppPageShell (with back, no drawer). Loading and error are global (when); content lives in a stateful _DeliveriesBody that drives the TabController. Composition tree (modals nested under what opens them):DeliveriesOfTheDayPage (ConsumerWidget) observa deliveriesOfTheDayProvider dentro de un AppPageShell (con volver, sin drawer). Loading y error son globales (when); el contenido vive en un _DeliveriesBody stateful que controla el TabController. Árbol de composición (modales anidados bajo quien los abre):

  • DeliveriesOfTheDayPage
    • AppPageShell back · no drawer
      • CustomLoadingIndicator loading
      • FailureStateView error → invalidate
      • _DeliveriesBody data · TabController
        • NestedScrollView header
          • DataLoadInfo lastSyncAt
          • DeliveriesOfTheDayTitleRow ícone + título
          • DeliveryTabBarWidget CustomTabBar → selectTab
        • TabBarView 1 por DeliveryTab
          • _DeliveriesListSection deliveriesForTab(tab)
            • CustomEmptyState lista vazia
            • DeliveryCardWidget por entrega
              • SwipeToRevealReschedule só pending → _openReschedule
                • CustomCalendarModalContent modal · próximo dia útil, 60d, sem fim de semana → rescheduleDelivery
              • _DeliveryCardHeader
                • CustomRadio só pending → toggleSelection
                • _DeliveryStatusPill tag por status
              • _DeliveryCardDetails expandido
                • DeliveryProductGroupWidget por grupo · SKU/preço/qty
                • total de itens deliveryTotalItems
        • DeliveryActionButtonsWidget Rejeitar (outlined) · Confirmar (filled) · enable = hasSelection
          • DeliveryConfirmModalContent modal → confirmSelected
          • DeliveryRejectReasonModalContent modal · dropdown de motivos → rejectSelected

Notas por mercadoMarket notesNotas por mercado

Entregas do dia é dirigida por End Market Configuration: o atalho existe só onde o módulo rep_actions lista deliveries_of_the_day como visível. Hoje isso é BR e CL — no ZA o rep_actions traz só tasks, então a tela não é alcançável lá.Deliveries of the day is driven by End Market Configuration: the shortcut exists only where the rep_actions module lists deliveries_of_the_day as visible. Today that's BR and CL — on ZA the rep_actions module carries only tasks, so the screen isn't reachable there.Entregas del día se rige por End Market Configuration: el atajo existe solo donde el módulo rep_actions lista deliveries_of_the_day como visible. Hoy eso es BR y CL — en ZA el rep_actions trae solo tasks, así que la pantalla no es alcanzable allí.

BRx CLx ZA AR PY PE
disponívelavailabledisponible presente, desligadopresent, offpresente, apagado ausenteabsentausente
BR

Brasil · ChileBrazil · ChileBrasil · Chile Atalho e ações habilitados. A moeda dos itens segue o formato do mercado (BR/CL estilo 1.234,56; CLP sem decimais). Confirmar/rejeitar usam a transação MobileorderAPI (BR/CL/ZA); reagendar usa também TripsheetUploadAPI (deliveryReschedule), habilitada em BR/CL. Shortcut and actions enabled. Item currency follows the market format (BR/CL as 1.234,56; CLP without decimals). Confirm/reject use the MobileorderAPI transaction (BR/CL/ZA); reschedule also uses TripsheetUploadAPI (deliveryReschedule), enabled in BR/CL. Atajo y acciones habilitados. La moneda de los ítems sigue el formato del mercado (BR/CL como 1.234,56; CLP sin decimales). Confirmar/rechazar usan la transacción MobileorderAPI (BR/CL/ZA); reagendar usa también TripsheetUploadAPI (deliveryReschedule), habilitada en BR/CL.

ZA

Sem atalhoNo shortcutSin atajo O rep_actions do ZA lista só tasks — sem deliveries_of_the_day. Embora a transação de status (MobileorderAPI) exista no ZA, não há ponto de entrada para a tela. ZA's rep_actions lists only tasks — no deliveries_of_the_day. Although the status transaction (MobileorderAPI) exists on ZA, there is no entry point to the screen. El rep_actions de ZA lista solo tasks — sin deliveries_of_the_day. Aunque la transacción de estado (MobileorderAPI) existe en ZA, no hay punto de entrada a la pantalla.

AR · PY · PE Existem como mercados do app, mas não têm o módulo/atalho no End Market Configuration — a tela é inalcançável. (AR/PY/PE rodam com config mínima PANGEA.) They exist as app markets, but have no module/shortcut in the End Market Configuration — the screen is unreachable. (AR/PY/PE run on minimal PANGEA config.) Existen como mercados de la app, pero no tienen el módulo/atajo en el End Market Configuration — la pantalla es inalcanzable. (AR/PY/PE corren con config mínima PANGEA.)