Compare commits

...

213 Commits

Author SHA1 Message Date
dcfa56bdb9 fix(notify): fixed to plantto plant that would cause multiple emails to be sent and never update 2026-03-11 15:30:53 -05:00
ea92422bb1 feat(notification): plant to plant edi 2026-03-10 08:18:29 -05:00
2111a5fdc9 refactor(sql): changes to improve the job disable 2026-02-18 08:53:19 -06:00
6edd20585f refactor(stats): added in mastermacro version 2026-02-18 08:52:29 -06:00
a9759795c4 fix(scripts): changed the fake scanning to be more readable 2026-02-16 19:15:32 -06:00
32f26a1725 fix(quality): hoping to finally find the bud that kills me everynight 2026-02-16 19:05:41 -06:00
60533beed5 feat(sql): job disabling scripts 2026-02-16 19:05:08 -06:00
24ced97b6d feat(notification): added cycle count check 2026-02-16 19:04:38 -06:00
dc1d342799 fix(scanner): if host or port not sent over stop the connection right away 2026-02-16 19:04:04 -06:00
44d0cb63cf refactor(sql): moved new queries to there own folder to make it more easy to work and migrate 2026-02-16 19:01:23 -06:00
ace73fa919 refactor(sendmail): updated the smtp per alpla needs 2026-02-16 18:59:12 -06:00
316af4233f refactor(stats): added sheet version check in 2026-02-16 18:58:17 -06:00
36a805c652 refactor(scripts): create finance bol 2026-02-16 09:40:19 -06:00
460bc3d24a feat(query selector): queryselector from file based vs cp to ts filesz 2026-02-16 09:40:00 -06:00
ec201fcfb5 refactor(sql): full changes to localhost if on produciton server 2026-02-16 09:39:35 -06:00
914ad46c43 refactor(sql server): changes to look at localhost if in production 2026-02-16 09:38:55 -06:00
b96c546ed3 refactor(notify): changed to only allow max 100 errors in the email 2026-02-16 09:38:31 -06:00
29b3be41a1 build(notification): fixed fifo index ts errors 2026-02-16 09:38:10 -06:00
16edf58025 refactor(eom): changes to hist inv 2026-02-16 09:37:40 -06:00
775627f215 feat(scanner): tcp scanner connection based on env var no more db stuff 2026-02-16 09:37:14 -06:00
4e70fae69b refactor(api docs): added/changed docs 2026-02-16 09:36:44 -06:00
24dd109a21 fix(commandlog): changes to the log table 2026-02-13 16:08:23 -06:00
38b57a00cc refactor(datamart): article changes to add pet-g 2026-02-13 16:03:26 -06:00
f8070db95f fix(sqlserver): changed to proper pool connection 2026-02-13 16:02:43 -06:00
10e9dc430c fix(notification): limited to 1000 max errors 2026-02-13 15:59:38 -06:00
6b669ccd9c fix(labelinfo): corrected the query on label info for external 2026-02-13 14:51:15 -06:00
d9a10d98a1 refactor(sendmail): change the send mail function from noreply to donotreply 2026-02-13 14:50:44 -06:00
e64dc7c013 refactor(ocp): removed zechetti 2 from this silly thing for now 2026-02-13 14:50:07 -06:00
d63138d746 helper scripts 2026-02-03 15:40:51 -06:00
84a28f2d01 added relocate 2026-02-03 15:40:41 -06:00
9be6614972 fix(ocp): more material check work 2026-01-19 07:50:27 -06:00
9d0db71f6a fix(datamart): psiPlanning was looking at thertical but a rare case this would look at last years da
and be missed and not pull correct data, switched to plan end
2026-01-15 13:28:18 -06:00
3cc55436f3 refactor(psi): old planning numbers to revert back to maybe 2026-01-08 20:11:40 -06:00
124fde07e0 refactor(psi): planning numbers refactored to deal with a bad downsync that caused negative numbers 2026-01-08 20:08:31 -06:00
b15d0d7322 refactor(datamart): delivery by date range updates 2026-01-08 20:08:03 -06:00
0680f332fb refactor(manual print): added new option for mulitple tags on pallet 2026-01-08 20:07:28 -06:00
46bf310dce refactor(datamart): changed the getDelbyDateRange to the new 2.0 way 2026-01-05 15:17:15 -06:00
0dda6ae744 fix(notifications): fixed a type in the alert being sent out only showing 1 alert instead of many 2026-01-05 10:27:09 -06:00
1b59cdd3a4 fix(psi): correcrtions to account for the tiem offset in the psi 2026-01-02 11:07:45 -06:00
56934216f7 fix(sql): fix connection issues in the sql connection loosing it 2025-12-31 07:54:26 -06:00
e8a2ef8b85 refactor(ocp): plc reading changes to disconnect and reconnect
it was found that there were some errors that spammed the log and caused the server to actually stop
responding and crash weirdly so added a disconnect and reconnect back. so we can figure out whats
going on.
2025-12-30 10:55:28 -06:00
6cbffa4ac5 feat(notification): error monitoring
if there are more than 10 errors in a 15min window sends email to alert someone
2025-12-30 10:54:09 -06:00
09f16f4e62 refactor(datamart): added in 2 new queroes 2025-12-30 08:43:03 -06:00
461acb2b16 fix(datamart): removed limitation on inhousedelivery 2025-12-30 07:21:40 -06:00
0d05c66a2b fix(quality): changes to the logging to reduce un nessasary logging 2025-12-30 07:13:20 -06:00
096cc18477 refactor(datamart): psi work 2025-12-30 07:12:38 -06:00
f3333ce020 fix(dm): abbott truck time corrections 2025-12-18 08:47:12 -06:00
8e3d2b3d95 fix(dm): new scj custom mapping added for westbend 2025-12-12 10:53:33 -06:00
501709546d feat(dm): abbott trucklist will do orders and forecast now 2025-12-11 15:56:34 -06:00
2b5e77993b test(dm): starts on abbot forecast to be brought over from the original truck list 2025-12-11 14:43:50 -06:00
6efaffbb17 fix(printers): add null case for the printerID 2025-12-11 14:43:22 -06:00
90ddbca2e7 fix(rfid): changes to log all reads and also replace some trailing text from a hex 2025-12-11 14:42:51 -06:00
7a9ea16f48 fix(dm): energizer forecast to correct the date and qty push over 2025-12-11 14:42:22 -06:00
420826de9b fix(frontend): transfer lots style adjustment 2025-12-11 14:41:48 -06:00
dc2d3718fa fix(dm): energizer orders missing remark 2025-12-11 14:41:22 -06:00
5013228384 feat(inhouse): delivery by pallet and lot added 2025-12-08 13:16:23 -06:00
4459742cf0 feat(datamart): inhouse delivery added 2025-12-08 13:15:59 -06:00
070c3ee975 fix(mainmaterial): added missing return 2025-12-08 13:15:37 -06:00
8ac92888ad test(mobile): keyence added 2025-12-08 08:37:25 -06:00
567579ef35 fix(transfers): corrected to be a int vs float 2025-12-08 08:37:07 -06:00
8d90f27514 fix(rfid): corrected the link to reset 2025-12-08 08:36:47 -06:00
722b23a321 fix(rfid): changed the tag reading to have a little more flexable 2025-12-08 08:36:25 -06:00
ba48c5307f style(transfer to next lot): spelling issue 2025-12-08 08:35:22 -06:00
30d2ec0477 fix(materials): if no machine stop the check and fail so it manual needs tried again 2025-12-08 08:34:52 -06:00
d3c6444491 chore(release): 1.9.0 2025-12-02 18:30:54 -06:00
12345c0b64 fix(commands): corrections to allow external labels to be consumed and transfered 2025-12-02 18:29:30 -06:00
6833dfc992 refactor(quality): added a check to monior #7 as well 2025-12-02 15:25:05 -06:00
ac27a286c0 fix(lot transfer): changes to make it so the reprint and return do not happen instantly 2025-12-02 15:24:10 -06:00
a3dba6cc9d refactor(helpercommands): removed the remove as reusabele 2025-12-02 15:22:02 -06:00
320dd47aea refactor(sql): some changes to help with sql connection on random disconnect 2025-12-02 15:21:34 -06:00
712a6eebdf fix(lstv2): added in a close function to stop crashing the server 2025-11-30 10:31:27 -06:00
f226c5644c fix(dm): type in customer article number 2025-11-30 10:30:54 -06:00
d605225e48 refactor(swagger): corrected the name displaced 2025-11-26 08:53:05 -06:00
8e7f1eb098 feat(datamart): active article moved over to the new version 2025-11-26 08:52:28 -06:00
59c6fd0117 fix(labeling): added in a catch to avoid rouge lots 2025-11-26 08:29:33 -06:00
2607fd3026 feat(swagger): added in the start of swagger where all the common and useable endpoints will be 2025-11-25 17:02:20 -06:00
bdb4bfc53d chore(module updates): just updated all the modules 2025-11-25 16:12:12 -06:00
c1816c07ff refactor(contorller): only install npm production modules dont install everything 2025-11-25 16:11:41 -06:00
7311372ba8 feat(dm): added article description into the historical data 2025-11-25 14:58:47 -06:00
cd53460bec chore(release): 1.8.0 2025-11-25 14:36:45 -06:00
7e15e5d7bc feat(settings): final migration of settings and edits added 2025-11-25 14:36:06 -06:00
3193e07e47 fix(prodendpoint): if we have a real error just report it dont actually crash 2025-11-24 15:22:47 -06:00
40bc19aa6f feat(migration): settings migration from old app all is now in the new app 2025-11-24 15:22:12 -06:00
90920e8fba refactor(app): refactored how we have the pkg.json so we can reduce on size of the app 2025-11-24 15:21:17 -06:00
f8cf0851a8 test(ti intergration): added the place holder for intergration of comments for customer 2025-11-24 15:20:43 -06:00
efdab5bafc test(controller): added in server port that might night be needed but oh well 2025-11-24 15:19:38 -06:00
700346d809 refactor(ocp): work around for zechetti 2 until we can monitor more closing
currently when 2 pallets from the same line come over at the same time the second one dose not print
when running off lst.
2025-11-23 10:55:32 -06:00
a96b85bc53 feat(dm): new endpoint to get the forecast data 2025-11-21 15:37:22 -06:00
b23bb0db31 feat(form stuff): added in a searchable dropdown and added to new forklifts 2025-11-20 20:21:43 -06:00
8c0f67ca35 refactor(forklifts): more refactoring to improve during production 2025-11-20 19:47:52 -06:00
7b6c9bdfbf feat(forklifts): added the ability to add new forklifts in 2025-11-20 17:51:06 -06:00
7b28f4e9ef refactor(quality): more changes to the system to perfect it 2025-11-20 15:08:29 -06:00
a30eebf5d3 test(materials per day): work on getting this running better 2025-11-19 18:42:58 -06:00
9aa0b31278 fix(silo adjustments): added supervisor to see the actual page so it matches the sidbard 2025-11-19 18:42:37 -06:00
33cbb17a0e refactor(cards): trying to make the cards fit the odd shaped screens better 2025-11-19 18:42:13 -06:00
242ff6277a refactor(quality): added some new options plus cancel button 2025-11-19 18:41:44 -06:00
566754bf2e feat(quality): added in comments 2025-11-17 18:01:24 -06:00
50b7c9cac5 fix(label ratio): correction to the endpoint 2025-11-17 18:01:05 -06:00
b0ac326752 feat(scroll view): added in a scroll view to for quality so it dose not go over the end of the page 2025-11-17 17:21:53 -06:00
9572b71592 feat(quality): added location moved to to the table 2025-11-17 17:07:41 -06:00
96c3e4c24a fix(quality): request was missing the forced selection 2025-11-17 17:07:23 -06:00
aba1668d2c fix(register): added the ability to put in _ for user name 2025-11-17 17:00:26 -06:00
20fc286069 test(mobile): stallion intergration starts 2025-11-16 20:21:08 -06:00
75c0659658 test(mobile): more testing on ota 2025-11-16 20:11:34 -06:00
564f0b5add feat(materials per day): more work on materials per day 2025-11-15 16:22:52 -06:00
7b630d5c0b test(android app): this is the start to the android app 2025-11-15 16:22:19 -06:00
eb6b9ce388 fix(quality): corrected url and perms for quality link 2025-11-14 11:50:28 -06:00
c777395b03 feat(quality): priority ranking added 2025-11-14 11:49:57 -06:00
c509c7fe28 feat(notify): material per day for the next 90 days 2025-11-12 20:22:53 -06:00
6f632ecd68 fix(quality request): bug fixes
lots of bug fixes plug 2 new counters, quality inspect time and warehouse return time
2025-11-12 20:22:21 -06:00
fef0303cd6 fix(dm): fixes to validate auth before submiting incase someone stays on the page to long 2025-11-12 20:21:14 -06:00
314ab049bb test(mobile): testing for ota updated on android scanner 2025-11-12 20:20:44 -06:00
5277ddfc51 ci(settings): changes to vs code as it was being way to slow 2025-11-12 20:20:08 -06:00
b6030de4f4 feat(mobile): ota updates added 2025-11-10 20:19:19 -06:00
1084cede04 refactor(inv with rn): now includes batch number for tetra 2025-11-10 17:22:48 -06:00
ca866bf8c6 fix(uom): correction to how we do the uom check so we dont just look for the space 2025-11-10 15:14:56 -06:00
9d793d2205 fix(historical date): added so we can have all dates 2025-11-10 15:14:19 -06:00
247010d48f fix(plc zeccetti): changes to improve the timing on the zecetti more to be done 2025-11-07 10:08:56 -06:00
7c40f028c8 fix(historical inv): corrected the way the date can come over to allow for yyyy-mm-dd or with /
the date was coming over in utc format somnetimes and others times local.

close #1 correction to the date formats
2025-11-07 10:08:12 -06:00
65304f61ce feat(invoice form): added new invoice form 2025-11-05 21:58:28 -06:00
6ce4d84fd0 refactor(leases): removed main server until i have a better way to sync them 2025-11-04 22:12:41 -06:00
2e05f6eeee feat(invoices): added invoice + linking to forklift 2025-11-04 22:12:08 -06:00
577584ef4d feat(forklifts): added the crud 2025-11-04 22:11:16 -06:00
360c0163f1 fix(preprint): added the correct to string for the preprint stuff 2025-11-04 20:16:59 -06:00
bd7bea8db6 feat(leases): added in leases and move table to reuseable component 2025-11-04 20:16:14 -06:00
b1c56ee4bb fix(correction): the name needed to be correct to have a proper tempalte 2025-11-04 11:27:22 -06:00
79f4121311 feat(templates): added bug repot template 2025-11-04 11:22:49 -06:00
d17edb1f9c feat(missing inv): adding a way to check for missing data in case it dose pull on the correct days 2025-11-03 18:01:58 -06:00
8fca201e04 fix(nav): added missing add card button 2025-11-03 18:01:15 -06:00
b4064e8769 feat(barcode gen): added the missing link 2025-11-03 18:00:50 -06:00
8996da7eb4 fix(file name wrong): fixed the name of the file for getCompanies 2025-11-02 16:27:08 -06:00
5023d4d129 refactor(types): moved the item type to the sidebar to keep it more clean 2025-11-02 16:24:37 -06:00
0b0298423e feat(db manual fixes): added a way to fix manual db changes as needed 2025-11-02 16:24:12 -06:00
a7bde5e4eb fix(servers): changed the server name to be unique 2025-11-02 16:17:46 -06:00
50cde2d8d2 feat(forklifts): added backend forklift stuff and frontend companies 2025-11-02 16:16:35 -06:00
a6cc17ccb1 fix(historicalinv): removed the second running one that caused duplicates 2025-11-01 06:54:28 -05:00
ebe5c0bd5a fix(forecast table): correction to the customer article number 2025-11-01 00:09:06 -05:00
b8a9aa5132 refactor(wrapper): removed the logs so its not spamming the server 2025-11-01 00:08:42 -05:00
52089ecdf0 chore(misc): api doc dates and db changes 2025-11-01 00:08:21 -05:00
d406a92f3d refactor(ocp page): using the name of the url now vs the settings 2025-11-01 00:07:48 -05:00
2a6eafa19a feat(articles): moved articles over to the main server 2025-11-01 00:06:54 -05:00
00ef72de90 feat(servers): added a link to the server by clicking on the name and the gp code 2025-11-01 00:06:27 -05:00
9d9ca63d7c feat(added in swagger): added the base for swagger to implement fully later 2025-11-01 00:05:56 -05:00
f9cfada840 feat(listeners): added in a new feature to auto add new listeners 2025-11-01 00:05:25 -05:00
c2ae445ea4 feat(forecast data): added in a historical forecast data set 2025-11-01 00:05:01 -05:00
2ed6bf4d1f feat(settings): added in dyco printing settings 2025-11-01 00:04:21 -05:00
6d27a7aa63 refactor(base modules): removed the log spam 2025-11-01 00:04:04 -05:00
92af7262f6 fix(ocp): made corrections to the ocp page in dayton 2025-10-31 13:42:35 -05:00
2133b94a1d refactor(all server stats): added a 5 second time out if it dose not reach it just stops 2025-10-31 09:46:27 -05:00
a7a9aa2874 fix(dm): correction to passing the username over for the importing of the file 2025-10-31 09:41:08 -05:00
1283a63b5f fix(comments): added new role to put comments in 2025-10-31 07:15:09 -05:00
25a958d592 fix(silo commits): added in email that was now missing due to new authj 2025-10-31 07:14:49 -05:00
e1e659f9b1 refactor(serverlist): refactored to also show uptime and other info about the server 2025-10-31 07:14:11 -05:00
d60c08a281 feat(start of server): added the start of server data 2025-10-30 14:21:00 -05:00
d3e8e94110 fix(manual print): fixed so the print disables 2025-10-30 14:20:30 -05:00
2a83f92850 chore(release): 1.7.0 2025-10-30 10:43:06 -05:00
dd6c2971f8 refactor(datamart): added in av and alias to the query 2025-10-30 10:24:58 -05:00
a19b03b8bf refactor(lottransfer): formatting changes 2025-10-30 10:24:22 -05:00
c552b9eb1c feat(modules): modules added to frontend 2025-10-30 10:24:04 -05:00
99b2d762d6 refactor(modules): moved modules to app to control everything based on there active setting 2025-10-29 21:57:11 -05:00
6493e0398a ci(ts query): added in the debugger for this 2025-10-29 21:56:30 -05:00
be6510f912 refactor(invhist): reformated file 2025-10-29 17:01:33 -05:00
006ec1bfc0 feat(user migration): user migration to the new app with a default password that will force reset 2025-10-29 17:01:03 -05:00
c6f766089b fix(silo adjustment): change the module to name for checking access 2025-10-29 08:47:29 -05:00
6c27fa10a6 fix(sidebar): changed from module to name to have tighter control 2025-10-29 08:46:56 -05:00
8198c7a478 fix(dm): corrected the permissions needed to view this page 2025-10-29 08:46:20 -05:00
45dda3c40a refactor(logins): added a proper redirect to the last place you were 2025-10-29 08:45:58 -05:00
56d21fec84 fix(login): redirect back to profile is ignored so it will not cause confusion 2025-10-29 08:45:06 -05:00
721813dc29 feat(dashboard): added notification on use of old version 2025-10-28 22:21:01 -05:00
0ddf67d815 feat(user stuff): added in all the user stuff 2025-10-28 21:06:37 -05:00
147d189a81 refactor(materials): added in if staged just pass the check 2025-10-28 19:40:29 -05:00
e9ff8bb4cb fix(siloadjustmnets): corrected the silo adjustments to account for removed middleware 2025-10-28 19:39:08 -05:00
78a5a4a398 docs(api): more old version stuff 2025-10-28 07:42:46 -05:00
66ae443fb8 refactor(printers): allowed for more logging to come over 2025-10-28 07:42:19 -05:00
8f22165951 refactor(v1 middle ware): removed the need for this and just let it all pass 2025-10-28 07:41:34 -05:00
cc3657f66f fix(proxy): changes to allow multiple onsite instances 2025-10-28 07:40:55 -05:00
6392441f1b fix(export inv): added the button to exprot data 2025-10-27 07:18:46 -05:00
5eac14062f chore(release): 1.6.0 2025-10-26 11:49:05 -05:00
e620397938 fix(dmbuttons): missed the uncomment here 2025-10-26 11:48:36 -05:00
ac9670d553 feat(migration): dm moved 2025-10-26 11:47:12 -05:00
6a84da4117 fix(barcodes): moved to correct folder 2025-10-26 11:37:46 -05:00
fd9d774772 feat(migration): moved barcode generator 2025-10-26 11:35:54 -05:00
39c31aa1ec feat(migration): moved helper commands 2025-10-26 11:32:29 -05:00
1da7b145a9 feat(migration): moved material helper over 2025-10-26 10:47:07 -05:00
f078cd6ceb fix(ocme): corrected the urls for ocme 2025-10-26 10:39:30 -05:00
f90a975a50 feat(migration): moved rfid page 2025-10-26 10:39:10 -05:00
4ca20a085e feat(migration): moved ocp, ocme, wrapper stuff 2025-10-26 10:35:06 -05:00
0fe0a8f56a feat(migration): moved changed log and properly added in the link to it 2025-10-26 10:01:06 -05:00
2206a4d4ba feat(migration): dashboard migrated over 2025-10-26 09:47:47 -05:00
70a2ff5e84 fix(old app): correction for dev redirect if on localhost to be proper now 2025-10-26 09:37:37 -05:00
0fd777ccbd refactor(frontend): tempt to stop the popup when redrected or coming to the page with no auth 2025-10-26 09:37:08 -05:00
425f8f5f71 feat(frontend): migrated old > new silo adjustments
moved the apps around so we can use 1 url for cors bs
2025-10-25 17:22:51 -05:00
d46ef922f3 fix(silos): added only active machines, and ordered by location in asending 2025-10-22 07:15:25 -05:00
414a21a287 fix(loginform): bug where the reset errror was not properly coming over 2025-10-21 21:24:46 -05:00
eae9436f6d fix(loginform): error with password reset 2025-10-21 20:29:08 -05:00
e99c409cad refactor(front end): login fixes to account for the forced password change 2025-10-21 20:27:00 -05:00
43abbd53f4 fix(printers): missing logs for errors 2025-10-21 20:25:58 -05:00
17e13d4604 refactor(login): added in a check for lastlogin and force reset password
this also includes passowrd for non alpla users will deal with them later
2025-10-21 20:24:55 -05:00
eb3fa4dd52 refactor(old app): login migration to new app 2025-10-21 20:22:21 -05:00
a2a8e0ef9f docs(bruno): preprint in app added 2025-10-20 06:49:09 -05:00
358c41deb4 fix(controller): fix for updating iowa2 server 2025-10-20 06:48:29 -05:00
af079b8306 feat(labels): added listener for old app to push all labels to the new app 2025-10-17 11:18:31 -05:00
0d1f96333b fix(controller): changed to actaully update both main and old app 2025-10-17 11:17:14 -05:00
953af5e0fe feat(labeling): added printers and machine and other data for preprinting 2025-10-17 07:44:39 -05:00
c59b6a1ec2 refactor(printdelay): added in a change to allow override the actualy time 2025-10-17 06:23:51 -05:00
b102112228 fix(misc): changes to several files for formatting 2025-10-16 14:38:17 -05:00
282eab01e1 feat(preprint): added in preprint function to help with operations planning constraints 2025-10-16 14:37:51 -05:00
1d79195d89 feat(v1 logger): added in a logger to monitor the old app 2025-10-16 14:37:00 -05:00
b9b0cd5c70 refactor(stats): added in ram useage to the stats 2025-10-16 14:36:34 -05:00
a09ad8773c feat(settings): added in settings 2025-10-16 14:36:12 -05:00
f264c98fbf ci(app): config changes to bruno and incoming sqls 2025-10-16 14:34:58 -05:00
38edc6214b refactor(plc connection zechetti): added in more logging due to a weird issue with line 7 not sendin 2025-10-15 21:17:08 -05:00
2142c06ac3 feat(admin): users and roles added to the frontend to manage easier 2025-10-15 21:16:14 -05:00
743 changed files with 149341 additions and 36211 deletions

View File

@@ -12,6 +12,9 @@ LOG_LEVEL=debug
# alpaprod tec apiKey
TEC_API_KEY=api key
# v1 listener
DATABASE_URL_V1=postgresql://ausername:password@localhost:5433/lst_db
# postgres connection
DATABASE_HOST=localhost
DATABASE_PORT=5432

33
.gitea/ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,33 @@
---
name: Bug Report
about: Report a bug to help us improve.
title: "[BUG] "
labels: ["bug", "needs-triage"]
---
### Describe the bug
A clear and concise description of what the bug is.
### Steps to reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
### Expected behavior
A clear and concise description of what you expected to happen.
### Screenshots
If applicable, add screenshots to help explain your problem.
### Gitea Version
e.g., 1.25.0
### Additional context
Add any other context about the problem here.

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@ controllerBuilds
# ignoring the old app that will be built into this one to make deploying faster and more easy as we do the migration
lstV2/frontend/.tanstack
keys
# Logs
logs
*.log

View File

@@ -1,5 +1,6 @@
dist
frontend/dist
mobileLst/dist
lstDocs/build
migrations
Dockerfile

View File

@@ -1,48 +0,0 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"workbench.colorTheme": "Default Dark+",
"prettier.tabWidth": 4,
"terminal.integrated.env.windows": {},
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"[graphql]": {
"editor.formatOnSave": true
},
"[handlebars]": {
"editor.formatOnSave": true
},
"[go]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "golang.go"
},
"[powershell]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.powershell" // requires PowerShell extension
},
"[bat]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "foxundermoon.shell-format" // supports .sh, .bat, .cmd
},
"[cmd]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "foxundermoon.shell-format"
},
// Optional: Configure goimports instead of gofmt
"go.formatTool": "goimports",
"cSpell.words": ["alpla", "alplamart", "alplaprod", "ppoo"]
}

71
.vscode/settings.json vendored
View File

@@ -1,9 +1,66 @@
{
"editor.defaultFormatter": "biomejs.biome",
"workbench.colorTheme": "Default Dark+",
"terminal.integrated.env.windows": {},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit" },
"cSpell.words": ["alpla", "alplamart", "alplaprod", "ppoo"]
"editor.defaultFormatter": "biomejs.biome",
"workbench.colorTheme": "Default Dark+",
"terminal.integrated.env.windows": {},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"[graphql]": {
"editor.formatOnSave": true
},
"[handlebars]": {
"editor.formatOnSave": true
},
"[go]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "golang.go"
},
"[powershell]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.powershell" // requires PowerShell extension
},
"[bat]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "foxundermoon.shell-format" // supports .sh, .bat, .cmd
},
"[cmd]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "foxundermoon.shell-format"
},
// Optional: Configure goimports instead of gofmt
"go.formatTool": "goimports",
"cSpell.words": [
"acitve",
"actaully",
"alpla",
"alplamart",
"alplaprod",
"autoconsume",
"intiallally",
"ppoo",
"prodlabels",
"rfid"
],
"gitea.token": "8456def90e1c651a761a8711763d6ef225d6b2db",
"gitea.instanceURL": "https://git.tuffraid.net",
"gitea.owner": "cowch",
"gitea.repo": "lst"
}

View File

@@ -1,5 +1,253 @@
# All Changes to LST can be found below.
## [1.9.0](https://git.tuffraid.net/cowch/lst/compare/v1.8.0...v1.9.0) (2025-12-03)
### 📝 Chore
* **module updates:** just updated all the modules ([bdb4bfc](https://git.tuffraid.net/cowch/lst/commits/bdb4bfc53d24f37f0e7098ea828cf418d58d5224))
### 🌟 Enhancements
* **datamart:** active article moved over to the new version ([8e7f1eb](https://git.tuffraid.net/cowch/lst/commits/8e7f1eb09811fcf3ea49b95b0ba9a8f55b9c4184))
* **dm:** added article description into the historical data ([7311372](https://git.tuffraid.net/cowch/lst/commits/7311372ba8eb901b51972ca216152bcfc2b009af))
* **swagger:** added in the start of swagger where all the common and useable endpoints will be ([2607fd3](https://git.tuffraid.net/cowch/lst/commits/2607fd3026ed0b5777a5598aa3498ffc67baa012))
### 🛠️ Code Refactor
* **contorller:** only install npm production modules dont install everything ([c1816c0](https://git.tuffraid.net/cowch/lst/commits/c1816c07ff5ac939b0997d314a9da624a4a66b7a))
* **helpercommands:** removed the remove as reusabele ([a3dba6c](https://git.tuffraid.net/cowch/lst/commits/a3dba6cc9db147ff4765fef648867e50878a6ac8))
* **quality:** added a check to monior [#7](https://git.tuffraid.net/cowch/lst/issues/7) as well ([6833dfc](https://git.tuffraid.net/cowch/lst/commits/6833dfc9929741203083b01726b83a6c8d61d308))
* **sql:** some changes to help with sql connection on random disconnect ([320dd47](https://git.tuffraid.net/cowch/lst/commits/320dd47aea017b4ff219b07e363ef87ec8523b82))
* **swagger:** corrected the name displaced ([d605225](https://git.tuffraid.net/cowch/lst/commits/d605225e48bca66f915ce0db448aa61933891986))
### 🐛 Bug fixes
* **commands:** corrections to allow external labels to be consumed and transfered ([12345c0](https://git.tuffraid.net/cowch/lst/commits/12345c0b6442c3abd309f660bb43216def9abb89))
* **dm:** type in customer article number ([f226c56](https://git.tuffraid.net/cowch/lst/commits/f226c5644cc2b93b9d967962bd6f82b3e506c8c0))
* **labeling:** added in a catch to avoid rouge lots ([59c6fd0](https://git.tuffraid.net/cowch/lst/commits/59c6fd011728dff50bfa3233d6095c396d0b1999))
* **lot transfer:** changes to make it so the reprint and return do not happen instantly ([ac27a28](https://git.tuffraid.net/cowch/lst/commits/ac27a286c07733333703d8421cfa525691363e54))
* **lstv2:** added in a close function to stop crashing the server ([712a6ee](https://git.tuffraid.net/cowch/lst/commits/712a6eebdfef0ce2b99155d23422ddc7e5e0daad))
## [1.8.0](https://git.tuffraid.net/cowch/lst/compare/v1.7.0...v1.8.0) (2025-11-25)
### 📝 Chore
* **misc:** api doc dates and db changes ([52089ec](https://git.tuffraid.net/cowch/lst/commits/52089ecdf06d9e5983afb6a24953d066a0456949))
### 📈 Project changes
* **settings:** changes to vs code as it was being way to slow ([5277ddf](https://git.tuffraid.net/cowch/lst/commits/5277ddfc51632651059e35b799ddf2a63d70cb70))
### 📝 Testing Code
* **android app:** this is the start to the android app ([7b630d5](https://git.tuffraid.net/cowch/lst/commits/7b630d5c0b1175f06c866b1238754e455d3a27c9))
* **controller:** added in server port that might night be needed but oh well ([efdab5b](https://git.tuffraid.net/cowch/lst/commits/efdab5bafca2a46d73de7ab1d776d283d5294aa3))
* **materials per day:** work on getting this running better ([a30eebf](https://git.tuffraid.net/cowch/lst/commits/a30eebf5d34c77c6c7118faf01776651f8888547))
* **mobile:** more testing on ota ([75c0659](https://git.tuffraid.net/cowch/lst/commits/75c0659658cbbb7e983df5538538d6429a325379))
* **mobile:** stallion intergration starts ([20fc286](https://git.tuffraid.net/cowch/lst/commits/20fc2860690f59851ca1e0251df84854c9d2ba01))
* **mobile:** testing for ota updated on android scanner ([314ab04](https://git.tuffraid.net/cowch/lst/commits/314ab049bb650120489259e920e52fd530f0ce41))
* **ti intergration:** added the place holder for intergration of comments for customer ([f8cf085](https://git.tuffraid.net/cowch/lst/commits/f8cf0851a86a6923a8941774efe17f93cb92e984))
### 🛠️ Code Refactor
* **all server stats:** added a 5 second time out if it dose not reach it just stops ([2133b94](https://git.tuffraid.net/cowch/lst/commits/2133b94a1dd84e16bb5a4b8fe215739a4b355223))
* **app:** refactored how we have the pkg.json so we can reduce on size of the app ([90920e8](https://git.tuffraid.net/cowch/lst/commits/90920e8fba4757297e0e42e86f80d5f14434a48e))
* **base modules:** removed the log spam ([6d27a7a](https://git.tuffraid.net/cowch/lst/commits/6d27a7aa6395a094d8763ba3fde0bdb81a7e3082))
* **cards:** trying to make the cards fit the odd shaped screens better ([33cbb17](https://git.tuffraid.net/cowch/lst/commits/33cbb17a0ede136a9be96e47ba0a7a66468b1ebc))
* **forklifts:** more refactoring to improve during production ([8c0f67c](https://git.tuffraid.net/cowch/lst/commits/8c0f67ca351778405279f7e225ee8dae654033f9))
* **inv with rn:** now includes batch number for tetra ([1084ced](https://git.tuffraid.net/cowch/lst/commits/1084cede04d43ec2b2c22c43c6e701bad4701981))
* **leases:** removed main server until i have a better way to sync them ([6ce4d84](https://git.tuffraid.net/cowch/lst/commits/6ce4d84fd00fa446ccb7d1bbad28680f045fae52))
* **ocp page:** using the name of the url now vs the settings ([d406a92](https://git.tuffraid.net/cowch/lst/commits/d406a92f3d5d6a8902164e9182717912debae804))
* **ocp:** work around for zechetti 2 until we can monitor more closing ([700346d](https://git.tuffraid.net/cowch/lst/commits/700346d80972e464d0a9ba62bba4dc0ed949cdee))
* **quality:** added some new options plus cancel button ([242ff62](https://git.tuffraid.net/cowch/lst/commits/242ff6277a1f407fbed2951d30dd6cf1ee32dd60))
* **quality:** more changes to the system to perfect it ([7b28f4e](https://git.tuffraid.net/cowch/lst/commits/7b28f4e9ef32a4fc90a0b4b16953b6cead096cac))
* **serverlist:** refactored to also show uptime and other info about the server ([e1e659f](https://git.tuffraid.net/cowch/lst/commits/e1e659f9b14f22474f919350f07b02b45141aa63))
* **types:** moved the item type to the sidebar to keep it more clean ([5023d4d](https://git.tuffraid.net/cowch/lst/commits/5023d4d129737cf6e0609592e5606a20a0f3728b))
* **wrapper:** removed the logs so its not spamming the server ([b8a9aa5](https://git.tuffraid.net/cowch/lst/commits/b8a9aa5132c7606fcccae8f058a77a11a8ed552a))
### 🐛 Bug fixes
* **comments:** added new role to put comments in ([1283a63](https://git.tuffraid.net/cowch/lst/commits/1283a63b5fd71fb44f7ec7789f670f8af7eafbb8))
* **correction:** the name needed to be correct to have a proper tempalte ([b1c56ee](https://git.tuffraid.net/cowch/lst/commits/b1c56ee4bb32c0dbf86e0164614fb3f1ecaf262d))
* **dm:** correction to passing the username over for the importing of the file ([a7a9aa2](https://git.tuffraid.net/cowch/lst/commits/a7a9aa2874ddd1391b56983db51cfabd8e789213))
* **dm:** fixes to validate auth before submiting incase someone stays on the page to long ([fef0303](https://git.tuffraid.net/cowch/lst/commits/fef0303cd6fdc9cc8cf9f9f4ad674a8b725691f3))
* **file name wrong:** fixed the name of the file for getCompanies ([8996da7](https://git.tuffraid.net/cowch/lst/commits/8996da7eb46a8b5bdfe44ee74a676e701d64fdbf))
* **forecast table:** correction to the customer article number ([ebe5c0b](https://git.tuffraid.net/cowch/lst/commits/ebe5c0bd5a883b1cbe87f7f9932fd803e80e7fae))
* **historical date:** added so we can have all dates ([9d793d2](https://git.tuffraid.net/cowch/lst/commits/9d793d22051c585ed224bfaf16e2a9b60bb02635))
* **historical inv:** corrected the way the date can come over to allow for yyyy-mm-dd or with / ([7c40f02](https://git.tuffraid.net/cowch/lst/commits/7c40f028c88d7fd78ac8ab75c172d808783fc641)), closes [#1](https://git.tuffraid.net/cowch/lst/issues/1)
* **historicalinv:** removed the second running one that caused duplicates ([a6cc17c](https://git.tuffraid.net/cowch/lst/commits/a6cc17ccb12b0d99ffdb1d371c5daf3bbb91f7ba))
* **label ratio:** correction to the endpoint ([50b7c9c](https://git.tuffraid.net/cowch/lst/commits/50b7c9cac5cd6923b08a8705fc8cb41530ec5b02))
* **manual print:** fixed so the print disables ([d3e8e94](https://git.tuffraid.net/cowch/lst/commits/d3e8e941103dc0118066e8790e7c27e5f035a6c5))
* **nav:** added missing add card button ([8fca201](https://git.tuffraid.net/cowch/lst/commits/8fca201e0463aba7ecace61f8dfb737e2acf4140))
* **ocp:** made corrections to the ocp page in dayton ([92af726](https://git.tuffraid.net/cowch/lst/commits/92af7262f60514501b903f5307d34e9154cc9034))
* **plc zeccetti:** changes to improve the timing on the zecetti more to be done ([247010d](https://git.tuffraid.net/cowch/lst/commits/247010d48f10ebb02a1b98c5df101134e8dab250))
* **preprint:** added the correct to string for the preprint stuff ([360c016](https://git.tuffraid.net/cowch/lst/commits/360c0163f1d3135d9c1c3788ac53dc8e0757c441))
* **prodendpoint:** if we have a real error just report it dont actually crash ([3193e07](https://git.tuffraid.net/cowch/lst/commits/3193e07e4707d055517b15f77ac117fefe07de12))
* **quality request:** bug fixes ([6f632ec](https://git.tuffraid.net/cowch/lst/commits/6f632ecd6831456c6e3c9973bc0ce7feb229aeec))
* **quality:** corrected url and perms for quality link ([eb6b9ce](https://git.tuffraid.net/cowch/lst/commits/eb6b9ce388c5dea35f95a9403765e7d330b664f9))
* **quality:** request was missing the forced selection ([96c3e4c](https://git.tuffraid.net/cowch/lst/commits/96c3e4c24adbdc59d11f7ea43888e1c47d061f90))
* **register:** added the ability to put in _ for user name ([aba1668](https://git.tuffraid.net/cowch/lst/commits/aba1668d2cab63a031657fb7c9f2bfb9777fa72a))
* **servers:** changed the server name to be unique ([a7bde5e](https://git.tuffraid.net/cowch/lst/commits/a7bde5e4eb41c597f94302dd2d119f7048c18a6f))
* **silo adjustments:** added supervisor to see the actual page so it matches the sidbard ([9aa0b31](https://git.tuffraid.net/cowch/lst/commits/9aa0b31278e5f8201acd21774f19ba69709a654d))
* **silo commits:** added in email that was now missing due to new authj ([25a958d](https://git.tuffraid.net/cowch/lst/commits/25a958d592d189f896ae0b5f7608d80a6ee2b1e7))
* **uom:** correction to how we do the uom check so we dont just look for the space ([ca866bf](https://git.tuffraid.net/cowch/lst/commits/ca866bf8c63e0576e890367d24a47c7ab46cc864))
### 🌟 Enhancements
* **added in swagger:** added the base for swagger to implement fully later ([9d9ca63](https://git.tuffraid.net/cowch/lst/commits/9d9ca63d7c9ab3e3ea168cf2add9c7baf2b9ed15))
* **articles:** moved articles over to the main server ([2a6eafa](https://git.tuffraid.net/cowch/lst/commits/2a6eafa19a97f0be01f63c68b63b4abfc4de1409))
* **barcode gen:** added the missing link ([b4064e8](https://git.tuffraid.net/cowch/lst/commits/b4064e87691937ad9f99441767b556a167b91055))
* **db manual fixes:** added a way to fix manual db changes as needed ([0b02984](https://git.tuffraid.net/cowch/lst/commits/0b0298423ed75eed6d112a04dda998b8a23b20ea))
* **dm:** new endpoint to get the forecast data ([a96b85b](https://git.tuffraid.net/cowch/lst/commits/a96b85bc536809d223dd7a29150d1a4d632e80da))
* **forecast data:** added in a historical forecast data set ([c2ae445](https://git.tuffraid.net/cowch/lst/commits/c2ae445ea4d26b047a2ee5d16041ed230f7b2061))
* **forklifts:** added backend forklift stuff and frontend companies ([50cde2d](https://git.tuffraid.net/cowch/lst/commits/50cde2d8d2aa24796db1f1c0126ef8c373614d5d))
* **forklifts:** added the ability to add new forklifts in ([7b6c9bd](https://git.tuffraid.net/cowch/lst/commits/7b6c9bdfbf2cf9d97c8e23d8ebd6523e32284963))
* **forklifts:** added the crud ([577584e](https://git.tuffraid.net/cowch/lst/commits/577584ef4dd10ee7f57ab0ad0d6261adddaf8966))
* **form stuff:** added in a searchable dropdown and added to new forklifts ([b23bb0d](https://git.tuffraid.net/cowch/lst/commits/b23bb0db31f78f46ffc556577cadb62e0bfa3b83))
* **invoice form:** added new invoice form ([65304f6](https://git.tuffraid.net/cowch/lst/commits/65304f61ceb3ad4655757aa5c291ac4ed77db048))
* **invoices:** added invoice + linking to forklift ([2e05f6e](https://git.tuffraid.net/cowch/lst/commits/2e05f6eeee052a92095098c73ace0bd331c43b22))
* **leases:** added in leases and move table to reuseable component ([bd7bea8](https://git.tuffraid.net/cowch/lst/commits/bd7bea8db697f5b025b8d93f86677a9a69cdf2b4))
* **listeners:** added in a new feature to auto add new listeners ([f9cfada](https://git.tuffraid.net/cowch/lst/commits/f9cfada8409b3a88323dafa80730c5565c067da8))
* **materials per day:** more work on materials per day ([564f0b5](https://git.tuffraid.net/cowch/lst/commits/564f0b5addd109018a806edd6a1fed4399ea63aa))
* **migration:** settings migration from old app all is now in the new app ([40bc19a](https://git.tuffraid.net/cowch/lst/commits/40bc19aa6f952a7a60b5ee8281fa159ca114161f))
* **missing inv:** adding a way to check for missing data in case it dose pull on the correct days ([d17edb1](https://git.tuffraid.net/cowch/lst/commits/d17edb1f9c830a2c17d28bd9180d264607d66fa2))
* **mobile:** ota updates added ([b6030de](https://git.tuffraid.net/cowch/lst/commits/b6030de4f44e73ce8bb9152886d384b9d7f2edff))
* **notify:** material per day for the next 90 days ([c509c7f](https://git.tuffraid.net/cowch/lst/commits/c509c7fe286a43ab0ffbf86635631477237632b5))
* **quality:** added in comments ([566754b](https://git.tuffraid.net/cowch/lst/commits/566754bf2ecfc390bc927b48aadb2fa934353769))
* **quality:** added location moved to to the table ([9572b71](https://git.tuffraid.net/cowch/lst/commits/9572b7159235c18617ff46058c94dfd9cfab8abc))
* **quality:** priority ranking added ([c777395](https://git.tuffraid.net/cowch/lst/commits/c777395b0350f60bd457c3164ed1ae478249df3a))
* **scroll view:** added in a scroll view to for quality so it dose not go over the end of the page ([b0ac326](https://git.tuffraid.net/cowch/lst/commits/b0ac326752331ab01ad981fa7b1022e82beab143))
* **servers:** added a link to the server by clicking on the name and the gp code ([00ef72d](https://git.tuffraid.net/cowch/lst/commits/00ef72de90e43c12bd3fecdc08dfa1e3a4f881fb))
* **settings:** added in dyco printing settings ([2ed6bf4](https://git.tuffraid.net/cowch/lst/commits/2ed6bf4d1f32f9a92712ccb36d4a4146ca112e85))
* **settings:** final migration of settings and edits added ([7e15e5d](https://git.tuffraid.net/cowch/lst/commits/7e15e5d7bcdf58f31bd96564be1f213d01d37cda))
* **start of server:** added the start of server data ([d60c08a](https://git.tuffraid.net/cowch/lst/commits/d60c08a281cd63f2183381a1a19c5e196b41fbc5))
* **templates:** added bug repot template ([79f4121](https://git.tuffraid.net/cowch/lst/commits/79f4121311df733f5dc59b32a6b32c1b4a32f97b))
## [1.7.0](https://git.tuffraid.net/cowch/lst/compare/v1.6.0...v1.7.0) (2025-10-30)
### 📚 Documentation
* **api:** more old version stuff ([78a5a4a](https://git.tuffraid.net/cowch/lst/commits/78a5a4a398f8c0840e4aaffe62383d2d2fa0908a))
### 🐛 Bug fixes
* **dm:** corrected the permissions needed to view this page ([8198c7a](https://git.tuffraid.net/cowch/lst/commits/8198c7a47834466515b9446eaca105f37346a4a3))
* **export inv:** added the button to exprot data ([6392441](https://git.tuffraid.net/cowch/lst/commits/6392441f1b8330c33b0126942ab6bf21a8bb7bdc))
* **login:** redirect back to profile is ignored so it will not cause confusion ([56d21fe](https://git.tuffraid.net/cowch/lst/commits/56d21fec8439c038cb3625c8537cf4f5b2912ef6))
* **proxy:** changes to allow multiple onsite instances ([cc3657f](https://git.tuffraid.net/cowch/lst/commits/cc3657f66fcc07785e786fb16dec9009a8e9a103))
* **sidebar:** changed from module to name to have tighter control ([6c27fa1](https://git.tuffraid.net/cowch/lst/commits/6c27fa10a68e624033a0e80a33305844f007793d))
* **silo adjustment:** change the module to name for checking access ([c6f7660](https://git.tuffraid.net/cowch/lst/commits/c6f766089bd1b1a13bd8d92fa31e149ea4a7ec72))
* **siloadjustmnets:** corrected the silo adjustments to account for removed middleware ([e9ff8bb](https://git.tuffraid.net/cowch/lst/commits/e9ff8bb4cb11381aaa86f20d5882ce90f28d4783))
### 📈 Project changes
* **ts query:** added in the debugger for this ([6493e03](https://git.tuffraid.net/cowch/lst/commits/6493e0398ace860990d675aa42664cd172849a96))
### 🌟 Enhancements
* **dashboard:** added notification on use of old version ([721813d](https://git.tuffraid.net/cowch/lst/commits/721813dc299aeef651e3f46487b94fc1c59019e9))
* **modules:** modules added to frontend ([c552b9e](https://git.tuffraid.net/cowch/lst/commits/c552b9eb1c23074fcb73970acb192c8a58b9f423))
* **user migration:** user migration to the new app with a default password that will force reset ([006ec1b](https://git.tuffraid.net/cowch/lst/commits/006ec1bfc03733a14512eed5344b352ed503a99e))
* **user stuff:** added in all the user stuff ([0ddf67d](https://git.tuffraid.net/cowch/lst/commits/0ddf67d815dd8a0a87661acb9cdbfb9442bc9672))
### 🛠️ Code Refactor
* **datamart:** added in av and alias to the query ([dd6c297](https://git.tuffraid.net/cowch/lst/commits/dd6c2971f8d4ab05e9bcafc53e491ee893cb2717))
* **invhist:** reformated file ([be6510f](https://git.tuffraid.net/cowch/lst/commits/be6510f91207e913e15a60d59401fcfc21e918f8))
* **logins:** added a proper redirect to the last place you were ([45dda3c](https://git.tuffraid.net/cowch/lst/commits/45dda3c40a97a51fb8620fa2081d99989e95475c))
* **lottransfer:** formatting changes ([a19b03b](https://git.tuffraid.net/cowch/lst/commits/a19b03b8bfdac7114e61c8590e446d290f87e365))
* **materials:** added in if staged just pass the check ([147d189](https://git.tuffraid.net/cowch/lst/commits/147d189a81682b4832cbf802b79fed26576e405f))
* **modules:** moved modules to app to control everything based on there active setting ([99b2d76](https://git.tuffraid.net/cowch/lst/commits/99b2d762d6b14aadec3c280f3415b5a196b11c50))
* **printers:** allowed for more logging to come over ([66ae443](https://git.tuffraid.net/cowch/lst/commits/66ae443fb8c920d83fb58aab52ef1c8f7071749b))
* **v1 middle ware:** removed the need for this and just let it all pass ([8f22165](https://git.tuffraid.net/cowch/lst/commits/8f221659514644fd571108e0ec1233dbecb6e52a))
## [1.6.0](https://git.tuffraid.net/cowch/lst/compare/v1.5.0...v1.6.0) (2025-10-26)
### 📝 Testing Code
* **dock schedule fail:** failed attempt ad doing a dock schedule but leaving in here ([817a5c6](https://git.tuffraid.net/cowch/lst/commits/817a5c6876b338e4e0347eed94d0c2d9507e7ba3))
### 📈 Project changes
* **added biome linter in:** added in biom linter to assist ([2023c2f](https://git.tuffraid.net/cowch/lst/commits/2023c2fc35f8d57a6884d82b3710a03f3ccc57e7))
* **app:** config changes to bruno and incoming sqls ([f264c98](https://git.tuffraid.net/cowch/lst/commits/f264c98fbfccd4f1eb6dfdcb28b69903711a9e2b))
* **settings:** settings for biome ([dfff8fc](https://git.tuffraid.net/cowch/lst/commits/dfff8fc1667a5199a9f92bdbf7df1a1b19606b82))
### 📚 Documentation
* **api:** bruno endpoint saves ([705f29e](https://git.tuffraid.net/cowch/lst/commits/705f29e908b75e8ba8d09a9fc4a2b5745460babb))
* **bruno:** preprint in app added ([a2a8e0e](https://git.tuffraid.net/cowch/lst/commits/a2a8e0ef9f7086ba9d32bc4ec05a61e6904bfecc))
### 🛠️ Code Refactor
* **biome:** format changes ([dbe84d5](https://git.tuffraid.net/cowch/lst/commits/dbe84d5325291fb51f971426ec521c91eafa3537))
* **biome:** formats from biome ([27fa456](https://git.tuffraid.net/cowch/lst/commits/27fa45614e604a768c49dc4489fbf7a671364a7b))
* **biome:** more format changes ([255ceaa](https://git.tuffraid.net/cowch/lst/commits/255ceaab856e72435bbc3ebad37fb82c036f5208))
* **front end:** login fixes to account for the forced password change ([e99c409](https://git.tuffraid.net/cowch/lst/commits/e99c409cad049f781d4a52864f40264146a2bb49))
* **frontend:** tempt to stop the popup when redrected or coming to the page with no auth ([0fd777c](https://git.tuffraid.net/cowch/lst/commits/0fd777ccbdab2e8de8dcc02c134e01390bbc0d0a))
* **login:** added in a check for lastlogin and force reset password ([17e13d4](https://git.tuffraid.net/cowch/lst/commits/17e13d4604787d1473ae1e24ad4e9479087f6dce))
* **material checks:** added proper logging to capture it all for auditing later ([26b769f](https://git.tuffraid.net/cowch/lst/commits/26b769f4776df2833e3f27b02e5eedbc9f8693a6))
* **old app:** login migration to new app ([eb3fa4d](https://git.tuffraid.net/cowch/lst/commits/eb3fa4dd528427da49e2212bfa304ef9cdb06cc2))
* **plc connection zechetti:** added in more logging due to a weird issue with line 7 not sendin ([38edc62](https://git.tuffraid.net/cowch/lst/commits/38edc6214b353841a3414a66553446d4008ad54a))
* **printdelay:** added in a change to allow override the actualy time ([c59b6a1](https://git.tuffraid.net/cowch/lst/commits/c59b6a1ec27ecb8e5b6b08c8db7aee5bcb060801))
* **stats:** added in ram useage to the stats ([b9b0cd5](https://git.tuffraid.net/cowch/lst/commits/b9b0cd5c7010726532ef56ddab714308c8045b94))
* **wrapper:** changes to allow both controller and app to connect via wss:// ([da11270](https://git.tuffraid.net/cowch/lst/commits/da1127057cd766ec72316dee1ffcb11aed77904b))
### 🌟 Enhancements
* **admin:** users and roles added to the frontend to manage easier ([2142c06](https://git.tuffraid.net/cowch/lst/commits/2142c06ac3900aa70f1cf672b5a64102ed1c574f))
* **app:** order schdeuler ([94e1198](https://git.tuffraid.net/cowch/lst/commits/94e1198f6305751af7662a63e0ac21ac04f805d1))
* **frontend:** migrated old > new silo adjustments ([425f8f5](https://git.tuffraid.net/cowch/lst/commits/425f8f5f71d1dae1cf3a5d0307b3a2faeadb54b5))
* **labeling:** added printers and machine and other data for preprinting ([953af5e](https://git.tuffraid.net/cowch/lst/commits/953af5e0fea4cf0738a2bbfd3ee6ec46182b83dd))
* **labels:** added listener for old app to push all labels to the new app ([af079b8](https://git.tuffraid.net/cowch/lst/commits/af079b83069560f0a0d6f19c396a8238fba25e94))
* **migration:** dashboard migrated over ([2206a4d](https://git.tuffraid.net/cowch/lst/commits/2206a4d4baefdd770c83a03d68c9f5ac8f55a4c3))
* **migration:** dm moved ([ac9670d](https://git.tuffraid.net/cowch/lst/commits/ac9670d55340a3cc8e45d13ac1c09a056d06d1dd))
* **migration:** moved barcode generator ([fd9d774](https://git.tuffraid.net/cowch/lst/commits/fd9d774772aabb63fd69fe70302444fd2088d960))
* **migration:** moved changed log and properly added in the link to it ([0fe0a8f](https://git.tuffraid.net/cowch/lst/commits/0fe0a8f56a9833de1de4f8ba49f1d06b31e42ee8))
* **migration:** moved helper commands ([39c31aa](https://git.tuffraid.net/cowch/lst/commits/39c31aa1ec61231737cc4e7c3c33331ab562a808))
* **migration:** moved material helper over ([1da7b14](https://git.tuffraid.net/cowch/lst/commits/1da7b145a942dd64891511a8a63160748800de87))
* **migration:** moved ocp, ocme, wrapper stuff ([4ca20a0](https://git.tuffraid.net/cowch/lst/commits/4ca20a085efcb795bc312abff649a53132deac05))
* **migration:** moved rfid page ([f90a975](https://git.tuffraid.net/cowch/lst/commits/f90a975a5020a262109552019a13ead71271396c))
* **preprint:** added in preprint function to help with operations planning constraints ([282eab0](https://git.tuffraid.net/cowch/lst/commits/282eab01e15f81bcc407f45f1f3ffff056e0f27a))
* **settings:** added in settings ([a09ad87](https://git.tuffraid.net/cowch/lst/commits/a09ad8773c77b7b23ce98b3b3f6ce6122842f3ff))
* **v1 logger:** added in a logger to monitor the old app ([1d79195](https://git.tuffraid.net/cowch/lst/commits/1d79195d89cc31192c9998ef2b2f8ea501aff41e))
### 🐛 Bug fixes
* **admin:** corrections to sending over to test server for updates ([7964cda](https://git.tuffraid.net/cowch/lst/commits/7964cda197e42f2eadea3e636c2d910cb34c97bc))
* **barcodes:** moved to correct folder ([6a84da4](https://git.tuffraid.net/cowch/lst/commits/6a84da411770986f6f4c2088ebae169c688b28c1))
* **controller:** changed to actaully update both main and old app ([0d1f963](https://git.tuffraid.net/cowch/lst/commits/0d1f96333b11e6a2323e25552c10cc85d3c425af))
* **controller:** fix for updating iowa2 server ([358c41d](https://git.tuffraid.net/cowch/lst/commits/358c41deb41d418c5b1c6040269f2ed74e1782ff))
* **dmbuttons:** missed the uncomment here ([e620397](https://git.tuffraid.net/cowch/lst/commits/e62039793870a4d4b1f67adf256a9db2f6027e37))
* **loginform:** bug where the reset errror was not properly coming over ([414a21a](https://git.tuffraid.net/cowch/lst/commits/414a21a28719b50f61cc41056efc9b599491e048))
* **loginform:** error with password reset ([eae9436](https://git.tuffraid.net/cowch/lst/commits/eae9436f6d3aa8424043a426d5bbcc764967b3b6))
* **misc:** changes to several files for formatting ([b102112](https://git.tuffraid.net/cowch/lst/commits/b102112228bbf58b12bbca19cdf99483517b784d))
* **ocme:** corrected the urls for ocme ([f078cd6](https://git.tuffraid.net/cowch/lst/commits/f078cd6ceb9039e1f6e9b31f3e33ad446e65dd87))
* **old app:** correction for dev redirect if on localhost to be proper now ([70a2ff5](https://git.tuffraid.net/cowch/lst/commits/70a2ff5e845d9a8c460f4810f8de741fae32ad96))
* **printers:** missing logs for errors ([43abbd5](https://git.tuffraid.net/cowch/lst/commits/43abbd53f421988a13cbf8974a49d5ae5cbba1b9))
* **silos:** added only active machines, and ordered by location in asending ([d46ef92](https://git.tuffraid.net/cowch/lst/commits/d46ef922f3a6ddc36d5ddfcd94d424745f473a16))
## [1.5.0](https://git.tuffraid.net/cowch/lst/compare/v1.4.0...v1.5.0) (2025-10-07)

View File

@@ -1,6 +1,6 @@
meta {
name: Controller
seq: 1
seq: 2
}
auth {

View File

@@ -0,0 +1,32 @@
meta {
name: Get Roles
type: http
seq: 2
}
get {
url: {{urlv2}}/api/auth/getuseraccess
body: none
auth: inherit
}
headers {
Content-Type: application/json
Cookie: {{session_cookie}}
}
body:json {
{
"username": "matthes01",
"password": "{{v2Password}}"
}
}
script:post-response {
bru.setEnvVar("jwtV2",res.body.token)
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -22,9 +22,19 @@ body:json {
}
script:post-response {
bru.setEnvVar("jwtV2",res.body.token)
// grab the raw Set-Cookie header
const cookies = res.headers["set-cookie"];
// cookies is usually an array, e.g. ["auth_session=abcd123; Path=/; HttpOnly; Secure; SameSite=Lax"]
// Extract just the value part ("auth_session=abcd123")
const sessionCookie = cookies[0].split(";")[0];
// Save it as an environment variable
bru.setEnvVar("session_cookie", sessionCookie);
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,20 @@
meta {
name: Get Inv
type: http
seq: 2
}
get {
url: {{url}}/lst/old/api/eom/histinv?month=2025/11/1
body: none
auth: inherit
}
params:query {
month: 2025/11/1
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: Error logging
type: http
seq: 4
}
get {
url: {{urlv2}}/api/notify/toomanyerrors
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: materialPerDay
type: http
seq: 2
}
get {
url: {{urlv2}}/api/notify/materialperday
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: ti Intergration
type: http
seq: 3
}
get {
url: {{urlv2}}/api/notify/tiTrigger
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,25 @@
meta {
name: Add pallet
type: http
seq: 2
}
post {
url: {{url}}/lst/old/api/quality/newrequest
body: json
auth: inherit
}
body:json {
{
"username": "matthes01",
"runningNr": 618302,
"palletStatusText":"return" // returned will be the only allowed key
//"moveTo": "hold area" //hold area, rework, inspection
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: Get Pallets
type: http
seq: 1
}
get {
url: {{url}}/lst/old/api/quality/getrequest
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: Quality
seq: 7
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,25 @@
meta {
name: CreateSilo Adjustment
type: http
seq: 3
}
post {
url: {{url}}/lst/old/api/logistics/createsiloadjustment
body: json
auth: inherit
}
body:json {
{
"warehouseId": 51,
"quantity": 60575,
"laneId": 31717,
"username":"matthes01"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,23 @@
meta {
name: Machine Connections
type: http
seq: 2
}
post {
url: {{url}}/lst/old/api/logistics/siloconnection
body: json
auth: inherit
}
body:json {
{
"siloID": "35010",
"connectionType": "connected"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: PPOO
type: http
seq: 1
}
get {
url: {{url}}/lst/old/api/logistics/getppoo
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: Warehouse
seq: 5
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,22 @@
meta {
name: sscc
type: http
seq: 4
}
post {
url: {{url}}/lst/old/api/logistics/getsscc
body: json
auth: inherit
}
body:json {
{
"runningNr": ""
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,20 @@
meta {
name: PSI - Forecast data
type: http
seq: 1
}
get {
url: {{url}}/lst/old/api/datamart/psiforecastdata?customer=8
body: none
auth: inherit
}
params:query {
customer: 8
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,22 @@
meta {
name: PSI -planning data
type: http
seq: 2
}
get {
url: {{url}}/lst/old/api/datamart/psiplanningdata?avs=118,120&startDate=12/1/2025&endDate=12/31/2026
body: none
auth: inherit
}
params:query {
avs: 118,120
startDate: 12/1/2025
endDate: 12/31/2026
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: datamart
seq: 8
}
auth {
mode: inherit
}

View File

@@ -1,6 +1,6 @@
meta {
name: LstV2
seq: 3
seq: 4
}
auth {

View File

@@ -0,0 +1,26 @@
meta {
name: Logs
type: http
seq: 2
}
get {
url: {{url}}/lst/old/api/logger/logs?service=ocp&service=rfid&service=dyco&level=error&level=info&level=warn&hours=12
body: none
auth: inherit
}
params:query {
service: ocp
service: rfid
service: dyco
level: error
level: info
level: warn
hours: 12
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: ocp
seq: 6
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,16 @@
meta {
name: Update Printers
type: http
seq: 1
}
get {
url: {{url}}/lst/old/api/ocp/updateprinters
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: printers
seq: 1
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,26 @@
meta {
name: Change user password
type: http
seq: 5
}
patch {
url: {{url}}/lst/api/admin/users/changePassword/:userId
body: json
auth: inherit
}
params:path {
userId: 0hlO48C7Jw1J804FxrCnonKjQ2zh48R6
}
body:json {
{
"password":"nova0511"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,24 @@
meta {
name: Create user
type: http
seq: 4
}
post {
url: {{url}}/lst/api/admin/users/new
body: json
auth: inherit
}
body:json {
{
"username":"hardin001",
"email":"ryan.hardin@alpla.com",
"password":"Alpla2025!"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,26 @@
meta {
name: Delete User
type: http
seq: 6
}
delete {
url: {{url}}/lst/api/admin/users/delete/:userId
body: json
auth: inherit
}
params:path {
userId: 0hlO48C7Jw1J804FxrCnonKjQ2zh48R6
}
body:json {
{
"password":"nova0511"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -21,4 +21,5 @@ body:json {
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,23 @@
meta {
name: Get roles
type: http
seq: 7
}
get {
url: {{url}}/lst/api/user/roles
body: json
auth: inherit
}
body:json {
{
"module":"siloAdjustments",
"role":"viewer"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -4,23 +4,24 @@ meta {
seq: 7
}
post {
url: {{url}}/lst/api/admin/:userID/grant
patch {
url: {{url}}/lst/api/admin/users/:userID/grant
body: json
auth: inherit
}
params:path {
userID: 0hlO48C7Jw1J804FxrCnonK
userID: 0hlO48C7Jw1J804FxrCnonKjQ2zh48R6
}
body:json {
{
"module":"users",
"role":"admin"
"module":"siloAdjustments",
"role":"viewer"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,27 @@
meta {
name: RevokeRole by ID
type: http
seq: 3
}
patch {
url: {{url}}/lst/api/admin/users/:userID/revoke
body: json
auth: inherit
}
params:path {
userID: 0hlO48C7Jw1J804FxrCnonKjQ2zh48R6
}
body:json {
{
"module":"ocp"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -16,16 +16,17 @@ headers {
body:json {
{
"name": "Bowling Green 2",
"serverDNS": "USBOW2VMS006",
"plantToken": "usbow2",
"ipAddress": "10.30.0.26",
"greatPlainsPlantCode": 0,
"name": "St Peters",
"serverDNS": "USSTP1VMS006",
"plantToken": "usstp1",
"ipAddress": "10.37.0.26",
"greatPlainsPlantCode": 45,
"lstServerPort": 4000,
"serverLoc": "E$\\LST"
"serverLoc": "E:\\LST"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -6,17 +6,11 @@ meta {
get {
url: {{url}}/lst/api/user/roles
body: json
body: none
auth: inherit
}
body:json {
{
"module":"users",
"role":"admin"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,35 @@
meta {
name: Login
type: http
seq: 10
}
post {
url: {{url}}/lst/api/user/login
body: json
auth: inherit
}
body:json {
{
"username": "matthes01",
"password": "nova0511"
}
}
script:post-response {
// grab the raw Set-Cookie header
const cookies = res.headers["set-cookie"];
const sessionCookie = cookies[0].split(";")[0];
// Save it as an environment variable
bru.setEnvVar("session_cookie", sessionCookie);
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -21,4 +21,5 @@ body:json {
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -32,4 +32,5 @@ script:post-response {
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -32,4 +32,5 @@ script:post-response {
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -5,7 +5,7 @@ meta {
}
post {
url: {{url}}/lst/api/auth/session
url: {{url}}/lst/api/auth/sign-out
body: none
auth: inherit
}
@@ -25,4 +25,5 @@ script:post-response {
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -1,6 +1,6 @@
meta {
name: app
seq: 2
seq: 3
}
auth {

View File

@@ -0,0 +1,22 @@
meta {
name: Get Invoices
type: http
seq: 4
}
get {
url: {{url}}/lst/api/forklifts/invoices
body: none
auth: inherit
}
body:json {
{
"name":"Delage DLL"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,27 @@
meta {
name: Update lease
type: http
seq: 3
}
patch {
url: {{url}}/lst/api/forklifts/invoices/:id
body: json
auth: inherit
}
params:path {
id: de10c8ee-5756-4efb-9664-3c55338b2b60
}
body:json {
{
"companyId": "b34c6684-ec35-4364-acef-0c1570faf123"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,30 @@
meta {
name: add lease
type: http
seq: 1
}
post {
url: {{url}}/lst/api/forklifts/invoices
body: json
auth: inherit
}
body:json {
{
"leaseId": "0147d082-aee0-4594-b0f4-c6f4ee777e92",
"invoiceNumber": "592596987",
"invoiceDate": "10/12/2025",
"uploadedBy": "matthes01",
"totalAmount": "1820.88",
"forklifts": [
{ "forklift_Id": "ec2f3759-1580-4c1b-8fbf-8a4b0b506758", "amount": 909.91 }
]
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: Invoices
seq: 4
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,22 @@
meta {
name: Get Companies
type: http
seq: 2
}
get {
url: {{url}}/lst/api/forklifts/companies
body: none
auth: inherit
}
body:json {
{
"name":"Delage DLL"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,27 @@
meta {
name: Update Company
type: http
seq: 3
}
patch {
url: {{url}}/lst/api/forklifts/companies/:id
body: json
auth: inherit
}
params:path {
id: fbfba3df-8c0f-4994-adae-c03808cbccdc
}
body:json {
{
"name":"Delage DLL",
"active": true
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,22 @@
meta {
name: add company
type: http
seq: 1
}
post {
url: {{url}}/lst/api/forklifts/companies
body: json
auth: inherit
}
body:json {
{
"name":"Delage DLL"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: companies
seq: 2
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,8 @@
meta {
name: forklifts
seq: 4
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,22 @@
meta {
name: Get forklift
type: http
seq: 2
}
get {
url: {{url}}/lst/api/forklifts
body: none
auth: inherit
}
body:json {
{
"name":"Delage DLL"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,28 @@
meta {
name: Update forklfit
type: http
seq: 3
}
patch {
url: {{url}}/lst/api/forklifts/:id
body: json
auth: inherit
}
params:path {
id: ec2f3759-1580-4c1b-8fbf-8a4b0b506758
}
body:json {
{
"glCode": 31
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,31 @@
meta {
name: add forklift
type: http
seq: 1
}
post {
url: {{url}}/lst/api/forklifts
body: json
auth: inherit
}
body:json {
{
"serialNumber":"FN682004",
"model": "EFG220",
"plant": "Iowa City ISBM",
"glCode": 31,
"profitCenter": 30,
"manufacturer":"Jungheinrich",
"manufacturerYear":"2022",
"engine":"electric",
"batteryType":"lead acid",
"leaseId":"0147d082-aee0-4594-b0f4-c6f4ee777e92"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: forklifts
seq: 3
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,26 @@
meta {
name: Get lease
type: http
seq: 2
}
get {
url: {{url}}/lst/api/forklifts/leases?companyId=b34c6684-ec35-4364-acef-0c1570faf123
body: none
auth: inherit
}
params:query {
companyId: b34c6684-ec35-4364-acef-0c1570faf123
}
body:json {
{
"name":"Delage DLL"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,27 @@
meta {
name: Update lease
type: http
seq: 3
}
patch {
url: {{url}}/lst/api/forklifts/leases/:id
body: json
auth: inherit
}
params:path {
id: de10c8ee-5756-4efb-9664-3c55338b2b60
}
body:json {
{
"companyId": "b34c6684-ec35-4364-acef-0c1570faf123"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,25 @@
meta {
name: add lease
type: http
seq: 1
}
post {
url: {{url}}/lst/api/forklifts/leases
body: json
auth: inherit
}
body:json {
{
"leaseNumber":"40829107-1",
"startDate": "11/08/2023",
"endDate": "11/12/2025",
"companyId": "59c4eaa3-55db-4348-a033-f2fcd91a91d1"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: lease
seq: 1
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,23 @@
meta {
name: Consume
type: http
seq: 1
}
post {
url: {{url}}/lst/old/api/logistics/consume
body: json
auth: inherit
}
body:json {
{
"lotNum":283559,
"runningNr":19302907
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: Consume
seq: 5
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,15 @@
meta {
name: RFID Trigger
type: http
seq: 1
}
post {
url: {{url}}/lst/old/api/rfid/manualtrigger/wrapper1
body: none
auth: inherit
}
settings {
encodeUrl: true
}

View File

@@ -0,0 +1,8 @@
meta {
name: RFID
seq: 3
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,8 @@
meta {
name: demandmgt
seq: 4
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,16 @@
meta {
name: get forecast data
type: http
seq: 1
}
get {
url: {{url}}/lst/api/logistics/dm/forecastData
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: logistics
seq: 4
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,28 @@
meta {
name: Preprint
type: http
seq: 1
}
post {
url: {{url}}/lst/api/logistics/labeling/preprint
body: json
auth: inherit
}
body:json {
{
"scannerId": 999,
"lotNr": 26656,
"machineId": 5, // 457=22, 458=23
"printerId": 7, // 457=22, 458=23
"layoutId": 22,
"numberOfCopies": 1,
"qtyToPrint":0
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: SSCC
type: http
seq: 2
}
get {
url: {{url}}/lst/api/logistics/getsscc
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: labeling
seq: 1
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,16 @@
meta {
name: ForecastData
type: http
seq: 1
}
post {
url: {{url}}/lst/api/logistics/dm/forecastData
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: warehouse
seq: 2
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,16 @@
meta {
name: All Server Stats
type: http
seq: 3
}
get {
url: {{url}}/lst/api/system/allservers/stats
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: Settings
type: http
seq: 2
}
get {
url: {{url}}/lst/api/system/settings
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,20 @@
meta {
name: Update Setting
type: http
seq: 4
}
post {
url: {{url}}/lst/api/system/settings/:token
body: none
auth: inherit
}
params:path {
token: test3
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,16 @@
meta {
name: GetModules
type: http
seq: 3
}
get {
url: {{url}}/lst/api/system/modules
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,28 @@
meta {
name: Update Modules
type: http
seq: 2
}
patch {
url: {{url}}/lst/api/system/modules/update/:module
body: json
auth: inherit
}
params:path {
module: materialHelper
}
body:json {
{
"active": true,
"updateAll": true
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: modules
seq: 3
}
auth {
mode: inherit
}

View File

@@ -1,6 +1,6 @@
{
"version": "1",
"name": "LogisticsSupportTool_API_DOCS",
"name": "lstv2",
"type": "collection",
"ignore": [
"node_modules",

View File

@@ -1,8 +1,9 @@
vars {
url: http://localhost:4200
url: http://localhost:5500
session_cookie:
urlv2: http://usiow1vms006:3001
urlv2: http://usbow1vms006:3000
jwtV2:
userID:
}
vars:secret [
v2Password

View File

@@ -0,0 +1,24 @@
meta {
name: bookout
type: http
seq: 2
}
post {
url: {{url}}/lst/old/api/logistics/bookout
body: json
auth: none
}
body:json {
{
"runningNr": "1865027",
"reason": "packer printed premature"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: logistics
seq: 7
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,24 @@
meta {
name: relocate
type: http
seq: 1
}
post {
url: {{url}}/lst/old/api/logistics/relocate
body: json
auth: inherit
}
body:json {
{
"runningNr": "56121541",
"laneID": "30006"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,24 @@
meta {
name: removeAsWaste
type: http
seq: 3
}
post {
url: {{url}}/lst/old/api/logistics/removeasreusable
body: json
auth: none
}
body:json {
{
"runningNr": "1865018",
"reason": "validating stockout"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: mobile
seq: 4
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,20 @@
meta {
name: getsession
type: http
seq: 1
}
get {
url: {{url}}/lst/api/user/me
body: none
auth: bearer
}
auth:bearer {
token: jpHHbLNGJRpUMvfrVOYmhbJL2Ux0arse
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,15 @@
meta {
name: ota system check
type: http
seq: 2
}
get {
url: {{url}}/lst/api/mobile
body: none
auth: inherit
}
settings {
encodeUrl: true
}

View File

@@ -0,0 +1,20 @@
meta {
name: otacheck
type: http
seq: 3
}
get {
url: http://10.193.0.56:4000/api/mobile/updates
body: none
auth: inherit
}
headers {
expo-runtime-version: 1.0.0
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -0,0 +1,8 @@
meta {
name: v3endpoints
seq: 5
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,16 @@
meta {
name: tester
type: http
seq: 1
}
post {
url: http://localhost:3000/lst/api/system/prodsql/start
body: none
auth: inherit
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -1,200 +1,306 @@
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
import { toNodeHandler } from "better-auth/node";
import cors from "cors";
import express from "express";
import morgan from "morgan";
import { createServer } from "http";
import { setupRoutes } from "./src/internal/routerHandler/routeHandler.js";
import { printers } from "./src/internal/ocp/printers/printers.js";
import { createProxyMiddleware } from "http-proxy-middleware";
import morgan from "morgan";
import os from "os";
import { dirname, join } from "path";
import swaggerJsdoc from "swagger-jsdoc";
import swaggerUi from "swagger-ui-express";
import { fileURLToPath } from "url";
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
import { setupMobileRoutes } from "./src/internal/mobile/route.js";
import { printers } from "./src/internal/ocp/printers/printers.js";
import { setupRoutes } from "./src/internal/routerHandler/routeHandler.js";
import { baseModules } from "./src/internal/system/controller/modules/baseModules.js";
import { baseSettings } from "./src/internal/system/controller/settings/baseSettings.js";
import {
addListeners,
manualFixes,
} from "./src/internal/system/utlis/addListeners.js";
import { auth } from "./src/pkg/auth/auth.js";
import { db } from "./src/pkg/db/db.js";
import { settings } from "./src/pkg/db/schema/settings.js";
import { validateEnv } from "./src/pkg/utils/envValidator.js";
import { createLogger } from "./src/pkg/logger/logger.js";
import { returnFunc } from "./src/pkg/utils/return.js";
import { initializeProdPool } from "./src/pkg/prodSql/prodSqlConnect.js";
import { tryCatch } from "./src/pkg/utils/tryCatch.js";
import os from "os";
import cors from "cors";
import { sendNotify } from "./src/pkg/utils/notify.js";
import { toNodeHandler } from "better-auth/node";
import { auth } from "./src/pkg/auth/auth.js";
import { v1Listener } from "./src/pkg/logger/v1Listener.js";
import { apiHitMiddleware } from "./src/pkg/middleware/apiHits.js";
import { initializeProdPool, pool } from "./src/pkg/prodSql/prodSqlConnect.js";
import { validateEnv } from "./src/pkg/utils/envValidator.js";
import { sendNotify } from "./src/pkg/utils/notify.js";
import { returnFunc } from "./src/pkg/utils/return.js";
import { tryCatch } from "./src/pkg/utils/tryCatch.js";
import { setupIoServer } from "./src/ws/server.js";
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
import { swaggerConfig, swaggerUiOptions } from "./src/internal/swagger/config.js";
import { setupSwagger } from "./src/internal/swagger/swagger.js";
const main = async () => {
const env = validateEnv(process.env);
const PORT = Number(env.VITE_PORT) || 4200;
const env = validateEnv(process.env);
const PORT = Number(process.env.VITE_PORT) || 4200;
//create the logger
const log = createLogger({ module: "system", subModule: "main start" });
//create the logger
const log = createLogger({ module: "system", subModule: "main start" });
// base path
let basePath: string = "";
// base path
let basePath: string = "";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Db connection stuff
const res = await tryCatch(db.select().from(settings));
// Db connection stuff
const res = await tryCatch(db.select().from(settings));
if (res.error) {
return returnFunc({
success: false,
module: "system",
level: "fatal",
message: `Database lookup failed`,
notify: false,
data: [],
});
}
if (res.error) {
return returnFunc({
success: false,
module: "system",
level: "fatal",
message: `Database lookup failed`,
notify: false,
data: [],
});
}
if (res.data.length === 0) {
//return
// returnFunc({
// success: false,
// module: "system",
// level: "fatal",
// message: `This seems to be the first time you have started the app please validate the settings have been intiated`,
// notify: false,
// data: [],
// });
}
if (res.data.length === 0) {
//return
// returnFunc({
// success: false,
// module: "system",
// level: "fatal",
// message: `This seems to be the first time you have started the app please validate the settings have been intiated`,
// notify: false,
// data: [],
// });
}
// connect to the prod sql
await initializeProdPool();
// connect to the prod sql
console.log("Connecting to the sql server");
// express app
const app = express();
// express app
const app = express();
// global env that run only in dev
if (process.env.NODE_ENV?.trim() !== "production") {
app.use(morgan("tiny"));
basePath = "/lst";
// global env that run only in dev
if (process.env.NODE_ENV?.trim() !== "production") {
app.use(morgan("tiny"));
basePath = "/lst";
app.use(
basePath + "/test",
express.static(join(__dirname, "../controller"))
);
}
app.use(
basePath + "/test",
express.static(join(__dirname, "../controller")),
);
}
// global middleware
app.set("trust proxy", true);
app.use(apiHitMiddleware);
app.all(basePath + "/api/auth/*splat", toNodeHandler(auth)); // sign-in sign-out
app.use(express.json());
// old app prox temp stuff
app.use(
basePath + "/old",
createProxyMiddleware({
target: `http://localhost:${process.env.V1PORT || "3000"}`, // change this to pull from the correct port
changeOrigin: true,
pathRewrite: (path, req) => {
// Remove the basePath + '/old' prefix from the path dynamically
return path.replace(`${basePath}/old`, "");
},
const allowedOrigins = [
/^https?:\/\/localhost:(5173|5500|4200|3000|4000)$/, // all the allowed backend ports
/^https?:\/\/.*\.alpla\.net$/,
env.BETTER_AUTH_URL, // prod
];
headers: {
// forward auth headers if needed
"X-Forwarded-By": "express-proxy",
},
}),
);
app.use(
cors({
origin: (origin, callback) => {
//console.log("CORS request from origin:", origin);
// global middleware
app.set("trust proxy", true);
app.use(apiHitMiddleware);
app.all(basePath + "/api/auth/*splat", toNodeHandler(auth)); // sign-in sign-out
app.use(express.json());
if (!origin) return callback(null, true); // allow same-site or direct calls
const allowedOrigins = [
/^https?:\/\/localhost:(5173|5500|4200|3000|4000)$/, // all the allowed backend ports
/^http?:\/\/localhost:(5173|5500|4200|3000|4000)$/,
/^https?:\/\/.*\.alpla\.net$/,
"http://localhost:4173",
"http://localhost:4200",
"http://localhost:3000",
"http://localhost:3001",
"http://localhost:4000",
"http://localhost:4001",
"http://localhost:5500",
env.BETTER_AUTH_URL, // prod
];
try {
const hostname = new URL(origin).hostname; // strips protocol/port
//console.log("Parsed hostname:", hostname);
app.use(
cors({
origin: (origin, callback) => {
//console.log("CORS request from origin:", origin);
if (allowedOrigins.includes(origin)) {
return callback(null, true);
}
if (!origin) return callback(null, true); // allow same-site or direct calls
// Now this works for *.alpla.net
if (
hostname.endsWith(".alpla.net") ||
hostname === "alpla.net"
) {
return callback(null, true);
}
} catch (err) {
//console.error("Invalid Origin header:", origin);
}
try {
const hostname = new URL(origin).hostname; // strips protocol/port
//console.log("Parsed hostname:", hostname);
return callback(new Error("Not allowed by CORS: " + origin));
},
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
credentials: true,
})
);
if (allowedOrigins.includes(origin)) {
return callback(null, true);
}
// docs and api stuff
app.use(
basePath + "/d",
express.static(join(__dirname, "../lstDocs/build"))
);
app.use(
basePath + "/app",
express.static(join(__dirname, "../frontend/dist"))
);
// Now this works for *.alpla.net
if (hostname.endsWith(".alpla.net") || hostname === "alpla.net") {
return callback(null, true);
}
} catch (err) {
//console.error("Invalid Origin header:", origin);
}
// server setup
const server = createServer(app);
return callback(new Error("Not allowed by CORS: " + origin));
},
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
credentials: true,
exposedHeaders: [
"set-cookie",
"expo-protocol-version",
"expo-sfv-version",
],
allowedHeaders: [
"Content-Type",
"Authorization",
"X-Requested-With",
"XMLHttpRequest",
"expo-runtime-version",
"expo-platform",
"expo-channel-name",
"*",
],
}),
);
// register app
setupRoutes(app, basePath);
// docs and routes
// const openapiSpec: any = swaggerJsdoc(swaggerConfig);
// app.use(
// basePath + "/api/docs",
// swaggerUi.serve,
// swaggerUi.setup(openapiSpec, swaggerUiOptions),
// );
initializeProdPool();
setupSwagger(app, basePath)
app.use(basePath + "/d", express.static(join(__dirname, "../lstDocs/build")));
app.use(
basePath + "/app",
express.static(join(__dirname, "../frontend/dist")),
);
// ws stuff
setupIoServer(server, basePath);
app.get(basePath + "/app/*splat", (req, res) => {
res.sendFile(join(__dirname, "../frontend/dist/index.html"));
});
// sub systems
printers();
schedulerManager();
app.get(basePath + "/d/*splat", (req, res) => {
res.sendFile(join(__dirname, "../lstDocs/build/index.html"));
});
// start the server up
server.listen(PORT, "0.0.0.0", () =>
log.info(
{ stack: { name: "test" } },
`Server running in ${
process.env.NODE_ENV ? process.env.NODE_ENV : "dev"
}, on http://0.0.0.0:${PORT}${basePath}`
)
);
// server setup
const server = createServer(app);
process.on("uncaughtException", async (err) => {
//console.log("Uncaught Exception:", err);
// await closePool();
// const emailData = {
// email: "blake.matthes@alpla.com", // should be moved to the db so it can be reused.
// subject: `${os.hostname()} has just encountered a crash.`,
// template: "serverCrash",
// context: {
// error: err,
// plant: `${os.hostname()}`,
// },
// };
// register app
setupRoutes(app, basePath);
if (!process.env.WEBHOOK_URL) {
// await sendEmail(emailData);
} else {
log.fatal({ stack: err.stack }, err.message);
await sendNotify({
module: "system",
subModule: "fatalCrash",
hostname: os.hostname(),
message: err.message,
stack: err?.stack,
});
}
// ws stuff
setupIoServer(server, basePath);
//process.exit(1);
});
// start all systems after we are intiallally up and running
setTimeout(() => {
baseSettings();
baseModules();
printers();
schedulerManager();
// setInterval(() => {
// const used = process.memoryUsage();
// console.log(
// `Heap: ${(used.heapUsed / 1024 / 1024).toFixed(2)} MB / RSS: ${(
// used.rss /
// 1024 /
// 1024
// ).toFixed(2)} MB`
// );
// }, 10000);
// start up the v1listener
v1Listener();
addListeners();
//userMigrate();
// some temp fixes
// above 235 remove these
manualFixes();
//settingsMigrate();
}, 5 * 1000);
// setTimeout(() => {
// startHonoServer();
// }, 8 * 1000);
// start the server up
server.listen(PORT, "0.0.0.0", () =>
log.info(
{ stack: { name: "test" } },
`Server running in ${
process.env.NODE_ENV ? process.env.NODE_ENV : "dev"
}, on http://0.0.0.0:${PORT}${basePath}`,
),
);
process.on("uncaughtException", async (err) => {
//console.log("Uncaught Exception:", err);
// await closePool();
// const emailData = {
// email: "blake.matthes@alpla.com", // should be moved to the db so it can be reused.
// subject: `${os.hostname()} has just encountered a crash.`,
// template: "serverCrash",
// context: {
// error: err,
// plant: `${os.hostname()}`,
// },
// };
if (!process.env.WEBHOOK_URL) {
// await sendEmail(emailData);
} else {
log.fatal({ stack: err.stack }, err.message);
await sendNotify({
module: "system",
subModule: "fatalCrash",
hostname: os.hostname(),
message: err.message,
stack: err?.stack,
});
}
//process.exit(1);
});
process.on("SIGINT", async () => {
console.log("\nGracefully shutting down...");
try {
await pool.close();
console.log("Closed SQL connection.");
} catch (err) {
console.error("Error closing SQL connection:", err);
} finally {
process.exit(0);
}
});
// Also handle other termination signals (optional)
process.on("SIGTERM", async () => {
console.log("SIGTERM received. Closing SQL connection...");
try {
await pool.close();
} catch (err) {
console.error(err);
} finally {
process.exit(0);
}
});
// setInterval(() => {
// const used = process.memoryUsage();
// console.log(
// `Heap: ${(used.heapUsed / 1024 / 1024).toFixed(2)} MB / RSS: ${(
// used.rss / 1024 / 1024
// ).toFixed(2)} MB`,
// );
// }, 10000);
};
main();

View File

@@ -0,0 +1,22 @@
/**
* This is intended for when running as dev so we can always keep the servers in sync with the main server.
* in the event the server has a change on it we want to make sure we stay in sync
*/
import { createLogger } from "../../../../pkg/logger/logger.js";
export const mainServerSync = async () => {
const log = createLogger({ module: "admin", subModule: "main server sync" });
if (
process.env.NODE_ENV?.trim() !== "production" &&
process.env.MAIN_SERVER
) {
log.info(
{},
"Running in dev and have a main server set we will now pull the servers and look for any changes",
);
} else {
log.info({}, "This server is running in production no sync will happen");
return;
}
};

View File

@@ -4,72 +4,77 @@ import { createLogger } from "../../../pkg/logger/logger.js";
import { tryCatch } from "../../../pkg/utils/tryCatch.js";
export const systemAdminRole = async (userId: string) => {
const log = createLogger({
module: "admin",
subModule: "systemAdminSetup",
});
const systemAdminRoles = [
{
userId: userId,
module: "users",
role: "systemAdmin",
},
{
userId: userId,
module: "admin",
role: "systemAdmin",
},
{
userId: userId,
module: "ocp",
role: "systemAdmin",
},
{
userId: userId,
module: "siloAdjustments",
role: "systemAdmin",
},
{
userId: userId,
module: "demandManagement",
role: "systemAdmin",
},
{
userId: userId,
module: "logistics",
role: "systemAdmin",
},
{
userId: userId,
module: "production",
role: "systemAdmin",
},
{
userId: userId,
module: "quality",
role: "systemAdmin",
},
{
userId: userId,
module: "eom",
role: "systemAdmin",
},
{
userId: userId,
module: "forklifts",
role: "systemAdmin",
},
];
const { data, error } = await tryCatch(
db.insert(userRoles).values(systemAdminRoles).onConflictDoNothing()
);
const log = createLogger({
module: "admin",
subModule: "systemAdminSetup",
});
const systemAdminRoles = [
{
userId: userId,
module: "users",
role: "systemAdmin",
},
{
userId: userId,
module: "admin",
role: "systemAdmin",
},
{
userId: userId,
module: "ocp",
role: "systemAdmin",
},
{
userId: userId,
module: "siloAdjustments",
role: "systemAdmin",
},
{
userId: userId,
module: "demandManagement",
role: "systemAdmin",
},
{
userId: userId,
module: "logistics",
role: "systemAdmin",
},
{
userId: userId,
module: "production",
role: "systemAdmin",
},
{
userId: userId,
module: "quality",
role: "systemAdmin",
},
{
userId: userId,
module: "eom",
role: "systemAdmin",
},
{
userId: userId,
module: "forklifts",
role: "systemAdmin",
},
{
userId: userId,
module: "helperCommands",
role: "systemAdmin",
},
];
const { data, error } = await tryCatch(
db.insert(userRoles).values(systemAdminRoles).onConflictDoNothing(),
);
if (error) {
log.error(
{ stack: { error: error } },
"There was an error creating the system admin roles"
);
}
if (error) {
log.error(
{ stack: { error: error } },
"There was an error creating the system admin roles",
);
}
log.info({ data }, "New system admin roles created");
log.info({ data }, "New system admin roles created");
};

View File

@@ -0,0 +1,42 @@
import type { User } from "better-auth";
import { DrizzleQueryError } from "drizzle-orm";
import { auth } from "../../../../pkg/auth/auth.js";
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
export type NewUser = {
email: string;
password: string;
username: string;
statusCode: number;
message: string;
};
export const createNewUser = async (userData: NewUser) => {
const { data, error } = await tryCatch(
auth.api.createUser({
body: {
email: userData.email, // required
password: userData.password, // required
name: userData.username, // required
role: "user",
data: { username: userData.username },
},
}),
);
if (error) {
if (error instanceof DrizzleQueryError) {
// @ts-ignore
if (error?.cause.message.includes("unique constraint")) {
return {
statusCode: 400,
message: `${userData.username} already exists`,
};
}
}
return error;
}
return data;
};

View File

@@ -1,25 +1,24 @@
import type { Express, Request, Response } from "express";
import { requireAuth } from "../../pkg/middleware/authMiddleware.js";
//admin routes
import users from "./routes/getUserRoles.js";
import grantRoles from "./routes/grantRole.js";
import { mainServerSync } from "./controller/servers/matchServers.js";
import servers from "./routes/servers/serverRoutes.js";
//admin routes
import users from "./routes/users/userRoutes.js";
export const setupAdminRoutes = (app: Express, basePath: string) => {
app.use(
basePath + "/api/admin/server", // will pass bc system admin but this is just telling us we need this
servers
);
app.use(
basePath + "/api/admin/server", // will pass bc system admin but this is just telling us we need this
servers,
);
app.use(
basePath + "/api/admin/users",
requireAuth("user", ["systemAdmin"]), // will pass bc system admin but this is just telling us we need this
users
);
app.use(
basePath + "/api/admin",
requireAuth("user", ["systemAdmin", "admin"]), // will pass bc system admin but this is just telling us we need this
grantRoles
);
app.use(
basePath + "/api/admin/users",
requireAuth("user", ["systemAdmin", "admin"]), // will pass bc system admin but this is just telling us we need this
users,
);
// run the sync only on startup
setTimeout(() => {
mainServerSync();
}, 5 * 1000);
};

View File

@@ -1,52 +0,0 @@
import { Router } from "express";
import type { Request, Response } from "express";
import { tryCatch } from "../../../pkg/utils/tryCatch.js";
import { db } from "../../../pkg/db/db.js";
import { user } from "../../../pkg/db/schema/auth-schema.js";
import { userRoles } from "../../../pkg/db/schema/user_roles.js";
const router = Router();
router.post("/", async (req: Request, res: Response) => {
// should get all users
const { data: users, error: userError } = await tryCatch(
db.select().from(user)
);
if (userError) {
return res.status(500).json({
success: false,
message: "Failed to get users",
error: userError,
});
}
// should get all roles
const { data: userRole, error: userRoleError } = await tryCatch(
db.select().from(userRoles)
);
if (userRoleError) {
return res.status(500).json({
success: false,
message: "Failed to get userRoless",
error: userRoleError,
});
}
// add the roles and return
const usersWithRoles = users.map((user) => {
const roles = userRole
.filter((ur) => ur.userId === user.id)
.map((ur) => ({ module: ur.module, role: ur.role }));
return { ...user, roles };
});
return res
.status(200)
.json({ success: true, message: "User data", data: usersWithRoles });
});
export default router;

View File

@@ -1,74 +0,0 @@
import { Router } from "express";
import type { Request, Response } from "express";
import { tryCatch } from "../../../pkg/utils/tryCatch.js";
import { db } from "../../../pkg/db/db.js";
import z from "zod";
import { userRoles } from "../../../pkg/db/schema/user_roles.js";
import { createLogger } from "../../../pkg/logger/logger.js";
const roleSchema = z.object({
module: z.enum([
"users",
"system",
"ocp",
"siloAdjustments",
"demandManagement",
"logistics",
"production",
"quality",
"eom",
"forklifts",
]),
role: z.enum(["admin", "manager", "supervisor", "test,", "viewer"]),
});
const router = Router();
router.post("/:userId/grant", async (req: Request, res: Response) => {
const log = createLogger({
module: "admin",
subModule: "grantRoles",
});
const userId = req.params.userId;
console.log(userId);
try {
const validated = roleSchema.parse(req.body);
const data = await db
.insert(userRoles)
.values({
userId,
module: validated.module,
role: validated.role,
})
.onConflictDoUpdate({
target: [userRoles.userId, userRoles.module],
set: { module: validated.module, role: validated.role },
});
log.info(
{},
`Module: ${validated.module}, Role: ${validated.role} as was just granted to userID: ${userId}`
);
return res.status(200).json({
success: true,
message: `Module: ${validated.module}, Role: ${validated.role} as was just granted`,
data,
});
} catch (err) {
if (err instanceof z.ZodError) {
const flattened = z.flattenError(err);
return res.status(400).json({
error: "Validation failed",
details: flattened,
});
}
return res.status(400).json({
success: false,
message: "Invalid input please try again.",
});
}
});
export default router;

View File

@@ -1,100 +1,106 @@
import { Router } from "express";
import type { Request, Response } from "express";
import {
insertServerDataSchema,
serverData,
} from "../../../../pkg/db/schema/servers.js";
import { db } from "../../../../pkg/db/db.js";
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
import type { DrizzleError } from "drizzle-orm";
import axios from "axios";
import { createLogger } from "../../../../pkg/logger/logger.js";
import { type DrizzleError, sql } from "drizzle-orm";
import type { Request, Response } from "express";
import { Router } from "express";
import https from "https";
import { db } from "../../../../pkg/db/db.js";
import {
insertServerDataSchema,
serverData,
} from "../../../../pkg/db/schema/servers.js";
import { createLogger } from "../../../../pkg/logger/logger.js";
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
const router = Router();
router.post("/", async (req: Request, res: Response) => {
// when a new server is posted from localhost or 127.0.0.1 we also want to post it to the test server so we can see it from there
//res.status(200).json({ message: "Server added", ip: req.hostname });
const log = createLogger({ module: "admin", subModule: "add server" });
const parsed = insertServerDataSchema.safeParse(req.body);
// when a new server is posted from localhost or 127.0.0.1 we also want to post it to the test server so we can see it from there
//res.status(200).json({ message: "Server added", ip: req.hostname });
const log = createLogger({ module: "admin", subModule: "add server" });
const parsed = insertServerDataSchema.safeParse(req.body);
if (!parsed.success) {
return res.status(400).json({ errors: parsed.error.flatten() });
}
if (!parsed.success) {
return res.status(400).json({ errors: parsed.error.flatten() });
}
const { data, error } = await tryCatch(
db
.insert(serverData)
.values(parsed.data)
//.onConflictDoNothing()
.returning({
name: serverData.name,
plantToken: serverData.plantToken,
})
);
const { data, error } = await tryCatch(
db
.insert(serverData)
.values({
...parsed.data,
add_user: req.user?.username,
add_date: sql`NOW()`,
upd_user: req.user?.username,
upd_date: sql`NOW()`,
})
//.onConflictDoNothing()
.returning({
name: serverData.name,
plantToken: serverData.plantToken,
}),
);
if (error) {
const err: DrizzleError = error;
return res.status(400).json({
message: `Error adding the server`,
error: err.cause,
});
}
if (error) {
const err: DrizzleError = error;
return res.status(400).json({
message: `Error adding the server`,
error: err.cause,
});
}
if (req.hostname === "localhost" && process.env.MAIN_SERVER) {
log.info({}, "Running in dev server about to add in a new server");
const axiosInstance = axios.create({
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
baseURL: process.env.MAIN_SERVER, // e.g. "https://example.com"
withCredentials: true,
});
if (req.hostname === "localhost" && process.env.MAIN_SERVER) {
log.info({}, "Running in dev server about to add in a new server");
const axiosInstance = axios.create({
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
baseURL: process.env.MAIN_SERVER, // e.g. "https://example.com"
withCredentials: true,
});
const loginRes = (await axiosInstance.post(
`${process.env.MAIN_SERVER}/lst/api/auth/sign-in/username`,
{
username: process.env.MAIN_SERVER_USERNAME,
password: process.env.MAIN_SERVER_PASSWORD,
},
{
headers: { "Content-Type": "application/json" },
}
)) as any;
const setCookie = loginRes.headers["set-cookie"][0];
const loginRes = (await axiosInstance.post(
`${process.env.MAIN_SERVER}/lst/api/auth/sign-in/username`,
{
username: process.env.MAIN_SERVER_USERNAME,
password: process.env.MAIN_SERVER_PASSWORD,
},
{
headers: { "Content-Type": "application/json" },
},
)) as any;
const setCookie = loginRes.headers["set-cookie"][0];
if (!setCookie) {
throw new Error("Did not receive a Set-Cookie header from login");
}
if (!setCookie) {
throw new Error("Did not receive a Set-Cookie header from login");
}
const { data, error } = await tryCatch(
axios.post(
`${process.env.MAIN_SERVER}/lst/api/admin/server`,
parsed.data,
{
headers: {
"Content-Type": "application/json",
Cookie: setCookie.split(";")[0],
},
withCredentials: true,
}
)
);
const { data, error } = await tryCatch(
axios.post(
`${process.env.MAIN_SERVER}/lst/api/admin/server`,
parsed.data,
{
headers: {
"Content-Type": "application/json",
Cookie: setCookie.split(";")[0],
},
withCredentials: true,
},
),
);
if (error) {
log.error(
{ stack: error },
"There was an error adding the server to Main Server"
);
}
log.info(
{ stack: data?.data },
"A new Server was just added to the server."
);
}
if (error) {
log.error(
{ stack: error },
"There was an error adding the server to Main Server",
);
}
log.info(
{ stack: data?.data },
"A new Server was just added to the server.",
);
}
return res
.status(201)
.json({ message: `Server ${data[0]?.name} added`, data: data });
return res
.status(201)
.json({ message: `Server ${data[0]?.name} added`, data: data });
});
export default router;

Some files were not shown because too many files have changed in this diff Show More