Sign inSign up

inputs/api-dev

By inputs

•Updated almost 4 years ago

Image
0

154

inputs/api-dev repository overview

⁠Tech Spec: Inputs.Ag

⁠Table of Contents

⁠Overview⁠
⁠Approach⁠

⁠Overview

⁠Goals
  • Product vendors can sign up and upload inventory
  • Consultants can sign up and build shopping lists for farms
  • Farms can review lists, confirm details, and pay invoices
⁠Assumptions
  • ACH primary form of payment
  • Should be naive of relationships between vendors, consultants, and farms
  • Should include consultant finding feature
⁠Out of Scope
  • In-house/independent consultant UX distinction
  • Multi-user grouping under single org
  • Literally anything fancy

⁠Approach

⁠Models

* required, ** generated

⁠Consultant Model
FieldTypeValidation
emailAddress*Stringemail
password*String8+ charachters, 1+ number, 1+ capital, 1+ lower
firstName*String
lastName*String
phoneNumberNumber
profileImgUrlStringalphanumeric
createdOn**Date
modifiedOn**Date
farmsFarm⁠[]
⁠Farm Model
FieldTypeValidation
emailAddress*Stringemail
password*String8+ charachters, 1+ number, 1+ capital, 1+ lower
businessName*String
phoneNumberNumber
websiteNumber
invoicesFarmInvoice⁠[]
logoUrlStringalphanumeric
addressesAddress⁠[]
createdOn**Date
modifiedOn**Date
⁠Vendor Model
FieldTypeValidation
emailAddress*Stringemail
password*String8+ charachters, 1+ number, 1+ capital, 1+ lower
businessName*String
phoneNumberNumber
websiteNumber
logoUrlStringalphanumeric
productsProduct⁠[]
invoicesVendorInvoice⁠[]
createdOn**Date
modifiedOn**Date
⁠Product Model
FieldTypeValidation
name*String
description*String
metadataObjectDict<String, String>
vendor*Vendor⁠
price*Number
unit*String
minimum*Number
maximum*Number
createdOn**Date
modifiedOn**Date
⁠FarmInvoice Model
FieldTypeValidation
consultant*Consultant⁠
farm*Farm⁠
vendorInvoicesVendorInvoice⁠[]
notesString
total**Number
billingAddressAddress⁠
shippingAddressAddress⁠
createdOn**Date
modifiedOn**Date
⁠VendorInvoice Model
FieldTypeValidation
orderItemsOrderItem⁠[]
consultant*Consultant⁠
farmInvoice*FarmInvoice⁠
vendor*Vendor⁠
notesString
total**Number
shippedOnDate
deliveredOnDate
createdOn**Date
modifiedOn**Date
⁠OrderItem Model
FieldTypeValidation
product*Product⁠
quantity*Numberproduct.minimum < x > product.maximum
createdOn**Date
modifiedOn**Date
⁠Address Model
FieldTypeValidation
addressLine1 *String
addressLine2String
streetName *String
city *String
state *String
zip *Number
lat **Number
long **Number
createdOn**Date
modifiedOn**Date
⁠API

[] list of item, ... attributes of item

⁠/consultant
methodpathparamsheaderbodyresponse
GET/loction, firstName, lastName-new Consultant⁠Consultant⁠[]
POST/register--new Consultant⁠token
POST/login--consultant.emailAddress, consultant.passwordtoken
PUT/edit-consultant token...Consultant⁠
⁠/farm
methodpathparamsheaderbodyresponse
GET/farmId-new Farm⁠Farm⁠ []
POST/new--new Farm⁠token
PUT/edit-farm token...Farm⁠updated Farm⁠
PUT/newAddress-farm tokennew Address⁠updated Farm⁠
PUT/editAddress-farm tokenaddressId, ...Address⁠updated Farm⁠
⁠/vendor
methodpathparamsheaderbodyresponse
POST/register--new Vendor⁠token
POST/login--vendor.emailAddress, vendor.passwordtoken
PUT/edit-vendor token...Vendor⁠updated Vendor⁠
⁠/product
methodpathparamsheaderbodyresponse
POST/new-vendor tokennew Product⁠saved Product⁠
POST/edit-vendor tokenproductId, ...Product⁠updated Product⁠
⁠/farmInvoice
methodpathparamsheaderbodyresponse
GET/-consultant token OR farm token 0R vendor token-FarmInvoice⁠[]
GET/farmInvoiceId, farmIdconsultant token OR farm token 0R vendor token-FarmInvoice⁠
POST/new-consultant tokennew FarmInvoice⁠saved FarmInvoice⁠
POST/editNotes-consultant tokenfarmInvoiceId, notesupdated FarmInvoice⁠
POST/changeAddress-consultant tokenfarmInvoiceId, addressIdupdated FarmInvoice⁠
POST/pay-farm tokenfarmInvoiceId, paymentTokenupdated FarmInvoice⁠
⁠/vendorInvoice
methodpathparamsheaderbodyresponse
GET/-consultant token OR farm token 0R vendor token-VendorInvoice⁠[]
GET/vendorInvoiceIdconsultant token OR farm token 0R vendor token-VendorInvoice⁠
POST/new-consultant tokennew VendorInvoice⁠saved VendorInvoice⁠
POST/new-consultant tokennew VendorInvoice⁠saved VendorInvoice⁠
POST/addOrderItem-consultant tokennew OrderItem⁠updated VendorInvoice⁠
⁠Testing
  • Mocha, Chai, Chai-http
  • Unit tests written for each user story
  • 100% coverage (Istanbul)

Tag summary

Content type

Image

Digest

sha256:391e19633…

Size

412.7 MB

Last updated

almost 4 years ago

docker pull inputs/api-dev