Coverage for backend / app / job_rating / schemas.py: 100%

35 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-17 21:34 +0000

1"""Job Rating schemas""" 

2 

3import datetime as dt 

4 

5from pydantic import BaseModel 

6 

7from app.base_schemas import Out 

8 

9 

10# --------------------------------------------------- AI SYSTEM PROMPT --------------------------------------------------- 

11 

12 

13class AiSystemPromptOut(Out): 

14 """AI System Prompt output schema""" 

15 

16 prompt: str 

17 

18 

19# ----------------------------------------------------- JOB RATING ----------------------------------------------------- 

20 

21 

22class JobRatingOut(BaseModel): 

23 """Job Rating output schema""" 

24 

25 overall_score: int | None 

26 technical_score: int | None 

27 experience_score: int | None 

28 educational_score: int | None 

29 interest_score: int | None 

30 feedback: str | None 

31 is_success: bool | None 

32 is_skipped: bool | None 

33 skip_reason: str | None 

34 error: str | None 

35 scraped_job_id: int | None 

36 user_qualification_id: int | None 

37 system_prompt_id: int | None 

38 job_prompt_template_id: int | None 

39 job_prompt: str | None 

40 notes: list[str] = [] 

41 

42 

43# ----------------------------------------------- JOB RATING SERVICE LOG ----------------------------------------------- 

44 

45 

46class JobRatingServiceLogOut(Out): 

47 """Job Rating Service Log output schema""" 

48 

49 run_datetime: dt.datetime 

50 run_duration: float | None = None 

51 is_success: bool | None = None 

52 error_message: str | None = None 

53 job_found_ids: list[int] = [] 

54 job_succeeded_ids: list[int] = [] 

55 job_failed_ids: list[int] = [] 

56 job_skipped_ids: list[int] = [] 

57 user_found_ids: list[int] = [] 

58 user_processed_ids: list[int] = [] 

59 

60 

61class JobRatingServiceLogStartRequest(BaseModel): 

62 """Job Rating Service Log start request schema""" 

63 

64 period_hours: int | None = 3