hackerspace-bootstrap / strichliste Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED - strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste
License: MIT License
DEPRECATED - strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste
License: MIT License
copied from strichliste-web issue
As you can see here http://demo.hackerspace-bootstrap.org/strichliste-web/#/metrics the 2014-10-04 is missing.
Can you provide a normal dataset with valid data (e.g. everything 0) even for the days where no transactions happend?
Implement dept restrictions
Something like that:
dept: {
allow: true,
max: -50
}
see https://github.com/dtrebbien/BigDecimal.js, which provides a safe workaround for floating-point issues in Javascript.
Also, only the values shown in the UI should be allowed in the backend as values for transactions.
TypeError: Cannot call method 'toString' of undefined
at ServerResponse.writeHead (http.js:1180:45)
at ServerResponse._implicitHeader (http.js:1131:8)
at ServerResponse.OutgoingMessage.end (http.js:920:10)
at ServerResponse.send (/home/schinken/strichliste/strichliste/node_modules/express/lib/response.js:189:8)
at /home/schinken/strichliste/strichliste/lib/bootstrap.js:32:17
at Layer.handle_error (/home/schinken/strichliste/strichliste/node_modules/express/lib/router/layer.js:52:5)
at trim_prefix (/home/schinken/strichliste/strichliste/node_modules/express/lib/router/index.js:261:13)
at /home/schinken/strichliste/strichliste/node_modules/express/lib/router/index.js:230:9
at Function.proto.process_params (/home/schinken/strichliste/strichliste/node_modules/express/lib/router/index.js:305:12)
at /home/schinken/strichliste/strichliste/node_modules/express/lib/router/index.js:221:12
Maybe it would be nice to have other database backends and introduce a query builder like squel.js with this step.
The reason is: I think it would be nice that one can use mysql if there's already a running instance, because multiple applications an query the database - not just one using the sqlite database
Make it possible to protect a user by pin/password/callItWhatYouWant
MQTT events for transactions. Make events configurable
mqtt: {
host: 'mqtt.core.bckspc.de',
port: 1883,
topics: {
transactionCreated: 'strichliste/transaction/create',
userCreated: 'strichliste/user/create'
}
}
something like dat.
I'd propose 150€+ and 20€- (14 Club Mate à 1,50€ on credit, should be enough IMO).
Limit a single transaction. these could be the defaults as proposed by else in #21
Proposal:
POST /transfer
{
fromUserId: 123,
toUserId: 42,
value: 32
}
as a result the api will create two transactions, one that charges the 'fromUserId' user, and one that adds the funding to the 'toUserId' user.
The problem lies within this check for boundaries:
https://github.com/hackerspace-bootstrap/strichliste/blob/master/lib/routes/UserIdTransaction.post.js#L40
If I exceeded for some reason one boundary (e.g. due to a config change), one can't make transactions anymore.
Example:
userBalance: -42
boundary: -41
Now I want to pay my debt -> boundaries exceeded
Should be handled in the server.
hackerspace-bootstrap/strichliste-web@088f2ec
As soon as this is implemented, I will remove it from the web frontend
Add lastTransaction to user list. Need it for the frontend
Basically the same statistics as in /metrics but limited to the user
Add possibility to store EAN Codes, Product Names and Price
POST /user/:userId/transaction should also support { eanCode: "....." }
{"message":"value must not be zero"}
Add e-mail address to user table and provide a migrate script which is automatically executed if it's missing for the specific version.
Add e-mail address to api response, too
Rename to strichliste-api, so that we can later create a strichliste package that contains the api and a ready-to-use build of the frontend.
@schinken thoughts on this?
after enabling the mqtt binding, the server does not start anymore (hangs?).
Add limit and offset parameter
We want to implement a script which sends a mail per user with all transactions of the past day. Unfortunately there's no API call to filter the transactions per date, so I'd have to query all transactions and filter the result in the script.
An API call which returns a structure with all users and their transactions of the date specified would be very handy to simplify this. Users with no transactions should be hidden in this result.
Of course the local timezone should be considered.
If you put the api behind a reverse proxy you might want to just listen to localhost
Create a file called CONTRIBUTING.md
describing your rules for contributions.
Please return not just the accound boundaries, but also the transaction boundaries. Needed by strichliste-web for handling custom transactions
Currently I retrieve dates in UTC, which is not a problem but it's weird if you do an transaction at 20:00 and the displayed time is 18:00.
I'm not sure where the solution should be: frontend or backend? I think both. We need a different output date format with time zone to handle it correctly in the frontend
After waiting a while in the custom transaction dialog, the site itself returns to the main page, but the dialog stays. Hitting "Pay purchase" then results in the above error.
@schinken what do you think?
TypeError: Cannot call method 'toString' of undefined
at ServerResponse.writeHead (http.js:1178:45)
at ServerResponse._implicitHeader (http.js:1129:8)
at ServerResponse.OutgoingMessage.end (http.js:918:10)
at ServerResponse.send (/opt/strichliste/node_modules/express/lib/response.js:189:8)
at ServerResponse.json (/opt/strichliste/node_modules/express/lib/response.js:233:15)
at ServerResponse.send (/opt/strichliste/node_modules/express/lib/response.js:132:21)
at errorHandler (/opt/strichliste/lib/result/errorHandler.js:4:10)
at Layer.handle_error (/opt/strichliste/node_modules/express/lib/router/layer.js:52:5)
at trim_prefix (/opt/strichliste/node_modules/express/lib/router/index.js:261:13)
at /opt/strichliste/node_modules/express/lib/router/index.js:230:9
Trying to reproduce. POC coming
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.