fix(performance): 쿠팡 광고 보고서 = 1열에 날짜가 있는 줄의 19열 값(빈 줄 건너뜀, 같은 날 합산)

쿠팡(윙) 보고서는 캠페인 줄에도 날짜가 있고 19열이 비어 있어 "청구금액이 비어 있습니다" 오류로 전부 막혔다.
금액이 한 줄도 없던 날은 업로드 창에 알려 준다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 17:38:08 +09:00
parent db73faf270
commit 53896f0425
9 changed files with 72 additions and 22 deletions
+9 -1
View File
@@ -30,7 +30,7 @@ async function env(file) {
}
if (/^\/performance\/api\/ad-spend\/upload/.test(url)) {
return { ok: true, status: 200, json: async function () {
return { ok: true, saved: 12, name: "쿠팡(로켓)", total: 2636494, from: "2026-10-01", to: "2026-10-12" }; } };
return { ok: true, saved: 12, name: "쿠팡(로켓)", total: 2636494, from: "2026-10-01", to: "2026-10-12", empty_days: e.uploadEmpty || [] }; } };
}
const ad = /^\/performance\/api\/ad-spend\/([^/]+)\/([\d-]+)$/.exec(url);
if (ad) {
@@ -204,6 +204,14 @@ function gross(td) { return td.querySelector(".v-gross").textContent.trim(); }
check("[업로드] 파일마다 files + 파일 날짜(modified)", post && post.form.getAll("files").length === 2 &&
JSON.stringify(post.form.getAll("modified")) === JSON.stringify(["1700000000000", "1800000000000"]), post && post.form.getAll("modified"));
check("[업로드] 끝나면 창이 닫힘", !e.d.body.contains(modal) && !e.d.querySelector(".perf-modal"));
// 금액이 없던 날짜가 있으면 창을 두고 알려 준다
e.uploadEmpty = ["2026-03-02"];
e.d.getElementById("perf-ad-upload").click();
const modal2 = e.d.querySelector(".perf-modal");
Object.defineProperty(modal2.querySelector(".perf-upload-file"), "files", { value: [f] });
Array.from(modal2.querySelectorAll("button")).filter(function (b) { return b.textContent === "업로드"; })[0].click();
await settle();
check("[업로드] 금액 없던 날짜 → 창 유지 + 날짜 안내", e.d.body.contains(modal2) && /건너뛴 날짜 1일: 2026-03-02/.test(modal2.textContent), modal2.textContent);
}
// ── 네이버 — 보고서 ROAS 표시 · 머리글 → 일자별 보고서 항목 ──
{