IBosonGroupHandler
View Source: contracts/interfaces/handlers/IBosonGroupHandler.sol
↗ Extends: IBosonGroupEvents
IBosonGroupHandler
Handles creation, voiding, and querying of groups within the protocol.
The ERC-165 identifier for this interface is: 0x08ccdf47
Functions
- createGroup(struct BosonTypes.Group _group, struct BosonTypes.Condition _condition)
- addOffersToGroup(uint256 _groupId, uint256[] _offerIds)
- removeOffersFromGroup(uint256 _groupId, uint256[] _offerIds)
- setGroupCondition(uint256 _groupId, struct BosonTypes.Condition _condition)
- getGroup(uint256 _groupId)
- getNextGroupId()
createGroup
Creates a group.
Emits a GroupCreated event if successful.
Reverts if:
- Caller is not an assistant
- Any of offers belongs to different seller
- Any of offers does not exist
- Offer exists in a different group
- Condition fields are invalid
function createGroup(struct BosonTypes.Group _group,
struct BosonTypes.Condition _condition)
external
Arguments
Name | Type | Description |
---|---|---|
_group | BosonTypes.Group | the fully populated struct with group id set to 0x0 |
_condition | BosonTypes.Condition | the fully populated condition struct |
addOffersToGroup
Adds offers to an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- Caller is not the seller
- Offer ids param is an empty list
- Group does not exist
- Any of offers belongs to different seller
- Any of offers does not exist
- Offer exists in a different group
- Offer ids param contains duplicated offers
function addOffersToGroup(uint256 _groupId,
uint256[] _offerIds)
external
Arguments
Name | Type | Description |
---|---|---|
_groupId | uint256 | the id of the group to be updated |
_offerIds | uint256[] | array of offer ids to be added to the group |
removeOffersFromGroup
Removes offers from an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- The groups region of protocol is paused
- Caller is not the seller
- Offer ids param is an empty list
- Group does not exist
- Any offer is not part of the group
function removeOffersFromGroup(uint256 _groupId,
uint256[] _offerIds)
external
Arguments
Name | Type | Description |
---|---|---|
_groupId | uint256 | the id of the group to be updated |
_offerIds | uint256[] | array of offer ids to be removed from the group |
setGroupCondition
Sets the condition of an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- The groups region of protocol is paused
- Condition includes invalid combination of fields
- Seller does not match caller
- Group does not exist
function setGroupCondition(uint256 _groupId,
struct BosonTypes.Condition _condition)
external
Arguments
Name | Type | Description |
---|---|---|
_groupId | uint256 | the id of the group whose condition will be set |
_condition | BosonTypes.Condition | fully populated condition struct |
getGroup
Gets the details about a given group.
function getGroup(uint256 _groupId)
external
view
returns(bool exists,
BosonTypes.Group memory group,
BosonTypes.Condition memory condition)
Arguments
Name | Type | Description |
---|---|---|
_groupId | uint256 | the id of the group to check |
Returns
Name | Type | Description |
---|---|---|
exists | bool | the group was found |
group | BosonTypes.Group | the group details. See {BosonTypes.Group} |
condition | BosonTypes.Condition | the group's condition details. See {BosonTypes.Condition} |
getNextGroupId
Gets the next group id.Does not increment the counter.
function getNextGroupId()
external
view
returns(uint256 nextGroupId)
Returns
Name | Type | Description |
---|---|---|
nextGroupId | uint256 | the next group id |