Add

[POST] .../v1/retailcardmigration/settings/add

Adds a new setting to a retail card migration task. Use this method to add a rule setting to an existing retail card migration task, such as purchased item quantity, purchased amount, or sales receipt count. The request requires task_id and accepts type, period_type, period, comparison, value, and order; missing period or order defaults to 1 and the response returns new_id for the created setting. The method checks the current request user and requires retail card migration edit permission; missing body, missing task_id, missing task, denied permission, invalid enum or numeric values, and storage errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
comparison String Optional Comparison type: Larger - greater than, Less - less than, Equal - equal to, EqualLarger - greater than or equal to, EqualLess - less than or equal to. Allowed values: Default, Larger, Less, Equal, EqualLarger, EqualLess.
order Int32 Optional Execution order from 1 to 10.
period Int32 Optional Period value. If the period is current month, current quarter, or current year, the value is ignored.
period_type String Optional Task period: Month - month before the migration task execution date, Quarter - quarter before the migration task execution date, Year - year before the migration task execution date, Current_Month - current month, Current_Quarter - current quarter, Current_Year - current year. Allowed values: Default, Month, Quarter, Year, Current_Month, Current_Quarter, Current_Year.
task_id Int64 Required Task ID that the setting is attached to.
type String Optional Setting type: ItemQuantity - purchased item quantity, ItemAmount - purchased amount, SalesCount - sales receipt count. Allowed values: Default, ItemQuantity, ItemAmount, SalesCount.
value Decimal Optional Value used for comparison.

Request Example

{
  "comparison": "Larger",
  "order": 1,
  "period": 1,
  "period_type": "Month",
  "task_id": 1,
  "type": "ItemQuantity",
  "value": 1.0
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 1
  }
}