posfgit / standard

9 stars 13 forks source link

409 Conflict #91

Closed csclaudiu closed 2 years ago

csclaudiu commented 2 years ago

Buna ziua,

Avem cateva intrebari:

  1. Contractele definite prin xsd sunt aceleasi cu cele definite in openapi specification-ul din https://posf-beta.anre.ro/broker/swagger-ui/index.html. Ne putem baza pe specificatiile de openApi din swagger pt a genera contractele, atat acum cat si in viitor ?
  2. Folosim in prezent credentialele default din collectia postman din repo. Am incercat sa facem un prim request de INIT insa avem un raspuns 409 Conflict si nu stim ce anume nu este corect completat in payload:

Request: Method: POST, RequestUri: 'https://posf-beta.anre.ro/broker/postMessage', Version: 1.1, Content: System.Net.Http.StringContent, Headers: { User-Agent: Petrom POSF client Accept: application/json Authorization: Bearer **** Content-Type: application/json; charset=utf-8 } {"info":"INIT","place":{"type":"CLC","address":{"county":"B","authorId":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","building":"Petrom City A","city":{"code":"B","name":"Bucuresti"},"country":"Romania","cua":"Test","cuaAuthor":"Test","extended":"test","flat":"22","floor":"8","number":"25","position":{"geohash":"24234234,23123123","latitude":"22","longitude":"13"},"postcode":"19233","stair":"B","street":"Vasilescu Zaharia","streetType":"normala"},"code":"test","operator":{"incorporation":"SOCIETATE_COMERCIALA","address":{"county":"B","authorId":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","building":"Petrom City A","city":{"code":"B","name":"Bucuresti"},"country":"Romania","cua":"Test","cuaAuthor":"Test","extended":"test","flat":"22","floor":"8","number":"25","position":{"geohash":"24234234,23123123","latitude":"22","longitude":"13"},"postcode":"19233","stair":"B","street":"Vasilescu Zaharia","streetType":"normala"},"code":"test","contactAddress":{"email":"claudiu@test.com","fax":"1231321","mobilePhone":"0734657999","phone":"0734657999"},"correspondenceAddress":{"county":"B","authorId":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","building":"Petrom City A","city":{"code":"B","name":"Bucuresti"},"country":"Romania","cua":"Test","cuaAuthor":"Test","extended":"test","flat":"22","floor":"8","number":"25","position":{"geohash":"24234234,23123123","latitude":"22","longitude":"13"},"postcode":"19233","stair":"B","street":"Vasilescu Zaharia","streetType":"normala"},"extra":"extra things","legalRepresentative":{"type":"CNP","address":{"county":"B","authorId":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","building":"Petrom City A","city":{"code":"B","name":"Bucuresti"},"country":"Romania","cua":"Test","cuaAuthor":"Test","extended":"test","flat":"22","floor":"8","number":"25","position":{"geohash":"24234234,23123123","latitude":"22","longitude":"13"},"postcode":"19233","stair":"B","street":"Vasilescu Zaharia","streetType":"normala"},"code":"coode","contactAddress":{"email":"claudiu@test.com","fax":"1231321","mobilePhone":"0734657999","phone":"0734657999"},"correspondenceAddress":{"county":"B","authorId":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","building":"Petrom City A","city":{"code":"B","name":"Bucuresti"},"country":"Romania","cua":"Test","cuaAuthor":"Test","extended":"test","flat":"22","floor":"8","number":"25","position":{"geohash":"24234234,23123123","latitude":"22","longitude":"13"},"postcode":"19233","stair":"B","street":"Vasilescu Zaharia","streetType":"normala"},"extra":"extraStuff","firstName":"Claudiu","lastName":"test","number":"23","series":"DD"},"legalRepresentativeQuality":"test","name":"Gigi","number":"123123123","license":"fawefawef","operatorId":"7e562920-0d46-49f9-b9b7-d053d556cec2"},"hasProsumer":false,"urls":[],"technicalDataElectricity":{"counterType":"ACTIVE","documentType":"ATREE","status":"CONECTAT","connectionType":"MONOFAZAT","networkType":"CA","consumption":{},"counterIndexDesc":"test","counterIndexInterval":2.0,"counterIndexReadDate":"2022-07-29","counterIndexValue":"200","counterSeries":"1234123","date":"2022-07-29","number":"123123123","smartMeter":false,"type":"test","approvedConsumptionPower":200.0,"approvedProducedPower":20.0,"voltageLevel":220.0}},"authorID":"f2dcefd8-8134-46dd-8eff-79c2f5c42f3a","authorName":"test","correlationID":"2368e22d-bb5a-4ede-a922-5488e684d480","description":"teeest","messageID":"15220543-2b32-43e1-9924-3f07a92507a9","timestamp":"2022-07-29T15:52:12.9966845+03:00","type":"PlaceUpdatedByOperator"}

  1. Uneori primim 401, desi tokenul este tocmai emis. Acelasi request o zi mai tarziu functioneaza...

Multumesc,

bogdannedelcu commented 2 years ago

Care este mesajul de eroare pe care il primiti pe response, in afara de 409. Daca e vorba de "Atribute authorID is not equal " inseamna ca in authorID din mesaj este un ID diferit decat cel al contului cu care va autentificati. Fiecare cont are un ID unic, il puteti vedea apeland /broker/list/supplier sau operator unde va veti identifica compania, sau folosind https://posf-beta.anre.ro/broker/profile

csclaudiu commented 2 years ago

Intr-adevar asta era problema. Multumesc!