service

package
v0.0.0-...-440c973 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 CheckCompanyNameAlphaKey

func CheckCompanyNameAlphaKey(companyProfileCompanyName string, insolvencyRequest *models.InsolvencyRequest, req *http.Request) (error, int)

func CheckIfTransactionClosed

func CheckIfTransactionClosed(transactionID string, req *http.Request) (bool, error, int)

CheckIfTransactionClosed checks against the transaction api if the transaction is closed or not

func CheckTransactionID

func CheckTransactionID(transactionID string, req *http.Request) (error, int)

CheckTransactionID will check with the transaction api that the provided transaction id exists

func GenerateFilings

func GenerateFilings(svc dao.Service, transactionID string) ([]models.Filing, error)

GenerateFilings generates an array of filings for this insolvency resource to be used by the filing resource handler

func GetCompanyIncorporatedOn

func GetCompanyIncorporatedOn(companyNumber string, req *http.Request) (string, error)

GetCompanyIncorporatedOn retrieves the date that the company was created

func IsUserOnEfsAllowList

func IsUserOnEfsAllowList(emailAddress string, req *http.Request) (bool, error)

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

func ValidateStatementDetails

func ValidateStatementDetails(svc dao.Service, statementDao *models.StatementOfAffairsResourceDao, transactionID string, req *http.Request) (string, error)

ValidateStatementDetails checks that the incoming statement details are 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`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL