Skip to content

API · campaign ​

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.

13 query · 8 mutation.

Query ​

campaign ​

Campaign configuration and history (figures: campaignOverview, U19-P2-08). Requires deal.read.

query · quyền: deal.read

Tham sốKiểuMặc địnhMô tả
idID!

Trả về Campaign!

FieldKiểuMô tả
idID!
codeString!Mã chiến dịch CD + ddmmyyyy + 4 số (B006.R14).
clonedFromCampaignCloneSource
typeCampaignType!
nameString
descriptionString
stateCampaignState!
statusCampaignStatus!
opensAtDateTime
closesAtDateTime
termOptions[Int!]Recurring only: Số kỳ of the term packages, ascending (U19-P1-05; the packages are Campaign.termPackages).
productCountInt!
products[CampaignProduct!]!
milestones[CampaignMilestone!]!
history[CampaignHistoryEntry!]!Lịch sử thao tác, newest first (U19-P2-04, B171.R11).
createdAtDateTime!
updatedAtDateTime!
versionInt!
rewardUnitCampaignRewardUnit
pointCapBpIntTrần thanh toán bằng Pi-Point of this campaign, basis points 0..10000.
payNowBonusIntMua chung: Thưởng thanh toán online, in rewardUnit.
prepayAllBonusIntMua định kỳ: Thưởng khi trả trước toàn bộ các kỳ, in rewardUnit.
spinWheelSpinWheelÁp dụng vòng quay may mắn (both types, BR-C-09, DEC-CV3-05): id, code, name, status of the chosen wheel; null = Không áp dụng.
termsSetIdIDĐiều khoản tham gia Deal (DealTermsSet id).
publishAtDateTimeThời gian công bố.
serverTimeDateTime!Server clock for the countdowns (B171.R05).
creatorAdminAccountRef!Tạo bởi (B171.R03).
termsDealTermsSetĐiều khoản tham gia Deal (B058.R10).
depositRatePctFloatMức cọc, % (current configuration).
pointCapPctFloatTrần thanh toán bằng Pi-Point, %.
maxCyclesIntMua định kỳ: Số kỳ tối đa = the longest package (B273.R02); null for a Group Buy.
cycles[CampaignCycle!]!Recurring delivery schedule computed from the start month, windows and longest package; empty for a Group Buy.
deliveryStartMonthStringMua định kỳ: Kỳ bắt đầu giao, YYYY-MM.
minOrderValueVndVndAmountMua định kỳ: Giá trị đơn tối thiểu per period.
deliveryWindows[CampaignDeliveryWindow!]!Mua định kỳ: khung ngày giao, window 1 first; empty for a Group Buy.
termPackages[CampaignTermPackage!]!Mua định kỳ: gói kỳ cam kết, package 1 first; empty for a Group Buy.

campaignCloneSource ​

Nhân bản: the form prefill from a campaign in any state (B006.R13). Requires deal.manage.

query · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
idID!

Trả về CampaignCloneDraft!

FieldKiểuMô tả
typeCampaignType!
clonedFromIdID!
clonedFromCodeString!
nameString
descriptionString
publishAtDateTime
opensAtDateTime
closesAtDateTime
rewardUnitCampaignRewardUnit
termsSetIdID
depositRatePctFloat
pointCapPctFloat
payNowBonusInt
prepayAllBonusInt
spinWheelSpinWheelBR-C-12: the source's wheel; null (Không áp dụng) when none or when it is Ngừng hoạt động (INACTIVE).
products[CampaignCloneProduct!]!
milestones[CampaignCloneMilestone!]!
deliveryStartMonthString
minOrderValueVndVndAmount
deliveryWindows[CampaignDeliveryWindow!]!
termPackages[CampaignTermPackage!]!

campaignCreators ​

Bộ lọc Người tạo: accounts that may create a campaign (B036.R06). Requires deal.read.

query · quyền: deal.read

Không có tham số.

Trả về [AdminAccountRef!]!

FieldKiểuMô tả
idID!
displayNameStringprofiles.full_name; null when the account has no profile (shown as —).

campaignOverlap ​

Field check when leaving Thời gian mở/đóng (B006.R18; touching is not overlapping). Requires deal.manage.

query · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
typeCampaignType!
opensAtDateTime!
closesAtDateTime!
excludeIdIDThe campaign being edited.

Trả về CampaignOverlap

FieldKiểuMô tả
codeString!
opensAtDateTime!
closesAtDateTime!

campaignOverview ​

Tổng quan of a Mua chung (B171.R04-R09) or a Mua định kỳ (B256.R02-R10, field recurring). Requires deal.read.

query · quyền: deal.read

Tham sốKiểuMặc địnhMô tả
idID!

Trả về CampaignOverview!

FieldKiểuMô tả
campaignIdID!
statusCampaignStatus!
closedAtDateTimeĐã chốt lúc; null before the close.
closePaymentWaitCampaignClosePaymentWait#479 T6: null unless the campaign is CLOSING and its close waits on unpaid orders.
asOfDateTime!
kpisCampaignOverviewKpis!
products[CampaignOverviewProduct!]!
milestones[CampaignOverviewMilestone!]!
purchaseMatrixCampaignPurchaseMatrixNull before the close (Chưa có số liệu…).
configCampaignOverviewConfig!
recurringCampaignOverviewRecurringMua định kỳ only (milestones [] and purchaseMatrix null then); null for a Mua chung.

campaignPickerBrands ​

Thương hiệu list of the picker (CV3-P4-16, DEC-CV3-32): live brands whose name contains search, Tên A→Z. Requires deal.manage (not catalog.read).

query · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
searchString
pageInt1
pageSizeInt50

Trả về CampaignPickerBrandPage!

FieldKiểuMô tả
items[CampaignPickerBrand!]!
pageInt!
pageSizeInt!
totalInt!

campaignPickerCategories ​

Ngành hàng list of the picker (CV3-P4-16, DEC-CV3-32): every live category, parents first, siblings by name. Requires deal.manage (not catalog.read).

query · quyền: deal.manage

Không có tham số.

Trả về [CampaignPickerCategory!]!

FieldKiểuMô tả
idID!
parentIdID
nameString!
levelInt!
isLeafBoolean!

campaignProductPicker ​

Active (On sale) single and combo products for a campaign. search under 3 characters is validation_failed search_too_short; no / blank search loads by the filters alone. RECURRING (ĐK basket) offers single products only: productType ALL means STANDARD, COMBO is product_type_not_allowed. Requires deal.manage.

query · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
searchString
productTypeCampaignPickerProductTypeALL
categoryIdIDA category includes all of its sub-categories.
brandIdID
campaignTypeCampaignTypeGROUP_BUYForm kind; RECURRING = single products only (BR-DK-02).
addedProductIds[ID!]Products already in the form; returned with alreadyAdded = true.
pageInt1
pageSizeInt50

Trả về CampaignPickerPage!

FieldKiểuMô tả
items[CampaignPickerProduct!]!
pageInt!
pageSizeInt!
totalInt!

campaigns ​

Admin list (B011/B031), newest first, filters AND-ed; search = Mã or Tên, ignored under 3 characters; dates = Vietnam days YYYY-MM-DD, closed, either end optional (delivery: overlap). Requires deal.read.

query · quyền: deal.read

Tham sốKiểuMặc địnhMô tả
searchString
typeCampaignType
statusCampaignStatus
createdFromString
createdToString
opensFromString
opensToString
closesFromString
closesToString
deliveryFromString
deliveryToString
createdByID
pageInt1
pageSizeInt50

Trả về CampaignPage!

FieldKiểuMô tả
items[CampaignListItem!]!
pageInt!
pageSizeInt!
totalInt!
sourceStatusSourceStatus!

campaignSettings ​

System parameters of the campaign form. Requires deal.read.

query · quyền: deal.read

Không có tham số.

Trả về CampaignSettings!

FieldKiểuMô tả
minImportLeadDaysInt!Minimum import lead time in days between close and milestone 1 (B006.R11).

campaignSpinWheelOptions ​

Áp dụng vòng quay may mắn of the campaign form (CV3-P4-22, DEC-CV3-37, BR-C-09): ACTIVE wheels only, search = code / name with accents kept, newest first, at most 50. Requires deal.manage (not spin.read).

query · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
searchString

Trả về [CampaignSpinWheelOption!]!

FieldKiểuMô tả
idID!
codeString!
nameString!
maxPointsPerSpinIntThe largest slot of the wheel's configuration in force (tối đa x Pi-Point / lượt); null without one.

dealTermsSets ​

Terms sets by status (default ACTIVE), by name then version. Requires deal.read.

query · quyền: deal.read

Tham sốKiểuMặc địnhMô tả
statusDealTermsStatusACTIVE

Trả về [DealTermsSet!]!

FieldKiểuMô tả
idID!
nameString!
versionString!Version label of the terms (e.g. v1.0); (name, version) is unique.
contentString!
statusDealTermsStatus!
createdAtDateTime!
updatedAtDateTime!

myRecurringBasket ​

The caller's own DRAFT basket of a Mua định kỳ campaign, or null. G2S: when the campaign close discarded the draft, the next read returns it once with closedNotice true (status DISCARDED), then null. Requires order.read (U-01, OWN).

query · quyền: order.read

Tham sốKiểuMặc địnhMô tả
campaignIdID!

Trả về RecurringBasket

FieldKiểuMô tả
idID!
campaignIdID!
statusRecurringBasketStatus!
packageNoIntGói kỳ cam kết; its Số kỳ is termCycles. G2S: null while the buyer has not chosen one (a draft saved from G2-02 / G2-03; G2-05 then preselects the first package, BR-MD-06), or a legacy draft whose Số kỳ is no package of the campaign.
termCyclesInt!Số kỳ of the package; 0 while packageNo is null and no Số kỳ is stored (G2S).
deliveryWindowNoIntG2S S3: Khung ngày giao chosen on G2-05; null until chosen (G2-05 then preselects the first window, BR-MD-06).
versionInt!Send it back as expectedVersion on the next save or discard.
lines[RecurringBasketLine!]!
cycleLines[RecurringBasketCycleLine!]!Only the cycles that differ from the default (sparse).
emptyCycles[Int!]!Cycles where every product is 0. G2S (BR-MD-05, DEC-FS27-MD-EMPTY-CYCLE): an empty cycle is refused (validation_failed cycle_empty), never a skip; always [].
skipMaxInt!Được bỏ qua tối đa of the package (0 when the package sets none or no package is chosen).
closedNoticeBoolean!G2S S3 (BR-MD-05): true on the draft the campaign close discarded (status DISCARDED), returned once by myRecurringBasket so the App shows '{Tên rổ} đã đóng nhận cọc. Rổ hàng của bạn đã được xóa.'; false otherwise.

Mutation ​

adoptRecurringBasket ​

G2S S3 (BR-MD-05 / BR-MD-11, DR-01, DEC-OWN28-G2S-BASKET-ADOPT-REPLACE): after sign-in, the device basket replaces the caller's DRAFT of the campaign (package, window, lines and per-cycle quantities) or starts one; idempotent by requestId. Requires order.create (U-02, OWN).

mutation · quyền: order.create

Tham sốKiểuMặc địnhMô tả
inputAdoptRecurringBasketInput!

Trả về RecurringBasketResult!

FieldKiểuMô tả
aggregateIdID!The basket id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextActionsubmit_recurring_order after a save; null after a discard.
basketRecurringBasket!

createCampaign ​

Tạo chiến dịch (B052.R09): validated, DRAFT -> PENDING_PUBLISH (UPCOMING if publishAt <= now). deal.manage.

mutation · SDL không ghi quyền

Tham sốKiểuMặc địnhMô tả
inputCampaignInput!

Trả về CampaignCommandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when nothing changed (close of an already closed campaign).
campaignCampaign!

deleteCampaign ​

Xóa (B198.R02): hard delete of a DRAFT / PENDING_PUBLISH / UPCOMING without orders. Requires deal.manage.

mutation · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
inputCampaignDeleteInput!

Trả về CampaignDeleteResult!

FieldKiểuMô tả
deletedIdID!
codeString!Mã chiến dịch of the deleted campaign.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!

discardRecurringBasket ​

Discards the caller's DRAFT basket. Requires order.create (U-02, OWN).

mutation · quyền: order.create

Tham sốKiểuMặc địnhMô tả
inputDiscardRecurringBasketInput!

Trả về RecurringBasketResult!

FieldKiểuMô tả
aggregateIdID!The basket id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextActionsubmit_recurring_order after a save; null after a discard.
basketRecurringBasket!

saveCampaignDraft ​

Lưu nháp (B052.R07): create or edit a Group Buy DRAFT, stored as typed (B006.R16). Requires deal.manage.

mutation · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
inputSaveCampaignDraftInput!

Trả về CampaignCommandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when nothing changed (close of an already closed campaign).
campaignCampaign!

saveRecurringBasketDraft ​

Creates or replaces the caller's DRAFT basket: package (optional since G2S), window, lines and every per-cycle quantity in one write. Requires order.create (U-02, OWN).

mutation · quyền: order.create

Tham sốKiểuMặc địnhMô tả
inputSaveRecurringBasketDraftInput!

Trả về RecurringBasketResult!

FieldKiểuMô tả
aggregateIdID!The basket id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextActionsubmit_recurring_order after a save; null after a discard.
basketRecurringBasket!

saveRecurringCampaignDraft ​

Lưu nháp of a Mua định kỳ DRAFT (create or edit): basket, tiers, windows, packages and schedule in one version. Requires deal.manage.

mutation · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
inputSaveRecurringCampaignDraftInput!

Trả về CampaignCommandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when nothing changed (close of an already closed campaign).
campaignCampaign!

updateCampaign ​

Lưu thay đổi (B149.R03) in PENDING_PUBLISH / UPCOMING: validated, state kept. Requires deal.manage.

mutation · quyền: deal.manage

Tham sốKiểuMặc địnhMô tả
inputCampaignInput!

Trả về CampaignCommandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when nothing changed (close of an already closed campaign).
campaignCampaign!

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17