DanielRHolland / AADGroupProject

0 stars 0 forks source link

Create REST API Proposal #39

Open DanielRHolland opened 5 years ago

DanielRHolland commented 5 years ago

List WebMethods with Params and returned JSONs.

Create REST API 'Hello World'

DanielRHolland commented 5 years ago

Classes:

ProductInformation:

TransactionEntry:

Transaction:

//TODO: consider differences between User and customer. Should user be called 'LoginDetails', and Customer be Customer (or Customer be User?)

User

Customer:

Warning:

WebMethods:

Format:

Name TYPE params return description/notes

All except Login

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.

Make Transaction

POST productId: String quantity: int transactionId: int

Create Purchase Order

GET dateFrom: Date purchaseOrder: PurchaseOrder Currently unsure of exactly what purchaseOrder will contain.

~Edit Transaction Log~ (replaced with the next three)

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.

Remove Transaction

DELETE transactionId: String Given a transactionId system will delete transaction from log.

~### Edit Transaction~ ~PUT~ ~productId: String~ ~quantity: int~ ~transactionId: int~

Add Product Type

PUT productName: String productId: String productDesc: String quantity: int

Remove Product Type

DELETE productName: String productId: String productDesc: String quantity: int

Edit Product Quantity

PUT productId: String, quantity:int Given productId and new quantity, this will create add new quantity value

Get Transaction Log

GET dateFrom: Date, currentDate: Date List Given two dates will return list of Transaction objects between dates.

Add User

PUT username: String, password: String Given userName and password will add a new user to the system.

Remove User

DELETE userName Given username system will delete corresponding user from system

Edit User 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


Get Customers

GET num: int (default=10), searchTerms: List customers: List Return a maximum of 'num' customers which match the searchTerms (if provided)

DanielRHolland commented 5 years ago

Created example Web Method See: https://github.com/DanielRHolland/AADGroupProject/commit/29fae7246a10f05b09d6cbf229ca164cdbb2e67e

James-Earle98 commented 5 years ago

Create purchase order: Is a GET as does not write data to database.. just gets needed data and outputs to user.

larrett commented 4 years ago

PurchaseOrder class not defined so getPurchaseOrder POJO skipped

James-Earle98 commented 4 years ago

Added all object I thought of working through web methods.

What would user object store? Would we store actual password, or password that has been hashed?

TheRojBlake commented 4 years ago

@DanielRHolland Would you say this issue is now ready to be closed?