Documentation ¶
Index ¶
- func CheckCompanyDetailsAreValid(companyProfile *companieshouseapi.CompanyProfile) error
- func CheckCompanyExists(insolvencyRequest *models.InsolvencyRequest, req *http.Request) (error, int, *companieshouseapi.CompanyProfile)
- func CheckCompanyNameAlphaKey(companyProfileCompanyName string, insolvencyRequest *models.InsolvencyRequest, ...) (error, int)
- func CheckIfTransactionClosed(transactionID string, req *http.Request) (bool, error, int)
- func CheckTransactionID(transactionID string, req *http.Request) (error, int)
- func GenerateFilings(svc dao.Service, transactionID string) ([]models.Filing, error)
- func GetCompanyIncorporatedOn(companyNumber string, req *http.Request) (string, error)
- func IsUserOnEfsAllowList(emailAddress string, req *http.Request) (bool, error)
- func PatchTransactionWithInsolvencyResource(transactionID string, insolvencyResource *models.InsolvencyResourceDao, ...) (error, int)
- func ValidateAntivirus(svc dao.Service, insolvencyResource models.InsolvencyResourceDao, ...) *[]models.ValidationErrorResponseResource
- func ValidateAppointmentDetails(svc dao.Service, appointment models.PractitionerAppointment, ...) (string, error)
- func ValidateAttachmentDetails(svc dao.Service, transactionID string, attachmentType string, ...) (string, error)
- func ValidateInsolvencyDetails(insolvencyResource models.InsolvencyResourceDao) *[]models.ValidationErrorResponseResource
- func ValidatePractitionerDetails(svc dao.Service, transactionID string, practitioner models.PractitionerRequest) (string, error)
- func ValidateProgressReportDetails(svc dao.Service, progressReportStatementDao *models.ProgressReportResourceDao, ...) (string, error)
- func ValidateResolutionDate(svc dao.Service, resolution *models.ResolutionResourceDao, ...) (string, error)
- func ValidateResolutionRequest(resolution models.Resolution) string
- func ValidateStatementDetails(svc dao.Service, statementDao *models.StatementOfAffairsResourceDao, ...) (string, error)
- type ResponseType
- func DeleteAttachment(id string, req *http.Request) (ResponseType, error)
- func DownloadAttachment(attachmentID string, req *http.Request, w http.ResponseWriter) (ResponseType, error)
- func GetAttachmentDetails(id string, req *http.Request) (*models.AttachmentFile, ResponseType, error)
- func UploadAttachment(file multipart.File, header *multipart.FileHeader, req *http.Request) (string, ResponseType, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCompanyDetailsAreValid ¶
func CheckCompanyDetailsAreValid(companyProfile *companieshouseapi.CompanyProfile) error
CheckCompanyDetailsAreValid checks the incoming company profile to see if it's valid for insolvency
func CheckCompanyExists ¶
func CheckCompanyExists(insolvencyRequest *models.InsolvencyRequest, req *http.Request) (error, int, *companieshouseapi.CompanyProfile)
CheckCompanyExists will check that the company exists against the company profile api to make a valid insolvency
func CheckIfTransactionClosed ¶
CheckIfTransactionClosed checks against the transaction api if the transaction is closed or not
func CheckTransactionID ¶
CheckTransactionID will check with the transaction api that the provided transaction id exists
func GenerateFilings ¶
GenerateFilings generates an array of filings for this insolvency resource to be used by the filing resource handler
func GetCompanyIncorporatedOn ¶
GetCompanyIncorporatedOn retrieves the date that the company was created
func IsUserOnEfsAllowList ¶
IsUserOnEfsAllowList uses the sdk to call the EFS api and return a boolean depending on whether or not the email address is on the allow list
func PatchTransactionWithInsolvencyResource ¶
func PatchTransactionWithInsolvencyResource(transactionID string, insolvencyResource *models.InsolvencyResourceDao, req *http.Request) (error, int)
PatchTransactionWithInsolvencyResource will patch the provided transaction with the created insolvency resource
func ValidateAntivirus ¶
func ValidateAntivirus(svc dao.Service, insolvencyResource models.InsolvencyResourceDao, req *http.Request) *[]models.ValidationErrorResponseResource
ValidateAntivirus checks that attachments on an insolvency case pass the antivirus check and are ready for submission Any validation errors found are added to an array to be returned
func ValidateAppointmentDetails ¶
func ValidateAppointmentDetails(svc dao.Service, appointment models.PractitionerAppointment, transactionID string, practitionerID string, req *http.Request) (string, error)
ValidateAppointmentDetails checks that the incoming appointment details are valid
func ValidateAttachmentDetails ¶
func ValidateAttachmentDetails(svc dao.Service, transactionID string, attachmentType string, header *multipart.FileHeader) (string, error)
ValidateAttachmentDetails checks that the incoming attachment details are valid
func ValidateInsolvencyDetails ¶
func ValidateInsolvencyDetails(insolvencyResource models.InsolvencyResourceDao) *[]models.ValidationErrorResponseResource
ValidateInsolvencyDetails checks that an insolvency case is valid and ready for submission Any validation errors found are added to an array to be returned
func ValidatePractitionerDetails ¶
func ValidatePractitionerDetails(svc dao.Service, transactionID string, practitioner models.PractitionerRequest) (string, error)
ValidatePractitionerDetails checks that the incoming practitioner details are valid
func ValidateProgressReportDetails ¶
func ValidateProgressReportDetails(svc dao.Service, progressReportStatementDao *models.ProgressReportResourceDao, transactionID string, req *http.Request) (string, error)
ValidateProgressReportDetails checks that the incoming statement details are valid
func ValidateResolutionDate ¶
func ValidateResolutionDate(svc dao.Service, resolution *models.ResolutionResourceDao, transactionID string, req *http.Request) (string, error)
ValidateResolutionDate checks that the incoming resolution date is valid
func ValidateResolutionRequest ¶
func ValidateResolutionRequest(resolution models.Resolution) string
ValidateResolutionRequest checks that the incoming resolution request is valid
Types ¶
type ResponseType ¶
type ResponseType int
ResponseType enumerates the types of authentication supported
const ( // InvalidData response InvalidData ResponseType = iota // Error response Error // Forbidden response Forbidden // Success response Success )
func DeleteAttachment ¶
func DeleteAttachment(id string, req *http.Request) (ResponseType, error)
DeleteAttachment deletes an attachment via the File Transfer API
func DownloadAttachment ¶
func DownloadAttachment(attachmentID string, req *http.Request, w http.ResponseWriter) (ResponseType, error)
DownloadAttachment downloads a file from the File Transfer API writes it to a ResponseWriter
func GetAttachmentDetails ¶
func GetAttachmentDetails(id string, req *http.Request) (*models.AttachmentFile, ResponseType, error)
GetAttachmentDetails gets attachment details from File Transfer API
func UploadAttachment ¶
func UploadAttachment(file multipart.File, header *multipart.FileHeader, req *http.Request) (string, ResponseType, error)
UploadAttachment sends a file to be uploaded to the File Transfer API and returns the ID
func (ResponseType) String ¶
func (a ResponseType) String() string
String representation of `ResponseType`