Skip to content

Commit

Permalink
new data model operation
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoabellagarcia committed Oct 30, 2024
1 parent da2bdf2 commit bdef8e3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 136 deletions.
3 changes: 2 additions & 1 deletion specs/AllSubjects/official_list_data_models.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updatedDate": "2024-10-28T18:34:00.31416",
"updatedDate": "2024-10-30T18:41:00.31416",
"officialList": [
{
"repoName": "dataModel.User",
Expand Down Expand Up @@ -1384,6 +1384,7 @@
"Berth",
"Booking",
"EdiCodeco",
"Operation",
"Port",
"PortAuthority",
"PortCall",
Expand Down
52 changes: 19 additions & 33 deletions utils/examples_conversor.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,45 +108,31 @@ def valid_date(datestring):


keyvaluesPayload = {
"id": "02ce3860-3126-42af-8ac7-c2a661134130",
"type": "Berth",
"mrn": "urn:mrn:eshuv:portcalls:berth:id:18013",
"gln": 1234567890123,
"id": "urn:mrn:eshuv:portcalls:activity:id:40923",
"type": "Operation",
"portCode": "ESHUV",
"year": 2023,
"portCallNumber": "ESHUV202300123",
"portCallRef": "urn:mrn:eshuv:portcalls:portcall:2023:id:941",
"portCallRef": "urn:mrn:eshuv:portcalls:activity:id:941",
"berthRef": "urn:mrn:eshuv:portcalls:berth:id:1234",
"stopRank": 2,
"terminal": "Muelle Levante",
"berthCode": "urn:mrn:eshuv:portcalls:berth:code:10",
"berthName": "Levante comercial",
"gln": 84332157000139,
"firstBollard": "N03",
"lastBollard": "N12",
"status": "AUTHORIZED",
"requestedAt": "2023-01-01T07:30:00",
"authorizedAt": "2023-01-01T07:30:00",
"berthingTypeCode": "AB1",
"mooringLines": 12,
"activityCode": "ZOP",
"etaBerth": "2023-01-01T07:30:00",
"rtaBerth": "2023-01-01T07:30:00",
"ptaBerth": "2023-01-01T07:30:00",
"ataBerth": "2023-01-01T07:30:00",
"etdBerth": "2023-01-01T07:30:00",
"rtdBerth": "2023-01-01T07:30:00",
"ptdBerth": "2023-01-01T07:30:00",
"atdBerth": "2023-01-01T07:30:00",
"arrivalDraught": 12.3,
"departureDraught": 9.5,
"remarks": "FONDEA PARA SUMINISTRO DE COMBUSTIBLE POR GABARRA",
"authorizationRemarks": "authorized after departure of ship XX",
"agentName": "Acme Huelva S.L.",
"agentLegalCode": "A-98345678",
"createdAt": "2023-01-01T07:30:00",
"modifiedAt": "2023-01-01T07:30:00"
"operationRank": 1,
"ets": "2023-01-01T07:30:00",
"etc": "2023-01-01T07:30:00",
"operationTypeCode": "ZE",
"productCode": "Z41",
"amount": 120,
"measureUnit": "TEU",
"maxWeightPerUnit": 23.3,
"terminal": "Muelle Sur",
"position": "Segunda línea granel",
"remarks": "Delayed 1h",
"manipulationMeansCode": "3",
"manipulationMeansNumber": 2,
"stevedoreRef": "1234"
}


normalizedPayload ={
"id": "urn:ngsi-ld:Memory:id:XJWG:82694953",
"type": "Memory",
Expand Down
138 changes: 36 additions & 102 deletions utils/output.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"id": "02ce3860-3126-42af-8ac7-c2a661134130",
"type": "Berth",
"mrn": {
"type": "string",
"value": "urn:mrn:eshuv:portcalls:berth:id:18013"
},
"gln": {
"type": "number",
"value": 84332157000139
},
"id": "urn:mrn:eshuv:portcalls:activity:id:40923",
"type": "Operation",
"portCode": {
"type": "string",
"value": "ESHUV"
Expand All @@ -23,130 +15,72 @@
},
"portCallRef": {
"type": "string",
"value": "urn:mrn:eshuv:portcalls:portcall:2023:id:941"
},
"stopRank": {
"type": "number",
"value": 2
},
"terminal": {
"type": "string",
"value": "Muelle Levante"
},
"berthCode": {
"type": "string",
"value": "urn:mrn:eshuv:portcalls:berth:code:10"
},
"berthName": {
"type": "string",
"value": "Levante comercial"
"value": "urn:mrn:eshuv:portcalls:activity:id:941"
},
"firstBollard": {
"berthRef": {
"type": "string",
"value": "N03"
"value": "urn:mrn:eshuv:portcalls:berth:id:1234"
},
"lastBollard": {
"type": "string",
"value": "N12"
},
"status": {
"type": "string",
"value": "AUTHORIZED"
},
"requestedAt": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
},
"authorizedAt": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
},
"berthingTypeCode": {
"type": "string",
"value": "AB1"
},
"mooringLines": {
"stopRank": {
"type": "number",
"value": 12
},
"activityCode": {
"type": "string",
"value": "ZOP"
},
"etaBerth": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
"value": 2
},
"rtaBerth": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
"operationRank": {
"type": "boolean",
"value": "true"
},
"ptaBerth": {
"ets": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
},
"ataBerth": {
"etc": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
},
"etdBerth": {
"format": "date-time",
"operationTypeCode": {
"type": "string",
"value": "2023-01-01T07:30:00"
"value": "ZE"
},
"rtdBerth": {
"format": "date-time",
"productCode": {
"type": "string",
"value": "2023-01-01T07:30:00"
"value": "Z41"
},
"ptdBerth": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
"amount": {
"type": "number",
"value": 120
},
"atdBerth": {
"format": "date-time",
"measureUnit": {
"type": "string",
"value": "2023-01-01T07:30:00"
},
"arrivalDraught": {
"type": "number",
"value": 12.3
"value": "TEU"
},
"departureDraught": {
"maxWeightPerUnit": {
"type": "number",
"value": 9.5
"value": 23.3
},
"remarks": {
"terminal": {
"type": "string",
"value": "FONDEA PARA SUMINISTRO DE COMBUSTIBLE POR GABARRA"
"value": "Muelle Sur"
},
"authorizationRemarks": {
"position": {
"type": "string",
"value": "authorized after departure of ship XX"
"value": "Segunda l\u00ednea granel"
},
"agentName": {
"remarks": {
"type": "string",
"value": "Acme Huelva S.L."
"value": "Delayed 1h"
},
"agentLegalCode": {
"manipulationMeansCode": {
"type": "string",
"value": "A-98345678"
"value": "3"
},
"createdAt": {
"format": "date-time",
"type": "string",
"value": "2023-01-01T07:30:00"
"manipulationMeansNumber": {
"type": "number",
"value": 2
},
"modifiedAt": {
"format": "date-time",
"stevedoreRef": {
"type": "string",
"value": "2023-01-01T07:30:00"
"value": "1234"
}
}

0 comments on commit bdef8e3

Please sign in to comment.