Difference between revisions of "Pathfinder Wiki:API/Database/Layout - Honor Requirements"

From Pathfinder Wiki
 
Line 68: Line 68:
 
* Match Data (could be a table maybe? For example [[AY Honors/Mountains/Requirements|requirment 4 of the Mountains Honor]].
 
* Match Data (could be a table maybe? For example [[AY Honors/Mountains/Requirements|requirment 4 of the Mountains Honor]].
 
* Video (same rules as for Image)
 
* Video (same rules as for Image)
* Honor (text is the honorname, a possibility would be to use additionalDataType=landingID to us the pageID, for a list of honors the same rules as for images would be used)
+
* Honor (text is the honorname, a possibility would be to use additionalDataType=landingID to us the pageID)
 
* Honor Category (will be needed for Master Awards. In this case the minReqNeeded will define how many honors of the specified category are needed)
 
* Honor Category (will be needed for Master Awards. In this case the minReqNeeded will define how many honors of the specified category are needed)
 
* Draw
 
* Draw

Latest revision as of 14:45, 23 September 2022

Those tables will hold all requirements of Honors, Master Awards, Awards, IA and AY. In order for saving anything beside honor requirements, there maybe another column needed which defines the source type of the requirement. So basically if it is a requirement from a Master Award or from IA. But it's possible to do this in a second step where empty means it's from an honor.

Template to save the data

There shall be a generic template for defining the structure of the database table and also to save the data in it. For the different types of requirements (Honors, Awards, IA, ...) wrapper templates should be created, which will have parameter's that make sense for the purpose they are needed in. Also it brings the possibility of default values or automatically filling in data where needed/possible.

Example

In File:DatabaseLayout Requirements.xlsx you'll find the layout of the table with some example content.

Layout details

To store the requirements table 3 tables are needed. One for the sections, one for the groups and a last one for the requirements. Is it really needed? It should be possible to store all data in one database, by just leaving the not needed columns empty. For a group it would be necessary to leave al the ID_level(n) columns empty. For a section, also the group column would need to stay empty.

Column description

In this part the columns of the requirements table are described in detail.

ID (unique)

This column hold's a combination of data from other columns, through which every requirement is identify able. This is needed to prevent double entries.

Each column data is separated by a |. The following data is concatenated in the specified order:

  1. landingID
  2. reqPageID
  3. reqVariantNo
  4. sectionID
  5. groupID
  6. ID_level1
  7. ID_level2
  8. ID_level3
  9. ID_level4
  10. ID_level5
  11. ID_level6
  12. language

landingID (pageid)

Page ID of the Honor's landing page (used as unique identifier of the Honor)

reqPageID (pageid)

Page ID of the requirements page the requirement is from

reqVariantNo (number)

The requirement variant number the requirement belongs to.

sectionID (number)

Section is used to structure requirements. In each section the enumeration is starting from 1. A section will only have groups right underneath it, never requirements. An example of the use of sections is the Abseiling Honor

groupID (number)

Groups are also used to structure requirements. The difference is, that the enumeration should continue although the requirement may belong to another group. Also group's can only be part of a section and can only have requirements underneath. An example of the use of groups is the Abseiling Honor

ID_level[n] (number)

ID_level1 to ID_level6 are used to build the actual requirement structure.

minReqNeeded (number)

In the case of multiple sub-requirements it is possible that only a certain amount is needed. Set it to the number needed. If it is 0 or empty (null) all sub-requirements need to be completed.

text (wikitext?)

It is the content that shall be displayed. It should be possible to use embedded link, for that it most likely the API needs to parse the wikitext. Maybe setting the column to wikitext it's parsed by cargo but that probably only happens if it is queried by cargo itself.

language (string)

This column holds that language suffix of the source requirement page.

requriementType (string - allowed values)

Type of the requirement, also kind of the type of the answer.

Allowed values:

  • Text
  • Image (only single img, if there are more then one, they shall be defined as sub requriements with no text. We probably need a way of defining that it doesn't needs to be tracked for progress)
  • Match Data (could be a table maybe? For example requirment 4 of the Mountains Honor.
  • Video (same rules as for Image)
  • Honor (text is the honorname, a possibility would be to use additionalDataType=landingID to us the pageID)
  • Honor Category (will be needed for Master Awards. In this case the minReqNeeded will define how many honors of the specified category are needed)
  • Draw
  • Practical
  • Presentation
  • Certificate

additionalDataType (string - allowed values)

Some requirements need additional data displayed or saved to link to. Those could be, a page ID, a file name, a table to match data, a link or something else what wasn't thought of yet.

Allowed values:

  • link
  • pageID
  • file
  • table
  • ...

additionalData (defined by additionalDataType)

This column holds the actual data, which type is defined by the additionalDataType column.