patt/_requirements_/specification.py
2025-08-12 16:36:12 +02:00

492 lines
14 KiB
Python

def specification(req_spec):
req_spec.add_title("Project and Teamorganisation Tool (PaTT)")
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=1,
heading="General",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=1,
heading="Task",
description="The application shall have multiple tasks",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=2,
heading="User",
description="The application shall have multiple users",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=3,
heading="Project",
description="The application shall have multiple projects",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=13,
heading="Userinterface",
description="The application shall have a userinterface",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=2,
heading="Definitions for user",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=4,
heading="Username",
description="A user shall have a username",
reason="Authentification",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=5,
heading="Password",
description="A user shall have a password",
reason="Authentification",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=6,
heading="E-Mail",
description="A user shall have an emailadress",
reason="Give information to a user which is not currently using the userinterface",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=38,
heading="threshold_very_soon",
description="The {\\tt user\_profile} object shall be able to hold the Infomation {\\tt threshold\_very\_soon} with the following values: 1 day, 2 days, 3 days, 4 days, 5 days, 7 days, 9 days, 12 days",
reason="Information for the sorting criteria {\\tt warning\_group}",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=39,
heading="threshold_soon",
description="The user object shall be able to hold the Infomation {\\tt threshold\_soon} with the following values: 1 day, 2 days, 3 days, 5 days, 7 days, 10 days, 14 days, 21 days",
reason="Information for the sorting criteria {\\tt warning\_group}",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=3,
heading="project Fields",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=7,
heading="Projectname",
description="A project shall have a projectname",
reason="Definition of a short identification for the Project.",
fitcriterion="projectname exists in project and can hold a string",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=8,
heading="Projectdescription",
description="A project shall have a projectdescription",
reason="Definition of additional information for the Project.",
fitcriterion="projectdescription exists in project and can hold a string",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=26,
heading="State",
description="A project shall have a projectstate with the following possible values: \"TBD, \\dots\"",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=9,
heading="Projectrole Leader",
description="A project shall have the projectrole {\\tt role\_leader}",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=12,
heading="Projectrole Member",
description="A project shall have the projectrole {\\tt role\_member}",
reason="Default value for Task generation",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=33,
heading="Projectrole Visitor",
description="A project shall have the projectrole {\\tt role\_visitor}",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=4,
heading="Description for projectrole",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=11,
heading="Userlist",
description="A projectrole shall hold multiple users",
reason="Define Members for the different projectroles",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=5,
heading=" task Fields",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=14,
heading="state",
description="A task shall have a state with the following possible values: \"open, in progress, finished, closed\"",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=15,
heading="priority",
description="A task shall have a priority with the following possible values: 1, 2, 3, 4, 5 ,6, 7",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=16,
heading="targetdate",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=17,
heading="progress",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=18,
heading="description",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=19,
heading="comments",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=20,
heading="appraisals",
description="Just for Projectleader or Superuser (TBD)",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=31,
heading="assigned_user",
description="A task shall have one {\\tt assigned\_user}. The {\\tt assigned\_user} needs to have a role in the related project.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=32,
heading="History",
description="The tasks change history shall be fully stored.",
reason="Implementation of a view for the projectleaders to inspect all changes from creation till now.",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=6,
heading="Permission definitions for tasks",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=27,
heading="read permission",
description="If the user has read permissions, all task fields (except of the appraisals) shall be visible.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=24,
heading="limited_modify permission",
description="If the user has {\\tt limited\_modify} permission, the fields progress, description, comment shall be fully editable and the filed state shall be editable, if the state is one of \"open, closed\", and the targetstates shall be limited to \"open, closed\".",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=23,
heading="add_comment permission",
description="The user shall be able to add a comment, if {\\tt add\_comment} permissions are given.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=25,
heading="create permission",
description="The user shall be able to create a task, if create permissions are given.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=28,
heading="modify permission",
description="All task fields (except of the comment, appraisal) shall be editable, if the user has modify permission.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=29,
heading="modify_comment permission",
description="The task field comment shall be editable, if the user has {\\tt modify\_comment} permission.",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=7,
heading="Access rules for task",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=34,
heading="read permissions",
description="A user shall have read permission, if he is a superuser or (user is the {\\tt assigned\_user} and the current task state is one of \"open, closed\") or (has a role in the related project and is a staffuser).",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=35,
heading="limited_modify permission",
description="A user shall have {\\tt limited\_modify} permission, if he is the {\\tt assigned\_user} and is a staffuser and the current task state is one of \"open, closed\".",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=22,
heading="modify permission",
description="A user shall have modify permission, if he is a superuser or (has the has the role {\\tt role\_leader} in the related project and is a staffuser).",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=30,
heading="add_comment permission",
description="A user shall have {\\tt add\_comment} permission, if he is a superuser or (has one of the roles {\\tt role\_leader}, {\\tt role\_member} in the related project and is a staffuser and the current task state is one of \"open, closed\").",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=36,
heading="create permission",
description="A user shall have create permission, if he has at least in one project a role and is staffuser.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=37,
heading="modify_comment permission",
description="A user shall have {\\tt modify\_comment} permission, if he is a superuser or (has the has the role {\\tt role\_leader} in the related project and is a staffuser).",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=8,
heading="task sorting",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=41,
heading="Sorting criterias and prioreties",
description="A tasklist shall be sorted by the following documented sorting criterias. The sorting order shall be the same as the criteria order in this document.",
reason="Tasklist shall be be sorted in a user friendly order.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=40,
heading="1st sort criteria shall be warning_group",
description="""The sorting shalll be in the order as the listed {\\tt warning\_groups}:
\\begin{itemize}
\\item {\\bf overdue}: If the {\\tt days\_before\_targetdate} = 0
\\item {\\bf very\_soon}: If the {\\tt days\_before\_targetdate} = {\\tt assigned\_user.threshold\_very\_soon}
\\item {\\bf soon:} If the {\tt days\_before\_targetdate} = {\\tt assigned\_user.threshold\_soon}
\\item {\\bf default}: In all other cases
\\item {\\bf done:} If the task is in one of the following states: \"canceled, closed, finished\" (independent from the other group definitions)
\\end{itemize}""",
reason="Tasklist shall be be sorted in a user friendly order.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=42,
heading="2nd sort criteria shall be priority",
description="Highest priority (1) first.",
reason="Tasklist shall be be sorted in a user friendly order.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=43,
heading="3rd sort criteria shall be days_before_targetdate",
description="Lowesr value of {\\tt days\_before\_targetdate} first.",
reason="Tasklist shall be be sorted in a user friendly order.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=46,
heading="4th sort criteria progress",
description="Lowest progresss first.",
reason="Tasklist shall be be sorted in a user friendly order.",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=47,
heading="5th sort criteria name",
description="Alphabetic sorting.",
reason="Tasklist shall be be sorted in a user friendly order.",
)
#
# Section
#
sec_uuid = req_spec.add(
itemtype="SEC",
id=9,
heading="Userinterface",
)
# Requirement
req_spec.add(
parent=sec_uuid,
itemtype="REQ",
id=21,
heading="State Types",
description="REQ-21",
)