Documentation ¶
Index ¶
- Constants
- Variables
- type Service
- func (service Service) CreatePdf(application map[string]interface{}, pdfType api.ArchivalPdf, hash string) ([]byte, error)
- func (service Service) GenerateReleases(account api.Account, app api.Application) ([]api.Attachment, error)
- func (service Service) SignatureAvailable(application map[string]interface{}, pdfType api.ArchivalPdf) (*time.Time, bool)
Constants ¶
const DocumentTypeCertification = "CER"
DocumentTypeCertification is the document type for the certification/signature-form
const DocumentTypeCreditRelease = "FCR"
DocumentTypeCreditRelease is the document type for the credit release
const DocumentTypeInformationRelease = "REL"
DocumentTypeInformationRelease is the document type for the infomation release
const DocumentTypeMedicalRelease = "MEL"
DocumentTypeMedicalRelease is the document type for the medical release
Variables ¶
var ( // ReleasePDFs lists the supported archival PDFs. ReleasePDFs = []api.ArchivalPdf{ {"signature-form", "certification-SF86-July2017.template.pdf", "AdditionalComments", DocumentTypeCertification}, {"release-credit", "credit-SF86-July2017.template.pdf", "Credit", DocumentTypeCreditRelease}, {"release-medical", "medical-SF86-July2017.template.pdf", "Medical", DocumentTypeMedicalRelease}, {"release-information", "general-SF86-July2017.template.pdf", "General", DocumentTypeInformationRelease}, } )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements operations to create and query archival PDFs
func NewPDFService ¶
NewPDFService returns a new PDF service
func (Service) CreatePdf ¶
func (service Service) CreatePdf(application map[string]interface{}, pdfType api.ArchivalPdf, hash string) ([]byte, error)
CreatePdf creates an in-memory PDF from a template, populated with values from the application, using basic text subsitution. Field names (e.g., SSN) are replaced with application values, space padded to a fixed length to ensure that PDF object/xref byte offsets do not need to be updated. Assumes field values are ASCII. The type of PDF controls the template used. The SHA256 hash of the application, in hexadecimal, may also be populated in the resulting PDF.
func (Service) GenerateReleases ¶
func (service Service) GenerateReleases(account api.Account, app api.Application) ([]api.Attachment, error)
GenerateReleases generates the four signed pdfs for a given Application
func (Service) SignatureAvailable ¶
func (service Service) SignatureAvailable(application map[string]interface{}, pdfType api.ArchivalPdf) (*time.Time, bool)
SignatureAvailable returns the date the eApp section corresponding to the PDF type was signed. If the section was not signed (e.g., no responses requiring medical release), returns nil and false.