This repository was archived by the owner on Apr 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
extract route names to constants #146
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contributing | ||
|
||
TODO: Move most of the readme into here. | ||
|
||
## Design Principles | ||
|
||
### Route Names and Links | ||
|
||
The route names used in route defintions should be constants in `stapi_fastapi.routers.route_names`. This | ||
makes it easier to populate these links in numerous places, including in apps that use this library. | ||
|
||
The general scheme for route names should follow: | ||
|
||
- `create-{x}` - create a resource `x` | ||
- `create-{x}-for-{y}` - create a resource `x` as a sub-resource or associated resource of `y` | ||
- `get-{x}` - retrieve a resource `x` | ||
- `list-{xs}` - retrieve a list of resources of type `x` | ||
- `list-{xs}-for-{y}` - retrieve a list of subresources of type `x` of a resource `y` | ||
- `set-{x}` - update an existing resource `x` | ||
- `set-{x}-for-{y}` - set a sub-resource `x` of a resource `y`, e.g., `set-status-for-order` |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Root | ||
ROOT = "root" | ||
CONFORMANCE = "conformance" | ||
|
||
# Product | ||
LIST_PRODUCTS = "list-products" | ||
LIST_PRODUCTS = "list-products" | ||
GET_PRODUCT = "get-product" | ||
GET_CONSTRAINTS = "get-constraints" | ||
GET_ORDER_PARAMETERS = "get-order-parameters" | ||
|
||
# Opportunity | ||
LIST_OPPORTUNITY_SEARCH_RECORDS = "list-opportunity-search-records" | ||
GET_OPPORTUNITY_SEARCH_RECORD = "get-opportunity-search-record" | ||
SEARCH_OPPORTUNITIES = "search-opportunities" | ||
GET_OPPORTUNITY_COLLECTION = "get-opportunity-collection" | ||
|
||
# Order | ||
LIST_ORDERS = "list-orders" | ||
GET_ORDER = "get-order" | ||
LIST_ORDER_STATUSES = "list-order-statuses" | ||
CREATE_ORDER = "create-order" |
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.
Uh oh!
There was an error while loading. Please reload this page.