Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 1f0d556

Browse files
Schecher_1Schecher_1
authored andcommitted
Update Postmen Coll and Api Doc
1 parent f0324fd commit 1f0d556

8 files changed

Lines changed: 22 additions & 19 deletions

File tree

Controllers/v01/InvoiceController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ public async Task<IActionResult> Edit([FromBody] InvoiceModel editInvoice)
229229
//get the invoice id
230230
int index = user.Invoices.FindIndex(x => x.Id == editInvoice.Id);
231231

232+
//check if the file id was manipulated
233+
if (user.Invoices[index].FileID != editInvoice.FileID)
234+
return new BadRequestObjectResult(ResponseMgr.CreateResponse(400, traceId, "The file id was manipulated", new Dictionary<string, object> { { "fileId", editInvoice.FileID } }));
235+
232236
//create a new invoice and delete the old one
233237
editInvoice.Id = user.Invoices[index].Id;
234238
editInvoice.FileID = user.Invoices[index].FileID;

Resources/ApiDoc_V01/Invoice/DEL__Invoice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Content-Type: application/json*
5656
"importanceState": 1,
5757
"moneyState": 1,
5858
"paidState": 1,
59-
"moneyTotal": 10000
59+
"moneyTotal": "10000"
6060
}
6161
}
6262
}

Resources/ApiDoc_V01/Invoice/GET__Invoice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Content-Type: application/json*
5757
"importanceState": 1,
5858
"moneyState": 1,
5959
"paidState": 1,
60-
"moneyTotal": 100
60+
"moneyTotal": "100"
6161
},
6262
"base64": "SGFsbG8="
6363
}

Resources/ApiDoc_V01/Invoice/GET__Invoice_GetAll.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Content-Type: application/json*
5757
"importanceState": 1,
5858
"moneyState": 1,
5959
"paidState": 1,
60-
"moneyTotal": 100
60+
"moneyTotal": "100"
6161
}
6262
]
6363
}

Resources/ApiDoc_V01/Invoice/POST__Invoice.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
```json
2323
{
2424
"NewInvoice": {
25+
//no matter what, best a hash from the file, and no special characters
26+
"fileId": "asd435fgddxf34456456fgdh",
2527
"CaptureDate": "2022-01-01T00:00:00Z",
2628
"ExhibitionDate": "2022-01-01T00:00:00Z",
2729
"Reference": "Ref-123",
@@ -35,7 +37,7 @@
3537
"ImportanceState": 1,
3638
"MoneyState": 1,
3739
"PaidState": 1,
38-
"MoneyTotal": 100.00
40+
"MoneyTotal": "100.00"
3941
},
4042
"InvoiceFileBase64": "SGFsbG8="
4143
}
@@ -72,7 +74,7 @@ Content-Type: application/json*
7274
"importanceState": 1,
7375
"moneyState": 1,
7476
"paidState": 1,
75-
"moneyTotal": 100
77+
"moneyTotal": "100"
7678
}
7779
}
7880
}

Resources/ApiDoc_V01/Invoice/PUT__Invoice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"importanceState": 1,
3737
"moneyState": 1,
3838
"paidState": 1,
39-
"moneyTotal": 10000
39+
"moneyTotal": "10000"
4040
}
4141
```
4242

@@ -71,7 +71,7 @@ Content-Type: application/json*
7171
"importanceState": 1,
7272
"moneyState": 1,
7373
"paidState": 1,
74-
"moneyTotal": 10000
74+
"moneyTotal": "10000"
7575
}
7676
}
7777
}

Resources/Invoices-Manager-API-v01.postman_collection.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
],
135135
"body": {
136136
"mode": "raw",
137-
"raw": "{\r\n \"NewInvoice\": {\r\n \"CaptureDate\": \"2022-01-01T00:00:00Z\",\r\n \"ExhibitionDate\": \"2022-01-01T00:00:00Z\",\r\n \"Reference\": \"Ref-123\",\r\n \"DocumentType\": \"PDF\",\r\n \"Organization\": \"ABC Inc.\",\r\n \"InvoiceNumber\": \"INV-123\",\r\n \"Tags\": [\r\n \"Tag1\",\r\n \"Tag2\"\r\n ],\r\n \"ImportanceState\": 1,\r\n \"MoneyState\": 1,\r\n \"PaidState\": 1,\r\n \"MoneyTotal\": 100.00\r\n },\r\n \"InvoiceFileBase64\": \"SGFsbG8=\"\r\n}",
137+
"raw": "{\r\n \"NewInvoice\": {\r\n //no matter what, best a hash from the file, and no special characters\r\n \"fileId\": \"asd435fgddxf34456456fgdh\",\r\n \"CaptureDate\": \"2022-01-01T00:00:00Z\",\r\n \"ExhibitionDate\": \"2022-01-01T00:00:00Z\",\r\n \"Reference\": \"Ref-123\",\r\n \"DocumentType\": \"PDF\",\r\n \"Organization\": \"ABC Inc.\",\r\n \"InvoiceNumber\": \"INV-123\",\r\n \"Tags\": [\r\n \"Tag1\",\r\n \"Tag2\"\r\n ],\r\n \"ImportanceState\": 1,\r\n \"MoneyState\": 1,\r\n \"PaidState\": 1,\r\n \"MoneyTotal\": \"100.00\"\r\n },\r\n \"InvoiceFileBase64\": \"SGFsbG8=\"\r\n}",
138138
"options": {
139139
"raw": {
140140
"language": "json"
@@ -168,7 +168,7 @@
168168
],
169169
"body": {
170170
"mode": "raw",
171-
"raw": "{\r\n \"id\": 4,\r\n \"captureDate\": \"2023-04-28T19:21:14.4365823+02:00\",\r\n \"exhibitionDate\": \"2022-01-01T00:00:00Z\",\r\n \"reference\": \"Ref-123\",\r\n \"documentType\": \"PDF\",\r\n \"organization\": \"ABC Inc.\",\r\n \"invoiceNumber\": \"INV-123\",\r\n \"tags\": [\r\n \"Tag1\",\r\n \"Tag22222\"\r\n ],\r\n \"tagsAsString\": \"Tag1;Tag2\",\r\n \"importanceState\": 1,\r\n \"moneyState\": 1,\r\n \"paidState\": 1,\r\n \"moneyTotal\": 10000\r\n}",
171+
"raw": "{\r\n \"id\": 2,\r\n \"captureDate\": \"2023-04-28T19:21:14.4365823+02:00\",\r\n \"exhibitionDate\": \"2022-01-01T00:00:00Z\",\r\n \"reference\": \"Ref-123\",\r\n \"documentType\": \"PDF\",\r\n \"organization\": \"ABC Inc.\",\r\n \"invoiceNumber\": \"INV-123\",\r\n \"tags\": [\r\n \"Tag1\",\r\n \"Tag22222\"\r\n ],\r\n \"tagsAsString\": \"Tag1;Tag2\",\r\n \"importanceState\": 1,\r\n \"moneyState\": 1,\r\n \"paidState\": 1,\r\n \"moneyTotal\": \"10000\"\r\n}",
172172
"options": {
173173
"raw": {
174174
"language": "json"
@@ -488,18 +488,15 @@
488488
},
489489
{
490490
"name": "Login",
491-
"protocolProfileBehavior": {
492-
"disableBodyPruning": true
493-
},
494491
"request": {
495492
"auth": {
496493
"type": "noauth"
497494
},
498-
"method": "GET",
495+
"method": "POST",
499496
"header": [],
500497
"body": {
501498
"mode": "raw",
502-
"raw": "{\r\n \"username\": \"UserNames\",\r\n \"password\": \"UserPassword\"\r\n}",
499+
"raw": "{\r\n \"username\": \"UserName\",\r\n \"password\": \"UserPassword\"\r\n}",
503500
"options": {
504501
"raw": {
505502
"language": "json"

appsettings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"AllowedHosts": "*",
33
"ConnectionStrings": {
4-
"DefaultConnection": "Server=;Port=3306;Database=InvoicesMgr;Uid=;Pwd=;"
4+
"DefaultConnection": "Server=localhost;Port=3306;Database=InvoicesMgr;Uid=root;Pwd=;"
55
},
66
"JwtKeys": {
7-
"SymmetricSecurityKey": "", // Symmetric security key for JWT
8-
"Issuer": "", // Issuer of the JWT
9-
"Audience": "", // Audience of the JWT
10-
"Expiration": 30 // 30 minutes //The login token has a durability of 30 minutes
7+
"SymmetricSecurityKey": "TqsLHzfrk58trjoYEIvTN7aerVEHrv86YlSQyPEDQb7OJSAzpk6rOjjC4nZQmx5i9gdszR5EuaGfUS8c5ryu0tN5DfvIkTmSWCH3XCXIk0gYzxr8h7Jg60Z525tDFxQN3Mz14QX73bKKcLL2u8fkySq4RgZ6eSwfTSMab3AUBpAcOa9FdOwIRGdQkwXcWXDJSASwwdjAggbBHPP3lyVqEn8wo6iZ09Hk2IXNnCj8Wney01evwvvz19MzyaHp0u0",
8+
"Issuer": "InvoiceMangerAPI",
9+
"Audience": "InvoiceManger",
10+
"Expiration": 3000
1111
},
1212
"Logging": {
1313
"LogLevel": {

0 commit comments

Comments
 (0)