# 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: 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.2"
            validate: /^(\\d{1}|\\d{2})\\.(\\d{1}|\\d{2})(\\.(\\d{1}|\\d{2}|\\d{3}))?$/
          - name: RootAssetId
            type: string
          - name: SystemOfRecordTOId
            type: string
          - name: UniversalId
            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: TotalWeight
            type: string
            validate: min(1),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(1),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(1),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: ShipToTimeWindow
            type: TimeWindow[]
    - name: TransportUnit
      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: TUId
            type: string
          - name: SystemOfRecordTUId
            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: UniversalId
            type: string
          - name: StructVersion
            type: string
            #IM:v1.7
            default: "1.0.3"
            validate: /^(\\d{1}|\\d{2})\\.(\\d{1}|\\d{2})(\\.(\\d{1}|\\d{2}|\\d{3}))?$/
          - 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(1),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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUGroupWeight
            type: string
            validate: min(1),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(1),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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
            type: string
          - name: TUNetWeight
            type: string
            validate: min(1),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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUNetVolume
            type: string
            validate: min(1),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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TULength
            type: string
            validate: min(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: TUWidth
            type: string
            validate: min(1),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
            #Added this field for the task (SCRUM-453)
          - 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: TotalPerLoadPriceFlag
            type: string
          - name: UoM
            type: string
          - name: Amount
            type: string
            validate: min(1),max(20),/^\d+\.(\d{1}|\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: CapacityId
            type: string
          - name: SourceAssetId
            type: string
          - name: SourceChannelName
            type: string
          - name: StructVersion
            type: string
            #IM:v1.10
            default: "1.1.1"
            validate: /^(\\d{1}|\\d{2})\\.(\\d{1}|\\d{2})(\\.(\\d{1}|\\d{2}|\\d{3}))?$/
          - name: RootAssetId
            type: string
          - name: SystemOfRecordCapacityId
            type: string
          - name: CarrierReferenceNumber
            type: string
            # Renamed CustomerReferenceNumber to ShipperReferenceNumber as part of SCRUM-436
          - name: ShipperReferenceNumber
            type: string
          - name: PartnerReferenceNumber
            type: string
          - name: UniversalId
            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: CarrierContractNumber
            type: string
          - name: State
            type: string
            validate: /^(CREATED|ASSIGNED|ACCEPTED|PARTIALLY ACCEPTED|ACCEPTED BID|AWARDED|DECLINED|CANCELED|ANNULLED|VALIDATED|REJECTED)$/
            mandatory: true 
          - name: RequiredResponseDateTime
            type: string 
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: ResponseDateTimeZone
            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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableWidth
            type: string
            validate: min(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableHeight
            type: string
            validate: min(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: AvailableWeight
            type: string
            validate: min(1),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: ServiceDistance
            type: string
            validate: min(1),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
          - name: BidValidTo
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/ 
          - name: ValidToTimeZone
            type: string
          - name: AwardBeforeResponseDeadlinePossible
            type: string
          - name: ExecutionVisibilityRequired
            type: string
          - name: ExecutionVisibilityServiceOnTMA
            type: string
          - name: ExecutionVisibilityServiceName
            type: string
          - name: CustomizedBidAllowed
            type: string
          - name: ShipFrom
            type: ShipFrom
          - name: ShipTo
            type: ShipTo
          - name: ContactInfo
            type: ContactInfo[]
          - name: Attachment
            type: Attachment[]
          - name: ExternalReferences
            type: ExternalReferences[]
          - name: Price
            type: Price[]
      methods:
          crud: []  
          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.10
            default: "1.0.8"
            validate: /^(\\d{1}|\\d{2})\\.(\\d{1}|\\d{2})(\\.(\\d{1}|\\d{2}|\\d{3}))?$/
          #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: CopyShipmentFromLBToCC
            type: string
            validate: /^(YES|NO)$/         
          - name: PlannedTotalWeight
            type: string
            validate: min(1),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(1),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)$/
          - name: PlannedTotalVolume
            type: string
            validate: min(1),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(1),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)$/
          - name: PlannedLoadingMeter
            type: string
            validate: min(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualLoadingMeter
            type: string
            validate: min(1),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: /^(CREATED|ASSIGNED|ACCEPTED|PARTIALLY ACCEPTED|ACCEPTED BID|AWARDED|DECLINED|CANCELED|ANNULLED|VALIDATED|REJECTED)$/
            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: OrganizationSelection
            type: OrganizationSelection[]
          - name: AwardCriteria
            type: string[]  
          - name: BuyNowPrice
            type: string
            validate: min(1),max(20),/^\d+\.(\d{1}|\d{2}|\d{3}|\d{4}|\d{5}|\d{6})?$/
          - name: BidCurrency
            type: string
            validate: /^[A-Z]{3}$/
          - name: MinimumNumberOfBids
            type: number
          - name: MaxAcceptablePrice
            type: string
          - name: AwardedCarrierId
            type: string
          - 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
    - name: TimeWindow
      type: embedded
      properties:
          - name: DateTimeType
            type: string
          - name: StartTime
            type: string
          - name: EndTime
            type: string
          - name: TimeZone
            type: string
    - name: DateTimeWindow
      type: embedded
      properties:
          - name: DateTimeType
            type: string
          - name: StartDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: EndDateTime
            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: OrganizationSelection
      type: embedded
      properties:
          - name: OrganizationTMAID
            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: OrganizationName
            type: string
          - name: OrganizationReferenceNumber
            type: string
    - name: Values
      type: embedded
      properties:
          - name: AttributeValue
            type: string
    - name: ServiceSpecificInformation
      type: embedded
      properties:
          - name: AttributeDescription
            type: string
          - name: InformationGroup
            type: string
          - name: Values
            type: Values[]
    - name: CACapacity
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: ChannelName
            type: string
    - name: CACargo
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: CargoId
            type: string
          - name: ShipmentId
            type: string
          - name: ChannelName
            type: string 
    - name: CATransportOrder
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: ChannelName
            type: string 
    - name: CATransportUnit
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: ChannelName
            type: string 
    - name: CABusinessMessage
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: ChannelName
            type: string 
    - name: CACertificate
      type: embedded
      properties:
          - name: AssetId
            type: string
          - name: ChannelName
            type: string  
    - name: BusinessMessage
      properties: 
            # don't set this field, it is calculated automatically
          - name: AssetId
            type: string
            mandatory: false
            id: true
          - name: BMId
            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: RevokedDateTime
            type: string
            validate: /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$/
          - name: RevokedTimeZone
            type: string
          - name: Revoked
            type: string
            default: "NO"
          - name: BusinessMessageType
            type: string
            validate: /^(TRANSPORT EVENT|SERVICE COMMUNICATION|KEY)$/
            mandatory: true
          - name: StandardMessage
            type: string
            validate: /^(YES|NO)$/
            mandatory: true
           #Validation in a chaincode
          - name: MessageCode
            type: string
          - name: MessageSubCode1
            type: string
          - name: StandardMessageSupplementaryInformation
            type: string
          - name: SystemOfRecordMessageId
            type: string
          - name: MessageInformation
            type: string
            validate: max(256)
          - name: EquipmentNumber
            type: string
          - name: ActualTotalWeight
            type: string
            validate: min(1),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(1),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(1),max(20),/^\d+\.(\d{2}|\d{3}|\d{4}|\d{5}|\d{6})$/
          - name: ActualNumberOfTUs
            type: number
          - name: Key
            type: string
          - name: APIAddress1
            type: string
          - name: APIAddress1KeyApplied
            type: string
          - name: APIAddress2
            type: string
          - name: APIAddress2KeyApplied
            type: string
          # id of related Capacity asset 
          - name: Capacity 
            type: CACapacity[]
          # id of related Cargo asset 
          - name: Cargo 
            type: CACargo[]
            # id of related TransportOrder assets 
          - name: TransportOrder
            type: CATransportOrder[]
            # id of related TransportUnit assets
          - name: TransportUnit
            type: CATransportUnit[]
            # id of related TransportUnit assets
          - name: BusinessMessage
            type: CABusinessMessage[]
          - name: Certificate
            type: CACertificate[]
          - name: ServiceSpecificInformation
            type: ServiceSpecificInformation[]
          - name: Price
            type: Price
          - name: OrganizationSelection
            type: OrganizationSelection[]
          - name: TimeWindow
            type: TimeWindow[]
          - name: DateTimeWindow
            type: DateTimeWindow[]
          - name: Time
            type: Time[]
          - name: Location
            type: Location 
          - name: ExternalReferences
            type: ExternalReferences[]
          - name: ContactInfo
            type: ContactInfo[]  
          - name: Attachment
            type: Attachment[]         
          - name: StructVersion
            type: string
            #IM:v1.3
            default: "1.0.2"
            validate: /^(\\d{1}|\\d{2})\\.(\\d{1}|\\d{2})(\\.(\\d{1}|\\d{2}|\\d{3}))?$/
          - name: PaymentTxId
            type: string
            mandatory: true
          - name: CreatorInfo
            type: CreatorInfo
          - name: RecipientInfo
            type: RecipientInfo[]
            mandatory: true
          - name: VehicleDetails
            type: VehicleDetails

      methods:
        crud: [create, update, delete, getById]
        others: []      
customMethods:
    - executeQuery
    - "CreateShipment(asset Shipment)"
    - "DeleteShipmentByCargoId(id string)"
    - "GetShipmentByCargoId(id string)"
    - "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)"
    - "GetCO2(id string)"
    - "RevokeBusinessMessage(id string)"
