Imports System.Collections.Generic
Imports CharterDotCom.CommonEntities.Library.Enumerations


<Serializable()> _
Public Class Items
    Private m_id As String
    Private m_description As String
    Private m_number As Integer
    Private m_text As String
    Private m_type As GwyItemType
    Private m_subItems As Dictionary(Of String, Items)

  Public Sub New()

  End Sub

  Public Sub New(ByVal id As String, ByVal description As String, ByVal type As GwyItemType, Optional ByVal number As Integer = 0, Optional ByVal text As String = Nothing, Optional ByVal subitems As Dictionary(Of String, Items) = Nothing, Optional ByVal consumer As String = "GWY")
    If consumer.Equals("BL") Then
      Dim typeToInteger As Integer = type
            m_id = id.Substring(typeToInteger.ToString.Length)
    Else
            m_id = id
    End If
        m_description = description
        m_type = type
        m_number = number
        m_text = text
    If subitems Is Nothing Then
            m_subItems = New Dictionary(Of String, Items)
    Else
            m_subItems = subitems
    End If
  End Sub

  Public ReadOnly Property ID() As String
    Get
            Return m_id
    End Get
  End Property

  Public ReadOnly Property Description() As String
    Get
            Return m_description
    End Get
  End Property

  Public Property Number() As Integer
    Get
            Return m_number
    End Get
    Set(ByVal value As Integer)
            m_number = value
    End Set
  End Property

  Public Property Text() As String
    Get
            Return m_text
    End Get
    Set(ByVal value As String)
            m_text = value
    End Set
  End Property

  Public ReadOnly Property Type() As GwyItemType
    Get
            Return m_type
    End Get
  End Property

  Public ReadOnly Property SubItems() As Dictionary(Of String, Items)
    Get
            Return m_subItems
    End Get
  End Property

End Class

<Serializable()> _
Public Class ShoppingCart

    Private m_Offers As Dictionary(Of String, Items)

  Public Sub New(ByVal offer As Dictionary(Of String, Items))
        m_Offers = offer
  End Sub

  Public ReadOnly Property Offers() As Dictionary(Of String, Items)
    Get
            Return m_Offers
    End Get
  End Property

End Class



