Open larrett opened 4 years ago
Luke:
James:
Working branch: backend
Add Staff Member (PUT) username: String, password: String Given userName and password will add a new user to the system
Edit Staff Member Details (PUT) currentUser: User, newUser: User Given a current user will replace details with that of a new user.
Add/Update Transaction (PUT) transaction: Transaction This adds a new transaction to the transaction log if none exists with the id, otherwise updates the existing one. Note: The save method will do this automatically, make sure when you set up the database you set the ID to INCREMENT! IMPORTANT OR WONT WORK
REST Method: /staff/save/ Takes the object of 'Staff' and saves to the MySQL database, this also works for editing staff member as long as the respective staff_id is used, the data will be updated accordingly.
Login (GET) userId:String, hashOfPassword: String apiKey: String
REST Method /staff/getStaffMember/{id} Will return the staff members details related to the respective id, can be used for checking if staff information is correct on login. If this needs changing so it takes the {username} as the param, or something that returns the {id} given the username.
Remove Staff Member (DELETE) userName Given username system will delete corresponding user from system
REST Method Not yet implemented
Make Transaction (POST) productId: String quantity: int transactionId: int
Edit Transaction (PUT) productId: String quantity: int transactionId: int
REST Method /transaction/save Works exactly the same as the Staff for now, quite basic functionality. Should be enough for the front-end to do what they need. Let me know if anything needs changing.
Get Transaction Log (GET) dateFrom: Date, currentDate: Date List Given two dates will return list of Transaction objects between dates.
REST METHOD /transaction/getLog/{dateFrom}/{currentDate} Given two dates will return list of Transaction objects between dates. "dateFrom" and "currentDate" are the UNIX time
Database view:
WebMethods:
Products
View Product Information (GET) productId: String productInformation: ProductInformation Gets the product information for a product, but only returns the information that the user is authorised to view
Check Stock Level (GET) productId: String quantity: int After being given productID returns quantity remaining of this product.
Create Purchase Order (GET) dateFrom: Date purchaseOrder: PurchaseOrder Currently unsure of exactly what purchaseOrder will contain.
Transactions
Make Transaction (POST) productId: String quantity: int transactionId: int
Remove Transaction (DELETE) transactionId: String Given a transactionId system will delete transaction from log.
Edit Transaction (PUT) productId: String quantity: int transactionId: int
Get Transaction Log (GET) dateFrom: Date, currentDate: Date List Given two dates will return list of Transaction objects between dates.
Add/Update Transaction (PUT) transaction: Transaction This adds a new transaction to the transaction log if none exists with the id, otherwise updates the existing one.
Staff Management
Add Staff Member (PUT) username: String, password: String Given userName and password will add a new user to the system.
Remove Staff Member (DELETE) userName Given username system will delete corresponding user from system
Edit Staff Member Details (PUT) currentUser: User, newUser: User Given a current user will replace details with that of a new user.
Login (GET) userId:String, hashOfPassword: String apiKey: String
Might not need:
Get Customers (GET) num: int (default=10), searchTerms: List customers: List Return a maximum of 'num' customers which match the searchTerms (if provided)