Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export interface Appliance {
*/
export interface PropertyApplianceRequest {
property_appliance: {
appliance_id?: number | null;
inspection_id?: number | null;
serial: string | null;
model: string | null;
Expand Down Expand Up @@ -307,7 +306,6 @@ export class FixleClient {
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,
Comment on lines 306 to 310
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.
model: appliance.model,
Expand Down
20 changes: 0 additions & 20 deletions tests/appliances.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ describe('Fixle API - Appliances Integration Tests', () => {

const applianceData = {
property_appliance: {
appliance_id: 1,
serial: 'TEST-SERIAL-123',
model: 'Model-X1000',
year: '2024',
Expand Down Expand Up @@ -102,7 +101,6 @@ describe('Fixle API - Appliances Integration Tests', () => {

const applianceData = {
property_appliance: {
appliance_id: 1,
serial: `MIN-${Date.now()}`,
model: null,
year: null,
Expand All @@ -127,7 +125,6 @@ describe('Fixle API - Appliances Integration Tests', () => {
const appliances = [
{
property_appliance: {
appliance_id: 1,
serial: `MULTI-1-${Date.now()}`,
model: 'Model-A',
year: '2024',
Expand All @@ -136,7 +133,6 @@ describe('Fixle API - Appliances Integration Tests', () => {
},
{
property_appliance: {
appliance_id: 1,
serial: `MULTI-2-${Date.now()}`,
model: 'Model-B',
year: '2023',
Expand All @@ -161,25 +157,9 @@ describe('Fixle API - Appliances Integration Tests', () => {
expect(responses[0].data.id).not.toBe(responses[1].data.id);
}, 30000);

it('should fail when appliance_id is missing', async () => {
testPropertyId = await createTestProperty();

const applianceData = {
property_appliance: {
serial: 'NO-APPLIANCE-ID',
model: 'TestModel',
},
};

await expect(
makeApiRequest('POST', `/api/v1/properties/${testPropertyId}/appliances`, applianceData)
).rejects.toThrow(/422|Appliance must exist/);
}, 30000);

it('should fail when property does not exist', async () => {
const applianceData = {
property_appliance: {
appliance_id: 1,
serial: 'TEST-123',
model: 'TestModel',
},
Expand Down
2 changes: 1 addition & 1 deletion tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('FixleClient', () => {
expect(parsedBody.property_appliance.model).toBe('XE50M06ST45U1');
expect(parsedBody.property_appliance.serial).toBe('ABC123456');
expect(parsedBody.property_appliance.year).toBe('2020');
expect(parsedBody.property_appliance.appliance_id).toBe(1);
expect(parsedBody.property_appliance.appliance_id).toBeUndefined();
expect(parsedBody.property_appliance.inspection_id).toBeUndefined();
});

Expand Down
1 change: 0 additions & 1 deletion tests/recordings/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "e4a812ad40e202c4a4f862120a64f1e3",
"_id": "87003cca659c865a278e558143d768f3",
"_order": 0,
"cache": {},
"request": {
"bodySize": 81,
"bodySize": 64,
"cookies": [],
"headers": [
{
Expand All @@ -25,11 +25,11 @@
},
{
"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": "content-length",
"value": 81
"value": 64
},
{
"name": "host",
Expand All @@ -42,7 +42,7 @@
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"property_appliance\":{\"appliance_id\":1,\"serial\":\"TEST-123\",\"model\":\"TestModel\"}}"
"text": "{\"property_appliance\":{\"serial\":\"TEST-123\",\"model\":\"TestModel\"}}"
},
"queryString": [],
"url": "http://localhost:3000/api/v1/properties/99999999/appliances"
Expand Down Expand Up @@ -90,37 +90,37 @@
},
{
"name": "x-request-id",
"value": "7005d419-7a96-4ad0-8eba-734c0916a1f2"
"value": "e8eb71df-cc77-4e27-918a-dabae3f5a3bd"
},
{
"name": "x-runtime",
"value": "0.023668"
"value": "0.014869"
},
{
"name": "server-timing",
"value": "start_processing.action_controller;dur=0.00, sql.active_record;dur=1.24, instantiation.active_record;dur=0.02, process_action.action_controller;dur=2.93"
"value": "start_processing.action_controller;dur=0.00, sql.active_record;dur=1.38, instantiation.active_record;dur=0.01, rescue_from_callback.action_controller;dur=0.00, process_action.action_controller;dur=8.08"
},
{
"name": "content-length",
"value": "180"
}
],
"headersSize": 525,
"headersSize": 574,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2025-11-20T18:37:29.620Z",
"time": 26,
"startedDateTime": "2026-02-02T18:51:17.843Z",
"time": 16,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 26
"wait": 16
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"entries": [
{
"_id": "66db20409bd13d09ca54d50a139117d4",
"_id": "65ea730bff656dbcfbe6544a498e0e3e",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -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. 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": "content-length",
Expand All @@ -42,7 +42,7 @@
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"inspection\":{\"external_id\":\"INSP-1763663849853\"}}"
"text": "{\"inspection\":{\"external_id\":\"INSP-1770058279353\"}}"
},
"queryString": [],
"url": "http://localhost:3000/api/v1/properties/99999999/inspections"
Expand Down Expand Up @@ -90,37 +90,37 @@
},
{
"name": "x-request-id",
"value": "68c883b6-8cd8-42d1-8cd1-4ec63c9dbfb1"
"value": "7a4ac97e-ee9f-497d-b073-08024cc4050a"
},
{
"name": "x-runtime",
"value": "0.010680"
"value": "0.011487"
},
{
"name": "server-timing",
"value": "start_processing.action_controller;dur=0.00, sql.active_record;dur=1.10, instantiation.active_record;dur=0.01, process_action.action_controller;dur=2.43"
"value": "start_processing.action_controller;dur=0.00, sql.active_record;dur=1.47, instantiation.active_record;dur=0.01, rescue_from_callback.action_controller;dur=0.00, process_action.action_controller;dur=5.03"
},
{
"name": "content-length",
"value": "180"
}
],
"headersSize": 525,
"headersSize": 574,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2025-11-20T18:37:29.854Z",
"time": 11,
"startedDateTime": "2026-02-02T18:51:19.353Z",
"time": 13,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 11
"wait": 13
}
}
],
Expand Down

Large diffs are not rendered by default.

Loading