Skip to content

Deal programs: update, delete

The Deal Verbs update, delete as MCP do programs, with inputs, result, refusals and an example.

Reference for Deal, one group of Deal programs.

Deal.update

Changes the given properties of a Deal. Verb page.

Text
do: return await $.Deal.update(input)

Emits Deal.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Deal.
valuemoneyWhat the Deal is worth if won.
ownerWorkerThe Worker who runs it.
closesOndateThe date the buyer expects to decide.
nextSteptextThe next dated step agreed with the buyer.

Returns

OutputTypeRequiredDescription
dealDealrequiredThe Deal.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Deal.update({ id: 'deal_NgACZ6DcII', value: { amount: 29, currency: 'USD' } })"
  }
}

Deal.delete

Deletes a Deal: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
do: return await $.Deal.delete(input)

Emits Deal.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Deal.

Returns

OutputTypeRequiredDescription
dealDealrequiredThe Deal.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Deal.delete({ id: 'deal_NgACZ6DcII' })"
  }
}