feat(collections): edit a saved place's provider ids, website, phone and price (#2646)

The update contract takes google_place_id, google_ftid, osm_id, website,
phone, price and currency like saving does, website with the same
normalisation and refusal. REST and update_collection_place share it, so an
agent can correct a place instead of re-saving it and losing its labels,
ratings, position and id. The assistant's change card names the new fields.
This commit is contained in:
Maurice
2026-11-13 09:33:27 +01:00
parent 72e8b1f8d9
commit cae04e83dd
44 changed files with 289 additions and 13 deletions
@@ -1,5 +1,5 @@
/**
* FE-AI-COLL-020 to FE-AI-COLL-031
* FE-AI-COLL-020 to FE-AI-COLL-031, FE-AI-COLL-041
*
* The collections inside the change card: a held save with its list, its
* status and the lists that hold the place already; a change of status, of
@@ -165,6 +165,14 @@ describe('collection change cards', () => {
expect(screen.getByText('+2')).toBeInTheDocument();
});
it('FE-AI-COLL-041: a change of the website and the map entry names both (#2646)', () => {
const delta = emptyDelta({ fields: ['website', 'mapEntry'] });
const card = placesCard({ places: [savedPlace({ delta })] });
draw([pending('update_collection_place', 'Septime', card, 'genericUpdate')]);
expect(screen.getByText('Website')).toBeInTheDocument();
expect(screen.getByText('Map entry')).toBeInTheDocument();
});
it('FE-AI-COLL-029: trip places saved to a list are trip places by nature, so no warning is given', () => {
const louvre = savedPlace({ id: null, name: 'Louvre', inTripPlaceId: 6 });
const card = placesCard({ places: [savedPlace({ id: null, inTripPlaceId: 5 }), louvre] });
@@ -45,6 +45,10 @@ const FIELD_LOOK: Record<CollectionCardDelta['fields'][number], { labelKey: stri
category: { labelKey: 'assistant.change.label.category' },
link: { labelKey: 'assistant.change.label.link' },
photo: { labelKey: 'assistant.card.collection.photo' },
website: { labelKey: 'assistant.change.label.website' },
phone: { labelKey: 'assistant.change.label.phone' },
price: { labelKey: 'assistant.change.label.price' },
mapEntry: { labelKey: 'assistant.card.collection.mapEntry' },
};
/** The verb's tile, as the row shows it without a place. */