Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Tu 482 #14

wants to merge 3 commits into from

Conversation

aemotyka
Copy link
Contributor

Sensors functionality

Copy link

Sensors Refactor

Copy link
Contributor

@bennetthermanoff bennetthermanoff left a 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: {
Copy link
Contributor

@bennetthermanoff bennetthermanoff Apr 17, 2024

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>;
Copy link
Contributor

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.

Copy link
Contributor

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) => {
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants