Coverage for src / qdrant_loader / connectors / jira / models.py: 100%

40 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-06-11 09:38 +0000

1"""Data models for Jira connector.""" 

2 

3from datetime import datetime 

4 

5from pydantic import BaseModel, ConfigDict, Field, HttpUrl 

6 

7 

8class JiraUser(BaseModel): 

9 """Jira user model.""" 

10 

11 account_id: str = Field(..., description="User's account ID") 

12 display_name: str = Field(..., description="User's display name") 

13 email_address: str | None = Field(None, description="User's email address") 

14 

15 

16class JiraComment(BaseModel): 

17 """Jira comment model.""" 

18 

19 id: str = Field(..., description="Comment ID") 

20 body: str = Field(..., description="Comment content") 

21 created: datetime = Field(..., description="Comment creation timestamp") 

22 updated: datetime | None = Field(None, description="Comment last update timestamp") 

23 author: JiraUser = Field(..., description="User who created the comment") 

24 

25 

26class JiraAttachment(BaseModel): 

27 """Jira attachment model.""" 

28 

29 id: str = Field(..., description="Attachment ID") 

30 filename: str = Field(..., description="Attachment filename") 

31 size: int = Field(..., description="Attachment size in bytes") 

32 mime_type: str = Field(..., description="Attachment MIME type") 

33 content_url: HttpUrl = Field(..., description="URL to download attachment content") 

34 created: datetime = Field(..., description="Attachment creation timestamp") 

35 author: JiraUser = Field(..., description="User who attached the file") 

36 

37 

38class JiraIssue(BaseModel): 

39 """Jira issue model.""" 

40 

41 model_config = ConfigDict(extra="allow") 

42 id: str = Field(..., description="Issue ID") 

43 key: str = Field(..., description="Issue key") 

44 summary: str = Field(..., description="Issue summary") 

45 description: str | None = Field(None, description="Issue description") 

46 issue_type: str = Field(..., description="Issue type") 

47 status: str = Field(..., description="Issue status") 

48 priority: str | None = Field(None, description="Issue priority") 

49 project_key: str = Field(..., description="Project key") 

50 created: datetime = Field(..., description="Issue creation timestamp") 

51 updated: datetime = Field(..., description="Last update timestamp") 

52 reporter: JiraUser = Field(..., description="Issue reporter") 

53 assignee: JiraUser | None = Field(None, description="Issue assignee") 

54 labels: list[str] = Field(default_factory=list, description="Issue labels") 

55 attachments: list[JiraAttachment] = Field( 

56 default_factory=list, description="Issue attachments" 

57 ) 

58 comments: list[JiraComment] = Field( 

59 default_factory=list, description="Issue comments" 

60 ) 

61 parent_key: str | None = Field(None, description="Parent issue key for subtasks") 

62 subtasks: list[str] = Field( 

63 default_factory=list, description="List of subtask keys" 

64 ) 

65 linked_issues: list[str] = Field( 

66 default_factory=list, description="List of linked issue keys" 

67 )