Cleaned up code
This commit is contained in:
55
README.md
55
README.md
@@ -1,55 +0,0 @@
|
|||||||
# Darbinieku darba laiku atskaite no SQLite datubāzes
|
|
||||||
|
|
||||||
## Resursi
|
|
||||||
|
|
||||||
Tev tiek dots **SQLite datubāzes fails**: `attendance.db`
|
|
||||||
Šajā datubāzē ir divas tabulas:
|
|
||||||
|
|
||||||
### Tabulu struktūra
|
|
||||||
|
|
||||||
**`Employees`**
|
|
||||||
|
|
||||||
| id | username |
|
|
||||||
|:----|:-----------|
|
|
||||||
| 1 | janis |
|
|
||||||
| 2 | liga |
|
|
||||||
| 3 | juris |
|
|
||||||
| 4 | dace |
|
|
||||||
|
|
||||||
**`Attendance`**
|
|
||||||
|
|
||||||
| id | employee_id | date | hours_worked |
|
|
||||||
|:----|:-------------|:-------------|:----------------|
|
|
||||||
| 1 | 1 | 2024-06-29 | 4 |
|
|
||||||
| 2 | 1 | 2024-06-29 | 3.5 |
|
|
||||||
| 3 | 1 | 2024-06-28 | 8 |
|
|
||||||
| 4 | 2 | 2024-06-29 | 5 |
|
|
||||||
| 5 | 2 | 2024-06-29 | 2.5 |
|
|
||||||
| 6 | 2 | 2024-06-28 | 6.75 |
|
|
||||||
| 7 | 3 | 2024-06-30 | 6 |
|
|
||||||
| 8 | 3 | 2024-06-27 | 2 |
|
|
||||||
| 9 | 3 | 2024-06-27 | 7 |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📌 Uzdevums
|
|
||||||
|
|
||||||
Izveidot **WEB aplikāciju** (vēlams izmantot Python):
|
|
||||||
|
|
||||||
### 📍 Sākuma lapa `/`
|
|
||||||
- Parāda sarakstu ar visiem darbinieku `username`
|
|
||||||
- Iespēja veikt **username meklēšanu**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 📍 Darbinieka skatījums
|
|
||||||
- Klikšķinot uz kāda darbinieka username, atveras lapa/skats, kur:
|
|
||||||
- Redzama **tabula ar divām kolonnām: `date`, `hours_worked`**
|
|
||||||
- Tabulā katrai dienai **tiek summētas visas nostrādātās stundas šajā datumā**
|
|
||||||
- 📌 *Piemērs*:
|
|
||||||
Ja vienā dienā ir divi ieraksti ar 4h un 3.5h — kopsumma būs **7.5**
|
|
||||||
- Tabula **sakārtota pēc `date` DESC**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
55
Uzdevums.md
Normal file
55
Uzdevums.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Darbinieku darba laiku atskaite no SQLite datubāzes
|
||||||
|
|
||||||
|
## Resursi
|
||||||
|
|
||||||
|
Tev tiek dots **SQLite datubāzes fails**: `attendance.db`
|
||||||
|
Šajā datubāzē ir divas tabulas:
|
||||||
|
|
||||||
|
### Tabulu struktūra
|
||||||
|
|
||||||
|
**`Employees`**
|
||||||
|
|
||||||
|
| id | username |
|
||||||
|
|:----|:-----------|
|
||||||
|
| 1 | janis |
|
||||||
|
| 2 | liga |
|
||||||
|
| 3 | juris |
|
||||||
|
| 4 | dace |
|
||||||
|
|
||||||
|
**`Attendance`**
|
||||||
|
|
||||||
|
| id | employee_id | date | hours_worked |
|
||||||
|
|:----|:-------------|:-------------|:----------------|
|
||||||
|
| 1 | 1 | 2024-06-29 | 4 |
|
||||||
|
| 2 | 1 | 2024-06-29 | 3.5 |
|
||||||
|
| 3 | 1 | 2024-06-28 | 8 |
|
||||||
|
| 4 | 2 | 2024-06-29 | 5 |
|
||||||
|
| 5 | 2 | 2024-06-29 | 2.5 |
|
||||||
|
| 6 | 2 | 2024-06-28 | 6.75 |
|
||||||
|
| 7 | 3 | 2024-06-30 | 6 |
|
||||||
|
| 8 | 3 | 2024-06-27 | 2 |
|
||||||
|
| 9 | 3 | 2024-06-27 | 7 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📌 Uzdevums
|
||||||
|
|
||||||
|
Izveidot **WEB aplikāciju** (vēlams izmantot Python):
|
||||||
|
|
||||||
|
### 📍 Sākuma lapa `/`
|
||||||
|
- Parāda sarakstu ar visiem darbinieku `username`
|
||||||
|
- Iespēja veikt **username meklēšanu**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 📍 Darbinieka skatījums
|
||||||
|
- Klikšķinot uz kāda darbinieka username, atveras lapa/skats, kur:
|
||||||
|
- Redzama **tabula ar divām kolonnām: `date`, `hours_worked`**
|
||||||
|
- Tabulā katrai dienai **tiek summētas visas nostrādātās stundas šajā datumā**
|
||||||
|
- 📌 *Piemērs*:
|
||||||
|
Ja vienā dienā ir divi ieraksti ar 4h un 3.5h — kopsumma būs **7.5**
|
||||||
|
- Tabula **sakārtota pēc `date` DESC**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ import { API_BASE_URL } from "@/consts";
|
|||||||
import type { UserInfo } from "@/types/api";
|
import type { UserInfo } from "@/types/api";
|
||||||
import { capitalizeFirstLetter } from "@/utils/capitalizeFirstLetter";
|
import { capitalizeFirstLetter } from "@/utils/capitalizeFirstLetter";
|
||||||
import { useQuery, type UseQueryResult } from "@tanstack/react-query";
|
import { useQuery, type UseQueryResult } from "@tanstack/react-query";
|
||||||
import { createFileRoute, useParams } from "@tanstack/react-router";
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
|
||||||
export const Route = createFileRoute("/$userId")({
|
export const Route = createFileRoute("/$userId")({
|
||||||
component: RouteComponent,
|
component: RouteComponent,
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
|
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
|
||||||
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
|
||||||
|
|
||||||
import Header from "../components/Header";
|
import Header from "../components/Header";
|
||||||
|
|
||||||
import TanStackQueryLayout from "../integrations/tanstack-query/layout.tsx";
|
|
||||||
|
|
||||||
import type { QueryClient } from "@tanstack/react-query";
|
import type { QueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
interface MyRouterContext {
|
interface MyRouterContext {
|
||||||
@@ -15,11 +11,7 @@ export const Route = createRootRouteWithContext<MyRouterContext>()({
|
|||||||
component: () => (
|
component: () => (
|
||||||
<>
|
<>
|
||||||
<Header />
|
<Header />
|
||||||
|
|
||||||
<Outlet />
|
<Outlet />
|
||||||
<TanStackRouterDevtools />
|
|
||||||
|
|
||||||
<TanStackQueryLayout />
|
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|||||||
BIN
preview 1.webp
Normal file
BIN
preview 1.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
BIN
preview 2.webp
Normal file
BIN
preview 2.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Reference in New Issue
Block a user