OrderTicket.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. class OrderTicket(object):
  2. def __init__(self, serviceType, driverSearchEngine, comment, arrivalTime, additionalServices, tasks, spendingLimit, isWithPaymentDocument, id, isProceedBeforeArrival):
  3. self.serviceType = serviceType
  4. self.driverSearchEngine = driverSearchEngine
  5. self.comment = comment
  6. self.arrivalTime = arrivalTime
  7. self.additionalServices = additionalServices
  8. self.tasks = tasks
  9. self.spendingLimit = spendingLimit
  10. self.isWithPaymentDocument = isWithPaymentDocument
  11. self.id = id
  12. self.isProceedBeforeArrival = isProceedBeforeArrival
  13. #ticket json example
  14. '''
  15. {
  16. "id": 2,
  17. "status": 111,
  18. "created_date": "2023-05-15",
  19. "status_changed_date": "2023-05-15T17:16:22.955601Z",
  20. "priority": 0,
  21. "title": "Test",
  22. "note": "{\n \n \"ticket\": 1,\n \"state\": 1,\n \"id_metaservice\": 1,\n \"is_global\": false,\n \"is_visible\": false,\n \"service\": 1,\n \"service_type\": 1,\n\n \"time_placed\": 1}"
  23. "due_date": "2023-05-15",
  24. "task_list": 10,
  25. "created_by": 1,
  26. "type": 1,
  27. "assigned_to": 1
  28. }
  29. '''
  30. #ticket minimal example
  31. '''
  32. {
  33. "id": 2,
  34. "status": 111,
  35. "created_date": "2023-05-15",
  36. "status_changed_date": "2023-05-15T17:16:22.955601Z",
  37. "priority": 0,
  38. "title": null,
  39. "note": null,
  40. "due_date": null,
  41. "task_list": 10,
  42. "created_by": 1,
  43. "type": 1,
  44. "assigned_to": null
  45. }
  46. {
  47. "serviceType": 2,
  48. "driverSearchEngine": 0,
  49. "comment": "Yyyy",
  50. "arrivalTime": "2023-12-07T14:39:54Z",
  51. "additionalServices": [],
  52. "tasks": [
  53. {
  54. "text": "Eeee",
  55. "address": "Jjjj"
  56. }
  57. ],
  58. "spendingLimit": 6668,
  59. "isWithPaymentDocument": true,
  60. "id": 294830,
  61. "isProceedBeforeArrival": true
  62. }
  63. '''
  64. # class OrderTicketOLD(object):
  65. # def __init__(self, id, status, created_date, status_changed_date, priority, title=None, note=None, due_date=None, task_list=None, created_by=None, type=None, assigned_to=None):
  66. # self.id = id
  67. # self.status = status
  68. # self.created_date = created_date
  69. # self.status_changed_date = status_changed_date
  70. # self.priority = priority
  71. # self.title = title
  72. # self.note = note
  73. # self.due_date = due_date
  74. # self.task_list = task_list
  75. # self.created_by = created_by
  76. # self.type = type
  77. # self.assigned_to = assigned_to
  78. # def __str__(self):
  79. # return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}\n".format(self.id, self.status, self.created_date, self.status_changed_date, self.priority, self.title, self.note, self.due_date, self.task_list, self.created_by, self.type, self.assigned_to)