data61 / Mirza

6 stars 2 forks source link

Use LocationReferenceNum in LocationT #70

Closed sajidanower23 closed 5 years ago

sajidanower23 commented 5 years ago

The table LocationT is defined as:

data LocationT f = Location
  { location_id     :: C f EPC.LocationReference
  , location_biz_id :: PrimaryKey BusinessT f
  , location_lat    :: C f Double
  , location_long   :: C f Double }
  deriving Generic

However, in the module Data.GS1.EPC, LocationEPC is defined as

newtype LocationReference
  = LocationReference
  {
    _locationRefVal :: T.Text
  }
  deriving (Read, Eq, Generic, Show)

data LocationEPC = SGLN {
    _sglnCompanyPrefix :: GS1CompanyPrefix
  , _locationRef       :: LocationReference
  , _sglnExt           :: Maybe SGLNExtension
  }
  deriving (Show, Read, Eq, Generic)

The key point to note here is, Lat and Lng are unused variables here, and they have not been mentioned in the latest GS1 standards. Inside LocationT therefore, we should have a LocationReference instead of a Lat and a Lng

Original Author: ano002

(Moved with github-migration-0.1.0.0 (package github-migration-0.1.0.0 revision df9f38b))

sarafalamaki commented 5 years ago

The physical location (lat, long) and the GLN should be linked in the location table in BusinessRegistry. SCS should only know/care about GLNs.

I'm not sure what the code looks like now. I'll self assign and investigate.

Original Author: fal05c

axman6 commented 5 years ago

Closed via #245

Original Author: mas17k