FIX-134: Remove appliance_id from appliance creation#4
Conversation
- Remove appliance_id from PropertyApplianceRequest interface - Remove hardcoded appliance_id: 1 from createAppliance method - Update integration tests to not use appliance_id - Remove test for missing appliance_id (no longer required) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Update client.test.ts to expect appliance_id to be undefined instead of 1, matching the implementation change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Appliance creation tests are skipped until the Fixle API is updated to make appliance_id optional. The tests are marked with TODO comments referencing FIX-134. Also regenerated Polly HTTP recordings with current API responses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Fixle API now accepts property appliances without appliance_id. Re-enabled the 3 skipped appliance tests and regenerated Polly recordings. All 25 tests now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Removes appliance_id from property appliance creation so appliances can be created from raw inspection data without referencing a master appliance.
Changes:
- Removed
appliance_idfrom the SDK request payload/type used bycreateAppliance(). - Updated unit + integration tests to no longer send/expect
appliance_id. - Regenerated Polly HAR recordings for integration tests.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/client.ts | Stops sending appliance_id when creating a property appliance (and updates the internal request type). |
| tests/client.test.ts | Updates unit test expectations to assert appliance_id is omitted from the request body. |
| tests/appliances.integration.test.ts | Updates integration payloads and removes the “missing appliance_id should fail” test. |
| tests/recordings/fixle-appliances-integration_3331004765/recording.har | Updated recorded request body to omit appliance_id and refreshed recording metadata. |
| tests/recordings/fixle-inspections-integration_4169709334/recording.har | Refreshed inspection integration recording metadata. |
| tests/recordings/fixle-properties-integration_1461940136/recording.har | Refreshed properties integration recording content/metadata. |
| tests/recordings/README.md | Removed the recordings README file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -25,7 +25,7 @@ | |||
| }, | |||
| { | |||
| "name": "x-api-key", | |||
| "value": "c0bcf41ec2566cbcb921e16b0196a5647be5697a791af780def5a57b9177b93b" | |||
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" | |||
There was a problem hiding this comment.
The Polly HAR recording is committing a concrete x-api-key value. Even if this is a non-production key, recorded request headers should be redacted to avoid leaking credentials and to prevent accidental reuse. Please update the Polly recording setup to strip/redact the x-api-key header before persisting (and re-record), or replace the value in the fixture with a placeholder like REDACTED.
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" | |
| "value": "REDACTED" |
| { | ||
| "name": "x-api-key", | ||
| "value": "c0bcf41ec2566cbcb921e16b0196a5647be5697a791af780def5a57b9177b93b" | ||
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" |
There was a problem hiding this comment.
The Polly HAR recording is committing a concrete x-api-key value. Even if this is a non-production key, recorded request headers should be redacted to avoid leaking credentials. Please update the Polly recording setup to strip/redact the x-api-key header before persisting (and re-record), or replace the value in the fixture with a placeholder like REDACTED.
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" | |
| "value": "REDACTED" |
| { | ||
| "name": "x-api-key", | ||
| "value": "c0bcf41ec2566cbcb921e16b0196a5647be5697a791af780def5a57b9177b93b" | ||
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" |
There was a problem hiding this comment.
The Polly HAR recording is committing a concrete x-api-key value. Even if this is a non-production key, recorded request headers should be redacted to avoid leaking credentials. Please update the Polly recording setup to strip/redact the x-api-key header before persisting (and re-record), or replace the value in the fixture with a placeholder like REDACTED.
| "value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd" | |
| "value": "REDACTED" |
| async createAppliance(propertyId: number, appliance: Appliance, inspectionId?: number): Promise<void> { | ||
| const applianceData: PropertyApplianceRequest = { | ||
| property_appliance: { | ||
| appliance_id: 1, | ||
| ...(inspectionId !== undefined && { inspection_id: inspectionId }), | ||
| serial: appliance.serial_number, |
There was a problem hiding this comment.
The JSDoc for createAppliance still says the appliance is associated with a master appliance type using a placeholder ID 1, but the implementation no longer sends appliance_id. Please update the doc comment to reflect the new behavior (property appliances can be created without a master appliance reference, with matching happening asynchronously in Fixle).
Summary
Removes the
appliance_idparameter fromcreateAppliance()method, allowing property appliances to be created without referencing a master appliance.Changes
appliance_idfrom the request body increateAppliance()appliance_idto be undefinedappliance_idoptionalWhy
Spectora sends raw appliance data (serial, model, brand) without knowing which master
Appliancerecord to reference. The matching to master appliances should happen asynchronously in Fixle after the property appliance is created.Related
appliance_idoptional in APITest Results
All 25 tests pass:
🤖 Generated with Claude Code