-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tu 482 #14
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it. Lets meet today to discuss creation of messages. I have some documentation and code semi done for communication between backend and the gateway that will necessitate some special routes to cook up 👨🍳
For this PR. just take a look at the comments I added (mainly remove the create message and create measurement) and I'll approve after
import { ModelAttributes, DataTypes } from 'sequelize'; | ||
|
||
export const sensorsModel:ModelAttributes = { | ||
id: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id for a sensor is just a 6 bit number. When nodes send a message they will attach what data comes from which sensor id. Will need to not have guid here
}; | ||
|
||
interface CreateSensorBody { | ||
sensor:Partial<Sensor>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are leaving this partial, but which fields are allowed to be omitted? Maybe we type this more explicitly, as well as check in the route if req fields are missing and reply with an error if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also do we want to check for auth? verifying a usertype is what they said earlier?
measurement:Partial<Measurement> | ||
} | ||
|
||
export const createMeasurement: RequestHandler = async (req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should meet to discuss message/measurement creation (its a special topic. Lets omit of any message creation routes for this PR
Sensors functionality