coupon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBarcodeFile

func GenerateBarcodeFile(couponID string) (string, error)

GenerateBarcodeFile generates a barcode png photo based on the coupon ID and return its path

func ReadableCouponID

func ReadableCouponID(couponID string) string

ReadableCouponID puts a dash after every 4 chars of coupon ID for making it more readable

Types

type Coupon

type Coupon struct {
	ID         string `json:"id"`         // ID is the coupon's unique identifier
	Vendor     string `json:"vendor"`     // Vendor is the shopping Vendor the coupon refers to
	Value      int    `json:"value"`      // Value is the amount of money available in the coupon
	Expiration int64  `json:"expiration"` // Expiration is the epoch timestamp in which the coupon will expire
}

Coupon is the object representing a Cibus coupon

func NewCoupon

func NewCoupon(id, vendor string, value int, expiration int64) *Coupon

NewCoupon creates a new coupon

func (*Coupon) String

func (c *Coupon) String() string

String returns a string representation of the coupon

Jump to

Keyboard shortcuts

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