# NOTE: THIS FILE IS NOT MAINTAINED ANY MORE
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
#
assets:
    #https://en.wikipedia.org/wiki/ISO_6709
    #Latitude and Longitude in Degrees
    - name: Position
      type: embedded
      properties:
          - name: Latitude
            type: string
            validate: /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/
          - name: Longitude
            type: string
            validate: /^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/
    - name: CreatorInfo
      type: embedded
      properties:
          - name: ClientTMAID
            type: string
          - name: ServiceProviderMSPID
            type: string
    - name: RecipientInfo
      type: embedded
      properties:
          - name: ClientTMAID
            type: string
            mandatory: true
            # this field is set automatically
          - name: ServiceProviderMSPID
            type: string
    - name: ContactInfo
      type: embedded
      properties:
          - name: Actor
            type: string
          - name: Name
            type: string
          - name: Email
            type: string
          - name: Phone
            type: string
    - name: TimeWindow
      type: embedded
      properties:
          - name: DateTimeType
            type: string
          - name: StartTime
            type: string
          - name: EndTime
            type: string
          - name: TimeZone
            type: string
    - name: ExternalReferences
      type: embedded
      properties:
          - name: AttributeDescription
            type: string
          - name: AttributeValue
            type: string
    - name: Attachment
      type: embedded
      properties:
          - name: Description
            type: string
          - name: Type
            type: string
          - name: Link
            type: string
          - name: Hash
            type: string
          - name: State
            type: string
    - name: TransportReferences
      type: embedded
      properties:
          - name: ReferenceType
            type: string
            validate: /^(Pickup|Delivery|Message To Carrier)$/
          - name: ReferenceValue
            type: string
    - name: TransportOrder
      properties:
          # don't set this field, it is calculated automatically
          - name: AssetId
            type: string
            mandatory: false
            id: true
          - name: SourceAssetId
            type: string
          - name: SourceChannelName
            type: string
          - name: TOId
            type: string
          - name: StructVersion
            type: string
            #IM:v1.10
            default: "1.0.3"
            validate: /^1\.0\.\d+$/
          - name: RootAssetId
            type: string
          - name: SystemOfRecordTOId
            type: string
          - name: UniversalId
            type: string
          - name: CreationDateTime
            type: string
          - name: CreationTimeZone
            type: string
          - name: TotalWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: WeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: TotalVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: VolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: LoadingMeter
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: NumberOfTransportUnits
            type: number
          - name: TransportExecutionState
            type: string
          - name: EventDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
           #Format https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
           #Full validation in a chaincode
          - name: EventTimeZone
            type: string
          - name: PreviousTOId
            type: string
          - name: SubsequentTOId
            type: string
          - name: ParentTOId
            type: string
          - name: ShipFrom
            type: ShipFrom
          - name: ShipTo
            type: ShipTo
          - name: TOContactInfo
            type: ContactInfo[]
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[]
          - name: TransportReferences
            type: TransportReferences[]
          - name: TransportUnit
            type: TransportUnit[]
      methods:
        crud: []
        others: []
    - name: ShipFrom
      type: embedded
      properties:
          - name: YourLocationReference
            type: string
          - name: Position
            type: Position
          - name: LocationName
            type: string
          - name: AddressLine1
            type: string
          - name: AddressLine2
            type: string
          - name: PostalCode
            type: string
          - name: PickupZone
            type: string
          - name: City
            type: string
          - name: CountryCode
            type: string
            validate: /^[A-Z]{3}$/
          - name: County_State_Region
            type: string
          - name: EarliestPickupDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: LatestPickupDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: TimeZone
            type: string
          - name: EstimatedTimeOfArrival
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: SequenceNumber
            type: number
          - name: StopNumber
            type: number
          - name: ShipFromContactInfo
            type: ContactInfo[]
          - name: ShipFromTimeWindow
            type: TimeWindow[]
    - name: ShipTo
      type: embedded
      properties:
          - name: YourLocationReference
            type: string
          - name: Position
            type: Position
          - name: LocationName
            type: string
          - name: AddressLine1
            type: string
          - name: AddressLine2
            type: string
          - name: PostalCode
            type: string
          - name: DeliveryZone
            type: string
          - name: City
            type: string
          - name: CountryCode
            type: string
            validate: /^[A-Z]{3}$/
          - name: County_State_Region
            type: string
          - name: EarliestDeliveryDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: LatestDeliveryDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: TimeZone
            type: string
          - name: EstimatedTimeOfArrival
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: SequenceNumber
            type: number
          - name: StopNumber
            type: number
          - name: ShipToContactInfo
            type: ContactInfo[]
          - name: ShipTpTimeWindow
            type: TimeWindow[]
    - name: TransportUnit
      properties:
          # don't set this field, it is calculated automatically
          - name: AssetId
            type: string
            mandatory: false
            id: true
          - name: TUId
            type: string
          - name: SystemOfRecordTUId
            type: string
          - name: UniversalId
            type: string
          - name: StructVersion
            type: string
            #IM:v1.5
            default: "1.0.1"
            validate: /^1\.0\.\d+$/
          - name: RootAssetId
            type: string
          - name: OuterPackagingNumber
            type: string
          - name: TUType
            type: string
          - name: Stackable
            type: string
            validate: /^(YES|NO)$/
          - name: TemperatureControlled
            type: string
            validate: /^(YES|NO)$/
          - name: Temperature
            type: string
            validate: min(4),max(7),/^[-]?\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TemperatureUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: GoodsClass
            type: string
          - name: GoodsDescription
            type: string
          - name: SystemOfRecordTUGroupId
            type: string
          - name: TUGroupLoadingMeter
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUGroupWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUGroupWeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: TUGroupVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUGroupVolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: TUGrossWeight
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
            type: string
          - name: TUNetWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUWeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: TUGrossVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUNetVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUVolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: TUHeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TULength
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUWidth
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: DimensionUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: HazmatUNCode
            type: string
          - name: HazmatClass
            type: string
          - name: HazmatPackingGroup
            type: string
          - name: HazmatProperShippingName
            type: string
          - name: TransportExecutionState
            type: string
          - name: EventDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: EventTimeZone
            type: string
            #NeedsCustomClearance is not part of IM right now. Added this field for the task (C400151284-7194)
          - name: NeedsCustomClearance
            type: string
            default: "NO"
            validate: /^(YES|NO)$/
          - name: ContactInfo
            type: ContactInfo[]
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[]
      methods:
          crud: []  
          others: []     
    - name: Location
      type: embedded
      properties:
          - name: Position
            type: Position
          - name: SequenceNumber
            type: number
          - name: StopNumber
            type: number
          - name: LocationName
            type: string
          - name: AddressLine1
            type: string
          - name: AddressLine2
            type: string
          - name: City
            type: string
          - name: PostalCode
            type: string
          - name: CountryCode
            type: string
            validate: /^[A-Z]{3}$/
          - name: County_State_Region
            type: string
    - name: Time
      type: embedded
      properties:
          - name: DateTimeType
            type: string
          - name: DateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: TimeZone
            type: string
    - name: Price
      type: embedded
      properties:
          - name: PriceType
            type: string
          - name: Amount
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: CurrencyCode
            type: string
            validate: /^[A-Z]{3}$/
    - name: Capacity
      properties:
           #don't set this field, it is calculated automatically
          - name: AssetId
            type: string
            mandatory: false
            id: true
           #unique AssetId assigned by the Service
          - name: SourceAssetId
            type: string
          - name: SourceChannelName
            type: string
          - name: CapacityId
            type: string
          - name: StructVersion
            type: string
            #IM:v1.5.2
            default: "1.0.5"
            validate: /^1\.0\.\d+$/
          - name: RootAssetId
            type: string
          - name: ShipmentId
            type: string
            # id of related Shipment asset 
          - name: SystemOfRecordCapacityId
            type: string
          - name: CarrierReferenceNumber
            type: string
            # Renamed CustomerReferenceNumber to ShipperReferenceNumber as part of SCRUM-437
          - name: ShipperReferenceNumber
            type: string
          - name: PartnerReferenceNumber
            type: string
          - name: UniversalId
            type: string
          - name: CarrierContractNumber
            type: string
          - name: State
            type: string
            validate: /^(ASSIGNED|ACCEPTED|DECLINED|ACCEPTED BID|CANCELED)$/
            mandatory: true 
          - name: RequiredConfirmDateTime
            type: string 
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: ConfirmDateTimeZone
            type: string
          - name: PartialAcceptanceAllowed
            type: string
            validate: /^(YES|NO)$/
          - name: AutoAccept
            type: string
          - name: TransportMode
            type: string
            validate: /^(FTL|PTL)$/
          - name: EquipmentType
            type: string
          - name: AvailableLength
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableWidth
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableHeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: DimensionUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: WeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: CargoTerms
            type: string
          - name: PickupZone
            type: string
          - name: DeliveryZone
            type: string
          - name: ServiceDistance
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: DistanceUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/     
          - name: MaximumNumberOfStops
            type: number
          - name: ServiceTime
            type: string
          - name: EarliestPickupDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: LatestPickupDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: PickupDateTimeZone
            type: string 
          - name: EarliestDeliveryDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: LatestDeliveryDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: DeliveryDateTimeZone
            type: string
          # TimeZone field is currently used but it is missing in the information model. It should be removed later and substituted with other Timezone fields.
          # Removed in IM:v1.5.1
          # DM: "1.0.3"
          - name: TimeZone
            type: string
          - name: MinimumPricePerLoad
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: MinimumPricePerDistanceUoM
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: MinimumPricePerHour
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          #ISO4217
          - name: PriceCurrencyCode
            type: string
            validate: /^[A-Z][A-Z][A-Z]$/
          - name: ShipFrom
            type: ShipFrom
          - name: ShipTo
            type: ShipTo
          - name: ContactInfo
            type: ContactInfo[]
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[]
          - name: TransportReferences
            type: TransportReferences[]
      methods:
          crud: []  
          others: []     
    - name: TransportStatus
      properties: 
            # don't set this field, it is calculated automatically
          - name: AssetId
            type: string
            mandatory: false
            id: true
          - name: TSId
            type: string
          # id of related Cargo asset 
          - name: CargoAssetId 
            type: string
            # id of related TransportOrder assets 
          - name: TOAssetId
            type: string[]
            # id of related TransportUnit assets
          - name: TUAssetId
            type: string[]
          - name: CapacityAssetId
            type: string
          - name: StructVersion
            type: string
            #IM:v2.10
            default: "1.0.4"
            validate: /^1\.0\.\d+$/
          - name: TransportStatusType
            type: string
            validate: /^(STANDARD|NON STANDARD)$/
            mandatory: true
           #Validation in a chaincode
          - name: StatusCode
            type: string
          - name: ReasonCode
            type: string
          - name: StandardMessageSupplementaryInformation
            type: string
          - name: SystemOfRecordMessageId
            type: string
          - name: MessageInformation
            type: string
            validate: max(256)
          - name: CreationDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
           #Format https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
           #Full validation in a chaincode
          - name: CreationTimeZone
            type: string
          - name: EquipmentNumber
            type: string
          - name: ActualTotalWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: WeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: ActualTotalVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: VolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: ActualLoadingMeter
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualNumberOfTUs
            type: number
          - name: PaymentTxId
            type: string
            mandatory: true
          - name: Time
            type: Time[]
          - name: Price
            type: Price    
          - name: Location
            type: Location 
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[] 
          # Added CargoId as part of the change - C400151284-2342  
          - name: CargoId
            type: string
          - name: VehicleDetails
            type: VehicleDetails
      methods:
        crud: [create, update, delete, getById]
        others: []
    - name: Cargo
      properties:
          # don't set this field, it is calculated automatically
          - name: AssetId 
            type: string
            mandatory: false
            id: true
          - name: SourceAssetId
            type: string
          - name: SourceChannelName
            type: string
          - name: CargoId
            type: string
          #reference to Capacity, calculated automatically
          - name: CapacityAssetId
            type: string
          - name: UniversalId
            type: string  
          - name: ShipmentId
            type: string
          - name: CreationDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
           #Format https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
           #Full validation in a chaincode
          - name: CreationTimeZone
            type: string
          - name: StructVersion
            type: string
            #IM:v1.8
            default: "1.0.5"
            validate: /^1\.0\.\d+$/
          #don't set this structure, it is calculated automatically
          - name: CreatorInfo
            type: CreatorInfo
          - name: RecipientInfo
            type: RecipientInfo 
            mandatory: true
          - name: PaymentTxId
            type: string
          #here go fields from informational model
          - name: SystemOfRecordCargoId
            type: string        
          - name: PlannedTotalWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: PlannedWeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: ActualTotalWeight
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualWeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          # WeightUoM field is removed from the information model . It should be removed later and substituted with other UoM fields.
          # Removed in IM:v1.7
          # DM: "1.0.3"
          - name: WeightUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: PlannedTotalVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: PlannedVolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: ActualTotalVolume
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualVolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          # VolumeUoM field is removed from the information model . It should be removed later and substituted with other UoM fields.
          # Removed in IM:v1.7
          # DM: "1.0.3"
          - name: VolumeUoM
            type: string
            validate: /^(FOT|FTQ|FTK|INH|INK|INQ|MTR|MTK|MTQ|KGM|LBS|KMT|SMI|CEL|FAH)$/
          - name: PlannedLoadingMeter
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualLoadingMeter
            type: string
            validate: min(4),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: PlannedNumberOfTUs
            type: number
          - name: ActualNumberOfTUs
            type: number
          - name: CO2Emission
            type: string
          - name: ShipmentType
            type: string
          - name: LegType
            type: string
          - name: BookingState
            validate: /^(ASSIGNED|ACCEPTED|ACCEPTED BID|DECLINED|CANCELED)$/
            mandatory: true
            type: string
          - name: BookingSubState
            type: string
          - name: EquipmentNumber
            type: string
          - name: VesselName
            type: string
          - name: TransportExecutionState
            validate: /^(NOT STARTED|STARTED|COMPLETED)$/
            type: string
            mandatory: true
          - name: EventDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
           #Format https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
           #Full validation in a chaincode
          - name: EventTimeZone
            type: string
          - name: ContactInfo
            type: ContactInfo[]
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[]
          - name: TransportOrder
            type: TransportOrder[]
          - name: VehicleDetails
            type: VehicleDetails

      methods:
          crud: []
          others: []
    - name: Shipment
      type: embedded
      properties:
          # don't set this field, it is calculated automatically
          - name: Cargo 
            type: Cargo
            mandatory: true
          - name: Capacity
            type: Capacity
            mandatory: true
    - name: AttachmentUpdate
      type: embedded
      properties:
          - name: Id
            type: string
            mandatory: true
          - name: Attachment
            type: Attachment[1:]
            mandatory: true
    - name: TMAIDMapping
      properties:
      - name: TMAID
        type: string
        id: true
        validate: /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
      - name: MSPID
        type: string
        mandatory: true
      methods:
        crud: [create, update, delete, getById]
        others: []
    - name: Payment
      properties:
          - name: PaymentTxId
            type: string
            id: true
          - name: TxnId
            type: string  
          - name: FunctionName
            type: string   
          - name: TMAID
            type: string
            validate: /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
          - name: AssetId
            type: string
          - name: BusinessId
            type: string
    # Idea is to use this object for all the scenarios of retrieving the data with multiple ids
customMethods:
    - executeQuery
    - "CreateShipment(asset Shipment)"
    - "DeleteShipmentByCargoId(id string)"
    - "GetShipmentByCargoId(id string)"
    - "UpdateShipment(asset Shipment, updateType string)"
    # GetShipmentsWithTS do not support filtering/sorting based on TU fields
    - "GetShipmentsWithTS(query sql.Query)"
    # AppendAttachment is supported for Cargo,Capacity, TO and TS (not TU)
    # To invoke AppendAttachment function, endorser must always be speciefied
    # Endorsing peers can only be the peers corresponding to the Creator or Recipient of the respective Cargo
    - "AppendAttachment(attachmentUpdate AttachmentUpdate)"
    - "SetLoggerLevel(name string, logLevel string)"
    - "SetGlobalLogLevel(logLevel string)"
    - "CleanStateDB()"
    - "CleanStateDBLimit(rows int)"
    - "CleanStateDBByKey(key string)"
    - "CleanPrivateCollection(privateCollectionName string, keys []string)"
    - "ExecutePrivateQuery(privateCollectionName string, inputQuery string)"
    - "JoinService(tmaId string,memberMspId string)"
    - "GetHistoryById(key string)"
    - "GetTransportStatusById(id string)"
    - "GetCO2(id string)"
    - "FetchData(assetId string, businessId string, paymentTxId string)"
