domain

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = NewError("record not found")
)

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	Vehicles map[string]*Vehicle `json:"vehicles"`
}

type CoreService

type CoreService interface {
	FindByNumber(ctx context.Context, number string) (*Aggregate, error)
	FindByVIN(ctx context.Context, vin string) (*Aggregate, error)
}

type Department

type Department struct {
	Code int32
	Name string
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(msg string) Error

func (Error) Error

func (e Error) Error() string

type Operation

type Operation struct {
	Number      string
	Brand       string
	Model       string
	Year        int32
	Capacity    int32
	Color       string
	Fuel        string
	Kind        string
	Body        string
	Purpose     string
	OwnWeight   int32
	TotalWeight int32
	Date        *time.Time
	Department  *Department
	Owner       *Owner
}

type OperationProvider

type OperationProvider interface {
	FindByNumber(ctx context.Context, number string) ([]*operation.Record, error)
}

type Owner

type Owner struct {
	Entity       RegistrationEntity
	Registration *Territory
}

type Registration

type Registration struct {
	Code        string
	Number      string
	Vin         string
	Brand       string
	Model       string
	Year        int32
	Capacity    int32
	Color       string
	Fuel        string
	Kind        string
	NumSeating  int32
	OwnWeight   int32
	TotalWeight int32
	Date        *time.Time

	Category string
}

type RegistrationEntity

type RegistrationEntity int
const (
	UnknownEntity RegistrationEntity = iota
	Individual
	Legal
)

type RegistrationProvider

type RegistrationProvider interface {
	FindByVIN(ctx context.Context, vin string) ([]*registration.Record, error)
	FindByNumber(ctx context.Context, number string) ([]*registration.Record, error)
	FindByCode(ctx context.Context, code string) ([]*registration.Record, error)
}

type Territory

type Territory struct {
	Code int32
}

type Vehicle

type Vehicle struct {
	VIN          string     `json:"vin"`
	FirstRegDate *time.Time `json:"first_reg_date"`
	Brand        string     `json:"brand"`
	Model        string     `json:"model"`
	Year         int32      `json:"year"`

	Registrations []*registration.Record `json:"registrations"`
	Operations    []*operation.Record    `json:"operations"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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