document

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCardNo = errors.New("invalid card number length")

Card number doesn't have exactly 11 digits.

View Source
var ErrInvalidInsuranceNo = errors.New("invalid insurance number length")

Insurance number doesn't have exactly 11 digits.

View Source
var ErrNoSubmatchFound = errors.New("no submatch found")

Date `ValidUntil` could not be extracted from RFZO response.

Functions

func ParseValidUntilDateFromRfzoResponse added in v1.7.0

func ParseValidUntilDateFromRfzoResponse(response string) (string, error)

func SetData added in v1.2.0

func SetData(embedFS embed.FS) error

Sets fonts and graphics used for rendering PDF

Types

type Document

type Document interface {
	BuildPdf() ([]byte, string, error) // Renders document to pdf
	BuildJson() ([]byte, error)        // Renders document to json
}

Represents any document handled by Bas Celik

type IdDocument added in v1.2.0

type IdDocument struct {
	Portrait               image.Image
	DocumentNumber         string
	DocumentType           string
	DocumentSerialNumber   string
	IssuingDate            string
	ExpiryDate             string
	IssuingAuthority       string
	PersonalNumber         string
	Surname                string
	GivenName              string
	ParentGivenName        string
	Sex                    string
	PlaceOfBirth           string
	CommunityOfBirth       string
	StateOfBirth           string
	StateOfBirthCode       string
	DateOfBirth            string
	State                  string
	Community              string
	Place                  string
	Street                 string
	AddressNumber          string
	AddressLetter          string
	AddressEntrance        string
	AddressFloor           string
	AddressApartmentNumber string
	AddressDate            string
}

Represents a document stored on a Serbian ID card.

func (*IdDocument) BuildJson added in v1.4.0

func (doc *IdDocument) BuildJson() ([]byte, error)

func (*IdDocument) BuildPdf added in v1.2.0

func (doc *IdDocument) BuildPdf() (data []byte, fileName string, retErr error)

func (*IdDocument) GetFullAddress added in v1.6.0

func (doc *IdDocument) GetFullAddress() string

func (*IdDocument) GetFullName added in v1.6.0

func (doc *IdDocument) GetFullName() string

func (*IdDocument) GetFullPlaceOfBirth added in v1.6.0

func (doc *IdDocument) GetFullPlaceOfBirth() string

type MedicalDocument added in v1.2.0

type MedicalDocument struct {
	InsurerName                    string
	InsurerID                      string
	CardId                         string
	CardIssueDate                  string
	CardExpiryDate                 string
	ChipSerialNumber               string
	Language                       string
	PersonalNumber                 string
	Surname                        string
	GivenName                      string
	ParentName                     string
	SurnameCyrl                    string
	GivenNameCyrl                  string
	ParentNameCyrl                 string
	Sex                            string
	InsuranceNumber                string
	DateOfBirth                    string
	AddressApartmentNumber         string
	AddressNumber                  string
	AddressStreet                  string
	AddressTown                    string
	AddressMunicipality            string
	AddressState                   string
	ValidUntil                     string
	PermanentlyValid               bool
	InsuranceHolderName            string
	InsuranceHolderSurname         string
	InsuranceHolderNameCyrl        string
	InsuranceHolderSurnameCyrl     string
	InsuranceHolderPersonalNumber  string
	InsuranceHolderInsuranceNumber string
	InsuranceHolderIsFamilyMember  bool
	InsuranceHolderRelation        string
	InsuranceReason                string
	InsuranceStartDate             string
	InsuranceDescription           string
	ObligeeName                    string
	ObligeePlace                   string
	ObligeeRegistrationNumber      string
	ObligeeIdNumber                string
	ObligeeActivity                string
}

Represents a document stored on a Serbian public medical insurance card.

func (*MedicalDocument) BuildJson added in v1.4.0

func (doc *MedicalDocument) BuildJson() ([]byte, error)

func (*MedicalDocument) BuildPdf added in v1.2.0

func (doc *MedicalDocument) BuildPdf() (data []byte, fileName string, retErr error)

func (*MedicalDocument) GetFullName added in v1.6.0

func (doc *MedicalDocument) GetFullName() string

func (*MedicalDocument) GetFullPlaceAddress added in v1.6.0

func (doc *MedicalDocument) GetFullPlaceAddress() string

func (*MedicalDocument) GetFullStreetAddress added in v1.6.0

func (doc *MedicalDocument) GetFullStreetAddress() string

func (*MedicalDocument) UpdateValidUntilDateFromRfzo added in v1.7.0

func (doc *MedicalDocument) UpdateValidUntilDateFromRfzo() error

type VehicleDocument added in v1.4.0

type VehicleDocument struct {
	AuthorityIssuing            string
	ColourOfVehicle             string
	CommercialDescription       string
	CompetentAuthority          string
	DateOfFirstRegistration     string
	EngineCapacity              string
	EngineIdNumber              string
	EngineRatedSpeed            string
	ExpiryDate                  string
	HomologationMark            string
	IssuingDate                 string
	MaximumNetPower             string
	MaximumPermissibleLadenMass string
	NumberOfAxles               string
	NumberOfSeats               string
	NumberOfStandingPlaces      string
	OwnerAddress                string
	OwnerName                   string
	OwnersPersonalNo            string
	OwnersSurnameOrBusinessName string
	PowerWeightRatio            string
	RegistrationNumberOfVehicle string
	SerialNumber                string
	StateIssuing                string
	TypeApprovalNumber          string
	TypeOfFuel                  string
	UnambiguousNumber           string
	UsersAddress                string
	UsersName                   string
	UsersPersonalNo             string
	UsersSurnameOrBusinessName  string
	VehicleCategory             string
	VehicleIdNumber             string
	VehicleLoad                 string
	VehicleMake                 string
	VehicleMass                 string
	VehicleType                 string
	YearOfProduction            string
}

Represents a document stored on a Serbian vehicle card. Fields are named according to official API.

func (*VehicleDocument) BuildJson added in v1.4.0

func (doc *VehicleDocument) BuildJson() ([]byte, error)

func (*VehicleDocument) BuildPdf added in v1.4.0

func (doc *VehicleDocument) BuildPdf() (data []byte, fileName string, retErr error)

Jump to

Keyboard shortcuts

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