Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pthorpe92/mvscanner
Front End For A Scanner Application
https://github.com/pthorpe92/mvscanner
Last synced: 8 days ago
JSON representation
Front End For A Scanner Application
- Host: GitHub
- URL: https://github.com/pthorpe92/mvscanner
- Owner: PThorpe92
- Created: 2023-11-05T23:32:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-21T22:49:51.000Z (about 1 year ago)
- Last Synced: 2024-10-28T20:45:16.193Z (about 2 months ago)
- Language: Rust
- Size: 243 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MVCF Scanning system API design
## Data/Tables
________________
### Resident:
________________
- __rfid__: == `String` (17 digit num)
- __name__: == `String` (Last, First)
- __doc__: == `String` (982392)
- __room__: == `String` (e.g 10b) 1 number && 'b' | t''
__unit:__ == `int`### `/api/residents`
**GET: Index** `/api/residents`**GET: SHOW** `/api/residents/{rfid}`
**POST: Create** `/api/residents body=full payload`
**PATCH: Update** `/api/residents/{rfid} body={any_updated_fields}`
**DELETE: Delete** `/api/residents/{id}`
**GET: Index** `/api/residents/{id}/timestamps`
Get all timestamps for X resident DEFAULT= TODAY**GET: Show** `/api/residents/{id}/timestamps/{start_date}/{end_date}`
========================================================
## Locations:
#### `/api/locations`- `id`: _int_ e.g. (6)
- `name`: _string_ e.g. (DeltaPod)**GET: Index** (all locations)
**GET: Show** `/api/locations{id}` Get the name of location X
**POST: Create** `/api/locations{body=full_payload}` Add a new location to sign out to
### `/api/locations/{id}/timestamps`
**GET: Show** Get all timestamps for X location DEFAULT= TODAY
### `/api/locations/{id}/timestamps/{start_date}/{end_date}`
**GET: Show** Get all timestamps for X location within date range
## Timestamps
### `/api/timestamps`
- __rfid__: `string`
- __dest__: `string`**GET: Index** `/api/timestamps` Get timestamps for that day (default)
**GET: Show** `/api/timestamps`
**POST: Create** `/api/timestamps/{body=timestamp}`
TIMESTAMP (Sent by front-end)
```json
[
{
"rfid": "12345678901234567",
"location": 8
}
]
```
RETURNS: (from back-end)
```json
{
"rfid": "12345678901234567",
"location": 0,
"timestamp": "2019-10-10 10:10:10"
}
```
### IF two timestamps are received at the same location, the location returned will be 0: "AWAY" and that can be checked for on the front-end, and you can send another timestamp after prompting the user**GET Show** `/api/timestamps/{start_date}/{end_date}`