o
    ia                     @  sF   d dl mZ d dlmZ ddlmZmZ ddlmZ G dd dZ	dS )	    )annotations)Path   )	read_json
write_json)now_isoc                   @  s.   e Zd ZdZdddZdddZdd	d
ZdS )ReportServicezICreates markdown/json report outputs for downstream review and prompting.applicant_baser   returnc                 C  sz   t |d i dp	i }|d d }dddd|d	pd
 d|dp$d
 dddddddddg}|j|d dd |S )Napplicant.jsondefault	generatedzcv.md
z# Applicant CV (Draft) zName: 	full_nameTBDzNominated Occupation: nominated_occupationz## Professional Summaryz<- Add manually verified summary based on processed evidence.z## Employment Historyz,- Populate from verified employment records.z## Educationz(- Populate from verified qualifications.utf-8encoding)r   joinget
write_text)selfr	   	applicantoutputbody r   U/var/www/html/flask_server/apps/migration_evidence_builder/services/report_service.pygenerate_cv   s(   zReportService.generate_cvc                 C  sd   t |d d i dpi }|d d }|dg }dddd	d
t| g}|jd|d dd |S )Nr   ztimeline.jsonr   zgap_report.mdeventsz# Gap Reportr   z1Potential chronology/data gaps for manual review:z&- No date-normalized extraction in V1.z- Events available: r   r   r   )r   r   lenr   r   )r   r	   timeliner   r!   linesr   r   r   generate_gap_report#   s   z!ReportService.generate_gap_reportc                 C  s   t |d i dp	i }t |d d i dpi }t |d d i dp!i }t |||dg ddd	}|d d
 }t|| |d d }|jddddddddddd|dd d|dd gd dd |S )Nr   r   r   zchecklist.jsonzoccupation_analysis.jsonz?Prepare draft support notes for sponsor visa evidence workflow.)zDo not provide legal advice.zDo not imply approval outcomes.zGSeparate verified evidence, inferred suggestions, and missing evidence.)goalconstraints)generated_atr   	checklistoccupation_analysisinstructionszchatgpt_briefing_pack.jsonzchatgpt_briefing_pack.mdr   z# ChatGPT Briefing Packr   z.Use this pack for drafting support notes only.z## Guardrailsz- Not legal advice.z- Not a visa decision tool.z?- Keep verified/inferred/missing evidence explicitly separated.z## Applicant
- ID: applicant_idunknownz- Name: r   r   r   r   )r   r   r   r   r   r   )r   r	   r   r)   
occupationpackjson_output	md_outputr   r   r   generate_chatgpt_pack1   sD   
z#ReportService.generate_chatgpt_packN)r	   r   r
   r   )__name__
__module____qualname____doc__r    r%   r2   r   r   r   r   r   	   s
    

r   N)

__future__r   pathlibr   utils.json_utilsr   r   utils.time_utilsr   r   r   r   r   r   <module>   s
    