Documentation ¶
Overview ¶
Package assurance implements the ts-assurance service from the original TrainTicket application
Index ¶
- Variables
- type Assurance
- type AssuranceService
- type AssuranceServiceImpl
- func (a *AssuranceServiceImpl) Create(ctx context.Context, typeindex int64, orderid string) (Assurance, error)
- func (a *AssuranceServiceImpl) DeleteById(ctx context.Context, id string) error
- func (a *AssuranceServiceImpl) DeleteByOrderId(ctx context.Context, order_id string) error
- func (a *AssuranceServiceImpl) FindAssuranceById(ctx context.Context, id string) (Assurance, error)
- func (a *AssuranceServiceImpl) FindAssuranceByOrderId(ctx context.Context, order_id string) (Assurance, error)
- func (a *AssuranceServiceImpl) GetAllAssuranceTypes(ctx context.Context) ([]AssuranceType, error)
- func (a *AssuranceServiceImpl) GetAllAssurances(ctx context.Context) ([]Assurance, error)
- func (a *AssuranceServiceImpl) Modify(ctx context.Context, assurance Assurance) (Assurance, error)
- type AssuranceType
Constants ¶
This section is empty.
Variables ¶
View Source
var ALL_ASSURANCES = []AssuranceType{TRAFFIC_ACCIDENT}
View Source
var TRAFFIC_ACCIDENT = AssuranceType{1, "Traffic Accident Assurance", 3.0}
Functions ¶
This section is empty.
Types ¶
type Assurance ¶
type Assurance struct { ID string OrderID string AT AssuranceType }
type AssuranceService ¶
type AssuranceService interface { // Find an assurance by ID of the assurance FindAssuranceById(ctx context.Context, id string) (Assurance, error) // Find an assurance by Order ID FindAssuranceByOrderId(ctx context.Context, orderId string) (Assurance, error) // Creates a new Assurance Create(ctx context.Context, typeindex int64, orderId string) (Assurance, error) // Deletes the assurance with ID `id` DeleteById(ctx context.Context, id string) error // Delete the assurance associated with order that has id `orderId` DeleteByOrderId(ctx context.Context, orderId string) error // Modify an existing an assurance with provided Assurance `a` Modify(ctx context.Context, a Assurance) (Assurance, error) // Return all assurances GetAllAssurances(ctx context.Context) ([]Assurance, error) // Return all types of assurances GetAllAssuranceTypes(ctx context.Context) ([]AssuranceType, error) }
AssuranceService manages assurances provided to customers for trips
type AssuranceServiceImpl ¶
type AssuranceServiceImpl struct {
// contains filtered or unexported fields
}
Implementation of an AssuranceService
func NewAssuranceServiceImpl ¶
func NewAssuranceServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*AssuranceServiceImpl, error)
Constructs an AssuranceService object
func (*AssuranceServiceImpl) DeleteById ¶
func (a *AssuranceServiceImpl) DeleteById(ctx context.Context, id string) error
func (*AssuranceServiceImpl) DeleteByOrderId ¶
func (a *AssuranceServiceImpl) DeleteByOrderId(ctx context.Context, order_id string) error
func (*AssuranceServiceImpl) FindAssuranceById ¶
func (*AssuranceServiceImpl) FindAssuranceByOrderId ¶
func (*AssuranceServiceImpl) GetAllAssuranceTypes ¶
func (a *AssuranceServiceImpl) GetAllAssuranceTypes(ctx context.Context) ([]AssuranceType, error)
func (*AssuranceServiceImpl) GetAllAssurances ¶
func (a *AssuranceServiceImpl) GetAllAssurances(ctx context.Context) ([]Assurance, error)
type AssuranceType ¶
Click to show internal directories.
Click to hide internal directories.