const manifestsAPI = {
  createCarUpdates: async (data, token) => {
    if (!data.id) data.id = 0;
    data.id++;
    return data;
  },

  archiveManifest: async (data, token) => {
    return { message: "Archived 1 update manifests" };
  },

  deleteManifest: async (manifest_id, token) => {
    return { message: "OK" };
  },

  getPackages: async (search, token) => {
    return {
      data: [
        {
          id: 1,
          package_name: "Test",
          version: "1.0",
          link: "https://cloudfront.com/download",
          ecu_list: "ECU1 1.0.0,ECU2 1.0.2",
        },
        {
          id: 2,
          package_name: "Test",
          version: "1.1",
          link: "https://cloudfront.com/download",
          ecu_list: "ECU1 1.0.1,ECU2 1.0.2",
        },
        {
          id: 3,
          package_name: "Test",
          version: "1.2",
          link: "https://cloudfront.com/download",
          ecu_list: "ECU1 1.1.0,ECU2 1.1.2",
        },
      ],
    };
  },

  updatePackage: async (data, token) => {
    return data;
  },

  deployPackage: async (data, token) => {
    return data;
  },

  getCarUpdates: async (filter, token) => {
    return { data: [] };
  },

  getVINUpdates: async (vin, token) => {
    return { data: [] };
  },

  getCarUpdateProgress: async (carupdateids, token) => {
    return { statuses: [] };
  },

  updateManifest: async (id, data, token) => {
    return {
      id,
      ...data,
    }
  },

  getManifest: async (id, token) => {
    return {
      id,
      name: "Test Deployment",
      version: "1.0.100",
      description: "Deployment folder test",
      release_notes: "https://releasenotes.com",
      ecu_list: "ICC 1000",
      ecu_updates: [
        {
          name: "ICC",
          part_number: "BBBBBB",
          version: "1000",
          files: [
            {
              file_id: "b0cda514c94080b4",
              filename: "LARGE.jpg",
              url: "https://upload-dev.fiskerdps.com/92bbc448-99c8-4851-91ad-f8042e4deb49/LARGE.jpg",
              file_size: 14559274,
              size: 14488498,
              type: "ODX Data",
              created: "2021-12-09T22:38:29.102813Z",
              updated: "2021-12-09T22:38:29.102813Z",
            },
          ],
          created: "2021-12-09T22:38:20.408351Z",
          updated: "2022-01-14T00:47:08.996451Z",
        },
      ],
      created: "2021-12-09T22:38:11.679943Z",
      updated: "2022-01-14T00:47:08.996451Z",
    };
  },
};

export default manifestsAPI;
