diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 90f4b21..b392cc8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,57 +1,78 @@ -name: .NET Tests with Coverage Checks for WarehousesTest +name: .NET Tests with Coverage Checks for unittests and integration tests + on: push: branches: - main - 6.2.workflow + - cicd_deploy + - publish + - cicd_tester + - 6.4-webhook-deel-maken pull_request: branches: - main - 6.2.workflow + - cicd_deploy + - publish + - cicd_tester + - 6.4-webhook-deel-maken + types: [opened, closed] + issues: + types: [opened, closed] + jobs: build: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v3 + - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.100' + - name: Restore dependencies run: dotnet restore + - name: Build the project run: dotnet build --no-restore --configuration Release + test: runs-on: ubuntu-latest needs: build + steps: - name: Checkout code uses: actions/checkout@v3 + - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.100' + - name: Restore Test Project Dependencies run: dotnet restore Test/Test.csproj - + - name: Build Test Project run: dotnet build --no-restore --configuration Release Test/Test.csproj - + - name: Run Tests with Code Coverage run: | dotnet test ./Test --collect:"XPlat Code Coverage" --results-directory ./Test/TestResults - + - name: Extract Coverage Percentage run: | COVERAGE_FILE=$(find . -path "./Test/TestResults/**/coverage.cobertura.xml" | head -n 1) @@ -70,17 +91,145 @@ jobs: exit 1 fi echo "Code coverage meets the required threshold." - - - - name: Generate HTML Coverage Report + + # - name: Generate HTML Coverage Report + # run: | + # dotnet tool install --global dotnet-reportgenerator-globaltool + # reportgenerator -reports:"./**/TestResults/**/coverage.cobertura.xml" -targetdir:"./coverage-html" -reporttypes:Html;MarkdownSummaryGithub + + - name: ReportGenerator + uses: danielpalme/ReportGenerator-GitHub-Action@5 + with: + reports: '*Test*/TestResults/*/coverage.cobertura.xml' + targetdir: "./coverage-html" + reporttypes: "Html;MarkdownSummaryGithub" + + - name: Upload HTML Coverage Report Artifact + uses: actions/upload-artifact@v4 + with: + name: html-coverage-report + path: ./coverage-html/ + + - name: Publish coverage in build summary # alleen mogelijk met MarkdownSummaryGithub + run: cat coverage-html/SummaryGithub.md >> $GITHUB_STEP_SUMMARY + shell: bash + + - name: Send Discord Notification (Tests Failed) + if: failure() run: | - dotnet tool install --global dotnet-reportgenerator-globaltool - reportgenerator -reports:"./**/TestResults/**/coverage.cobertura.xml" -targetdir:"./coverage-html" -reporttypes:Html + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [ + { + "title": ":x: Tests Failed", + "description": "**Workflow**: `${{ github.workflow }}`\n**Branch**: `${{ github.ref_name }}`\n**User**: `${{ github.actor }}`", + "color": 15158332, + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ], + "username": "GitHub Actions", + "avatar_url": "https://github.com/${{ github.actor }}.png" + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} + + publish: + runs-on: ubuntu-latest + needs: test + if: ${{ github.ref_name == 'publish' }} + steps: + - name: Checkout code + uses: actions/checkout@v3 - - name: Upload HTML Coverage Report - uses: actions/upload-artifact@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: - name: html-coverage-report - path: ./coverage-html/ + dotnet-version: '8.0.100' + + - name: Restore dependencies + run: dotnet restore + + - name: Dotnet publish + run: dotnet publish -c Release -r linux-x64 --self-contained -o ./publish + + - name: Upload Linux x64 published artifact + uses: actions/upload-artifact@v4 + with: + name: linux-artifact + path: ./publish - + notifications: + runs-on: ubuntu-latest + steps: + - name: Notify Pull Request Opened + if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }} + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [ + { + "title": ":handshake: Pull Request Opened", + "description": "**Title**: `${{ github.event.pull_request.title }}`\n**User**: `${{ github.event.pull_request.user.login }}` opened a pull request.", + "color": 3447003, + "url": "${{ github.event.pull_request.html_url }}" + } + ], + "username": "${{ github.event.pull_request.user.login }}", + "avatar_url": "${{ github.event.pull_request.user.avatar_url }}" + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} + + - name: Notify Pull Request Merged or Closed + if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [ + { + "title": ":white_check_mark: Pull Request Merged/Closed", + "description": "**Title**: `${{ github.event.pull_request.title }}`\n**User**: `${{ github.event.pull_request.user.login }}` merged/closed this pull request.", + "color": 3066993, + "url": "${{ github.event.pull_request.html_url }}" + } + ], + "username": "${{ github.event.pull_request.user.login }}", + "avatar_url": "${{ github.event.pull_request.user.avatar_url }}" + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} + + - name: Notify Issue Opened + if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [ + { + "title": ":scroll: Issue Opened", + "description": "**Title**: `${{ github.event.issue.title }}`\n**User**: `${{ github.event.issue.user.login }}` opened an issue.", + "color": 3447003, + "url": "${{ github.event.issue.html_url }}" + } + ], + "username": "${{ github.event.issue.user.login }}", + "avatar_url": "${{ github.event.issue.user.avatar_url }}" + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} + + - name: Notify Issue Closed + if: ${{ github.event_name == 'issues' && github.event.action == 'closed' }} + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [ + { + "title": ":white_check_mark: Issue Closed", + "description": "**Title**: `${{ github.event.issue.title }}`\n**User**: `${{ github.event.issue.user.login }}` closed this issue.", + "color": 15158332, + "url": "${{ github.event.issue.html_url }}" + } + ], + "username": "${{ github.event.issue.user.login }}", + "avatar_url": "${{ github.event.issue.user.avatar_url }}" + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} + +# test \ No newline at end of file diff --git a/api/Controllers/ItemControllers.cs b/api/Controllers/ItemControllers.cs index 0b2300d..c170b12 100644 --- a/api/Controllers/ItemControllers.cs +++ b/api/Controllers/ItemControllers.cs @@ -18,6 +18,7 @@ public ItemController(ItemServices item, ILogger? logger = null) [HttpGet("Items")] public async Task GetItems() { + _logger?.LogInformation("GET /api/v1/Item: Retrieved all items."); var items = await _item.GetItems(); return Ok(items); } @@ -31,6 +32,7 @@ public async Task GetItemById(string uid) _logger?.LogInformation("GET /api/v1/Item: Item with id {uid} not found.",uid); return NotFound("No Item found with that ID"); } + _logger?.LogInformation("GET /api/v1/Item/{Id}: Item with ID {Id} retrieved.", uid); return Ok(item); } diff --git a/api/REST/Inventory.REST b/api/REST/Inventory.REST index 783635b..b3e8f9a 100644 --- a/api/REST/Inventory.REST +++ b/api/REST/Inventory.REST @@ -17,9 +17,9 @@ Api-Key: a1b2c3d4e5 { "id": 1, - "itemId": "P000001", + "item_id": "P000001", "description": "Face-to-face clear-thinking complexity", - "itemReference": "sjQ23408K", + "item_reference": "sjQ23408K", "locations": [ { "inventoryId": 1, @@ -38,13 +38,13 @@ Api-Key: a1b2c3d4e5 "locationId": 19538 } ], - "totalOnHand": 262, - "totalExpected": 0, - "totalOrdered": 50, - "totalAllocated": 30, - "totalAvailable": 182, - "createdAt": "2023-10-01T12:00:00Z", - "updatedAt": "2023-10-10T12:00:00Z" + "total_on_hand": 262, + "total_expected": 0, + "total_ordered": 50, + "total_allocated": 30, + "total_available": 182, + "created_at": "2023-10-01T12:00:00Z", + "updated_at": "2023-10-10T12:00:00Z" } ### Put Update inventory based on body given @@ -54,9 +54,9 @@ Api-Key: a1b2c3d4e5 { "id": 1, - "itemId": "P000001", + "item_id": "P000001", "description": "Updated description", - "itemReference": "sjQ23408K", + "item_reference": "sjQ23408K", "locations": [ { "inventoryId": 1, @@ -67,13 +67,13 @@ Api-Key: a1b2c3d4e5 "locationId": 24700 } ], - "totalOnHand": 262, - "totalExpected": 0, - "totalOrdered": 50, - "totalAllocated": 30, - "totalAvailable": 182, - "createdAt": "2023-10-01T12:00:00Z", - "updatedAt": "2023-10-10T12:00:00Z" + "total_on_hand": 262, + "total_expected": 0, + "total_ordered": 50, + "total_allocated": 30, + "total_available": 182, + "created_at": "2023-10-01T12:00:00Z", + "updated_at": "2023-10-10T12:00:00Z" } ### Delete inventory by id diff --git a/api/REST/Item.REST b/api/REST/Item.REST index 320caa1..23d790c 100644 --- a/api/REST/Item.REST +++ b/api/REST/Item.REST @@ -31,6 +31,28 @@ Api-Key: a1b2c3d4e5 "created_at": "2015-02-19T16:08:24Z", "updated_at": "2015-09-26T06:37:56Z" } +### Post Item based on body given +POST http://localhost:5000/api/v1/Item HTTP/1.1 +Content-Type: application/json +Api-Key: a1b2c3d4e5 + +{ + "uid": "P000002", + "code": "sjQ23408K", + "description": "Face-to-face clear-thinking complexity", + "short_description": "must", + "upc_code": "6523540947122", + "model_number": "63-OFFTq0T", + "commodity_code": "oTo304", + "unit_purchase_quantity": 47, + "unit_order_quantity": 13, + "pack_order_quantity": 11, + "supplier_id": 1, + "supplier_code": "SUP423", + "supplier_part_number": "E-86805-uTM", + "created_at": "2015-02-19T16:08:24Z", + "updated_at": "2015-09-26T06:37:56Z" +} ### Put Update Item based on body given PUT http://localhost:5000/api/v1/Item/P000001 HTTP/1.1 diff --git a/api/REST/ItemGroup.REST b/api/REST/ItemGroup.REST index c3ed434..34f70ed 100644 --- a/api/REST/ItemGroup.REST +++ b/api/REST/ItemGroup.REST @@ -14,8 +14,8 @@ Api-Key: a1b2c3d4e5 "id": 1, "name": "Test", "description": "Test", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z" + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } ### PUT http://localhost:5000/api/v1/ItemGroups/1 HTTP/1.1 @@ -26,8 +26,8 @@ Api-Key: a1b2c3d4e5 "id": 1, "name": "TESTEST", "description": "Test", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z" + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } ### DELETE http://localhost:5000/api/v1/ItemGroup/1 HTTP/1.1 diff --git a/api/REST/ItemLines.REST b/api/REST/ItemLines.REST index 418c387..88c1c8e 100644 --- a/api/REST/ItemLines.REST +++ b/api/REST/ItemLines.REST @@ -11,11 +11,11 @@ Content-Type: application/json Api-Key: a1b2c3d4e5 { - "Id": 1, - "Name": "Test", - "Description": "Test", - "CreatedAt": "2000-03-11T13:11:14Z", - "UpdatedAt": "2000-03-12T16:11:14Z" + "id": 1, + "name": "Test", + "description": "Test", + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } ### PUT http://localhost:5000/api/v1/ItemLine/1 HTTP/1.1 @@ -23,11 +23,11 @@ Content-Type: application/json Api-Key: a1b2c3d4e5 { - "Id": 1, - "Name": "Test change", - "Description": "Test", - "CreatedAt": "2000-03-11T13:11:14Z", - "UpdatedAt": "2000-03-12T16:11:14Z" + "id": 1, + "name": "Test change", + "description": "Test", + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } ### diff --git a/api/REST/ItemTypes.REST b/api/REST/ItemTypes.REST index f247ce7..7da4b5b 100644 --- a/api/REST/ItemTypes.REST +++ b/api/REST/ItemTypes.REST @@ -14,8 +14,8 @@ Api-Key: a1b2c3d4e5 "id": 2, "name": "Test", "description": "Test", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z" + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } @@ -28,8 +28,8 @@ Api-Key: a1b2c3d4e5 "id": 2, "name": "Test update", "description": "Test", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z" + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z" } ### diff --git a/api/REST/Locations.REST b/api/REST/Locations.REST index 48b6d83..136d1e8 100644 --- a/api/REST/Locations.REST +++ b/api/REST/Locations.REST @@ -1,36 +1,40 @@ +### Get all locations +GET http://localhost:5000/api/v1/locations +Api-Key: a1b2c3d4e5 + +####### +GET http://localhost:5000/api/v1/locations/1 +Api-Key: a1b2c3d4e5 + +##### POST http://localhost:5000/api/v1/locations Content-Type: application/json Api-Key: a1b2c3d4e5 { "id": 1, - "warehouseId": 1, + "warehouse_id": 1, "code": ".1.0", "name": "Row: A, Rack: 1, Shelf: 0", - "createdAt": "1992-05-15T03:21:32", - "updatedAt": "1992-05-15T03:21:32" + "created_at": "1992-05-15T03:21:32", + "updated_at": "1992-05-15T03:21:32" } -### Get all locations -GET http://localhost:5000/api/v1/locations -Api-Key: a1b2c3d4e5 -####### -GET http://localhost:5000/api/v1/locations/1 -Api-Key: a1b2c3d4e5 -##### +### PUT http://localhost:5000/api/v1/locations/1 Content-Type: application/json Api-Key: a1b2c3d4e5 { "id": 1, - "warehouseId": 1, + "warehouse_id": 1, "code": "SAMI TEST", "name": "Row: A, Rack: 1, Shelf: 1", - "createdAt": "1992-05-15T03:21:32", - "updatedAt": "2024-10-19T10:00:00" + "created_at": "1992-05-15T03:21:32", + "updated_at": "2024-10-19T10:00:00" //volgensmij hoort id automatisch te zijn of niet } + ##### DELETE http://localhost:5000/api/v1/locations/1 Api-Key: a1b2c3d4e5 \ No newline at end of file diff --git a/api/REST/Shipments.REST b/api/REST/Shipments.REST index f5946f0..46f7940 100644 --- a/api/REST/Shipments.REST +++ b/api/REST/Shipments.REST @@ -36,87 +36,87 @@ Api-Key: a1b2c3d4e5 "updated_at": "2000-03-11T13:11:14Z", "items": [ { - "Item_Id": "P007435", + "item_id": "P007435", "amount": 23 }, { - "Item_Id": "P009557", + "item_id": "P009557", "amount": 1 }, { - "Item_Id": "P009553", + "item_id": "P009553", "amount": 50 }, { - "Item_Id": "P010015", + "item_id": "P010015", "amount": 16 }, { - "Item_Id": "P002084", + "item_id": "P002084", "amount": 33 }, { - "Item_Id": "P009663", + "item_id": "P009663", "amount": 18 }, { - "Item_Id": "P010125", + "item_id": "P010125", "amount": 18 }, { - "Item_Id": "P005768", + "item_id": "P005768", "amount": 26 }, { - "Item_Id": "P004051", + "item_id": "P004051", "amount": 1 }, { - "Item_Id": "P005026", + "item_id": "P005026", "amount": 29 }, { - "Item_Id": "P000726", + "item_id": "P000726", "amount": 22 }, { - "Item_Id": "P008107", + "item_id": "P008107", "amount": 47 }, { - "Item_Id": "P001598", + "item_id": "P001598", "amount": 32 }, { - "Item_Id": "P002855", + "item_id": "P002855", "amount": 20 }, { - "Item_Id": "P010404", + "item_id": "P010404", "amount": 30 }, { - "Item_Id": "P010446", + "item_id": "P010446", "amount": 6 }, { - "Item_Id": "P001517", + "item_id": "P001517", "amount": 9 }, { - "Item_Id": "P009265", + "item_id": "P009265", "amount": 2 }, { - "Item_Id": "P001108", + "item_id": "P001108", "amount": 20 }, { - "Item_Id": "P009110", + "item_id": "P009110", "amount": 18 }, { - "Item_Id": "P009686", + "item_id": "P009686", "amount": 13 } ] @@ -149,19 +149,19 @@ Api-Key: a1b2c3d4e5 "updated_at": "2000-03-11T13:11:14Z", "items": [ { - "Item_Id": "P007435", + "item_id": "P007435", "amount": 1 }, { - "Item_Id": "P009557", + "item_id": "P009557", "amount": 2 }, { - "Item_Id": "P009553", + "item_id": "P009553", "amount": 3 }, { - "Item_Id": "P010015", + "item_id": "P010015", "amount": 4 } ] diff --git a/api/REST/Suppliers.REST b/api/REST/Suppliers.REST index 31ff35f..4ba9b9f 100644 --- a/api/REST/Suppliers.REST +++ b/api/REST/Suppliers.REST @@ -16,16 +16,16 @@ Api-Key: a1b2c3d4e5 "code": "SUPP002", "name": "REST REST", "address": "456 Tech Park", - "addressextra": "Suite 101", + "address_extra": "Suite 101", "city": "Los Angeles", - "zipcode": "67890", + "zip_code": "67890", "province": "California", "country": "USA", - "contactname": "Jane Doe", + "contact_name": "Jane Doe", "phonenumber": "098-765-4321", "reference": "REF1234", - "createdat": "2024-10-22T10:00:00", - "updatedat": "2024-10-22T10:00:00" + "created_at": "2024-10-22T10:00:00", + "updated_at": "2024-10-22T10:00:00" } ### @@ -38,16 +38,16 @@ Api-Key: a1b2c3d4e5 "code": "REST TEST UPDATED", "name": "Tech Supplies Updated", "address": "789 New Tech Park", - "addressextra": "Suite 202", + "address_extra": "Suite 202", "city": "Los Angeles", - "zipcode": "54321", + "zip_code": "54321", "province": "California", "country": "USA", - "contactname": "Jane Doe Updated", + "contact_name": "Jane Doe Updated", "phonenumber": "098-765-9999", "reference": "REF5678", - "createdat": "2024-10-22T10:00:00", - "updatedat": "2024-10-22T12:00:00" + "created_at": "2024-10-22T10:00:00", + "updated_at": "2024-10-22T12:00:00" } #### //deze hieronder is om modelstate in controller te testen diff --git a/api/REST/client.REST b/api/REST/client.REST index 040a5a2..d92fa58 100644 --- a/api/REST/client.REST +++ b/api/REST/client.REST @@ -26,25 +26,6 @@ Api-Key: a1b2c3d4e5 "updated_at": "2022-02-09T20:22:35Z" } - - ### Put Update Client based on body given PUT http://localhost:5000/api/v1/clients/1 HTTP/1.1 Content-Type: application/json diff --git a/api/REST/orders.REST b/api/REST/orders.REST index a8e8d67..85cf9da 100644 --- a/api/REST/orders.REST +++ b/api/REST/orders.REST @@ -12,26 +12,26 @@ Api-Key: a1b2c3d4e5 { "id": 1, - "source_Id": 1, - "order_Date": "2024-10-22T10:00:00", - "request_Date": "2024-10-23T10:00:00", + "source_id": 1, + "order_date": "2024-10-22T10:00:00", + "request_date": "2024-10-23T10:00:00", "reference": "ORD1234", - "reference_Extra": "ORD_EXTRA_001", - "order_Status": "Pending", + "reference_extra": "ORD_EXTRA_001", + "order_status": "Pending", "notes": "Please process as soon as possible.", - "shipping_Notes": "Fragile items.", - "picking_Notes": "Pick items in the correct order.", - "warehouse_Id": 1, - "ship_To": 123, - "bill_To": 456, - "shipment_Id": 101, - "total_Amount": 1000.00, - "total_Discount": 50.00, - "total_Tax": 50.00, - "total_Surcharge": 10.00, + "shipping_notes": "Fragile items.", + "picking_notes": "Pick items in the correct order.", + "warehouse_id": 1, + "ship_to": 123, + "bill_to": 456, + "shipment_id": 101, + "total_amount": 1000.00, + "total_discount": 50.00, + "total_tax": 50.00, + "total_surcharge": 10.00, "items": [ { - "Uid": "P000001", + "uid": "P000001", "code": "sjQ23408K", "description": "Face-to-face clear-thinking complexity", "short_description": "Brief description here", @@ -42,8 +42,8 @@ Api-Key: a1b2c3d4e5 "item_group": 73 } ], - "created_At": "2024-10-22T10:00:00", - "updated_At": "2024-10-22T10:00:00" + "created_at": "2024-10-22T10:00:00", + "updated_at": "2024-10-22T10:00:00" } ### @@ -56,27 +56,27 @@ Content-Type: application/json Api-Key: a1b2c3d4e5 { - "id": 1, - "source_Id": 1, - "order_Date": "2024-10-22T10:00:00", - "request_Date": "2024-10-23T10:00:00", + "id": 2, + "source_id": 1, + "order_date": "2024-10-22T10:00:00", + "request_date": "2024-10-23T10:00:00", "reference": "ORD1234", - "reference_Extra": "ORD_EXTRA_001", - "order_Status": "Pending", + "reference_extra": "ORD_EXTRA_001", + "order_status": "Pending", "notes": "Edited. New notes for the order.", - "shipping_Notes": "Fragile items.", - "picking_Notes": "Pick items in the correct order.", - "warehouse_Id": 1, - "ship_To": 123, - "bill_To": 456, - "shipment_Id": 101, - "total_Amount": 1050.00, - "total_Discount": 60.00, - "total_Tax": 55.00, - "total_Surcharge": 12.00, + "shipping_notes": "Fragile items.", + "picking_notes": "Pick items in the correct order.", + "warehouse_id": 1, + "ship_to": 123, + "bill_to": 456, + "shipment_id": 101, + "total_amount": 1050.00, + "total_discount": 60.00, + "total_tax": 55.00, + "total_surcharge": 12.00, "items": [ { - "Uid": "P000001", + "uid": "P000001", "code": "sjQ23408K", "description": "Updated description for the item", "short_description": "Updated brief description", @@ -87,8 +87,8 @@ Api-Key: a1b2c3d4e5 "item_group": 73 } ], - "created_At": "2024-10-22T10:00:00", - "updated_At": "2024-10-22T12:00:00" + "created_at": "2024-10-22T10:00:00", + "updated_at": "2024-10-22T12:00:00" } ### diff --git a/api/REST/transfers.REST b/api/REST/transfers.REST index 9f42624..5b7e533 100644 --- a/api/REST/transfers.REST +++ b/api/REST/transfers.REST @@ -18,23 +18,23 @@ Api-Key: a1b2c3d4e5 { "id": 4, "reference": "TR00001", - "transferfrom": 2323, - "transferto": 9229, - "transferstatus": "Completed", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z", + "transfer_from": 2323, + "transfer_to": 9229, + "transfer_status": "Completed", + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z", "items": [ { - "ItemId": "P007435", - "Amount": 2 + "item_id": "P007435", + "amount": 2 }, { - "ItemId": "TEST2", - "Amount": 2333 + "item_id": "TEST2", + "amount": 2333 }, { - "ItemId": "TEST3", - "Amount": 3242 + "item_id": "TEST3", + "amount": 3242 } ] } @@ -48,15 +48,15 @@ Api-Key: a1b2c3d4e5 { "id": 4, "reference": "TR00001", - "transferfrom": null, - "transferto": 9229, - "transferstatus": "Completed update", - "createdat": "2000-03-11T13:11:14Z", - "updatedat": "2000-03-12T16:11:14Z", + "transfer_from": null, + "transfer_to": 9229, + "transfer_status": "Completed update", + "created_at": "2000-03-11T13:11:14Z", + "updated_at": "2000-03-12T16:11:14Z", "items": [ { - "itemid": "P007435", + "item_id": "P007435", "amount": 55555 } ] diff --git a/api/REST/warehouses.REST b/api/REST/warehouses.REST index 8fcb3cc..d6db1d1 100644 --- a/api/REST/warehouses.REST +++ b/api/REST/warehouses.REST @@ -26,11 +26,11 @@ Api-Key: a1b2c3d4e5 "phone": "FFFFF", "email": "TEST@example.net" }, - "createdat": "1983-04-13T04:59:55", - "updatedat": "2007-02-08T20:11:00" + "created_at": "1983-04-13T04:59:55", + "updated_at": "2007-02-08T20:11:00" } -### Update warehouse based on body given +### Update warehouse based on body given (when missing province) PUT http://localhost:5000/api/v1/Warehouse/1 HTTP/1.1 Content-Type: application/json Api-Key: a1b2c3d4e5 @@ -49,8 +49,8 @@ Api-Key: a1b2c3d4e5 "phone": "-353=3434-34", "email": "Jason@example.net" }, - "createdat": "2000-04-13T04:59:55", - "updatedat": "2007-02-08T20:11:00" + "created_at": "2000-04-13T04:59:55", + "updated_at": "2007-02-08T20:11:00" } ### PUT http://localhost:5000/api/v1/Warehouse/1 HTTP/1.1 @@ -72,8 +72,8 @@ Api-Key: a1b2c3d4e5 "phone": "FFFFF", "email": "TEST@example.net" }, - "createdat": "1983-04-13T04:59:55", - "updatedat": "2007-02-08T20:11:00" + "created_at": "1983-04-13T04:59:55", + "updated_at": "2007-02-08T20:11:00" } ### Delete warehouse by id