Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #230 from COS301-SE-2023/dev
Browse files Browse the repository at this point in the history
Merge dev into main for Demo 4
  • Loading branch information
JacoMalan1 authored Sep 29, 2023
2 parents b5e68d9 + 402337f commit 304971e
Show file tree
Hide file tree
Showing 38 changed files with 3,643 additions and 1,904 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/aws_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ env:
AWS_REGION: eu-central-1
ECR_REPOSITORY: witp
ECS_SERVICE: witp-server
ECS_CLUSTER: ProdCluster
ECS_CLUSTER: DevCluster
ECS_TASK_DEFINITION: .aws/task-definition.json
CONTAINER_NAME: witp

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: Production
environment: Production

steps:
- name: Checkout
Expand Down Expand Up @@ -71,4 +71,3 @@ jobs:
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,34 @@ the user a map overlay of areas where loadshedding is currently happening,
to help assist users navigate their routes through these dark times.

# Demos
- ## Demo 1
- [BytemyCode Demo 1 Video](https://drive.google.com/file/d/10su_NZ4v-KUKky87HE0h-KsPnfg_5ynS/view)
- [System Requirements Specifications](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Software-Requirements-Specification-(SRS))
- ## Demo 2
- [BytemyCode Demo 2 Video](https://drive.google.com/file/d/1gnUPZZERiG1_7zgNZKQTL3aRJQPowEPz/view)
- [Coding Standards Document](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Coding-Standards)
- [User Manual](https://github.com/COS301-SE-2023/Where-is-the-power/files/11878231/User_Manual.pdf)
- [System Requirements Specifications](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Software-Requirements-Specification-(SRS))
- [Architectural Requirements Document](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Architectural-Requirements-Document)
- ## Demo 3
[**All documentation can be found on the Wiki!**](https://github.com/COS301-SE-2023/Where-is-the-power/wiki)
- ## Demo 4
- [user-manual-mobile.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12755255/user-manual-mobile.pdf)
- [user-manual-desktop.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12755258/user-manual-desktop.pdf)
- [Tesing policy.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12755462/Tesing.policy.pdf)
- [Coding Standards.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12755477/Coding.Standards.pdf)
- [Software Requirement Specification.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12756323/Software.Requirement.Specification.pdf)
- [Technical Installation Manual.pdf](https://github.com/COS301-SE-2023/Where-is-the-power/files/12756471/Technical.Installation.Manual.1.pdf)



***However PDFs are listed below:***

- ## Demo 3
- [Project Management](https://github.com/orgs/COS301-SE-2023/projects/7)
- [User Manual](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/User_Manual.pdf)
- [Technical Installation Manual](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Technical%20Installation%20Manual.pdf)
- [Coding Standards/Quality](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Coding%20Standards.pdf)
- [SRS PDF](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Software-Requirements-Specification-(SRS).pdf)
- [Architectural Requirements Document](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Architectural-Requirements-Document.pdf)
- ## Demo 2
- [BytemyCode Demo 2 Video](https://drive.google.com/file/d/1gnUPZZERiG1_7zgNZKQTL3aRJQPowEPz/view)
- [Coding Standards Document](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Coding-Standards)
- [User Manual](https://github.com/COS301-SE-2023/Where-is-the-power/files/11878231/User_Manual.pdf)
- [System Requirements Specifications](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Software-Requirements-Specification-(SRS))
- [Architectural Requirements Document](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Architectural-Requirements-Document)
- ## Demo 1
- [BytemyCode Demo 1 Video](https://drive.google.com/file/d/10su_NZ4v-KUKky87HE0h-KsPnfg_5ynS/view)
- [System Requirements Specifications](https://github.com/COS301-SE-2023/Where-is-the-power/wiki/Software-Requirements-Specification-(SRS))



# About the repo ℹ️
Expand Down
16 changes: 9 additions & 7 deletions api/scripts/fetchstatstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
testing_endpoint = "https://witpa.codelog.co.za/api/fetchSuburbStats"
schedule_endpoint = "https://witpa.codelog.co.za/api/fetchScheduleData"
schedule_endpoint = "http://127.0.0.1:8000/api/fetchScheduleData"
maponoff_endpoint = "https://witpa.codelog.co.za/api/fetchTimeForPolygon"
maponoff_endpoint = "http://127.0.0.1:8000/api/fetchTimeForPolygon"
def sendRequest():
body = {
Expand All @@ -20,8 +21,8 @@ def sendRequest():

def sendScheduleRequest():
body = {
#"suburbId" :18231
"suburbId" : 18210
#"suburbId" :18231
"suburbId" : 18186
}
request = json.dumps(body)
headers = {
Expand All @@ -32,20 +33,21 @@ def sendScheduleRequest():

def sendTimeForPolygonRequest():
body = {
#"suburbId" :18057
#"suburbId" : 18231
"suburbId" : 18195
#"suburbId" :18057
#"suburbId" : 18231
"suburbId" : 18196
}
print(body)
request = json.dumps(body)
headers = {
"Content-Type":"application/json"
}
response = requests.post(url=maponoff_endpoint,data=request,headers=headers)
print(response.text)
if (__name__ == "__main__"):
sendRequest()
#sendRequest()
print("=================================================================================")
sendScheduleRequest()
print("=================================================================================")
sendTimeForPolygonRequest()
#sendTimeForPolygonRequest()

8 changes: 6 additions & 2 deletions api/src/loadshedding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,11 @@ impl TimeScheduleEntity {
.with_hour(if start {
self.start_hour as u32
} else {
self.stop_hour as u32
if self.stop_hour != 24 {
self.stop_hour as u32
} else {
0
}
})
.unwrap()
.with_minute(if start {
Expand All @@ -708,7 +712,7 @@ impl TimeScheduleEntity {
self.stop_minute as u32
})
.unwrap();
if time < time_to_search {
if time < time_to_search && !start {
time = time.checked_add_signed(chrono::Duration::days(1)).unwrap();
}
time
Expand Down
4 changes: 2 additions & 2 deletions api/src/scraper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ pub fn convert_to_ints(time_range:&str) -> Result<Times,Json<ApiError<'static>>>
return Err(Json(ApiError::ScraperUploadError(
"You have a malformed starting hour, please fix this, HH <= 23",
)));
} else if potential_times.end_hour >= 24 {
} else if potential_times.end_hour > 24 || potential_times.end_hour == 0 {
return Err(Json(ApiError::ScraperUploadError(
"You have a malformed end hour, please fix this, HH <= 23",
"You have a malformed end hour, please fix this, 0 < HH <= 24",
)));
} else if potential_times.start_minute >= 60 {
return Err(Json(ApiError::ScraperUploadError(
Expand Down
Loading

0 comments on commit 304971e

Please sign in to comment.