import { describe, expect, it } from "vitest";

import { buildCombinedStandardizationBatchUserMessage } from "./combined-standardization-contract.ts";

describe("buildCombinedStandardizationBatchUserMessage", () => {
  it("asks the model to return an items array with material ids", () => {
    const message = buildCombinedStandardizationBatchUserMessage([
      {
        materialId: "mat-1",
        row: {
          发票种类: "专票",
          名称: "不锈钢护栏",
          规格型号: "304 立柱式",
          品牌: "",
          数量: "20",
          单位: "米",
          "备注/附件": "",
          收货地址: "上海",
        },
      },
      {
        materialId: "mat-2",
        row: {
          发票种类: "专票",
          名称: "PVC 管",
          规格型号: "DN50",
          品牌: "",
          数量: "10",
          单位: "根",
          "备注/附件": "",
          收货地址: "杭州",
        },
      },
    ]);

    expect(message).toContain('"items"');
    expect(message).toContain("material_id：mat-1");
    expect(message).toContain("material_id：mat-2");
    expect(message).toContain("名称：不锈钢护栏");
    expect(message).toContain("名称：PVC 管");
  });
});
