Skip to content

Comments

FIX-134: Remove appliance_id from appliance creation#4

Merged
apotema merged 4 commits intomainfrom
fix-134-remove-appliance-id
Feb 2, 2026
Merged

FIX-134: Remove appliance_id from appliance creation#4
apotema merged 4 commits intomainfrom
fix-134-remove-appliance-id

Conversation

@apotema
Copy link
Collaborator

@apotema apotema commented Feb 2, 2026

Summary

Removes the appliance_id parameter from createAppliance() method, allowing property appliances to be created without referencing a master appliance.

Changes

  • Removed appliance_id from the request body in createAppliance()
  • Updated unit tests to expect appliance_id to be undefined
  • Re-enabled integration tests after Fixle API was updated to make appliance_id optional
  • Regenerated Polly HTTP recordings

Why

Spectora sends raw appliance data (serial, model, brand) without knowing which master Appliance record to reference. The matching to master appliances should happen asynchronously in Fixle after the property appliance is created.

Related

  • fixle-rails issue #228 (merged) - Made appliance_id optional in API
  • gcp-fixle PR #12 - Uses this SDK branch

Test Results

All 25 tests pass:

  • 13 unit tests (client.test.ts)
  • 4 appliance integration tests
  • 4 inspection integration tests
  • 4 property integration tests

🤖 Generated with Claude Code

apotema and others added 4 commits February 2, 2026 12:03
- 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>
@apotema apotema requested a review from Copilot February 2, 2026 19:08
@apotema apotema merged commit 123cd97 into main Feb 2, 2026
7 checks passed
@apotema apotema deleted the fix-134-remove-appliance-id branch February 2, 2026 19:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_id from the SDK request payload/type used by createAppliance().
  • 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"
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd"
"value": "REDACTED"

Copilot uses AI. Check for mistakes.
{
"name": "x-api-key",
"value": "c0bcf41ec2566cbcb921e16b0196a5647be5697a791af780def5a57b9177b93b"
"value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd"
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd"
"value": "REDACTED"

Copilot uses AI. Check for mistakes.
{
"name": "x-api-key",
"value": "c0bcf41ec2566cbcb921e16b0196a5647be5697a791af780def5a57b9177b93b"
"value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd"
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"value": "b2bcbece2dedb0edbe8213d6f9eb84dc670c0d9e75666c5ea027ff2059ac5ecd"
"value": "REDACTED"

Copilot uses AI. Check for mistakes.
Comment on lines 306 to 310
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,
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
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.

1 participant