Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend to timestamp mutations? #61

Open
pral2a opened this issue Sep 7, 2021 · 2 comments
Open

Backend to timestamp mutations? #61

pral2a opened this issue Sep 7, 2021 · 2 comments

Comments

@pral2a
Copy link

pral2a commented Sep 7, 2021

Looks like the backend does not provide any timestamp information about when mutation happened to an event or a resource.

The properties available such as hasBeginning, hasEnd or hasPointInTime are only mean to be updated at the client-side.

Could you confirm that is correct?

@vcuculo
Copy link

vcuculo commented Sep 16, 2021

@pral2a are you able to provide a Timestamp? Mutations involving one of these properties seems to ignore such data (ref #66 )

@pral2a
Copy link
Author

pral2a commented Sep 16, 2021

@vcuculo I'm able to provide timestamp for economicEvents using properties hasEnd, hasPointInTime, hasBeginning. See example below:

mutation {
  createEconomicEvent(
    event: {
      note: "Test produce with time",
      action: "produce",
      resourceInventoriedAs: "01FF0N5ADMKF50V4VB8J7AXDS2",
      provider: "01EYJR67EAYVWRW5Z87HNGN16X",
      receiver: "01EYJR67EAYVWRW5Z87HNGN16X",
      resourceQuantity: {
        hasUnit: "01EVTV5PZEQYQFW34SFHY2M4NN",
        hasNumericalValue: 10
      }
      hasEnd: "2021-09-19T10:00:00Z",
      hasPointInTime: "2021-09-16T10:00:00Z",
      hasBeginning: "2021-09-15T10:00:00Z"
    }
  ) {
  economicEvent {
      id
      note
      action {
        id
      }
      hasEnd
      hasPointInTime
      hasBeginning
      resourceInventoriedAs { # updated details of the existing resource
        id
        name
        onhandQuantity {
          hasNumericalValue
          hasUnit {
            label
            symbol
          }
        }
        accountingQuantity {
          hasNumericalValue
          hasUnit {
            label
            symbol
          }
        }
      }
    }
  }
}
{
  "data": {
    "createEconomicEvent": {
      "economicEvent": {
        "action": {
          "id": "produce"
        },
        "hasBeginning": "2021-09-15T10:00:00.000000Z",
        "hasEnd": "2021-09-19T10:00:00.000000Z",
        "hasPointInTime": "2021-09-16T10:00:00.000000Z",
        "id": "01FFQR6HS3ZH8478DJCY4YR875",
        "note": "Test produce with time",
        "resourceInventoriedAs": {
          "accountingQuantity": {
            "hasNumericalValue": 10,
            "hasUnit": {
              "label": "liter",
              "symbol": "kg"
            }
          },
          "id": "01FF0N5ADMKF50V4VB8J7AXDS2",
          "name": "10kg produced to be consumed",
          "onhandQuantity": {
            "hasNumericalValue": 10,
            "hasUnit": {
              "label": "liter",
              "symbol": "kg"
            }
          }
        }
      }
    }
  }
}

However, I have the same issues for createOffer. due returns null after it's set with a valid ISO8601 timestamp. See example below:

mutation {
  createOffer(intent: {
      action: "transfer",
      name: "Givign Away",
      provider: "01EYJR67EAYVWRW5Z87HNGN16X",
      receiver:"01F3MHQ0KWJC7M19B1E8BXVY46",
      resourceInventoriedAs:"01FF0N5ADMKF50V4VB8J7AXDS2"
      availableQuantity: {hasUnit: "01FFJEBJ4S4E4ZDWZNEWYFZYD7", hasNumericalValue: 10}
      due: "2021-09-20T14:10:20Z"
  }
  ) {
    intent {
      id
      name
      due
    }
  }
}
{
  "data": {
    "createOffer": {
      "intent": {
        "due": null,
        "id": "01FFQRM96YV3EBAQT3FMPGJ1S0",
        "name": "Givign Away"
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants