ytgov / travel-authorization

0 stars 3 forks source link

PreApproved: Submission not working properly #96

Open dpdavids opened 3 weeks ago

dpdavids commented 3 weeks ago

Relates to:

Context

Is your feature request related to a problem? Please describe. on the request tab. Selected all (2) the requests I wanted to include in my submission. Selected "Submit Selected Travel" and hit save. The submissions got moved over to the submission tab. But only one of the two requests came over.

Describe the solution you'd like I want both selected requests to be included in the submissions.

dpdavids commented 3 weeks ago

image image

image Submission date is wrong I made a submission June 13, 2024 and June 12, 2024 Location should have a comma seperate list of locations of all the request selected image The print button shows that only 1 of the 3 requests were submitted. image only shows 1 of 3 requests submitted

klondikemarlen commented 3 weeks ago

Page load failure identified as user lookup being commented out in https://github.com/ytgov/travel-authorization/pull/41, (specifically 074a3fffc8b480) and was introduced by removing user lookup after route change https://github.com/icefoganalytics/travel-authorization/pull/196 (specifically https://github.com/icefoganalytics/travel-authorization/commit/379c6c9e2853d81659f309bc0546a3133c2be02e)

The code could be replaced by global useCurrentUser composable; which loads user once during sign-in.

klondikemarlen commented 3 weeks ago

Identified further issues do to data modeling mismatch. Introduced in https://github.com/ytgov/travel-authorization/commit/db9194308725e908b79f9587a201d70ab48101c5.

Relationship between preapprovedSubmissions and travel_authorization_pre_approvals is one-to-many not one-to-one.

klondikemarlen commented 3 weeks ago

UI changes referring to .preApproval as singular need to be reverted; one example is https://github.com/icefoganalytics/travel-authorization/commit/dc55491d934aad0bef555f1dde7e11c2d39507d6. Probably other similar issues in https://github.com/icefoganalytics/travel-authorization/pull/179.

klondikemarlen commented 3 weeks ago

Identified issue with submission date being incorrect introduced in https://github.com/ytgov/travel-authorization/commit/98f86b1134b2650a23ec315566955bfc23a21670. Migrating sets default date to date that the migration ran at, rather than CURRENT_TIMESTAMP.

This issue was probably suppressed by someone manually setting submittedDate on submission; although, I can't find where after digging through the git history. Or maybe by us regularly dropping the database in production?