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

Commit

Permalink
0.9.0
Browse files Browse the repository at this point in the history
Co-authored-by: Luca-Goran <[email protected]>
  • Loading branch information
SerbanTudor04 and Luca-Goran committed May 8, 2023
1 parent 02e184a commit 0b1a683
Show file tree
Hide file tree
Showing 59 changed files with 7,860 additions and 262 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 0.9.0
## Features:
- Migrate from `jsx` to `tsx`
- Add Documentation page with complete features.
- Implement partially reports users balance
- Migrate management part from the web_admin to a hole new application web_superuser
- Remove todo comment
- Add when a message is sent, notify every user that has any right on this ticket
- Added ability to send email to the creator of the ticket or to add message to inbox of the creator.
# Fixes:
- Fix typo
- Fix AMgmDeparment table view error
- Fix tickets on message send when a message is send
- Fix bug in server.py in for test endpoints
# 0.8.1
## Fixes:
- Added missing default data on installation
Expand Down
89 changes: 84 additions & 5 deletions backend/endpoints/frontoffice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,95 @@
log = logger


@server.route("/public/getTicket", methods=["POST"])
@adminLoginCheck
def getTicket():
@server.route("/public/ticket/validate", methods=["POST"])
def validateTicketCode():

data = jsonify(request.json)

jsonData = data.json

if "ticket_code" not in jsonData :
__responseObject = {
'status': 'invalid',
'message': 'Missing ticket_code',
}
return makeReturnResponse(__responseObject), 400

conn = db.getConnection()
cursor = conn.cursor()
cursor.execute(DB_QUERY_STRING)

data={
data={"is_valid":False}

cursor.execute("""
select count(*) from tickets where code=%s
""",[jsonData["ticket_code"]])

IS_VALID=cursor.fetchone()[0]

if IS_VALID>0:
data['is_valid']=True

cursor.close()
db.releaseConnection(conn)

__responseObject = {
'status': 'success',
'message': 'OK',
"data":data

}

return makeReturnResponse(__responseObject), 200

@server.route("/public/ticket/get/data", methods=["GET"])
def getTicketData():

data = jsonify(request.json)

jsonData = data.json

if "ticket_code" not in jsonData :
__responseObject = {
'status': 'invalid',
'message': 'Missing ticket_code or invalid ticket_code',
}
return makeReturnResponse(__responseObject), 400

conn = db.getConnection()
cursor = conn.cursor()
cursor.execute(DB_QUERY_STRING)

data=[]

cursor.execute("""
select id,code,subject,description,status,department_id,content,created_at,closed_at,
created_by,updated_at from tickets where code =%s
""")

r=cursor.fetchone()

if r is None:
__responseObject = {
'status': 'invalid',
'message': 'Missing ticket_code or invalid ticket_code',
}
return makeReturnResponse(__responseObject), 400

data={
"id":r[0],
"code":r[1],
"subject":r[2],
"descrrptron":r[3],
"status":r[4],
"department_rd":r[5],
"content":r[6],
"created_at":r[7],
"closed_at":r[8],
"created_by":r[9],
"updated_at":r[10],
}

cursor.close()
db.releaseConnection(conn)

Expand All @@ -33,4 +110,6 @@ def getTicket():

}

return makeReturnResponse(__responseObject), 200
return makeReturnResponse(__responseObject), 200


2 changes: 1 addition & 1 deletion web_admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 0b1a683

Please sign in to comment.