model

package
v0.0.0-...-3d01394 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discount

type Discount struct {
	Percentage   float32
	ValueInCents int32
}

Discount is a model structure that represents a product discount

type DiscountRule

type DiscountRule interface {
	// CalculateDiscount is responsible for making a discount calculation
	// following a specific rule
	CalculateDiscount() float32
}

DiscountRule represents a simple strategic interface to create n types of discount calculations

type Product

type Product struct {
	ID           string
	PriceInCents int32
}

Product is a model structure that represents a store product

type User

type User struct {
	ID          int64
	DateOfBirth time.Time
}

User represents the user model of the application

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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