gateway/modules/interfaces/interfaceTicketObjects.py
2025-09-03 17:16:42 +02:00

50 lines
1.5 KiB
Python

from dataclasses import dataclass
from shareplum import Site
from shareplum import Office365
from shareplum.site import Version
from modules.interfaces.interfaceTicketModel import TicketBase
SUPPORTED_SYSTEMS = ["jira"]
@dataclass(slots=True)
class TicketSharepointSyncInterface:
ticketConnector: TicketBase
task_sync_definition: dict
# TODO: shareplum instance
@classmethod
async def create(
cls,
ticket_connector: TicketBase,
) -> "TicketSharepointSyncInterface":
instance = cls()
instance.ticketConnector = ticket_connector
return instance
# TODO: 1. Read JIRA tickets
# TODO: 2. Transform tasks according to task_sync_definition (get_task_object) l. 79ff
# TODO: 3. Create export file: Save transformed tasks to a timestamped export file in sharepoint
# - maybe not needed?
# TODO: 4. Backup current main sync file
# TODO: 5. Compare JIRA data (export file) with current main sync file and update line by line
# - update GET only
# - important so that we don't overwrite the changes from SELISE in the main sync file
# TODO: 6. Take PUT changes from the main sync file and write it back to JIRA.
# TODO: Write file to sharepoint folder
# TODO: Remove file from sharepoint folder
# TODO: Rename file in sharepoint folder
# Next steps:
# - Complete connectorSharepoint CRUD-ish
# - pytest sharepoint connector
# - pytest JIRA connector
# - connect logic here...