icefoganalytics / travel-authorization

0 stars 0 forks source link

Ytgov: Issue 82: Data Modeling for Admin Tables for Travel Rates #207

Closed klondikemarlen closed 4 months ago

klondikemarlen commented 4 months ago

Relates to:

Context

Is your feature request related to a problem? Please describe. Every year the travel rates for Meals and Incidentals, distance allowance, and private accommodations are updated. Create admin tables that allow system admin to update these. Allow the ability to audit who updated the field and when the update occured.

Describe the solution you'd like Create admin tables in the admin section of the application (access thru top right) for each of the stored amounts. https://yukon.ca/travel-rates

Update the code to hit the newly entered values.

Implementation

Implement back-end for per-diems and travel allowances. Standardize per-diems table. Update bulk generate service to load travel allowances from the database.

Screenshots

image

Testing Instructions

  1. Run the test suite via dev test (or dev test_api)
  2. Boot the app via dev up
  3. Check that the migrations didn't crash via dev logs api in another terminal tab.
  4. Check that the seeds run via dev seed run
  5. Log in to the app at http://localhost:8080
burkkyy commented 4 months ago

Following the test instructions, each passed:

klondikemarlen commented 4 months ago

I'm having an issue while attempting to migrate down: (see screenshot for more info)

{"message":"Failed to migrate: error: drop table \"travel_authorization_pre_approval_profiles\" - cannot drop table travel_authorization_pre_approval_profiles because other objects depend on it"}

2024-07-22_13-38

I'm thinking it a result of Knex batching? Knex batches migrations, and then tries to roll back in batches, instead of one at a time. This means if you spin up the project for the first time, doing dev migrate down would try to roll back every migration instead of just the last one.

I think the solution for you would be to do

dev migrate down 20240722171542_add-travel-allowances-table.ts
dev migrate down 20240722162530_standardize-per-diem-claim-types.ts
dev migrate down 20240719232927_standardize-per-diem-table.ts