bradwarrum / cs307-server Goto Github PK
View Code? Open in Web Editor NEWMobile pantry inventory project for CS 307, server-side repository. Also contains course documents (docs folder)
Mobile pantry inventory project for CS 307, server-side repository. Also contains course documents (docs folder)
Will it cause an error or create it? Overwrite the description? Dumb the old household?
Does creating a UPC link?
also what is the format of units int (enumeration) or string:
same goes for package name
{
"description" : "Planter's Cocktail Peanuts",
"packageName" : 23,
"packageUnits" : 3,
"packageSize" : 12.0
}
{
"description" : "Orange",
"packageName" : "each",
"packageUnits" : "unit",
"packageSize" : 1.0
}
Can we up token times to be pretty long for the demo? The app is iffy on getting a new one currently
If there is already something called apples return that as the UPC to guard against duplicates.
From the comment on #4, the Sprint1Initialization.sql file needs a composite key added to the householdpermissions table
Please post what the value is when completed. 201 seems to make more sense.
sent:
{
"items": [
{
"UPC": "011110799906",
"fractional": 1,
"quantity": 0
}
],
"version": 1428634713911
}
got back:
listJSON:
{
"items": [
{
"UPC": "011110799906",
"description": "ibu",
"packaging": {
"packageName": "bottle",
"unitAbbreviation": "units",
"unitName": "units",
"packageSize": 500.0,
"unitID": 14
},
"fractional": 1,
"quantity": 0
},
{
"UPC": "00001",
"description": "banana",
"packaging": {
"packageName": "bunch",
"unitAbbreviation": "units",
"unitName": "units",
"packageSize": 1.0,
"unitID": 14
},
"fractional": 1,
"quantity": 0
},
{
"UPC": "00002",
"description": "oranges",
"packaging": {
"packageName": "orange",
"unitAbbreviation": "units",
"unitName": "units",
"packageSize": 1.0,
"unitID": 14
},
"fractional": 3,
"quantity": 0
},
{
"UPC": "00006",
"description": "pears",
"packaging": {
"packageName": "pear",
"unitAbbreviation": "units",
"unitName": "units",
"packageSize": 1.0,
"unitID": 14
},
"fractional": 0,
"quantity": 5
}
],
"name": "list1",
"version": 1428634838270
}
#1 changed the UserRegistrationWrapper to use 1 query instead of 2 and simply use the SQLState to detect presence of a user with a specific email. On insertion the auto-increment field increments even if there is an exception, so userIDs are not contiguous.
Is this easily fixable by modifying the SQL query within the registration wrapper?
/cc @rogerse
Registering a user is returning an error code that does not exist in documentation of 405.
it does not return an object
I did a dumb
The server and client need to do:
As a user I would like to be able to create an item entry for a product that
does not have an associated UPC code. (Backlog #5)
Only created work time for the android app. Server will need API adaption to cooperate.
Shopping list API doesn't have fractional returning, Inventory does.
04-29 13:24:21.546 16148-16148/com.example.android.virtualpantry E/View﹕ hasTransientState decremented below 0: unmatched pair of setHasTransientState calls
04-29 13:24:27.405 16148-16191/com.example.android.virtualpantry E/SQLiteLog﹕ (1299) abort at 13 in [INSERT INTO InventoryItems(Fractional,PackageUnits,Description,PackageQuantity,PackageName,UPC,Quantity,HouseholdID) VALUES (?,?,?,?,?,?,?,?)]: NOT NULL constraint failed: InventoryItems.UPC
04-29 13:24:27.411 16148-16191/com.example.android.virtualpantry E/SQLiteDatabase﹕ Error inserting Fractional=0 PackageUnits=14 Description=Banana PackageQuantity=1.0 PackageName=banana UPC=null Quantity=0 HouseholdID=3
android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: InventoryItems.UPC (code 1299)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:790)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:926)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1581)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1451)
at com.example.android.virtualpantry.Database.InventoryDataSource$1.linkStage(InventoryDataSource.java:161)
at com.example.android.virtualpantry.Database.InventoryDataSource$1.requeryStage(InventoryDataSource.java:143)
at com.example.android.virtualpantry.Database.InventoryDataSource$1.pullInventoryStage(InventoryDataSource.java:117)
at com.example.android.virtualpantry.Database.InventoryDataSource$1.doInBackground(InventoryDataSource.java:91)
at com.example.android.virtualpantry.Database.PersistenceTask.doInBackground(PersistenceTask.java:35)
at com.example.android.virtualpantry.Database.PersistenceTask.doInBackground(PersistenceTask.java:18)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
When registering on top of an existing account a 403 error occurs but there is then no object passed back for further debugging.
Does creating a UPC link?
also what is the format of units int (enumeration) or string:
{
"description" : "Planter's Cocktail Peanuts",
"packageName" : 23,
"packageUnits" : 3,
"packageSize" : 12.0
}
{
"description" : "Orange",
"packageName" : "each",
"packageUnits" : "unit",
"packageSize" : 1.0
}
Users do not have access to internal UPC so fully remove it from the database when unlinking
It would be awesome if the get household info request provided the server's current version of the list: this could reduce the number of queries needed when logging back in.
03-06 12:58:31.537 22023-22328/com.example.android.virtualpantry V/linkItem﹕ regstr={
"description": "coke zero",
"unitName": "bottle"
}
03-06 12:58:31.607 22023-22328/com.example.android.virtualpantry E/linkItem﹕ Unkwnon
java.io.FileNotFoundException: http://IP_REDACTED/households/3/items/049000045840/link?token=5uhdVgttv6nMmxNjwAew1jOGtGphi3yh
Attempting to link an item resulting in 400 malformed input
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.