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 @@
/**
* ASTCOL-020 to ASTCOL-035: the change cards of the collections' writes, as
* ASTCOL-020 to ASTCOL-035 and ASTCOL-037: the change cards of the collections' writes, as
* describeToolCall writes them (the card through the guarded registry, so it
* passed the union), and the lookups they read first.
*/
@@ -104,6 +104,21 @@ describe('collection change cards', () => {
expect(placesOf(removed.card).places[0]?.delta?.removed).toBe(true);
});
it('ASTCOL-037: the provider ids, contact and price fields an update now takes are named once each (#2646)', () => {
const items = itemsValue([savedPlace()]);
const args = {
placeId: 34,
website: 'septime-charonne.fr',
phone: null,
price: 45,
currency: 'EUR',
google_place_id: 'ChIJseptime',
osm_id: 'node/1',
};
const card = placesOf(preview('update_collection_place', args, { items }).card);
expect(card.places[0]?.delta?.fields).toEqual(['website', 'phone', 'price', 'mapEntry']);
});
it('ASTCOL-023: a change of a saved place names its fields, its labels as its own list allows them and the list it moves to', () => {
const items = itemsValue([savedPlace()]);
// In its own list: the labels asked for replace the ones it carries.