-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli for dealing with the proj (#108)
- Loading branch information
1 parent
3aa7d5c
commit a53dd81
Showing
57 changed files
with
1,480 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
UPLOAD_USER=user | ||
UPLOAD_PASSWORD=password | ||
DISCOGS_API_KEY=123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/media/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "milestone id: " milestoneId | ||
|
||
EVAL_STATUS=("OPEN" "IN_PROGRESS" "IN_REVIEW" "ACCEPTED" "PAID") | ||
|
||
evaluatedState=$(bash ./commands/dropdown.sh ${EVAL_STATUS[@]}) | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
json_payload=$(cat <<EOF | ||
{ | ||
"milestoneId": "$milestoneId", | ||
"evaluatedState": "$evaluatedState" | ||
} | ||
EOF | ||
) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" -d "$json_payload" http://localhost:80/api/v1/contracts/milestones/${milestoneId}/evaluate) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "contract id: " contractId | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/contracts/${contractId}) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "contract id: " contractId | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/contracts/${contractId}/milestones) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "milestone id: " milestoneId | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/contracts/milestones/${milestoneId}) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
18 changes: 18 additions & 0 deletions
18
workup-bash/commands/contracts/get_pending_terminations.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "contract id: " contractId | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/contracts/${contractId}/terminations) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
30 changes: 30 additions & 0 deletions
30
workup-bash/commands/contracts/handle_termination_request.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "termination request id: " contractTerminationRequestId | ||
|
||
EVAL_STATUS=("PENDING" "REJECTED" "ACCEPTED") | ||
|
||
chosenStatus=$(bash ./commands/dropdown.sh ${EVAL_STATUS[@]}) | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
json_payload=$(cat <<EOF | ||
{ | ||
"contractTerminationRequestId": "$contractTerminationRequestId", | ||
"chosenStatus": "$chosenStatus" | ||
} | ||
EOF | ||
) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" -d "$json_payload" http://localhost:80/api/v1/contracts/terminations/${contractTerminationRequestId}/handle) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# this has to send the json payload because the endpoint in webserver needs requestbody | ||
# even though not used there but have to send from here | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "milestone id: " milestoneId | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
json_payload=$(cat <<EOF | ||
{ | ||
"milestoneId": "$milestoneId" | ||
} | ||
EOF | ||
) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" -d "$json_payload" http://localhost:80/api/v1/contracts/milestones/${milestoneId}/progress) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "contract id: " contractId | ||
|
||
read -p "reason for termination: " reason | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
json_payload=$(cat <<EOF | ||
{ | ||
"contractId": "$contractId", | ||
"reason": "$reason" | ||
} | ||
EOF | ||
) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" -d "$json_payload" http://localhost:80/api/v1/contracts/${contractId}/terminations/request) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Define the options | ||
OPTIONS=("$@") | ||
|
||
echo "Select your experience level:" > /dev/null | ||
select OPTION in "${OPTIONS[@]}"; do | ||
if [[ " ${OPTIONS[@]} " =~ " ${OPTION} " ]]; then | ||
echo "$OPTION" | ||
break | ||
else | ||
echo "Invalid selection. Please choose a valid option." > /dev/null | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "jon id: " jobId | ||
read -p "proposal id: " proposalId | ||
|
||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/jobs/{$jobId}/proposals/{$proposalId}/accept) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "title: " title | ||
read -p "description: " description | ||
read -p "location: " location | ||
read -p "budget: " budget | ||
EXPERIENCE=("ENTRY_LEVEL" "INTERMEDIATE" "EXPERT") | ||
experience=$(bash ./commands/dropdown.sh ${EXPERIENCE[@]}) | ||
skills=$(bash ./commands/take_list.sh "skill") | ||
|
||
json_payload=$(cat <<EOF | ||
{ | ||
"title": "$title", | ||
"description": "$description", | ||
"location": "$location", | ||
"budget": $budget, | ||
"skills": $skills, | ||
"experience": "$experience" | ||
} | ||
EOF | ||
) | ||
|
||
echo "$json_payload" | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" -d "$json_payload" http://localhost:80/api/v1/jobs) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "job id: " id | ||
|
||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/jobs/{$id}) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
read -p "job id: " id | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/jobs/{$id}/proposals) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/jobs/me) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/jobs/me/proposals) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
YELLOW='\033[0;33m' | ||
NC='\033[0m' | ||
|
||
echo -e "${YELLOW}Sending your request to the server...${NC}" | ||
|
||
bearerToken=$(cat ./token.txt) | ||
|
||
status_code=$(curl -s -o response_body -w "%{http_code}" -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $bearerToken" http://localhost:80/api/v1/payments/clients/me/requests) | ||
|
||
response_body=$(cat response_body) | ||
|
||
rm response_body | ||
|
||
bash ./response_formatter.sh "$status_code" "$response_body" |
Oops, something went wrong.