feat(market): fix publish-duplicates, add offer detail page + filters
The vecino/market view had three gaps: - Publishing inventory duplicated the listing. discover() appended every offer the relay streamed, but relays legitimately resend an addressable NIP-99 event (stored copy + live echo on publish). Merge by (authorPubkeyHex, id) so each offer appears once; two authors reusing a lot id stay distinct. - No product detail. Tapping a card jumped straight to chat. Add a read-only "product page" (MarketOfferDetailScreen) with title, mode, category, eco badge, coarse location, price, a "Shared by" seller section (profile fetched by pubkey) and the message button. Reached via a new /market/offer route; cards are now fully tappable. Shows only what the network already carries — no photos/description added to the wire. - No filters. Add a filter bar (type, category, eco) mirroring inventory, each chip group shown only when a discovered offer can match it. To make the eco filter real, publish the organic flag on the wire: Offer.isOrganic -> NIP-99 'organic' tag -> OfferMapper -> ShareableLot. Tests: commons_core organic round-trip; app-side dedup, two-author separation, filter logic, mapper passthrough; detail-screen widget tests. i18n keys added to en/es/pt/ast and slang regenerated.
This commit is contained in:
parent
138027a8ef
commit
0213152bfb
21 changed files with 982 additions and 107 deletions
|
|
@ -128,6 +128,7 @@ class ShareableLot extends Equatable {
|
|||
required this.offerStatus,
|
||||
this.category,
|
||||
this.harvestYear,
|
||||
this.isOrganic = false,
|
||||
});
|
||||
|
||||
final String lotId;
|
||||
|
|
@ -140,8 +141,13 @@ class ShareableLot extends Equatable {
|
|||
final String? category;
|
||||
final int? harvestYear;
|
||||
|
||||
/// The variety's grower-declared organic ("eco") flag, published so peers can
|
||||
/// filter the market for it.
|
||||
final bool isOrganic;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [lotId, summary, offerStatus, category, harvestYear];
|
||||
List<Object?> get props =>
|
||||
[lotId, summary, offerStatus, category, harvestYear, isOrganic];
|
||||
}
|
||||
|
||||
/// One germination test on a lot; [rate] is derived (0..1), null when it can't
|
||||
|
|
@ -1269,6 +1275,7 @@ class VarietyRepository {
|
|||
offerStatus: l.offerStatus,
|
||||
category: v.category,
|
||||
harvestYear: l.harvestYear,
|
||||
isOrganic: v.isOrganic,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue