// __mocks__/webservice/gisStationsMeasurements.js

export const mockGisStationsMeasurements = {
  Name: "Liste aller Messungen der Geraete",
  Zeitstempel: "2025-05-29T08:53:04.1449106+02:00",
  IdMap: "12",
  Statis: [
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 3,
      Na: "FBT",
      Val: "6",
      Unit: "°C",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 10,
      Na: "GT",
      Val: "-2.14",
      Unit: "°C",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 2,
      Na: "LT",
      Val: "0.21",
      Unit: "°C",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 6,
      Na: "RLF",
      Val: "77.54",
      Unit: "%",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 4,
      Na: "RS",
      Val: "30.33",
      Unit: "%",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 11,
      Na: "TPT",
      Val: "2.99",
      Unit: "°C",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 12,
      Na: "TT1",
      Val: "0.1245",
      Unit: "°C",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 16,
      Na: "WFD",
      Val: "0.211",
      Unit: "mm",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 8,
      Na: "WGM",
      Val: "0.5",
      Unit: "m/s",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 9,
      Na: "WGS",
      Val: "0.75",
      Unit: "m/s",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
    {
      IdLD: 50937,
      IdL: 24101,
      IdDP: 7,
      Na: "WR",
      Val: "180",
      Unit: "Â°",
      Gr: "GMA",
      Area_Name: "Rastede",
    },
  ],
};

// Optional: Funktion zum Ändern
export const updateMeasurement = (id, changes) => {
  const deviceMeasurement = mockGisStationsMeasurements.Statis.find(p => p.IdLD === id);
  if (deviceMeasurement) Object.assign(deviceMeasurement, changes);
};

export const deleteMeasurement = id => {
  const index = mockGisStationsMeasurements.Statis.findIndex(p => p.IdLD === id);
  if (index !== -1) mockGisStationsMeasurements.Statis.splice(index, 1);
};
