Files
yourpart3/backend/routers/falukantRouter.js
2025-01-28 09:55:36 +01:00

35 lines
1.9 KiB
JavaScript

import express from 'express';
import FalukantController from '../controllers/falukantController.js';
const router = express.Router();
const falukantController = new FalukantController();
router.get('/user', falukantController.getUser);
router.post('/user', falukantController.createUser);
router.get('/name/randomfirstname/:gender', falukantController.randomFirstName);
router.get('/name/randomlastname', falukantController.randomLastName);
router.get('/info', falukantController.getInfo);
router.get('/branches/:branch', falukantController.getBranch);
router.get('/branches', falukantController.getBranches);
router.get('/productions', falukantController.getAllProductions);
router.post('/production', falukantController.createProduction);
router.get('/production/:branchId', falukantController.getProduction);
router.get('/stocktypes', falukantController.getStockTypes);
router.get('/stockoverview', falukantController.getStockOverview);
router.get('/stock/?:branchId', falukantController.getStock);
router.post('/stock', falukantController.createStock);
router.get('/products', falukantController.getProducts);
router.get('/inventory/?:branchId', falukantController.getInventory);
router.post('/sell/all', falukantController.sellAllProducts);
router.post('/sell', falukantController.sellProduct);
router.post('/moneyhistory', falukantController.moneyHistory);
router.get('/storage/:branchId', falukantController.getStorage);
router.post('/storage', falukantController.buyStorage);
router.delete('/storage', falukantController.sellStorage);
router.post('/director/proposal', falukantController.getDirectorProposals);
router.post('/director/convertproposal', falukantController.convertProposalToDirector);
router.post('/director/settings', falukantController.setSetting);
router.get('/director/:branchId', falukantController.getDirectorForBranch);
router.get('/marriage/proposals', falukantController.getMarriageProposals);
export default router;