Giao diện
API · campaign-import
Trang sinh tự động
Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.
3 query · 0 mutation.
Query
campaignImportCheck
Kiểm tra file (BR-IM-05): classifies the file against current, writes nothing (DEC-CV3-07). Requires deal.manage.
query · quyền: deal.manage
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | CampaignImportCheckInput! |
Trả về CampaignImportResult!
| Field | Kiểu | Mô tả |
|---|---|---|
mode | CampaignImportMode! | |
rowCount | Int! | Data rows read (Tổng dòng = valid + error); 0 when fileError is set. |
fileError | CampaignImportFileError | |
rows | [CampaignImportRow!]! | Valid rows in the order of the list after import (REPLACE: kept products fill the other positions); empty when fileError is set. |
rowErrors | [CampaignImportRowError!]! | |
groups | CampaignImportGroups! | |
removed | [CampaignImportRemoved!]! | |
kept | [CampaignImportKept!]! | REPLACE only (DEC-CV3-22), empty otherwise: the list after import = rows and kept merged by position (1..n, no gap); a client that applies only rows drops these products. |
errorFileB64 | String | File lỗi = the original file plus the column 'Lỗi' (BR-IM-06), base64 .xlsx; null without row errors. |
campaignImportPreflight
Số dòng sản phẩm of the chosen file (DEC-CV3-23): the caller's own READY upload, else not_found. Requires deal.manage.
query · quyền: deal.manage
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
fileMediaId | ID! |
Trả về CampaignImportPreflight!
| Field | Kiểu | Mô tả |
|---|---|---|
ok | Boolean! | True when the file passes the whole-file gate. |
rowCount | Int! | Data rows (header and blank rows not counted), 1..1.000 when ok; 0 when fileError is set. |
fileError | CampaignImportFileError | not_xlsx | wrong_template | no_rows | too_many_rows (duplicates always empty); null when ok. |
campaignImportTemplate
Tải file mẫu Mua chung / Mua định kỳ (.xlsx). Requires deal.manage.
query · quyền: deal.manage
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
campaignType | CampaignType! |
Trả về CampaignImportTemplate!
| Field | Kiểu | Mô tả |
|---|---|---|
fileName | String! | |
contentB64 | String! | The .xlsx bytes, base64. |