Skip to content

feat(stays): add chain_id support and NegotiatedRates module#1164

Merged
jekku merged 1 commit into
mainfrom
jek/chain-related-stays-changes
May 27, 2026
Merged

feat(stays): add chain_id support and NegotiatedRates module#1164
jekku merged 1 commit into
mainfrom
jek/chain-related-stays-changes

Conversation

@jekku

@jekku jekku commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add id field to StaysChain interface to support chain identification in accommodation responses
  • Add new NegotiatedRates module with full CRUD operations based on API docs:
    • create - with either chain_id or accommodation_ids (mutually exclusive)
    • get, update, list, listWithGenerator, delete
  • Add TypeScript types for negotiated rates: StaysNegotiatedRate, StaysNegotiatedRateCreatePayload, StaysNegotiatedRateUpdatePayload
  • Add MOCK_CHAIN and MOCK_NEGOTIATED_RATE test fixtures

Changes

File Change
StaysTypes.ts Added id to StaysChain, added all negotiated rate types
Stays.ts Added negotiatedRates resource
NegotiatedRates/ New module with class, index, and spec (9 tests)
mocks.ts Added MOCK_CHAIN, MOCK_NEGOTIATED_RATE, updated MOCK_ACCOMMODATION

Test plan

  • All 33 Stays tests pass
  • 9 new NegotiatedRates tests cover create, get, update, list, listWithGenerator, delete operations
  • Tests cover both chain_id and accommodation_ids variants for create/update

Made with Cursor

@jekku jekku force-pushed the jek/chain-related-stays-changes branch from 87d50cc to 39aff65 Compare May 26, 2026 13:19
@jekku jekku marked this pull request as ready for review May 26, 2026 13:19
@jekku jekku requested a review from a team as a code owner May 26, 2026 13:19
- Add `id` field to `StaysChain` interface for chain identification
- Add `NegotiatedRates` module with full CRUD operations:
  - create (with chain_id or accommodation_ids)
  - get, update, list, listWithGenerator, delete
- Add types: `StaysNegotiatedRate`, create/update payload types
- Add `MOCK_CHAIN` and `MOCK_NEGOTIATED_RATE` test fixtures
- Update `MOCK_ACCOMMODATION` to reference `MOCK_CHAIN`

Co-authored-by: Cursor <cursoragent@cursor.com>
@jekku jekku force-pushed the jek/chain-related-stays-changes branch from 1478313 to 4b6f89d Compare May 26, 2026 14:05
Comment thread src/Stays/StaysTypes.ts
* Payload for creating a negotiated rate associated with a chain.
* You must provide either chain_id or accommodation_ids, but not both.
*/
export interface StaysNegotiatedRateCreatePayloadWithChain {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: I think in TS you can use extends on interfaces so you won't have to repeat rate_access_code and display_name but not sure if you intentionally did this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be intentional. but there is something wrong here. you can't update the rac.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ... yes

@jekku jekku merged commit 9f31145 into main May 27, 2026
5 checks passed
@jekku jekku deleted the jek/chain-related-stays-changes branch May 27, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants