Class: Proposal
market/proposal.Proposal
Proposal module - an object representing an offer in the state of a proposal from the provider.
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Proposal(subscriptionId, parentId, setCounteringProposalReference, api, model, demandRequest, eventTarget?)
Create proposal for given subscription ID
Parameters
| Name | Type | Description |
|---|---|---|
subscriptionId | string | subscription ID |
parentId | null | string | Previous proposal ID with Initial state |
setCounteringProposalReference | (id: string, parentId: string) => null | void | |
api | RequestorApi | RequestorApi |
model | Proposal | ProposalModel |
demandRequest | DemandOfferBase | DemandOfferBase |
eventTarget? | EventTarget | EventTarget |
Defined in
Properties
id
• id: string
Defined in
issuerId
• Readonly issuerId: string
Defined in
provider
• Readonly provider: Object
Type declaration
| Name | Type |
|---|---|
id | string |
name | string |
Defined in
properties
• Readonly properties: ProposalProperties
Defined in
constraints
• Readonly constraints: string
Defined in
timestamp
• Readonly timestamp: string
Defined in
counteringProposalId
• counteringProposalId: null | string
Defined in
Accessors
details
• get details(): ProposalDetails
Returns
Defined in
pricing
• get pricing(): PricingInfo
Returns
Defined in
Methods
validate
▸ Protected validate(): void
Validates if the proposal satisfies basic business rules, is complete and thus safe to interact with
Use this method before executing any important logic, to ensure that you're working with correct, complete data
Returns
void
Defined in
isInitial
▸ isInitial(): boolean
Returns
boolean
Defined in
isDraft
▸ isDraft(): boolean
Returns
boolean
Defined in
isExpired
▸ isExpired(): boolean
Returns
boolean
Defined in
isRejected
▸ isRejected(): boolean
Returns
boolean
Defined in
reject
▸ reject(reason?): Promise<void>
Parameters
| Name | Type | Default value |
|---|---|---|
reason | string | "no reason" |
Returns
Promise<void>
Defined in
respond
▸ respond(chosenPlatform): Promise<string>
Parameters
| Name | Type |
|---|---|
chosenPlatform | string |
Returns
Promise<string>
Defined in
hasPaymentPlatform
▸ hasPaymentPlatform(paymentPlatform): boolean
Parameters
| Name | Type |
|---|---|
paymentPlatform | string |
Returns
boolean