Skip to content

Commit 85db585

Browse files
committed
fix: Add missing schema and response files
1 parent 1bd187c commit 85db585

File tree

6 files changed

+55
-84
lines changed

6 files changed

+55
-84
lines changed
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: The request was understood but the server is refusing to authorize it
1+
description: Permission denied
22
content:
33
application/json:
44
schema:
@@ -9,19 +9,7 @@ content:
99
example: "Forbidden"
1010
message:
1111
type: string
12-
example: "Insufficient permissions to access this resource"
12+
example: "Permission denied"
1313
code:
1414
type: string
15-
example: "INSUFFICIENT_PERMISSIONS"
16-
required_permissions:
17-
type: array
18-
items:
19-
type: string
20-
example: ["write:farms", "admin:companies"]
21-
timestamp:
22-
type: string
23-
format: date-time
24-
example: "2024-01-15T10:30:00Z"
25-
request_id:
26-
type: string
27-
example: "req_1234567890abcdef"
15+
example: "FORBIDDEN"

swt_api_spec/components/responses/ServerError.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ content:
1010
message:
1111
type: string
1212
example: "An unexpected error occurred"
13-
request_id:
14-
type: string
15-
example: "req_1234567890abcdef"
1613
code:
1714
type: string
18-
example: "INTERNAL_ERROR"
19-
timestamp:
20-
type: string
21-
format: date-time
22-
example: "2024-01-15T10:30:00Z"
23-
support_reference:
24-
type: string
25-
example: "SR-2024-001-123456"
15+
example: "SERVER_ERROR"
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: Authentication credentials were missing or invalid
1+
description: Authentication required or failed
22
content:
33
application/json:
44
schema:
@@ -9,14 +9,7 @@ content:
99
example: "Unauthorized"
1010
message:
1111
type: string
12-
example: "Invalid or missing authentication token"
12+
example: "Authentication required"
1313
code:
1414
type: string
15-
example: "AUTH_REQUIRED"
16-
timestamp:
17-
type: string
18-
format: date-time
19-
example: "2024-01-15T10:30:00Z"
20-
request_id:
21-
type: string
22-
example: "req_1234567890abcdef"
15+
example: "UNAUTHORIZED"
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: The request was well-formed but contains invalid parameters
1+
description: Invalid request parameters
22
content:
33
application/json:
44
schema:
@@ -9,7 +9,10 @@ content:
99
example: "Validation Error"
1010
message:
1111
type: string
12-
example: "Request validation failed"
12+
example: "Invalid request parameters"
13+
code:
14+
type: string
15+
example: "VALIDATION_ERROR"
1316
details:
1417
type: array
1518
items:
@@ -21,16 +24,3 @@ content:
2124
message:
2225
type: string
2326
example: "Invalid email format"
24-
value:
25-
type: string
26-
example: "invalid-email"
27-
code:
28-
type: string
29-
example: "VALIDATION_ERROR"
30-
timestamp:
31-
type: string
32-
format: date-time
33-
example: "2024-01-15T10:30:00Z"
34-
request_id:
35-
type: string
36-
example: "req_1234567890abcdef"

swt_api_spec/components/schemas/audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ properties:
5555
type: integer
5656
minimum: 0
5757
maximum: 100
58-
description: "Budget adherence score (project audits)"
58+
description: "Project budget adherence score (project audits)"
5959
example: 90
6060
timeline:
6161
type: integer
6262
minimum: 0
6363
maximum: 100
64-
description: "Timeline adherence score (project audits)"
64+
description: "Project timeline adherence score (project audits)"
6565
example: 80
6666
compliance:
6767
type: integer

swt_api_spec/components/schemas/transaction.yaml

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,74 +5,84 @@ properties:
55
type: string
66
format: cuid
77
readOnly: true
8-
example: "cuid:123e4567-e89b-12d3-a456-426655440000"
9-
description: "The unique Id of the transaction."
8+
description: "The unique ID of the transaction"
9+
example: "clh1234567890abcdef"
1010
market_id:
1111
type: string
1212
format: cuid
13-
example: "cuid:123e4567-e89b-12d3-a456-426655440000"
14-
description: "The unique Id of the market."
13+
description: "The ID of the market where the transaction occurred"
14+
example: "clh1234567890abcdef"
1515
date:
1616
type: string
1717
format: date-time
18-
example: "2022-10-10T00:00:00.000Z"
19-
description: "The date of the transaction."
18+
description: "The date and time of the transaction"
19+
example: "2024-01-15T10:30:00Z"
2020
level_of_traceability:
2121
type: string
22+
description: "The level of traceability for the transaction"
2223
example: "identite preservee"
23-
description: "The level of traceability of the transaction."
2424
driver_name:
2525
type: string
26-
example: "John Doe"
27-
description: "The name of the driver."
26+
description: "The name of the driver"
27+
example: "John Smith"
2828
quantity:
2929
type: number
30-
example: 10
31-
description: "The quantity of the transaction."
30+
description: "The quantity of product in the transaction"
31+
example: 500
3232
net_weight_declared_in_Ton:
3333
type: number
34-
example: 100
35-
description: "The net weight declared of the transaction."
34+
description: "The net weight declared in tons"
35+
example: 0.5
3636
humidity_level_of_product:
3737
type: number
3838
format: float
39-
example: 10
40-
description: "The humidity of the product in the transaction."
39+
description: "The humidity level of the product"
40+
example: 7.5
4141
total_quantity_in_bags:
4242
type: number
43+
description: "The total quantity in bags"
4344
example: 10
44-
description: "The quantity of bags of the transaction."
4545
receiver_name:
4646
type: string
47+
description: "The name of the receiver"
4748
example: "Jane Doe"
48-
description: "The name of the receiver."
4949
min_com_verif_agent_name_and_sig:
5050
type: string
51-
example: "mincommerce_signature"
52-
description: "The mincommerce signature of the transaction."
51+
description: "The name and signature of the verification agent"
52+
example: "Agent Smith - Verified"
5353
sender_signature:
5454
type: string
55-
example: "sender_signature"
56-
description: "The sender signature of the transaction."
55+
description: "The signature of the sender"
56+
example: "Sender123"
5757
driver_signature:
5858
type: string
59-
example: "driver_signature"
60-
description: "The driver signature of the transaction."
59+
description: "The signature of the driver"
60+
example: "Driver456"
6161
product_quality:
6262
type: string
63-
example: "good"
64-
description: "The quality of the product."
63+
description: "The quality grade of the product"
64+
example: "Grade A"
6565
vehicule_immatriculation_number:
6666
type: string
67-
example: "vehicule_number"
68-
description: "To specify the vehicule number of the transaction. It's in charge of transporting the product from buing plan the magazin of the other third company buyer."
67+
description: "The vehicle registration number"
68+
example: "ABC123XY"
6969
created_at:
7070
type: string
7171
format: date-time
72-
example: "2022-10-10T00:00:00.000Z"
73-
description: "The date and time at which the transaction was created."
72+
readOnly: true
73+
description: "When the transaction was created"
74+
example: "2024-01-15T10:30:00Z"
7475
updated_at:
7576
type: string
7677
format: date-time
77-
example: "2022-10-10T00:00:00.000Z"
78-
description: "The date and time at which the transaction was updated."
78+
readOnly: true
79+
description: "When the transaction was last updated"
80+
example: "2024-01-15T10:30:00Z"
81+
required:
82+
- market_id
83+
- date
84+
- quantity
85+
- net_weight_declared_in_Ton
86+
- humidity_level_of_product
87+
- total_quantity_in_bags
88+
- product_quality

0 commit comments

Comments
 (0)