Giter Site home page Giter Site logo

ucdavis / harvest Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 1.0 5.53 MB

Harvest Farm Project Tracking Website and Mobile App

License: MIT License

TypeScript 16.44% JavaScript 0.21% HTML 25.77% C# 56.82% Shell 0.04% SCSS 0.71% Batchfile 0.01%
ucdcaes

harvest's Introduction

Harvest

Harvest Farm Project Tracking Website

Node Version CodeQL Build Status

Local Setup

Requires .net 5 SDK from https://dotnet.microsoft.com/download

Requires nodeJS, recommended version 18.x (see badge above)

In the Harvest.Web/ClientApp folder, run npm install --legacy-peer-deps. Technically this step is optional but it's useful to do to get things started.

Run locally

Get the user-secrets file and store it in the correct location

In the Harvest.Web folder, run:

npm start

Development

Make sure to invoke "Prettier" before committing JS changes. If using VSCode consider using the plugin.

If making large JS changes, run npm test inside the Harvest.Web/ClientApp directory and it will automatically re-run affected tests.

harvest's People

Contributors

bryanwong8 avatar cydoval avatar jsylvestre avatar laholstege avatar mxthu313 avatar sprucely avatar srkirkland avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fasteddys

harvest's Issues

KFS Service

Want the ability to lookup/validate KFS accounts, and also find out the account manager of a given account.

Will be used for validation when a professor enters accounts to charge, but also in some cases the account manager will need to approve the use of an account for charges so we'll want to grab their user info, create a user account if needed, and then attach some sort of gated page to that.

Email mjml process

Figure out a good process for turning the mjml files into nice emails. Options:

  1. Use Jason's controller method to manually generate mjml templates from mjml.cshtml files, except I'd rather do it via string concatenation than razorLite compilation. It would allow us to keep our templates type-safe.
  2. Create a simple lib (npm step?) which can generate the proper cshtml files at build/CI time, or at least can be manually ran when files are changed.
  3. Reincarnate John's embedded compilation project

Project history

Create a history service, similar to PEAKS or other apps. Actions again the project should be recorded in the history table, definitely every time the project status changes but also on other changes. ex:

ProjectRequested
Quote created/updated/submitted/approved
Accounts approved
Change requested

Rate values & updating

Proposal:
Rates should never be allowed to change so that we can keep a historical record -- if the value of a rate is updated, we should duplicate the row and then set the old one inactive. This way we will not only have a good history but expenses can be linked with a FK relationship to the rate and it will always be correct.

Validate request create page

Add yup nuget package (just like in CECDSS project) and validate the project is valid in RequestContainer.tsx. For now we'll just wait until the create button has been pressed and then do validation and show any errors in a list right above the create button.

Quote page

When tabbing from the project name it doesn't go to the location next.

Create Request page

Develop the create request form, which is just basic info gathering except for a few things:

  1. We'll want datepickers for the dates
  2. Ability to specify multiple crop types. Can be a multi-create-select like in the mockup (similar to peaks), or just multiple input boxes with an addNew+ button. Ideally we'd like the typing to do a lookup on a list of the most popular crops, which an option to specify your own if you don't find one.
  3. Ability to lookup a PI by email or kerb.

I'm open to doing this page in either React or straight HTML (w/ jquery), dealer's choice.

image

Update range attributes

Decimal fields with the [Range(0.01, 1000000.00)] attribute should instead be [Min(0.01)] since there is no theoretical upper bound, we just want it to be a positive valid currency amount.

Expense entry page

Show the total for the quantity selected.
Also, for the quantity, maybe make the label Quantity (Per Acre) in this example:

image

Acreage Rate for project

The Quote needs to select one of the Rates with an Acreage type.
Then that Rate needs to be linked to the project.

I can use that to determine the account I should use when creating the expense when the invoice is created.

image

Add maps to react

Likely using mapbox and leaflet. Determine what libraries would be needed to allow "drawing" and labeling plots on the map.

Approve quote page

Page which shows if there is an open saved quote for a project that needs to be approved. Should show some quote details (show overall totals by default and then they can expand details if desired). Need to be able to enter account information across potentially multiple accounts before approving. Ignore docusign for now and just assume we'll capture their approval on click. Approving should set the project status and quote status to something approved.

Only the PI can see/approve.

https://www.sketch.com/s/2039549e-040d-41c3-89ca-c2d3d4d344df/a/YG5nZqv

Do we want a db table for emails?

Then a job can send them, check for errors, and mark as sent. It would just have a few fields:
email, subject, body, text body, (maybe projectId), sent date, status.

I don't really see a good way to do digest emails at the moment.

Create Change Request

Broken. Just shows Loading...

there's a scrolling message in output window: "Maximum destructuring depth reached"
It's a serilog message
Some object that is being passed to it is either too large or has a circular reference.

Import the latest datatables

Similar to peaks and most of our other apps, we need to import datatables, including the styles for datatables to look good with bootstrap. We should import those from the correct CDNs and be able to only load them on pages that need them.

CRUD page to enter values for pricing

need pricing information for anything that will go in the quote.

4 rate types: Acreage, Labor, Equipment and Other.
Each row has type, description, rate, and possibly account info (at least add a field for account number for now). Also add general fields like createdOn and createdBy, perhaps if you want to get fancy a "effectiveOn" column if we would like to be able to plan ahead for future rates.

See file in https://trello.com/c/DbKKQ4Ci/4-combined-invoice-and-quote-template-our-form-will-likely-follow-closely for examples and structure (rate data tab).

Job to manage invoices

Job which will run daily and:

1 - create invoices for all active projects on the 1st of the month. Double check to make sure there isn't a recent (<28 days) invoice already created for that project before creating. Should include all expenses for that project which aren't associated with another invoice, plus some proration of acreage fees (method TBD). Use a service to handle making invoices.

2 - finds invoices that haven't been paid and sends them to Sloth to be moved

3 - asks sloth for payment status and updates invoice until it is in the completed state.

Add in jquery + validation

Add jquery and validation into pages that need it. Probably worth just making as a partial import file since many pages will not need it, but any CSHTML pages with a form will. Also CSHTML pages with datatables will also need some version of jquery, and they might as well all use the same one.

For reference, a new MVC project from template uses these libs: https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/lib.

Let's at least load the same versions from CDN, but perhaps at some point we'll want to serve the actual files locally as well for development.

Email Notification Templates

Need some email templates created. For now they can be simple but should convey basic info. Follow the mjml example in the Harvest.Email lib and the homeController. If you have some good thoughts about how to create a shared header/body for the emails that'd be nice too. Payments emails might be a good example if looking for styles

Farm Manager:

  • 1. New request comes in
  • 2. Quote is accepted
  • 3. Quote is rejected
  • 4. Change request is created

Professor:

  • 1. Quote ready for approval

Fix up client testing

Make client testing work again now that we are using react-router and the structure of tests have changed. Should be basically exactly the same as Peaks. Create a new test for the QuoteContainer which loads when you go to /quote/create/:projectId. The test should make sure that when passed a projectId it shows up on the page, ex: Create quote for project: {projectId}

Create approved flag in Projects table

Discussion: How should we handle change requests? I'm thinking the simplest thing is to add a field to the projects table for like ChangeRequest (TXT) where they describe what they want changed, and we also update the status to something like ChangeRequested to indicate the difference. Then when a new change quote is submitted, we go back to PendingQuoteApproval status. The downside is that we want to keep taking expenses the whole time, and the quote might never be approved. So I'm thinking the simplest thing is to add an Approved flag which when true means that it's a valid project that can take expenses. We would still need to determine how to handle proposed accounts though. Perhaps we can do something clever with merging multiple projects (as in, should the change request be a separate project which merges back to the main one once accepted?)

Allow setting of field locations as lat/lng coords

Until we get a fancy map, allow creation of locations as a passed set of lat/lng coordinates. Probably using KML format will be useful to start since it can be exported from google earth pro: [lng],[lat],[elev][space] [lng],[lat],[elev].

Goal is to get the data associated with the quote and then project so we can see the locations drawn on a simple map, and mostly so we get the db structure correct and working with complex geometry.

-121.7362572473126,38.53441977139934,0 -121.7355166365403,38.53441178558781,0 -121.7354814725578,38.53455895851263,0 -121.7362224219185,38.53454446823565,0 -121.7362572473126,38.53441977139934,0

Redirect on success or show error on failure

A few pages just have a popup that says "Success" when they work. Instead we should redirect on success to some page.

  1. ExpenseEntryContainer.tsx (/expense/entry/3) -> When you submit expenses, it should go back to /project
  2. QuoteContainer.tsx (/quote/create/5) -> saving a quote should take you to the details page for that project ex: /Project/Details/5
  3. ApprovalContainer.tsx (/request/approve/5) -> Same as #2
  4. RequestContainer.tsx (/Request/Create) -> same as #2 but this will be slightly trickier because you won't know the project's ID until you save so you'll have to read the POST response.

Service to transfer money via sloth

Need to be able to send arbitrary transactions to sloth, ex $X from accountA to accountB and $Y to accountC to accountD.

We also don't have any backing db structure for tracking charges -- we can do that in a separate issue/sprint but if you have some ideas I'd say just lay something down which will allow us to keep track of all the IDs and links between the two systems.

Email service -- Send emails via SMTP

want to be able to send emails similar to peaks, except for now we don't have to make a job, we'll just assume all emails are sent real-time. Test method should be able to send an email reading the contents from a template cshtml page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.