From 14502e4c50b9542b70d6804469fc3d97e08e1b33 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sat, 11 Oct 2025 00:44:55 +0200 Subject: [PATCH] FEP-0837: minimumQuantity (#693) - Introduced `minimumQuantity` property for intents. - Specified default value for `unitBased` and removed `unitBased` from minimal example. - Require `attributedTo` property on finalized agreements. - Fixed typo in `stipulates`. - Added "Implementations" section. Reviewed-on: https://codeberg.org/fediverse/fep/pulls/693 Co-authored-by: silverpill Co-committed-by: silverpill --- fep/0837/fep-0837.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/fep/0837/fep-0837.md b/fep/0837/fep-0837.md index 2825c12..2dd1da5 100644 --- a/fep/0837/fep-0837.md +++ b/fep/0837/fep-0837.md @@ -43,14 +43,14 @@ The representation of a proposal is a JSON document with the following propertie - `id` (REQUIRED): the proposal's unique global identifier. - `type` (REQUIRED): the type of the object SHOULD be `Proposal`. If interoperability with other ActivityPub services is desirable, implementers MAY use object types from [Activity Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/#object-types), such as `Note`. - `purpose` (REQUIRED): the type of proposal. Possible values are `offer` and `request`. -- `attributedTo` (REQUIRED): the actor who published the proposal. +- `attributedTo` (REQUIRED): the identifier of an actor who published the proposal. - `name` (RECOMMENDED): the title of the proposal. - `content` (OPTIONAL): the description of the proposal. The type of content SHOULD be `text/html`. - `published` (RECOMMENDED): the date and time at which the proposal was published. - `location` (OPTIONAL): indicates a physical location associated with the proposal. The representation of location MUST conform to the recommendations of [Activity Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/#places) document, section *5.3 Representing Places*. - `publishes` (REQUIRED): the primary intent of this proposal (see below). - `reciprocal` (OPTIONAL): the reciprocal intent of this proposal (see below). -- `unitBased` (OPTIONAL): indicates whether the quantities expressed in the proposal can be multiplied or not. +- `unitBased` (OPTIONAL): indicates whether the quantities expressed in the proposal can be multiplied or not. The default is `false`. - `to` (REQUIRED): the audience of the proposal. **Intents** are proposed economic transactions. The **primary intent** describes what is being offered or requested, and **reciprocal intent** describes what is expected or offered in return. Some examples: @@ -69,6 +69,7 @@ The representation of an intent is a JSON document with the following properties - `hasUnit` (REQUIRED): name of the unit, according to [Ontology of units of Measure][OntologyOfUnits] classification. The RECOMMENDED unit for countable items is `one`. - `hasNumericalValue` (OPTIONAL): the amount of the resource. If not specified, arbitrary amounts can be used when responding to the proposal. - `availableQuantity` (OPTIONAL): the quantity of the offered resource currently available. +- `minimumQuantity` (OPTIONAL): the minimum possible quantity of the resource. Minimal example: @@ -103,7 +104,6 @@ Minimal example: "hasNumericalValue": "1" } }, - "unitBased": false, "to": "https://www.w3.org/ns/activitystreams#Public" } ``` @@ -127,6 +127,7 @@ Full example: "resourceConformsTo": "vf:resourceConformsTo", "resourceQuantity": "vf:resourceQuantity", "availableQuantity": "vf:availableQuantity", + "minimumQuantity": "vf:minimumQuantity", "hasUnit": "om2:hasUnit", "hasNumericalValue": "om2:hasNumericalValue" } @@ -155,6 +156,10 @@ Full example: "availableQuantity": { "hasUnit": "one", "hasNumericalValue": "1" + }, + "minimumQuantity": { + "hasUnit": "one", + "hasNumericalValue": "1" } }, "reciprocal": { @@ -217,6 +222,7 @@ The representation of an agreement is a JSON document with the following propert - `id` (OPTIONAL): the unique global identifier of the agreement. This property is REQUIRED for finalized agreements. - `type` (REQUIRED): the type of the object MUST be `Agreement`. +- `attributedTo` (OPTIONAL): the identifier of an actor who created the agreement. - `stipulates` (REQUIRED): the primary commitment associated with the agreement. - `stipulatesReciprocal` (OPTIONAL): the reciprocal commitment associated with the agreement. It is REQUIRED if the corresponding proposal has a reciprocal intent. @@ -280,7 +286,9 @@ Example of an `Offer(Agreement)` activity: The `object` of `Accept` activity MUST be the `id` of the `Offer` activity previously sent to the actor. -`Accept` activity MUST have the `result` property containing the `Agreement` object. The finalized agreement and corresponding commitments MUST have an `id` property. If a similar agreement between parties already exists, it MAY be updated and its `id` re-used. The quantities specified in the finalized agreement MUST match the quantities specified in `Agreement` object from the `Offer` activity. +`Accept` activity MUST have the `result` property containing the `Agreement` object. The finalized agreement and corresponding commitments MUST have an `id` property. If a similar agreement between parties already exists, it MAY be updated and its `id` re-used. The finalized agreement MUST have an `attributedTo` property and its value MUST match the actor of the `Accept` activity. + +The quantities specified in the finalized agreement MUST match the quantities specified in `Agreement` object from the `Offer` activity. The finalized agreement MAY have `url` property containing one or more links to resources associated with the agreement. An example of such resource is a payment page (which can be represented as an [FEP-0ea0] link). @@ -294,7 +302,7 @@ Example: "om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/", "vf": "https://w3id.org/valueflows/ont/vf#", "Agreement": "vf:Agreement", - "stiplulates": "vf:stiplulates", + "stipulates": "vf:stipulates", "stipulatesReciprocal": "vf:stipulatesReciprocal", "Commitment": "vf:Commitment", "satisfies": "vf:satisfies", @@ -311,7 +319,7 @@ Example: "type": "Agreement", "id": "https://market.example/agreements/edc374aa-e580-4a58-9404-f3e8bf8556b2", "attributedTo": "https://market.example/users/alice", - "stiplulates": { + "stipulates": { "id": "https://market.example/agreements/edc374aa-e580-4a58-9404-f3e8bf8556b2#primary", "type": "Commitment", "satisfies": "https://market.example/proposals/ddde9d6f-6f3b-4770-a966-3a18ef006930#primary", @@ -386,6 +394,10 @@ Example: } ``` +## Implementations + +- [Mitra](https://codeberg.org/silverpill/mitra/src/tag/v4.11.0/FEDERATION.md#subscriptions) + ## References - Christine Lemmer-Webber, Jessica Tallon, Erin Shepherd, Amy Guy, Evan Prodromou, [ActivityPub], 2018