poslog

package module
v0.0.0-...-e80afda Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Library to work with POSLog XML files

Currently targeted towards NCR ACS POSLog XML. NCR ACS namespace specific XML tags are currently included as part of regular XML marshaling. The plan is to extend to a ACS specific type as to accomidate other vendor specific namespace's.

Documentation

Overview

Package poslog works with POSLog XML files. Currently writing types for NCR ACS POSLog But can be extended for other POS vendores and all NCR specific tags are (will be) set as options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSON

func WriteJSON(filename string, p POSLog)

WriteJSON writes a POSLog object to an json file given as first argument

func WriteJSONs

func WriteJSONs(folder string, ps POSLogs)

WriteJSONs writes multiple POSLOGS (in a postlogs object) to multiple json files in a folder

Types

type AccountNumber

type AccountNumber string

type AgeRestriction

type AgeRestriction struct {
	AttrBirthdate string   `xml:" Birthdate,attr"  json:",omitempty"`
	AttrVerified  string   `xml:" Verified,attr"  json:",omitempty"`
	Text          string   `xml:",chardata" json:",omitempty"`
	XMLName       xml.Name `xml:"AgeRestriction,omitempty" json:"AgeRestriction,omitempty"`
}

type Amount

type Amount string

type AmountUsed

type AmountUsed string

type Authorization

type Authorization struct {
	AttrElectronicSignature string                  `xml:" ElectronicSignature,attr"  json:",omitempty"`
	AttrHostAuthorized      string                  `xml:" HostAuthorized,attr"  json:",omitempty"`
	AuthorizationCode       *AuthorizationCode      `xml:"AuthorizationCode,omitempty" json:"AuthorizationCode,omitempty" db:"AuthorizationCode,omitempty"`
	AuthorizationDateTime   *AuthorizationDateTime  `xml:"AuthorizationDateTime,omitempty" json:"AuthorizationDateTime,omitempty" db:"AuthorizationDateTime,omitempty"`
	AuthorizedChangeAmount  *AuthorizedChangeAmount `xml:"AuthorizedChangeAmount,omitempty" json:"AuthorizedChangeAmount,omitempty" db:"AuthorizedChangeAmount,omitempty"`
	ReferenceNumber         *ReferenceNumber        `xml:"ReferenceNumber,omitempty" json:"ReferenceNumber,omitempty" db:"ReferenceNumber,omitempty"`
	RequestedAmount         *RequestedAmount        `xml:"RequestedAmount,omitempty" json:"RequestedAmount,omitempty" db:"RequestedAmount,omitempty"`
	XMLName                 xml.Name                `xml:"Authorization,omitempty" json:"Authorization,omitempty"`
}

type AuthorizationCode

type AuthorizationCode string

type AuthorizationDateTime

type AuthorizationDateTime string

type AuthorizedChangeAmount

type AuthorizedChangeAmount string

type BaseRewardAmount

type BaseRewardAmount string

type CRMCustomVariable

type CRMCustomVariable struct {
	ID      *ID      `xml:"ID,omitempty" json:"ID,omitempty" db:"ID,omitempty"`
	Type    *Type    `xml:"Type,omitempty" json:"Type,omitempty" db:"Type,omitempty"`
	Value   *Value   `xml:"Value,omitempty" json:"Value,omitempty" db:"Value,omitempty"`
	XMLName xml.Name `xml:"CRMCustomVariable,omitempty" json:"CRMCustomVariable,omitempty"`
}

type CardActivation

type CardActivation struct {
	AccountNumber  *AccountNumber  `xml:"AccountNumber,omitempty" json:"AccountNumber,omitempty" db:"AccountNumber,omitempty"`
	CardType       *CardType       `xml:"CardType,omitempty" json:"CardType,omitempty" db:"CardType,omitempty"`
	EntryMode      *EntryMode      `xml:"EntryMode,omitempty" json:"EntryMode,omitempty" db:"EntryMode,omitempty"`
	ItemID         string          `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	PurchaseAmount *PurchaseAmount `xml:"PurchaseAmount,omitempty" json:"PurchaseAmount,omitempty" db:"PurchaseAmount,omitempty"`
	Track1         *Track1         `xml:"Track1,omitempty" json:"Track1,omitempty" db:"Track1,omitempty"`
	Track2         *Track2         `xml:"Track2,omitempty" json:"Track2,omitempty" db:"Track2,omitempty"`
	XMLName        xml.Name        `xml:"CardActivation,omitempty" json:"CardActivation,omitempty"`
}

type CardType

type CardType string

type Cashback

type Cashback string

type CloseBusinessDayDate

type CloseBusinessDayDate string

type CloseTransactionSequenceNumber

type CloseTransactionSequenceNumber string

type ControlTransaction

type ControlTransaction struct {
	AttrVersion     string           `xml:" Version,attr"  json:",omitempty"`
	NoSale          *NoSale          `xml:"NoSale,omitempty" json:"NoSale,omitempty" db:"NoSale,omitempty"`
	OperatorSignOff *OperatorSignOff `xml:"OperatorSignOff,omitempty" json:"OperatorSignOff,omitempty" db:"OperatorSignOff,omitempty"`
	OperatorSignOn  *OperatorSignOn  `xml:"OperatorSignOn,omitempty" json:"OperatorSignOn,omitempty" db:"OperatorSignOn,omitempty"`
	PriceLookup     *PriceLookup     `xml:"PriceLookup,omitempty" json:"PriceLookup,omitempty" db:"PriceLookup,omitempty"`
	ReasonCode      *ReasonCode      `xml:"ReasonCode,omitempty" json:"ReasonCode,omitempty" db:"ReasonCode,omitempty"`
	XMLName         xml.Name         `xml:"ControlTransaction,omitempty" json:"ControlTransaction,omitempty"`
}

type Coupon

type Coupon struct {
	AttrCouponType string          `xml:" CouponType,attr"  json:",omitempty"`
	ExpirationDate *ExpirationDate `xml:"ExpirationDate,omitempty" json:"ExpirationDate,omitempty" db:"ExpirationDate,omitempty"`
	Item           *Item           `xml:"Item,omitempty" json:"Item,omitempty" db:"Item,omitempty"`
	PrimaryLabel   *PrimaryLabel   `xml:"PrimaryLabel,omitempty" json:"PrimaryLabel,omitempty" db:"PrimaryLabel,omitempty"`
	Quantity       *Quantity       `xml:"Quantity,omitempty" json:"Quantity,omitempty" db:"Quantity,omitempty"`
	ScanCode       *ScanCode       `xml:"ScanCode,omitempty" json:"ScanCode,omitempty" db:"ScanCode,omitempty"`
	XMLName        xml.Name        `xml:"Coupon,omitempty" json:"Coupon,omitempty"`
}

type CreditDebit

type CreditDebit struct {
	AttrCardType                  string   `xml:" CardType,attr"  json:",omitempty"`
	AttrAcsSpaceCreditDescription string   `xml:"CreditDescription,attr"  json:",omitempty"`
	XMLName                       xml.Name `xml:"CreditDebit,omitempty" json:"CreditDebit,omitempty"`
}

type CustomOfferID

type CustomOfferID string

type Description

type Description string

type DiscountAmount

type DiscountAmount string

type Disposition

type Disposition string

type ElectronicSignature

type ElectronicSignature struct {
	Svg     *Svg     `xml:"svg,omitempty" json:"svg,omitempty" db:"svg,omitempty"`
	XMLName xml.Name `xml:"ElectronicSignature,omitempty" json:"ElectronicSignature,omitempty"`
}

type EndDateTimestamp

type EndDateTimestamp string

type EndDay

type EndDay string

type EntryMode

type EntryMode string

type EventID

type EventID string

type ExpirationDate

type ExpirationDate string

type ExtendedAmount

type ExtendedAmount string

type ExtendedDiscountAmount

type ExtendedDiscountAmount string

type ExtendedRewardAmount

type ExtendedRewardAmount string

type HouseholdID

type HouseholdID string

type ID

type ID string

type IdleTime

type IdleTime string

type Item

type Item struct {
	AttrItemType           string                  `xml:" ItemType,attr"  json:",omitempty"`
	Description            *Description            `xml:"Description,omitempty" json:"Description,omitempty" db:"Description,omitempty"`
	DiscountAmount         *DiscountAmount         `xml:"DiscountAmount,omitempty" json:"DiscountAmount,omitempty" db:"DiscountAmount,omitempty"`
	ExtendedAmount         *ExtendedAmount         `xml:"ExtendedAmount,omitempty" json:"ExtendedAmount,omitempty" db:"ExtendedAmount,omitempty"`
	ExtendedDiscountAmount *ExtendedDiscountAmount `xml:"ExtendedDiscountAmount,omitempty" json:"ExtendedDiscountAmount,omitempty" db:"ExtendedDiscountAmount,omitempty"`
	ItemID                 string                  `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	Itemizers              *Itemizers              `xml:"Itemizers,omitempty" json:"Itemizers,omitempty" db:"Itemizers,omitempty"`
	MerchandiseHierarchy   *MerchandiseHierarchy   `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty" db:"MerchandiseHierarchy,omitempty"`
	OperatorSequence       *OperatorSequence       `xml:"OperatorSequence,omitempty" json:"OperatorSequence,omitempty" db:"OperatorSequence,omitempty"`
	POSIdentity            *POSIdentity            `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty" db:"POSIdentity,omitempty"`
	Quantity               *Quantity               `xml:"Quantity,omitempty" json:"Quantity,omitempty" db:"Quantity,omitempty"`
	RegularSalesUnitPrice  *RegularSalesUnitPrice  `xml:"RegularSalesUnitPrice,omitempty" json:"RegularSalesUnitPrice,omitempty" db:"RegularSalesUnitPrice,omitempty"`
	ReportCode             *ReportCode             `xml:"ReportCode,omitempty" json:"ReportCode,omitempty" db:"ReportCode,omitempty"`
	SaleableMediaID        *SaleableMediaID        `xml:"SaleableMediaID,omitempty" json:"SaleableMediaID,omitempty" db:"SaleableMediaID,omitempty"`
	XMLName                xml.Name                `xml:"Item,omitempty" json:"Item,omitempty"`
}

type ItemCount

type ItemCount int

type ItemDescription

type ItemDescription string

type ItemNotFound

type ItemNotFound struct {
	Disposition          *Disposition          `xml:"Disposition,omitempty" json:"Disposition,omitempty" db:"Disposition,omitempty"`
	ItemDescription      *ItemDescription      `xml:"ItemDescription,omitempty" json:"ItemDescription,omitempty" db:"ItemDescription,omitempty"`
	ItemID               string                `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	MerchandiseHierarchy *MerchandiseHierarchy `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty" db:"MerchandiseHierarchy,omitempty"`
	POSIdentity          *POSIdentity          `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty" db:"POSIdentity,omitempty"`
	XMLName              xml.Name              `xml:"ItemNotFound,omitempty" json:"ItemNotFound,omitempty"`
}

type ItemRestriction

type ItemRestriction struct {
	EndDay               *EndDay               `xml:"EndDay,omitempty" json:"EndDay,omitempty" db:"EndDay,omitempty"`
	ItemDescription      *ItemDescription      `xml:"ItemDescription,omitempty" json:"ItemDescription,omitempty" db:"ItemDescription,omitempty"`
	ItemID               string                `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	MerchandiseHierarchy *MerchandiseHierarchy `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty" db:"MerchandiseHierarchy,omitempty"`
	POSIdentity          *POSIdentity          `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty" db:"POSIdentity,omitempty"`
	XMLName              xml.Name              `xml:"ItemRestriction,omitempty" json:"ItemRestriction,omitempty"`
}

type Itemizers

type Itemizers struct {
	AttrFoodStampable string `xml:" FoodStampable,attr"  json:",omitempty"`
	AttrItemizer1     string `xml:" Itemizer1,attr"  json:",omitempty"`
	AttrItemizer2     string `xml:" Itemizer2,attr"  json:",omitempty"`
	AttrTax1          string `xml:" Tax1,attr"  json:",omitempty"`
	Itemizers         string `xml:",chardata" json:",omitempty"`
}

type Items

type Items struct {
	ItemID  string   `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	XMLName xml.Name `xml:"Items,omitempty" json:"Items,omitempty"`
}

type LineItem

type LineItem struct {
	AttrEntryMethod              *string              `xml:" EntryMethod,attr,omitempty"  json:",omitempty"`
	AttrAcsSpaceKeyedPrice       *string              `xml:"keyedPrice,attr,omitempty"  json:",omitempty"`
	AttrAcsSpaceOperatorOverride *string              `xml:"OperatorOverride,attr,omitempty"  json:",omitempty"`
	AttrAcsSpacePriceRequired    *string              `xml:"priceRequired,attr,omitempty"  json:",omitempty"`
	AttrVoidFlag                 *string              `xml:" VoidFlag,attr,omitempty"  json:",omitempty"`
	AttrAcsSpaceWeightItem       *string              `xml:"weightItem,attr,omitempty"  json:",omitempty"`
	AgeRestriction               *AgeRestriction      `xml:"AgeRestriction,omitempty" json:"AgeRestriction,omitempty" db:"AgeRestriction,omitempty"`
	CRMCustomVariable            *CRMCustomVariable   `xml:"CRMCustomVariable,omitempty" json:"CRMCustomVariable,omitempty" db:"CRMCustomVariable,omitempty"`
	CardActivation               *CardActivation      `xml:"CardActivation,omitempty" json:"CardActivation,omitempty" db:"CardActivation,omitempty"`
	ElectronicSignature          *ElectronicSignature `xml:"ElectronicSignature,omitempty" json:"ElectronicSignature,omitempty" db:"ElectronicSignature,omitempty"`
	ItemNotFound                 *ItemNotFound        `xml:"ItemNotFound,omitempty" json:"ItemNotFound,omitempty" db:"ItemNotFound,omitempty"`
	ItemRestriction              *ItemRestriction     `xml:"ItemRestriction,omitempty" json:"ItemRestriction,omitempty" db:"ItemRestriction,omitempty"`
	LoyaltyMembership            *LoyaltyMembership   `xml:"LoyaltyMembership,omitempty" json:"LoyaltyMembership,omitempty" db:"LoyaltyMembership,omitempty"`
	LoyaltyReward                *LoyaltyReward       `xml:"LoyaltyReward,omitempty" json:"LoyaltyReward,omitempty" db:"LoyaltyReward,omitempty"`
	Sale                         *Sale                `xml:"Sale,omitempty" json:"Sale,omitempty" db:"Sale,omitempty"`
	SequenceNumber               int                  `xml:"SequenceNumber" json:"SequenceNumber" db:"SequenceNumber"`
	Tax                          *Tax                 `xml:"Tax,omitempty" json:"Tax,omitempty" db:"Tax,omitempty"`
	Tender                       *Tender              `xml:"Tender,omitempty" json:"Tender,omitempty" db:"Tender,omitempty"`
	XMLName                      xml.Name             `xml:"LineItem,omitempty" json:"LineItem,omitempty"`
}

LineItem is each line at the register, in order of squence

type LoyaltyID

type LoyaltyID struct {
	AttrType string   `xml:" Type,attr"  json:",omitempty"`
	Text     string   `xml:",chardata" json:",omitempty"`
	XMLName  xml.Name `xml:"LoyaltyID,omitempty" json:"LoyaltyID,omitempty"`
}

type LoyaltyMembership

type LoyaltyMembership struct {
	HouseholdID     *HouseholdID     `xml:"HouseholdID,omitempty" json:"HouseholdID,omitempty" db:"HouseholdID,omitempty"`
	LoyaltyID       *LoyaltyID       `xml:"LoyaltyID,omitempty" json:"LoyaltyID,omitempty" db:"LoyaltyID,omitempty"`
	MembershipID    *MembershipID    `xml:"MembershipID,omitempty" json:"MembershipID,omitempty" db:"MembershipID,omitempty"`
	MembershipLevel *MembershipLevel `xml:"MembershipLevel,omitempty" json:"MembershipLevel,omitempty" db:"MembershipLevel,omitempty"`
	XMLName         xml.Name         `xml:"LoyaltyMembership,omitempty" json:"LoyaltyMembership,omitempty"`
}

type LoyaltyReward

type LoyaltyReward struct {
	AttrAcsSpaceDetailedData       string                     `xml:"detailedData,attr"  json:",omitempty"`
	AttrAcsSpaceMembershipRequired string                     `xml:"membershipRequired,attr"  json:",omitempty"`
	AttrAcsSpaceSummarizedActivity string                     `xml:"summarizedActivity,attr"  json:",omitempty"`
	BaseRewardAmount               *BaseRewardAmount          `xml:"BaseRewardAmount,omitempty" json:"BaseRewardAmount,omitempty" db:"BaseRewardAmount,omitempty"`
	CustomOfferID                  *CustomOfferID             `xml:"CustomOfferID,omitempty" json:"CustomOfferID,omitempty" db:"CustomOfferID,omitempty"`
	EventID                        *EventID                   `xml:"EventID,omitempty" json:"EventID,omitempty" db:"EventID,omitempty"`
	ExtendedRewardAmount           *ExtendedRewardAmount      `xml:"ExtendedRewardAmount,omitempty" json:"ExtendedRewardAmount,omitempty" db:"ExtendedRewardAmount,omitempty"`
	Itemizers                      *Itemizers                 `xml:"Itemizers,omitempty" json:"Itemizers,omitempty" db:"Itemizers,omitempty"`
	OperatorSequenceReference      *OperatorSequenceReference `xml:"OperatorSequenceReference,omitempty" json:"OperatorSequenceReference,omitempty" db:"OperatorSequenceReference,omitempty"`
	PromotionID                    *PromotionID               `xml:"PromotionID,omitempty" json:"PromotionID,omitempty" db:"PromotionID,omitempty"`
	ReasonCode                     *ReasonCode                `xml:"ReasonCode,omitempty" json:"ReasonCode,omitempty" db:"ReasonCode,omitempty"`
	RewardBasis                    *RewardBasis               `xml:"RewardBasis,omitempty" json:"RewardBasis,omitempty" db:"RewardBasis,omitempty"`
	RewardCategory                 *RewardCategory            `xml:"RewardCategory,omitempty" json:"RewardCategory,omitempty" db:"RewardCategory,omitempty"`
	RewardLevel                    *RewardLevel               `xml:"RewardLevel,omitempty" json:"RewardLevel,omitempty" db:"RewardLevel,omitempty"`
	RewardType                     *RewardType                `xml:"RewardType,omitempty" json:"RewardType,omitempty" db:"RewardType,omitempty"`
	XMLName                        xml.Name                   `xml:"LoyaltyReward,omitempty" json:"LoyaltyReward,omitempty"`
}

type MembershipID

type MembershipID string

type MembershipLevel

type MembershipLevel string

type MerchandiseHierarchy

type MerchandiseHierarchy struct {
	AttrAcsSpaceDepartmentDescription string   `xml:"DepartmentDescription,attr"  json:",omitempty"`
	AttrLevel                         string   `xml:" Level,attr"  json:",omitempty"`
	Text                              string   `xml:",chardata" json:",omitempty"`
	XMLName                           xml.Name `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty"`
}

type NoSale

type NoSale string

type OpenBusinessDayDate

type OpenBusinessDayDate string

type OpenTransactionSequenceNumber

type OpenTransactionSequenceNumber string

type OperatorID

type OperatorID struct {
	OperatorID   int    `xml:",chardata" json:"OperatorID,omitempty" db:"OperatorID,omitempty"`
	OperatorName string `xml:" OperatorName,attr,omitempty"  json:",omitempty"`
}

OperatorID is the name and into of operator

type OperatorSequence

type OperatorSequence string

type OperatorSequenceReference

type OperatorSequenceReference string

type OperatorSignOff

type OperatorSignOff struct {
	CloseBusinessDayDate           *CloseBusinessDayDate           `xml:"CloseBusinessDayDate,omitempty" json:"CloseBusinessDayDate,omitempty" db:"CloseBusinessDayDate,omitempty"`
	CloseTransactionSequenceNumber *CloseTransactionSequenceNumber `` /* 140-byte string literal not displayed */
	EndDateTimestamp               *EndDateTimestamp               `xml:"EndDateTimestamp,omitempty" json:"EndDateTimestamp,omitempty" db:"EndDateTimestamp,omitempty"`
	OpenBusinessDayDate            *OpenBusinessDayDate            `xml:"OpenBusinessDayDate,omitempty" json:"OpenBusinessDayDate,omitempty" db:"OpenBusinessDayDate,omitempty"`
	OpenTransactionSequenceNumber  *OpenTransactionSequenceNumber  `` /* 137-byte string literal not displayed */
	StartDateTimestamp             *StartDateTimestamp             `xml:"StartDateTimestamp,omitempty" json:"StartDateTimestamp,omitempty" db:"StartDateTimestamp,omitempty"`
	XMLName                        xml.Name                        `xml:"OperatorSignOff,omitempty" json:"OperatorSignOff,omitempty"`
}

type OperatorSignOn

type OperatorSignOn struct {
	CloseBusinessDayDate           *CloseBusinessDayDate           `xml:"CloseBusinessDayDate,omitempty" json:"CloseBusinessDayDate,omitempty" db:"CloseBusinessDayDate,omitempty"`
	CloseTransactionSequenceNumber *CloseTransactionSequenceNumber `` /* 140-byte string literal not displayed */
	EndDateTimestamp               *EndDateTimestamp               `xml:"EndDateTimestamp,omitempty" json:"EndDateTimestamp,omitempty" db:"EndDateTimestamp,omitempty"`
	OpenBusinessDayDate            *OpenBusinessDayDate            `xml:"OpenBusinessDayDate,omitempty" json:"OpenBusinessDayDate,omitempty" db:"OpenBusinessDayDate,omitempty"`
	OpenTransactionSequenceNumber  *OpenTransactionSequenceNumber  `` /* 137-byte string literal not displayed */
	StartDateTimestamp             *StartDateTimestamp             `xml:"StartDateTimestamp,omitempty" json:"StartDateTimestamp,omitempty" db:"StartDateTimestamp,omitempty"`
	XMLName                        xml.Name                        `xml:"OperatorSignOn,omitempty" json:"OperatorSignOn,omitempty"`
}

type POSIdentity

type POSIdentity struct {
	AttrPOSIDType string   `xml:"POSIDType,attr"  json:",omitempty"`
	POSItemID     *string  `xml:"POSItemID,omitempty" json:"POSItemID,omitempty" db:"POSItemID,omitempty"`
	Qualifier     *string  `xml:"Qualifier,omitempty" json:"Qualifier,omitempty" db:"Qualifier,omitempty"`
	XMLName       xml.Name `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty"`
}

type POSLog

type POSLog struct {
	Filename string

	XmlnsAcs    *string        `xml:"xmlns acs,attr,omitempty"  json:",omitempty"`
	XmlnsAcssm  *string        `xml:"xmlns acssm,attr,omitempty"  json:",omitempty"`
	XmlnsAs     *string        `xml:"xmlns as,attr,omitempty"  json:",omitempty"`
	XmlnsMsxsl  *string        `xml:"xmlns msxsl,attr,omitempty"  json:",omitempty"`
	XmlnsPoslog *string        `xml:"xmlns poslog,attr,omitempty"  json:",omitempty"`
	XmlnsRaw    *string        `xml:"xmlns raw,attr,omitempty"  json:",omitempty"`
	Xmlns       *string        `xml:"xmlns,attr,omitempty"  json:",omitempty"`
	XmlnsXsi    *string        `xml:"xmlns xsi,attr,omitempty"  json:",omitempty"`
	Transaction []*Transaction `` /* 171-byte string literal not displayed */
	XMLName     xml.Name       `xml:"http://www.nrf-arts.org/IXRetail/namespace/ POSLog,omitempty" json:"POSLog,omitempty"`
	// contains filtered or unexported fields
}

POSLog the main type of a POSLog XMl file. The type contains the marshaling information to marshal and unmarshal to json and xml currently it is not complete and does not handle all fields in source XML

func ImportXML

func ImportXML(filename string) (p POSLog)

ImportXML takes a POSLog XML file as the argument and returns a POSLog

func (*POSLog) GetRetailStoreID

func (p *POSLog) GetRetailStoreID() (storeID int)

func (*POSLog) WriteXML

func (p *POSLog) WriteXML(filename string)

WriteXML writes a POSLog object to an XML file given as first argument

type POSLogs

type POSLogs struct {
	DayIDs  []string
	Stores  []int
	POSLogs []POSLog
}

POSLogs is an array of poslog grouped by store(s) and dayid(s)

func ZipReadAllXML

func ZipReadAllXML(archive string) (ps POSLogs)

ZipReadAllXML Reads all XML from a passed archive

type Path

type Path struct {
	AttrD   string   `xml:" d,attr"  json:",omitempty"`
	XMLName xml.Name `xml:"path,omitempty" json:"path,omitempty"`
}

type Percent

type Percent string

type PerformanceMetrics

type PerformanceMetrics struct {
	IdleTime   *IdleTime   `xml:"IdleTime,omitempty" json:"IdleTime,omitempty" db:"IdleTime,omitempty"`
	RingTime   *RingTime   `xml:"RingTime,omitempty" json:"RingTime,omitempty" db:"RingTime,omitempty"`
	TenderTime *TenderTime `xml:"TenderTime,omitempty" json:"TenderTime,omitempty" db:"TenderTime,omitempty"`
	XMLName    xml.Name    `xml:"PerformanceMetrics,omitempty" json:"PerformanceMetrics,omitempty"`
}

type PriceLookup

type PriceLookup struct {
	ItemCount *ItemCount `xml:"ItemCount,omitempty" json:"ItemCount,omitempty" db:"ItemCount,omitempty"`
	Items     *Items     `xml:"Items,omitempty" json:"Items,omitempty" db:"Items,omitempty"`
	XMLName   xml.Name   `xml:"PriceLookup,omitempty" json:"PriceLookup,omitempty"`
}

type PrimaryLabel

type PrimaryLabel struct {
	XMLName xml.Name `xml:"PrimaryLabel,omitempty" json:"PrimaryLabel,omitempty"`
}

type PromotionID

type PromotionID string

type PurchaseAmount

type PurchaseAmount string

type Quantity

type Quantity string

type QuantityUsed

type QuantityUsed string

type Reason

type Reason string

type ReasonCode

type ReasonCode string

type ReferenceNumber

type ReferenceNumber string

type RegularSalesUnitPrice

type RegularSalesUnitPrice string

type ReportCode

type ReportCode string

type RequestedAmount

type RequestedAmount string

type RetailTransaction

type RetailTransaction struct {
	AttrVersion        *string             `xml:" Version,attr,omitempty"  json:",omitempty"`
	ItemCount          *ItemCount          `xml:"ItemCount,omitempty" json:"ItemCount,omitempty" db:"ItemCount,omitempty"`
	LineItem           []*LineItem         `xml:"LineItem,omitempty" json:"LineItem,omitempty" db:"LineItem,omitempty"`
	PerformanceMetrics *PerformanceMetrics `xml:"PerformanceMetrics,omitempty" json:"PerformanceMetrics,omitempty" db:"PerformanceMetrics,omitempty"`
	ReceiptDateTime    string              `xml:"ReceiptDateTime,omitempty" json:"ReceiptDateTime,omitempty" db:"ReceiptDateTime,omitempty"`
	Total              []*Total            `xml:"Total,omitempty" json:"Total,omitempty" db:"Total,omitempty"`
	TransactionCount   *string             `xml:"TransactionCount,omitempty" json:"TransactionCount,omitempty" db:"TransactionCount,omitempty"`
	TransactionLink    *TransactionLink    `xml:"TransactionLink,omitempty" json:"TransactionLink,omitempty" db:"TransactionLink,omitempty"`
	XMLName            xml.Name            `xml:"RetailTransaction,omitempty" json:"RetailTransaction,omitempty"`
}

RetailTransaction is any "sale" transaction

type RewardBasis

type RewardBasis struct {
	AmountUsed           *AmountUsed           `xml:"AmountUsed,omitempty" json:"AmountUsed,omitempty" db:"AmountUsed,omitempty"`
	ItemDescription      *ItemDescription      `xml:"ItemDescription,omitempty" json:"ItemDescription,omitempty" db:"ItemDescription,omitempty"`
	ItemID               string                `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	MerchandiseHierarchy *MerchandiseHierarchy `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty" db:"MerchandiseHierarchy,omitempty"`
	POSIdentity          *POSIdentity          `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty" db:"POSIdentity,omitempty"`
	QuantityUsed         *QuantityUsed         `xml:"QuantityUsed,omitempty" json:"QuantityUsed,omitempty" db:"QuantityUsed,omitempty"`
	WeightUsed           *WeightUsed           `xml:"WeightUsed,omitempty" json:"WeightUsed,omitempty" db:"WeightUsed,omitempty"`
	XMLName              xml.Name              `xml:"RewardBasis,omitempty" json:"RewardBasis,omitempty"`
}

type RewardCategory

type RewardCategory string

type RewardLevel

type RewardLevel string

type RewardType

type RewardType string

type RingTime

type RingTime string

type Sale

type Sale struct {
	AttrItemType           string                  `xml:" ItemType,attr,omitempty"  json:",omitempty"`
	Description            *Description            `xml:"Description,omitempty" json:"Description,omitempty" db:"Description,omitempty"`
	DiscountAmount         *DiscountAmount         `xml:"DiscountAmount,omitempty" json:"DiscountAmount,omitempty" db:"DiscountAmount,omitempty"`
	ExtendedAmount         *ExtendedAmount         `xml:"ExtendedAmount,omitempty" json:"ExtendedAmount,omitempty" db:"ExtendedAmount,omitempty"`
	ExtendedDiscountAmount *ExtendedDiscountAmount `xml:"ExtendedDiscountAmount,omitempty" json:"ExtendedDiscountAmount,omitempty" db:"ExtendedDiscountAmount,omitempty"`
	ItemID                 string                  `xml:"ItemID,omitempty" json:"ItemID,omitempty" db:"ItemID,omitempty"`
	Itemizers              *Itemizers              `xml:"Itemizers,omitempty" json:"Itemizers,omitempty" db:"Itemizers,omitempty"`
	MerchandiseHierarchy   *MerchandiseHierarchy   `xml:"MerchandiseHierarchy,omitempty" json:"MerchandiseHierarchy,omitempty" db:"MerchandiseHierarchy,omitempty"`
	OperatorSequence       *OperatorSequence       `xml:"OperatorSequence,omitempty" json:"OperatorSequence,omitempty" db:"OperatorSequence,omitempty"`
	POSIdentity            *POSIdentity            `xml:"POSIdentity,omitempty" json:"POSIdentity,omitempty" db:"POSIdentity,omitempty"`
	Quantity               *Quantity               `xml:"Quantity,omitempty" json:"Quantity,omitempty" db:"Quantity,omitempty"`
	RegularSalesUnitPrice  *RegularSalesUnitPrice  `xml:"RegularSalesUnitPrice,omitempty" json:"RegularSalesUnitPrice,omitempty" db:"RegularSalesUnitPrice,omitempty"`
	ReportCode             *ReportCode             `xml:"ReportCode,omitempty" json:"ReportCode,omitempty" db:"ReportCode,omitempty"`
	SaleableMediaID        *SaleableMediaID        `xml:"SaleableMediaID,omitempty" json:"SaleableMediaID,omitempty" db:"SaleableMediaID,omitempty"`
	XMLName                xml.Name                `xml:"Sale,omitempty" json:"Sale,omitempty"`
}

type SaleableMediaID

type SaleableMediaID string

type ScanCode

type ScanCode string

type StartDateTimestamp

type StartDateTimestamp string

type Svg

type Svg struct {
	AttrHeight string   `xml:" height,attr"  json:",omitempty"`
	AttrStyle  string   `xml:" style,attr"  json:",omitempty"`
	AttrWidth  string   `xml:" width,attr"  json:",omitempty"`
	AttrXmlns  string   `xml:" xmlns,attr"  json:",omitempty"`
	Path       []*Path  `xml:"path,omitempty" json:"path,omitempty" db:"path,omitempty"`
	XMLName    xml.Name `xml:"svg,omitempty" json:"svg,omitempty"`
}

type Tax

type Tax struct {
	AttrAcsSpaceTaxDescription string         `xml:"TaxDescription,attr"  json:",omitempty"`
	AttrAcsSpaceTaxID          string         `xml:"TaxID,attr"  json:",omitempty"`
	Amount                     *Amount        `xml:"Amount,omitempty" json:"Amount,omitempty" db:"Amount,omitempty"`
	Percent                    *Percent       `xml:"Percent,omitempty" json:"Percent,omitempty" db:"Percent,omitempty"`
	Reason                     *Reason        `xml:"Reason,omitempty" json:"Reason,omitempty" db:"Reason,omitempty"`
	TaxableAmount              *TaxableAmount `xml:"TaxableAmount,omitempty" json:"TaxableAmount,omitempty" db:"TaxableAmount,omitempty"`
	XMLName                    xml.Name       `xml:"Tax,omitempty" json:"Tax,omitempty"`
}

type TaxableAmount

type TaxableAmount string

type Tender

type Tender struct {
	AttrAcsSpaceTenderDescription string            `xml:"TenderDescription,attr"  json:",omitempty"`
	AttrTenderType                string            `xml:" TenderType,attr"  json:",omitempty"`
	AttrTypeCode                  string            `xml:" TypeCode,attr"  json:",omitempty"`
	Amount                        *Amount           `xml:"Amount,omitempty" json:"Amount,omitempty" db:"Amount,omitempty"`
	Authorization                 *Authorization    `xml:"Authorization,omitempty" json:"Authorization,omitempty" db:"Authorization,omitempty"`
	Cashback                      *Cashback         `xml:"Cashback,omitempty" json:"Cashback,omitempty" db:"Cashback,omitempty"`
	Coupon                        *Coupon           `xml:"Coupon,omitempty" json:"Coupon,omitempty" db:"Coupon,omitempty"`
	CreditDebit                   *CreditDebit      `xml:"CreditDebit,omitempty" json:"CreditDebit,omitempty" db:"CreditDebit,omitempty"`
	OperatorSequence              *OperatorSequence `xml:"OperatorSequence,omitempty" json:"OperatorSequence,omitempty" db:"OperatorSequence,omitempty"`
	TenderChange                  *TenderChange     `xml:"TenderChange,omitempty" json:"TenderChange,omitempty" db:"TenderChange,omitempty"`
	TenderID                      *TenderID         `xml:"TenderID,omitempty" json:"TenderID,omitempty" db:"TenderID,omitempty"`
	XMLName                       xml.Name          `xml:"Tender,omitempty" json:"Tender,omitempty"`
}

type TenderChange

type TenderChange struct {
	Amount  *Amount  `xml:"Amount,omitempty" json:"Amount,omitempty" db:"Amount,omitempty"`
	XMLName xml.Name `xml:"TenderChange,omitempty" json:"TenderChange,omitempty"`
}

type TenderID

type TenderID string

type TenderTime

type TenderTime string

type Total

type Total struct {
	AttrTotalType string   `xml:" TotalType,attr"  json:",omitempty"`
	Text          string   `xml:",chardata" json:",omitempty"`
	XMLName       xml.Name `xml:"Total,omitempty" json:"Total,omitempty"`
}

type Track1

type Track1 string

type Track2

type Track2 string

type Transaction

type Transaction struct {
	TransactionID      string              `json:"TransactionID" db:"TransactionID"`
	BusinessDayDate    string              `xml:"BusinessDayDate" json:"BusinessDayDate" db:"BusinessDayDate"`
	ControlTransaction *ControlTransaction `xml:"ControlTransaction,omitempty" json:"ControlTransaction,omitempty" db:"ControlTransaction,omitempty"`
	CurrencyCode       *string             `xml:"CurrencyCode,omitempty" json:"CurrencyCode,omitempty" db:"CurrencyCode,omitempty"`
	EndDateTime        string              `xml:"EndDateTime" json:"EndDateTime" db:"EndDateTime"`
	OperatorID         *OperatorID
	RetailStoreID      int                `xml:"RetailStoreID" json:"RetailStoreID" db:"RetailStoreID"`
	RetailTransaction  *RetailTransaction `xml:"RetailTransaction,omitempty" json:"RetailTransaction,omitempty" db:"RetailTransaction,omitempty"`
	SequenceNumber     int                `xml:"SequenceNumber" json:"SequenceNumber" db:"SequenceNumber"`
	WorkstationID      int                `xml:"WorkstationID" json:"WorkstationID" db:"WorkstationID"`
	XMLName            xml.Name           `xml:"Transaction,omitempty" json:"Transaction,omitempty"`
}

Transaction is the body of POSLog, each action at the POS is a transaction

func (*Transaction) Dayid

func (tr *Transaction) Dayid() (dayid *string)

BusinessDay returns an int in dayid format YYYYMMDD Should actuall Validate this as go time 20060102 like EndInt

func (*Transaction) End

func (tr *Transaction) End() time.Time

End return the end DateTime for the transaction

func (*Transaction) EndInt

func (tr *Transaction) EndInt() (daytimeid *string)

func (*Transaction) ID

func (tr *Transaction) ID()
type TransactionLink struct {
	AttrEntryMethod string   `xml:" EntryMethod,attr"  json:",omitempty"`
	AttrReasonCode  string   `xml:" ReasonCode,attr"  json:",omitempty"`
	BusinessDayDate *string  `xml:"BusinessDayDate,omitempty" json:"BusinessDayDate,omitempty" db:"BusinessDayDate,omitempty"`
	RetailStoreID   *int     `xml:"RetailStoreID,omitempty" json:"RetailStoreID,omitempty" db:"RetailStoreID,omitempty"`
	SequenceNumber  int      `xml:"SequenceNumber,omitempty" json:"SequenceNumber,omitempty" db:"SequenceNumber,omitempty"`
	WorkstationID   *int     `xml:"WorkstationID,omitempty" json:"WorkstationID,omitempty" db:"WorkstationID,omitempty"`
	XMLName         xml.Name `xml:"TransactionLink,omitempty" json:"TransactionLink,omitempty"`
}

type Type

type Type string

type Value

type Value string

type WeightUsed

type WeightUsed string

type XTT

type XTT struct {
	Data     []byte  `json:"Data"`
	Type     *[]byte `json:"Type,omitempty"`
	Filename string  `json:"Filename"`
	XTag     *XTag   `json:"XTag,omitempty"`
}

type XTag

type XTag struct {
	Name      string    `json:"Name"`
	Attrs     *[]string `json:"Attrs,omitempty"`
	Datatypes *string   `json:"Datatypes,omitempty"`
	Members   *[]XTag   `json:"Members,omitempty"`
}

Jump to

Keyboard shortcuts

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