Pesquisa — coezzion_vendas_app (zzapp)
Repo: /Users/alt-zz/projetos/arezzo/coezzion_vendas_app
Data: 2026-07-09
Escopo: UI/create/edit de vitrines e expiração
1. Hub “Vitrines”
Arquivo: lib/screens/show_case/show_case/show_case_screen.dart
Rota: /show_case
| Card | Quem | Rota |
|---|---|---|
| Vitrine da marca | Seller + manager | brandShowCaseList |
| Vitrine por histórico de compras | Seller | recommendShowCaseList |
| Minhas vitrines | Seller | storeShowCaseList / my show case |
Feature flag: enable_showcase (Firebase Remote Config).
2. Minhas vitrines (Store)
Fluxo create
- Lista → CRIAR VITRINE (
my_show_case_list_*) - Busca produtos (
show_case_search_products_*) —setCreateModedefineexpirationDate = startDate + 31d - Conferir (
show_case_check_products_*+check_fast_catalog_product_list.dart) - POST
api/show-case-new(CreateShowCaseRequest)
Fluxo edit
- Detalhe (
show_case_detail_*) - Campo expiração só se API retornou
dateExpiration != null - PUT update / PUT delete
Regras de data (UI)
| Valor | |
|---|---|
| Default | +31 dias |
| Min picker | amanhã (now+1) |
| Max picker | now+31 |
| Required | Soft — sempre pré-preenchido; fallbacks +31 no submit |
Models
| Model | dateExpiration |
|---|---|
CreateShowCaseRequest | DateTime? — serializa ISO ou null |
UpdateShowCaseRequest | DateTime required no tipo Dart |
ShowCaseResponseItem | required (asDateTimeOrThrow) |
ShowCaseDetailResponse | nullable |
Listagem
listItem.dart — Minhas não passa nullExpirationLabel (assume data).
3. Histórico de compras (Recommend)
Fluxo create
Customer → produtos recomendados → check products → POST api/show-case-new/recommend
Controller create: recommend_show_case_check_products_controller.dart
- Default = lastExpirationDate (now+31 start of day)
- Min = amanhã; max = now+31
- Se null no submit: toast "Selecione a data de expiração"
Fluxo edit
recommend_show_case_detail_*
- Required no update (mesmo toast)
- Min = hoje
- Sem
finalDateRangeno edit (sem max no picker)
Models
| Model | expiration |
|---|---|
| Create/Update request | dateExpiration enviado |
| List/Detail | nullable; testes cobrem null |
Listagem
Passa nullExpirationLabel: 'Sem data de expiração' — UI parcialmente preparada.
4. Vitrine da marca (read-only no app)
- Lista/detalhe só leitura de expiração formatada.
- Share: POST
brand-seller. - Fora do CA de edição da SP.
5. Widget compartilhado de lista
lib/screens/show_case/widgets/listItem.dart:
final showExpiration = expirationDate != null || nullExpirationLabel != null;
final expirationText = expirationDate != null
? 'Data de expiração: ${MaskUtils.formatDateBr(expirationDate!)}'
: nullExpirationLabel ?? '';
CA-4 da SP encaixa neste padrão com label "Sem data de expiração".
6. APIs usadas (ApiUtils)
Prefixo: api/show-case-new
| Fluxo | Métodos principais |
|---|---|
| Minhas | GET store, GET app/{id}, POST/, PUT/, PUT/delete |
| Recommend | GET recommend/..., POST recommend, PUT/DELETE recommend/{id}, POST recommend/products |
| Brand | GET brand/app, detail, items-app, POST brand-seller |
7. Impacto da Spike neste repo
| Item | Ação |
|---|---|
| Date picker clearable (minhas + recommend create/edit) | Implementar |
| Remover hard-required recommend | Implementar |
| Default +31 mantido na UI | Manter (D3) |
UpdateShowCaseRequest.dateExpiration nullable | Sim |
ShowCaseResponseItem nullable + label na lista minhas | Sim |
| Detail minhas: mostrar campo mesmo se null | Sim |
| Recommend edit: aplicar max range | Alinhar com create |
| Testes models null | Estender |
Arquivos-chave
lib/screens/show_case/show_case/show_case_screen.dart
lib/screens/show_case/my_show_case_list/
lib/screens/show_case/show_case_detail/
lib/screens/show_case/search/show_case_search_products_controller.dart
lib/screens/show_case/show_case_check_products/
lib/screens/show_case/recommend_show_case_*
lib/screens/show_case/widgets/listItem.dart
lib/models/show_case/*
lib/models/recommend_show_case/*
lib/theme_widgets/date_form_field/zz_date_form_field.dart
8. Quirks AS-IS
- Default/max +31, não +30 (SP).
- Recommend edit sem max; create com max.
- Minhas detail esconde campo se API não manda data.
- Minhas list quebra parse se
dateExpirationnull (OrThrow). - Recommend list já tolera null com label.