Deal methods: update, delete
The Deal Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.
Reference for Deal, one group of Deal methods.
Deal.update
Changes the given properties of a Deal. Verb page.
interface DealVerbs {
update(input: DealUpdateInput, options?: SB.CallOptions): SB.Call<Deal>
}Emits Deal.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Deal. |
value | money | What the Deal is worth if won. | |
owner | Worker | The Worker who runs it. | |
closesOn | date | The date the buyer expects to decide. | |
nextStep | text | The next dated step agreed with the buyer. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
deal | Deal | required | The Deal. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const deal = 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.
interface DealVerbs {
delete(input: DealDeleteInput, options?: SB.CallOptions): SB.Call<Deal>
}Emits Deal.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Deal. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
deal | Deal | required | The Deal. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const deal = await $.Deal.delete({ id: 'deal_NgACZ6DcII' })