feat(pallet): add the Pallet API collection - #52
Open
roncodes wants to merge 1 commit into
Open
Conversation
Covers the Fleetbase Pallet consumable API — inventory and warehouse management
— across thirteen resources and sixty requests, in the repo's Local Mode layout
with the legacy single-file placeholder alongside it.
Folders are ordered so a full run builds its own fixtures and tears them down
afterwards. Deletes live in a Cleanup folder at the end rather than closing each
resource folder, because deleting as you go removes the very records the later
folders reference. Fixture SKUs and warehouse codes carry {{$timestamp}}: both
are unique columns, so fixed values let the collection succeed exactly once.
The collection-level afterResponse script asserts 2xx, a JSON body, and no
error payload, plus one Pallet-specific check — that no uuid-bearing key appears
in any response. Public ids are the addressing scheme for this API, so a uuid on
the wire means an internal identifier leaked. That check found a real leak in
the audits endpoint during authoring, fixed in fleetbase/pallet.
Coverage was verified by diffing the collection's requests against the routes
the application actually registers: sixty for sixty, nothing missing in either
direction. The eight PATCH routes are PUT aliases and are documented once, as
the other collections here do.
validate-collections.js asserted an exact count of five collections, which a
sixth necessarily fails.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Postman collection for the Fleetbase Pallet consumable API — inventory and warehouse management — covering thirteen resources across sixty requests.
The Pallet public API is new (
fleetbase/palletPR #4, branchdev-v0.0.2), so there was no prior collection to extend.Related Issue
Closes #
Type of Change
Implementation Notes
Layout. Local Mode tree under
postman/collections/Fleetbase Pallet API, with the legacy single-file placeholder atcollections/apis/pallet-api, matching Ledger and Storefront.A full run builds and tears down its own fixtures. Folders create a product, supplier and warehouse first and capture their public ids, then zones, bins, orders and transfers consume them.
Two things that shape the ordering, both found by running it rather than reasoning about it:
{{$timestamp}}.pallet_productshas aunique(company_uuid, sku)andpallet_warehouses.codeis unique outright, so fixed values let the collection succeed exactly once and fail on every run after.Stock adjustments and transfers address a second, deliberately variant-free product. The API correctly refuses an adjustment on a product that has variants without naming one, so the variant-bearing fixture cannot serve both purposes. Cancel likewise gets its own transfer, since a received transfer cannot be cancelled and one record cannot demonstrate both endings in a linear run.
Baseline assertions run at collection level: 2xx, a JSON body, no
errorpayload, and one Pallet-specific check — that no uuid-bearing key appears in any response. Public ids are this API's addressing scheme, so a uuid on the wire means an internal identifier leaked. That check earned its place immediately: it foundproduct_uuid,variant_uuid,inventory_uuidandwarehouse_uuidinside the audit endpoint'smetasnapshots, which Pallet's own 245-test suite had missed. Fixed upstream before this PR.Every request sends
Accept: application/json, so a 500 returns a readable error rather than a 1.2MB Ignition page.Coverage was verified by diff, not by eye: the collection's requests were compared against the routes the application actually registers — sixty for sixty, nothing missing in either direction. The eight PATCH routes are PUT aliases and are documented once, as the other collections here do.
scripts/validate-collections.jsasserted an exact count of five collections, which a sixth necessarily fails; bumped to six.Validation
Run against a local Fleetbase stack (
http://localhost:8000) with a real organization API credential:Documentation Impact
fleetbase/fleetbase.ioThe Pallet consumable API is documented in that repo's own README (endpoint table, auth, conventions, worked examples), pinned by a test that compares the table against the registered routes in both directions. A corresponding page in
fleetbase/fleetbase.iohas not been written.API Reference Impact
fleetbase/postmanAPI reference notes: this PR is the specification update. It should not merge before
fleetbase/palletPR #4, since every endpoint here is introduced there.Documentation Notes
Worth flagging for whoever picks up the
fleetbase.iopage: four Pallet resources deliberately refuse writes, and the absence reads as an oversight unless stated. Stock levels have no create/update/delete because stock follows from receipts, fulfilments, transfers and adjustments; adjustments cannot be edited or deleted because correcting one means making another; batches and audit entries are read-only because the system writes them. Transfers follow the same principle with transitions instead of a settable status.Risk
Low, and confined to this repo — a new collection plus a count constant.
The one ordering dependency is on
fleetbase/palletPR #4. Merging this first would leave a collection whose endpoints do not exist.Also worth knowing: the API cannot currently put a variant on a stock-transfer line, so a variant-tracked product cannot be transferred. The collection sidesteps it with a variant-free product. That is a Pallet gap, not a collection one, and is being tracked there.
Screenshots / Recordings
Not applicable — no UI changes.