Collection
Collection refers to a dictionary of information that can be adjusted to meet the needs of the Chainsite business logic.
Collection refers to a dictionary of information that can be adjusted to meet the needs of the Chainsite business logic.
Collections are grouped by types, and classified by categories. Collections can have a parent-child relationship, that way, you can set up a tree of information, mapped according to your preferences.
The following features are available to modify Collections to your taste:
The collection feature requires an authorization token.
Creating a collection requires CreateCollectionDto.
name
The appellation given to the collection
string
false
category
The classification of the collection
string
true
type
The group that the collection belongs to
string
false
description
Detailed explanation of what the collection is about
string
false
isPrivate
Identifier to check if the collection is private
boolean
false
deliveryDate
Timestamp for the requirements of completing the collection to be met
string
true
tags
Array of labels of the collection
string[]
true
attachments
Array of the identifiers of files uploaded for the collection. To add attachments to a collection, ensure the files have been uploaded to the chainsite storage and append the _id of the uploaded file to this field.
string[]
true
meta
Object that can be customised to suit the business logic and/or user preferences
Record<string, any>
true
paymentFee
For a collection that requires payment to be made, funds to be transferred, this field is key. Enter the amount required to complete the collection
number
parent
Collections can have a parent-child relationship and when such relationship are required, the identifier for the collection, marked as parent is necessary.
string
The authenticated user jwt token is required. Returns ICollectionDto.
The ICollectionDto is the model that contains the information that makes up the Collection.
_id
Identification of the collection record
string
creator
User details of the account that created the collection
string | IUser
owner
User details of the account that is a beneficiary to the collection
string | IUser
receiver
User details of the account that accepted an invite to the collection
string | IUser
owners
Array of User details that are beneficiaries to the collection
IUser[]
name
The appellation given to the collection
string
description
Detailed explanation of what the collection is about
string
type
The group that the collection belongs to
string
category
The classification of the collection
string
parent
The Identification of the parent collection in the collection tree. Note that not all collection will need a parent-child relationship, but for collections that do need, this field is for the _id of the collection that is the parent
string
collections
The collections record that belong to this collection in the parent-child
string[] | ICollectionDto[]
image
An uploaded image url of the collection
string
invite
Identifier for the invite sent to another user to be a participant and/or beneficiary of a collection
string | IInviteDto
invites
Array of identifiers of invitation sent out to other users to be participants
string[] | InviteDto[]
wallet
The identifier for the wallet details of the collection, meaning an escrow setup. All and any transaction that is occur with this collection is carried with this wallet. See WalletDto in Wallet for more information
string | WalletDto
attachments
An array of uploaded files for the collection
IAttachmentDto
attachmentData
A string array of identification of the uploaded files
string[]
status
The classification of the collection
ICollectionStatus
inviteAccepted
Identifier to indicate that a user(s) approached to this collection has accepted the invite
boolean
isPrivate
Identifier to indicate the privacy of the collection
boolean
ratings
The identifier for the rankings given to a creator and the participant(s)
string[] | IReviewDto[]
score
The total accumulation of points accrued for the collection
number
progress
The level of growth achieved so far for the collection, based on set objectives and deliverables. The progress is maxed at 100.
number
isDeleted
Identifier to indicate if the collection is deleted
boolean
charges
Identifier to indicate the duties accrued to be transferred to the chainsite wallet address
string
expectedAmount
Value determined to be paid
string
usdExpectedAmount
USD equivalent determined to be paid
string
usdExpectedFee
USD equivalent of the duties to be transferred to the chainsite wallet address
string
rate
The exchange rate for which the fee, value for the collection is determined
string
cancellationReason
Identifier that details the explanation as to why the collection was cancelled or ended.
string
completed
Identifer to indicate whether the collection has met the set objectives or a similar conclusion
boolean
meta
Custom Object that can be updated with information peculiar to the chainsite
Record<string, any>
IAttachmentDto
_id
Identifier for the file uploaded as attachment
string
url
URL of the file uploaded
string
ICollectionStatus
pending
Collection is in its initial state
ongoing
A user invited to the collection has accepted the invite and is now a participant of the collection
waiting
The collection is waiting for the escrow payout to be completed
cancelled
The collection is terminated
completed
Set objectives for the collection is met and achieved
reprocessing
The collection is at the state of executing the escrow transaction
Here is an example of implementing this function:
Users can create many collections, this requires the parent collection id, forming the parent-child relationship.
The CreateManyCollectionDto payload is required, as well as the authenticated user jwt token.
type
The group that the collection belongs to
false
string
parent
The Identification of the parent collection in the collection tree. Note that not all collection will need a parent-child relationship, but for collections that do need, this field is for the _id of the collection that is the parent
false
string
collections
List of collections to be created
false
CreateCollectionDto[]
Get all Collections corresponding to an optional filter, otherwise, return ALL collections.
Search using the filterCollectionDto.
The filterCollectionDto is an extension of the ICollectionDto, filter results with the details from ICollectionDto, for brevity, are not detailed here. See ICollectionDto above.
page
The desired page for the list of collections
number
limit
The total required number of collection document
number
receiver
the id of the user that accepted the invite to this collection
string
When a collection is created, the authenticated user is the of the collection. However, invite(s) sent to and accepted by another user, such user is now marked as the owner
and can be filtered as the receiver
.
Upon success, the feature returns FindCollectionDto.
page
The desired page for the list of collections
number
pages
All count of lists based on the collection query
number
total
The complete count of collection records based on the query
number
limit
The total required number of collection document
number
data
The list of collection records
ICollectionDto[]
Get a collection by ID, and return the ICollectionDto. The authenticated user jwt token is required.
Collection types refer to the style of the collection and are used to differentiate collections.
The authenticated jwt user token is required to execute this feature.
Upon success, returns FindCollectionTypeDto
page
The desired page for the list of collection types
number
pages
All count of lists based on the query
number
total
The complete count of collection types records based on the query
number
limit
The total required number of collection type document
number
data
The list of collection type records
ICollectionTypeDto[]
_id
Identifier for the collection type record
string
name
Designation given as the collection type
string
value
Designation marked as the collection type
string
Here is an example depicting how to fetch collection types
Get a collection type. The authenticated user jwt token is required.
Upon success, returns ICollectionTypeDto.
A collection can be updated. The authenticated user jwt token is required.
Use the payload UpdateCollectionDto to modify the collection.
The user's authenticated jwt token is required.
name
The appellation given to the collection
string
false
category
The classification of the collection
string
true
type
The group that the collection belongs to
string
false
description
Detailed explanation of what the collection is about
string
false
isPrivate
Identifier to check if the collection is private
boolean
false
deliveryDate
Timestamp for the requirements of completing the collection to be met
string
true
tags
Array of labels of the collection
string[]
true
attachments
Array of urls of files uploaded for the collection
string[]
true
meta
Object that can be customised to suit the business logic and/or user preferences
Record<string, any>
true
A list of collections can be updated together, they need not belong to the same parent.
The UpdateManyCollectionsDto is a list of UpdateCollectionDto
Deleting a collection is easy. The _id as seen in ICollectionDto is required as well as the authenticated user jwt token.