euniversal / umei-api-specification

UMEI API specifications
Apache License 2.0
3 stars 0 forks source link

chore/clarify-post-semantics #67

Closed narve closed 2 years ago

narve commented 2 years ago

Fixes #63

cdmNSIDE commented 2 years ago

Hello @narve,

How will the platform know if the resource must be created or updated when using those POST requests?

If we accept your modifications, then shouldn't we do the same for:

narve commented 2 years ago

Good points you make! I think that the "standard" behaviour for POST is to create (or fail if id already exists), and for PUT/PATCH to update (or fail if id is empty). This makes sense in most cases. Including flexibility zones, orders, portfolios etc.

However, for meter readings / baselines, when batch uploading (e.g. via text files), I think the behavour should be a bit different. For a given reference, e.g. portfolio, and a given period, there should only be one meter reading. One way of viewing this is that the identifier for a meter reading should have been (and can even be, thats up to the FMO) a concatenation of reference-periodfrom-periodto.

After first uploading a file containing meter readings for a given portfolio for a given day, all values are created. However, if you change one value in the file and upload the file again, I think the expectation is that the values are updated.

That is why I added the documentation to only those batch-uploading endpoints.

cdmNSIDE commented 2 years ago

So if it concerns the endpoints where a file is uploaded, shouldn't the modifications rather concern:

narve commented 2 years ago

Well... that is a good question. I see that I modified the descriptions of the POST single-item as well. I guess we can require that endpoint to only create. This is actually the way NODES behaves today anyway.

And we should probably add a /BaselineIntervals/import endpoint, since batch-uploading baselines is a normal operation.

narve commented 2 years ago

@cdmNSIDE @GiancarloNSIDE I've added a baseline interval batch import endpoint, and clarified that it is only the batch imports that will either create or update. POST operations will always create (or fail).

Is this PR ok now?

cdmNSIDE commented 2 years ago

Hi Narve,

I don't know why but I can't submit in line comments directly in the file, so I wrote them below:

I am ok with the rest of the file, this PR can be merged once the changes are done (if you agree with them)

narve commented 2 years ago

Great, thanks for the feedback! I've incorporated your suggestions and will merge it to main now.