Skip to content

How to handle references when more than 2 parties in a use case? #302

@larsolofsson

Description

@larsolofsson

An example of a use case with 3 parties

  • Supplier is responsible for providing the product.
  • Logistics Supplier A is responsible for distributing the products having the business role of a Forwarder. The Shipment Number is created by the Logistics Supplier A
  • Logistics Supplier B is responsible for the warehouse from where the products are dispatched having the business role of a Warehouse Operator (or Storage Operator). Logistics Supplier B is also responsible for loading of the products.

A party can have many business roles.

Logistics Supplier B needs to get the Shipment Number created by Logistics Supplier A.

The Supplier communicates with Logistics Supplier A and Logistics Supplier B via API:s
For example, A Loading Instruction created by Logistics Supplier A with a reference to the Shipment Number is sent to the Supplier. The Supplier needs to send this information to Logistics Supplier B as a Loading Instruction created by the Supplier with a reference to the ShipmentNumber created by the Logistics Supplier A.

After loading Logistics Supplier B sends a Delivery Note to the Supplier with references to the Loading Instruction created by the Supplier and the ShipmentNumber created by the Logistics Supplier A. The Supplier needs to send this information to Logistics Supplier A as a Delivery Note created by the Supplier with references to the Loading Instruction created by the Logistics Supplier A and to the ShipmentNumber created by the Logistics Supplier A.

So far in existing use cases having only 2 parties, references are given in properties, e.g. deliveryInstructionNumber, deliveryInstructionSequenceNumber and deliveryInstructionSequenceLineItemNumber.

I think that papiNet should have a more general and flexible reference construct similar to the reference construct in the XML standard using assigned by business roles and agencies. But without a requirement to specify the parties of the business roles. Related properties to a reference type should be possible to be specified, e.g. deliveryInstructionSequenceNumber, deliveryInstructionSequenceLineItemNumber and dateTime are related to reference type deliveryInstructionNumber. References by other means than API properties should also be possible to be specified.

API endpoints are still specified in logistics with 2 parties Supplier and Logistics Supplier.

Proposed reference construct

Image
  references:
    type: array
    minItems: 1
    items:
      type: object
      unevaluatedProperties: false
      required:
        - type
        - assignedBy
      anyOf:
        - required:
            - id
        - required:
            - identifier
      properties:
        type:
          type: string
          enum:
            - DeliveryNoteNumber
            - LoadingInstructionNumber
            - ShipmentNumber
        assignedBy:
          description: The business role of the assigning party.
          type: string
          enum:
            - Forwarder
            - Supplier
            - WarehouseOperator
        id:
          type: string
          format: uuid
        identifier:
          type: object
          unevaluatedProperties: false
          required:
            - value
            - assignedByIdentifierBySupplier
          properties:
            value:
              type: string
              minLength: 1
            assignedByIdentifierBySupplier:
              type: string
              minLength: 1
              description: The identifier of the assigning party assigned by the _Supplier_.
        dateTime:
          type: string
          format: date-time
        sequenceNumber:
          type: integer
          minimum: 0
        lineItemNumber:
          type: integer
          minimum: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions