beckn / beckn-ui-workspace

Mono Repo for Beckn UI Workspace
9 stars 12 forks source link

Clarification & Sample Snippet needed for Open Belem Project #1195

Closed emmayank closed 4 months ago

emmayank commented 4 months ago

Description

We need to provide clear guidelines and sample snippets to address the following queries related to the Open Belem Project:

  1. What is the ideal way to include more than one creator for the course. Currently creator of an Item is a single object.
  2. What is the ideal way (tag ?) to be used to indicate progress of course (50% completed, 75% completed etc). For our use case just “In Progress”, “Completed” is not sufficient. We need a % value for amount completed.

Goals

To ensure that the Open Belem Project can accommodate multiple creators for a course and accurately reflect the progress of course completion with percentage values.

Expected Outcome

Clear documentation explaining the ideal approaches for handling multiple creators and percentage-based course progress. Example JSON snippets demonstrating these implementations.

Acceptance Criteria

  1. Documentation must provide a clear explanation for including more than one creator for a course using the existing schema.
  2. Documentation must explain how to represent course progress as a percentage.
  3. Example JSON snippets must be included for both queries, illustrating the implementation of the proposed solutions.
  4. The solutions should be practical and easy to implement within the existing system.

Product Name

Beckn

Domain

Specifications

Tech Skills Needed

Complexity

Medium

Category

Documentation

Sub Category

Documentation

emmayank commented 4 months ago

1.What is the ideal way to include more than one creator for the course. Currently creator of an Item is a single object. Since we have a creator object instead of an array in the item schema, we can ideally have only one creator per course. However, we can make use of tags (Items.tag) to add more than one creator. We can still use the creator object for the primary creator, and for all secondary creators, we can use a tag group with the code secondary-creator. Under this tag group, we can have multiple tags like name, short_desc, long_desc, image, etc. I have attached a sample JSON for the tag schema, please have a look [item-tag-creator.txt]

2. What is the ideal way (tag ?) to be used to indicate progress of course (50% completed, 75% completed etc). For our use case just “In Progress”, “Completed” is not sufficient. We need a % value for amount completed.

First Approach In order to achieve this, I would suggest the following approach: a. In the Fulfillment object, use the stops array to send all the individual videos/content of the course. b. With each fulfillments[0].stops[0], use authorization.status to link the status of a course content, whose value will range between NOT-STARTED, COMPLETED, and IN-PROGRESS. c. Using this, BAP can calculate the percentage of completion. For example, if there are 5 objects in the stops array, out of which 2 are COMPLETED, then the course completion will be ( (2 / 5) x 100 ) = 40%. Snippet Attached [fulfilment.stop.txt]

Second Approach

  1. Instead of BAP Calculating the %, BBP can either send the % in fulfilments.[0].state.short_desc. Snippet Attached [fulfilment.state.txt]

fulfillment.state.txt fulfillment.stop.txt item-tag-creator.txt