API
CustomUser
Views
list_users(request)
The function list_users retrieves a list of CustomUser objects.
Endpoint
- Path:
/api/v2/users - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[CustomUserSchema]
|
List of CustomUser objects. |
Source code in backend/backend/api.py
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 | |
me(request)
The function me retrieves the CustomUser object of the logged in user.
Endpoint
- Path:
/api/v2/me - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
CustomUserSchema
|
The CustomUser object of the logged in user. |
Source code in backend/backend/api.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
TokenAuth
Source code in backend/backend/api.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
authenticate(request, token)
The function authenticate authenticates a user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
self
|
|
required | |
request
|
|
required | |
token
|
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
user |
token
|
Returns a user token. |
Source code in backend/backend/api.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
login_user(request, payload)
The function login_user logs in a user.
Endpoint
- Path:
/api/v2/login - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
LoginSchema
|
A username and password. |
required |
Returns:
| Type | Description |
|---|---|
object
|
Returns a user object with token. |
Source code in backend/backend/api.py
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 | |
logout_user(request)
The function logout_user logs out.
Endpoint
- Path:
/api/v2/logout - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 | |
Schemas
LoginSchema
Schema to represent a LoginSchema.
Attributes:
| Name | Type | Description |
|---|---|---|
username |
str
|
Username string. |
password |
str
|
Password string. |
Source code in backend/backend/api.py
65 66 67 68 69 70 71 72 73 74 75 | |
LoginUserSchema
Schema to represent a LoginUserSchema.
Attributes:
| Name | Type | Description |
|---|---|---|
email |
str
|
User email. |
profile_picture |
str
|
Path to user picutre. Default=None. |
male |
bool
|
Toggle if male or not. |
user_color |
str
|
Hex value of a user color. |
first_name |
str
|
User first name. |
last_name |
str
|
User last name. |
fullname |
str
|
Full name of user. |
is_superuser |
bool
|
Toggle if user is superuser. |
is_staff |
bool
|
Toggle if user is staff. |
is_active |
bool
|
Toggle if user is active. |
groups |
List[int]
|
List of group ids user belongs to. |
Source code in backend/backend/api.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
CustomUserSchema
Schema to represent a CustomUserSchema.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the user. |
email |
str
|
Email of the user. |
profile_picture |
str
|
Path to the user profile picture. Default=None. |
male |
bool
|
Toggle if user is male. |
user_color |
str
|
Hex value of a user color. |
first_name |
str
|
User first name. |
last_name |
str
|
User last name. |
fullname |
str
|
Full name of user. |
is_superuser |
bool
|
Toggle if user is superuser. |
is_staff |
bool
|
Toggle if user is staff. |
is_active |
bool
|
Toggle if user is active. |
Source code in backend/backend/api.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
AreaGroup
Views
create_areagroup(request, payload)
The function create_areagroup creates an AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
AreaGroupIn
|
An AreaGroup object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The ID of the newly created AreaGroup object. |
Source code in backend/backend/api.py
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | |
get_areagroup(request, areagroup_id)
The function get_areagroup retrieves an AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
AreaGroupOut
|
The AreaGroup object. |
Source code in backend/backend/api.py
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 | |
list_areagroups(request)
The function list_areagroups retrieves a list of AreaGroup objects.
Endpoint
- Path:
/api/v2/areagroups - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[AreaGroupOut]
|
List of AreaGroup objects. |
Source code in backend/backend/api.py
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 | |
update_areagroup(request, areagroup_id, payload)
The function update_areagroup updates a given AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to update. |
required |
payload
|
AreaGroupIn
|
AreaGroup object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | |
delete_areagroup(request, areagroup_id)
The function delete_areagroup deletes a given AreaGroup object.
Endpoint
- Path:
/api/v2/areagroups/{areagroup_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
areagroup_id
|
int
|
ID of the AreaGroup object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 | |
Schemas
AreaGroupIn
Schema to represent an AreaGroupIn.
Attributes:
| Name | Type | Description |
|---|---|---|
group_name |
str
|
Area group name. |
group_order |
int
|
Area group order index. |
group_color |
str
|
Hex value of area group color. |
Source code in backend/backend/api.py
140 141 142 143 144 145 146 147 148 149 150 151 152 | |
AreaGroupOut
Schema to represent an AreaGroupOut.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of area group. |
group_name |
str
|
Area group name. |
group_order |
int
|
Area group order index. |
group_color |
str
|
Hex value of area group color. |
Source code in backend/backend/api.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
Area
Views
create_area(request, payload)
The function create_area creates an Area object.
Endpoint
- Path:
/api/v2/areas - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
AreaIn
|
Area Object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created Area object. |
Source code in backend/backend/api.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | |
get_area(request, area_id)
The function get_area retrieves an Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
AreaOut
|
The Area object. |
Source code in backend/backend/api.py
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | |
list_areas(request)
The function list_areas retrieves a list of Area objects.
Endpoint
- Path:
/api/v2/areas - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[AreaOut]
|
List of Area objects. |
Source code in backend/backend/api.py
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | |
update_area(request, area_id, payload)
The function update_area updates a given Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to update. |
required |
payload
|
AreaIn
|
Area object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 | |
delete_area(request, area_id)
The function delete_area deletes a given Area object.
Endpoint
- Path:
/api/v2/areas/{area_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
area_id
|
int
|
ID of the Area object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 | |
Schemas
AreaIn
Schema to represent an AreaIn.
Attributes:
| Name | Type | Description |
|---|---|---|
area_name |
str
|
Area name. |
area_icon |
str
|
Name of area icon. |
group_id |
int
|
ID of group object area belongs to. |
Source code in backend/backend/api.py
172 173 174 175 176 177 178 179 180 181 182 183 184 | |
AreaOut
Schema to represent an AreaOut.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of an area. |
area_name |
str
|
Area name. |
area_icon |
str
|
Name of area icon. |
group_id |
int
|
ID of group object area belongs to. |
group |
AreaGroupOut
|
Group object area belongs to. |
dirtiness |
int
|
Percentage of dirtiness for the area. |
dueCount |
int
|
Number of chores due for the area. |
totalCount |
int
|
Total number of chores for the area. |
total_dirtiness |
int
|
Total dirtiness of the area. |
Source code in backend/backend/api.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
Month
Views
Schemas
MonthOut
Schema to represent a Month.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the month. |
name |
str
|
Name of the month. |
Source code in backend/backend/api.py
214 215 216 217 218 219 220 221 222 223 224 | |
Chore
Views
create_chore(request, payload)
The function create_chore creates a new Chore object.
Endpoint
- Path:
/api/v2/chores - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
ChoreIn
|
Chore object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created Chore object. |
Source code in backend/backend/api.py
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
get_chore(request, chore_id)
The function get_chore retrieves an Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
ChoreOut
|
The Chore object. |
Source code in backend/backend/api.py
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |
list_chores(request, inactive=False, timeframe=None, assignee_id=None, area_id=None)
The function list_chores retrieves a list of Chore objects.
Endpoint
- Path:
/api/v2/chores - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
inactive
|
bool
|
Toggle retreiving inactive chores. Default=False. |
False
|
timeframe
|
int
|
Days from today to retrieve. Retreives all if None. Default=None. |
None
|
assignee_id
|
int
|
Filter chores by assigned CustomUser ID. Retreives all if None. Default=None. |
None
|
area_id
|
int
|
Filter chores by Area ID. Retreives all if None. Default=None. |
None
|
Returns:
| Type | Description |
|---|---|
List[ChoreOut]
|
List of Chore objects. |
Source code in backend/backend/api.py
888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 | |
update_chore(request, chore_id, payload)
The function update_chore updates a given Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ChoreIn
|
Chore object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | |
delete_chore(request, chore_id)
The function delete_chore deletes a given Chore object.
Endpoint
- Path:
/api/v2/chores/{chore_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 | |
toggle_vacation(request)
The function toggle_vacation toggles vacation mode.
Endpoint
- Path:
/api/v2/toggle_vacation - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns success if successful. |
Source code in backend/backend/api.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
calculate_duedays(next_due)
The function calculate_duedays calculates the days until due based on a given date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
next_due
|
date
|
The chore next due date. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of days until due date. |
Source code in backend/backend/api.py
973 974 975 976 977 978 979 980 981 982 983 984 | |
toggle_chore(request, chore_id, payload)
The function toggle_chore toggles wether a Chore is active/inactive.
Endpoint
- Path:
/api/v2/chores/togglechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ToggleActive
|
ToggleActive schema with status to set for the Chore. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | |
snooze_chore(request, chore_id, payload)
The function snooze_chore updates a given Chore object's next due date.
Endpoint
- Path:
/api/v2/chores/snoozechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
SnoozeChore
|
SnoozeChore schema with nextDue date to update chore with. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 | |
claim_chore(request, chore_id, payload)
The function claim_chore assigns a given Chore object to a user.
Endpoint
- Path:
/api/v2/chores/claimchore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
ClaimChore
|
ClaimChore schema with a CustomUser ID to assign to chore. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 | |
complete_chore(request, chore_id, payload)
The function complete_chore completes a given Chore object.
Endpoint
- Path:
/api/v2/chores/completechore/{chore_id} - Method:
PATCH
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
chore_id
|
int
|
ID of the Chore object to update. |
required |
payload
|
CompleteChore
|
CompleteChore schema to update Chore with. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 | |
Schemas
ChoreIn
Schema to represent a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
chore_name |
str
|
Name of the chore. Optional. |
area_id |
int
|
ID of the area. Optional. |
intervalNumber |
int
|
The repeat interval of the chore. Optional. |
unit |
str
|
The repeat unit of the chore. Optional. |
active_months |
List[int]
|
A list of month ids this chore is active. Optional. |
effort |
int
|
The effort required for this chore. Optional. |
nextDue |
date
|
The date chore is next due. Optional. |
lastCompleted |
date
|
The date chore was last completed. Optional. |
assignee_id |
int
|
ID of the assigned user. Optional. |
status |
int
|
ID of the status. Optional. |
Source code in backend/backend/api.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
ChoreOut
Schema to represent a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the chore. |
chore_name |
str
|
Name of the chore. |
area_id |
int
|
ID of an Area object assigned to the chore. |
area |
AreaOut
|
Area object assigned to the chore. |
nextDue |
date
|
Date chore is next due. |
lastCompleted |
date
|
Date chore was last completed. |
intervalNumber |
int
|
Repeat interval for the chore. |
unit |
str
|
Repeat unit for the chore. |
active_months |
List[int]
|
List of Month ids chode is active. |
assignee_id |
int
|
ID of a user assigned to the chore. Default=None. |
effort |
int
|
Effort required for the chore. |
vacationPause |
bool
|
Due days when paused for vacation. |
expand |
bool
|
Toggle expand menu in UI. |
dirtiness |
int
|
Percentage dirty of the chore. |
duedays |
int
|
Days until chore is due. |
last_three_history_items |
List[LastHistoryItem]
|
List of 3 last history items of the chore. |
status |
int
|
Status ID of the chore. |
Source code in backend/backend/api.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | |
ChoreOutFull
Schema to represent a Chore with full Assigned User and no History.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the chore. |
chore_name |
str
|
Name of the chore. |
area_id |
int
|
ID of an Area object assigned to the chore. |
area |
AreaOut
|
Area object assigned to the chore. |
nextDue |
date
|
Date chore is next due. |
lastCompleted |
date
|
Date chore was last completed. |
intervalNumber |
int
|
Repeat interval for the chore. |
unit |
str
|
Repeat unit for the chore. |
active_months |
List[int]
|
List of Month ids chode is active. |
assignee_id |
int
|
ID of a user assigned to the chore. Default=None. |
assignee |
CustomUserSchema
|
CustomUser object of the assigned user. Default=None. |
effort |
int
|
Effort required for the chore. |
vacationPause |
bool
|
Due days when paused for vacation. |
expand |
bool
|
Toggle expand menu in UI. |
dirtiness |
int
|
Percentage dirty of the chore. |
duedays |
int
|
Days until chore is due. |
status |
int
|
Status ID of the chore. |
Source code in backend/backend/api.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | |
TogglActive
Schema to toggle a Chore status.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
int
|
ID of a status object. |
Source code in backend/backend/api.py
256 257 258 259 260 261 262 263 264 | |
CompleteChore
Schema to complete a Chore object.
Attributes:
| Name | Type | Description |
|---|---|---|
lastCompleted |
date
|
Date chore was completed. |
completed_by_id |
int
|
ID of the user who completed chore. |
Source code in backend/backend/api.py
267 268 269 270 271 272 273 274 275 276 277 | |
SnoozeChore
Schema to snooze a chore object.
Attributes:
| Name | Type | Description |
|---|---|---|
nextDue |
date
|
Date to set nextDue to. |
Source code in backend/backend/api.py
280 281 282 283 284 285 286 287 288 | |
ClaimChore
Schema to claim a Chore.
Attributes:
| Name | Type | Description |
|---|---|---|
assignee_id |
int
|
ID of a user to assign to chore. Optional. |
Source code in backend/backend/api.py
291 292 293 294 295 296 297 298 299 | |
HistoryItem
Views
create_historyitem(request, payload)
The function create_historyitem creates a new HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems - Method:
POST
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
payload
|
HistoryItemIn
|
HistoryItem object to create. |
required |
Returns:
| Type | Description |
|---|---|
int
|
ID of the newly created HistoryItem object. |
Source code in backend/backend/api.py
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | |
get_historyitem(request, historyitem_id)
The function get_historyitem retrieves an HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
HistoryItemOut
|
The HistoryItem object. |
Source code in backend/backend/api.py
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 | |
list_historyitems(request, page=Query(1), page_size=Query(60))
The function list_historyitems retrieves a list of HistoryItem objects.
Endpoint
- Path:
/api/v2/historyitems - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
page
|
int
|
The page of the paginated History Items to return. Default=1. Optional. |
Query(1)
|
page_size
|
int
|
The page size of paginated History Items. Default=60. Optional. |
Query(60)
|
Returns:
| Type | Description |
|---|---|
PaginatedHistoryItems
|
Paginated List of HistoryItem objects. |
Source code in backend/backend/api.py
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 | |
update_historyitem(request, historyitem_id, payload)
The function update_historyitem updates a given HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to update. |
required |
payload
|
HistoryItemIn
|
HistoryItem object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 | |
delete_historyitem(request, historyitem_id)
The function delete_historyitem deletes a given HistoryItem object.
Endpoint
- Path:
/api/v2/historyitems/{historyitem_id} - Method:
DELETE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
historyitem_id
|
int
|
ID of the HistoryItem object to delete. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 | |
Schemas
HistoryItemIn
Schema to represent a HistoryItem.
Attributes:
| Name | Type | Description |
|---|---|---|
completed_date |
date
|
The date the chore was completed. |
completed_by |
str
|
A name of the user who completed the chore. |
chore_id |
int
|
ID of the chore completed. |
Source code in backend/backend/api.py
402 403 404 405 406 407 408 409 410 411 412 413 414 | |
HistoryItemOut
Schema to represent a HistoryItem.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the HistoryItem. |
completed_date |
date
|
The date the chore was completed. |
completed_by |
CustomUserSchema
|
Object of the user who completed chore. |
chore |
ChoreOutFull
|
Object of the chore completed. |
Source code in backend/backend/api.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |
LastHistoryItem
Schema to represent the last History Item for a chore.
Attributes:
| Name | Type | Description |
|---|---|---|
completed_date |
date
|
The date the chore was completed. |
completed_by |
str
|
A name of the user who completed the chore. |
Source code in backend/backend/api.py
302 303 304 305 306 307 308 309 310 311 312 | |
PaginatedHistoryItems
Schema to represent a paginated list of HistoryItems.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
List[HistoryItemOut]
|
List of HistoryItem objects. |
current_page |
int
|
Page number of current record set. |
total_pages |
int
|
Total number of pages. |
total_records |
int
|
Total numboer of HistoryItems. |
Source code in backend/backend/api.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
Option
Views
get_option(request, option_id)
The function get_option retrieves an Option object.
Endpoint
- Path:
/api/v2/options/{option_id} - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
option_id
|
int
|
ID of the Option object to retreive. |
required |
Returns:
| Type | Description |
|---|---|
OptionOut
|
The Option object. |
Source code in backend/backend/api.py
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | |
list_options(request)
The function list_options retrieves a list of Option objects.
Endpoint
- Path:
/api/v2/options - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Type | Description |
|---|---|
List[OptionOut]
|
List of Option objects. |
Source code in backend/backend/api.py
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 | |
update_option(request, option_id, payload)
The function update_option updates a given Option object.
Endpoint
- Path:
/api/v2/options/{option_id} - Method:
PUT
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
option_id
|
int
|
ID of the Option object to update. |
required |
payload
|
OptionIn
|
Option object with updates to apply. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Returns |
Source code in backend/backend/api.py
1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 | |
Schemas
OptionIn
Schema to represent an Option object.
Attributes:
| Name | Type | Description |
|---|---|---|
vacation_mode |
bool
|
Toggle for vacation mode. |
med_thresh |
int
|
Medium dirtiness threshold. |
high_thresh |
int
|
High dirtiness threshold. |
Source code in backend/backend/api.py
451 452 453 454 455 456 457 458 459 460 461 462 463 | |
OptionOut
Schema to represent an Option object.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID of the Option object. |
vacation_mode |
bool
|
Toggle for vacation mode. |
med_thresh |
int
|
Medium dirtiness threshold. |
high_thresh |
int
|
High dirtiness threshold. |
Source code in backend/backend/api.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
Version
Views
list_version(request)
The function list_version retrieves the app version number
from the backend.
Endpoint
- Path:
/api/v2/version/list - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VersionOut |
a version object |
Source code in backend/backend/api.py
1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | |
Schemas
VersionOut
Schema to represent a Version.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
ID integer. Unique. |
version_number |
str
|
The version of the app. |
Source code in backend/backend/api.py
32 33 34 35 36 37 38 39 40 41 42 | |
Graphs
Views
get_weeklytotals(request, week=0)
The function get_weeklytotals retrieves the weekly totals.
Endpoint
- Path:
/api/v2/weeklytotals - Method:
GET
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The HTTP request object. |
required |
week
|
int
|
Flag to indicate if the totals for last week should be retrieved. Default=0. |
0
|
Returns:
| Type | Description |
|---|---|
GraphData
|
The graph data with labels and datasets. |
Source code in backend/backend/api.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
Schemas
DatasetObject
Schema to represent a graph DataSet object.
Attributes:
| Name | Type | Description |
|---|---|---|
backgroundColor |
str
|
Hex value of the graph color. Optional. |
data |
List(int
|
List of object IDs for the graph. |
label |
str
|
Label for the gaph dataset. |
Source code in backend/backend/api.py
484 485 486 487 488 489 490 491 492 493 494 495 496 | |
GraphData
Schema to represent a GraphData object.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
List[str]
|
List of labels for the graph data. |
datasets |
List[DatasetObject]
|
List of DataSetObject objects. |
title |
str
|
Title of the graph. |
Source code in backend/backend/api.py
500 501 502 503 504 505 506 507 508 509 510 511 512 | |