Commit Graph

51 Commits

Author SHA1 Message Date
bd4a066d10 fix: remove domain->common/errors import — domain must be dependency-free
Review #3 comment: domain package shouldn't depend on any other package.
Replace common/errors.ErrNotImplemented alias with stdlib errors.New
so domain has zero internal dependencies.
2026-06-28 10:02:35 +00:00
9088caf600 fix: unify ErrNotFound — remove domain.ErrNotFound, use errors.ErrNotFound everywhere
Responds to PR #5 review comment: consolidate on common/errors.ErrNotFound
instead of having two separate error types (domain.PlainError and
common/errors.SimpleError) for the same sentinel.

- Remove domain.ErrNotFound and domain.PlainError type
- Keep domain.ErrNotImplemented as alias to common/errors.ErrNotImplemented
- Update sqlite_organization_repository to return cerrors.ErrNotFound
- Update sqlite_learning_category_repository to return cerrors.ErrNotFound
- Update server.go handleError to check only errors.ErrNotFound
- Update test to assert errors.ErrNotFound
- Remove unused domain import from server.go
2026-06-28 07:56:13 +00:00
4f89f59232 fix(cluster-3): http hardening (M15/M16/M14/C2)
- pagination: clamp per_page to [1,100] and page to >=1 in the parser,
  guard the TotalPages division against per_page=0 (panic), and clamp the
  current page to [1,totalPages]; preserves cursor (next-token) mode
- middleware: add panic-recovery as the outermost middleware so handler
  panics return a 500 instead of crashing the process; re-panics
  http.ErrAbortHandler to keep file serving intact
- index: bound the index page query (Limit:200) so it no longer drains
  the entire courses table in 1000-row batches
2026-06-28 04:31:21 +00:00
40e5621eb9 fix(cluster-2): error contract unification (C1/M10/M11/M12)
- http: handleError now recognizes domain.ErrNotFound in addition to the
  common errors.ErrNotFound sentinel, so repo-not-found maps to 404
  instead of 500 (the two packages use distinct error types)
- sqlite_course_repository: propagate listCount errors instead of logging
  and swallowing them, which left callers with a silent Count=0
- synchandler: collect course/organization insert failures into a
  function-scoped error via errors.Join and return it; previously the
  loop-local err was overwritten and the handler always returned nil,
  hiding all insert failures
2026-06-28 04:28:48 +00:00
23c29aba1d fix(cluster-1): data corruption fixes (C4/C5/C8)
- synchandler: combine course date with clock time via time.Date instead
  of adding two absolute Unix epochs, which produced corrupt start times
- tracing: make DeploymentEnvironment configurable via config.Trace
  (defaults to development instead of hardcoded production)
- http: align course handler tracer name to 'kuriweb.http' to match the
  request middleware instrument so spans share the same tracer
2026-06-27 23:54:07 +00:00
84656c6c56 test: add unit tests for domain and business logic (#4)
Adds 14 unit tests across 3 files covering inMemoryMapper, create/list/get/stats handlers, and pagination logic.
2026-06-27 23:23:00 +00:00
39c4fa5621 chore: upgrade Go from 1.22 to 1.26
Update go.mod to require go 1.26.0 and pin toolchain go1.26.4.

Generated with go mod tidy; no code or dependency changes required.
2026-06-27 22:46:52 +00:00
348c737163 add host support 2024-09-25 00:48:47 +03:00
c3d6510a7d support metrics sending via grpc 2024-09-25 00:47:12 +03:00
c7fada2c54 update trace logic 2024-09-24 21:59:33 +03:00
c0f45d98c2 count courses by school 2024-06-16 23:55:49 +03:00
1a31006b21 Make filters by all options at once
Before script has been separated on two groups: for learning type and
course category and for school and sorting. It means when school is
choosen, learning type and course category resets on update.

TODO: need to add pagination
2024-05-02 23:24:41 +03:00
e8ac96a065 minor fix 2024-04-19 00:31:26 +03:00
3a9e01a683 rework list courses page to be flatten 2024-04-19 00:13:03 +03:00
035e9c848f minor web-view improvment 2024-04-11 10:33:14 +03:00
605e117586 add pagination 2024-04-07 23:49:06 +03:00
68810d93a7 add opentelemetry tracing 2024-04-02 15:23:22 +03:00
e7c2832865 Add command and query for organizations
* Added command and query for organizations
* Saving unknown organizations into database in `background` service
* Added `List` method in `OrganizationRepository`
2024-03-24 22:59:32 +03:00
9d2efcc1c4 implement organization repo 2024-03-24 16:51:39 +03:00
88a3cae4fa learning category repo 2024-03-16 17:44:43 +03:00
938d3cd307 add sqlite support 2024-03-12 14:44:22 +03:00
97986063df bootstrap migrate 2024-03-04 00:03:08 +03:00
251ecd94d4 minor fixes 2024-03-03 09:34:17 +03:00
6d1769ff24 make bootstrap site be more cool 2024-03-03 00:55:43 +03:00
af4a4f7840 bootstrap migrate 2024-03-02 19:34:33 +03:00
e5dfccabbf use tailwind 2024-02-10 20:22:30 +03:00
d5f76f4e07 add templ engine 2024-01-21 16:49:47 +03:00
d4974b30ec update tags 2024-01-11 19:45:02 +03:00
8b8a7618a2 finish breadcumbs and categories 2024-01-11 19:17:26 +03:00
067c63baa8 add favicon and breadcumbs 2024-01-11 11:55:37 +03:00
5fd0861e2d filter by learning_types and course_thematics 2024-01-10 00:02:40 +03:00
728c8fa59e embed assets and minor fixes 2024-01-09 15:19:53 +03:00
2c0564f68c add show course and map names 2024-01-08 18:31:35 +03:00
48f5d80f7a add more style 2024-01-05 23:03:15 +03:00
fbe9927ac3 able to update desc for course 2023-12-18 00:14:07 +03:00
1d4e8e10fb implement webserver 2023-12-17 21:21:13 +03:00
f60ebcfb36 add simple http 2023-12-17 10:01:49 +03:00
b3e14f8c45 remove course thematics validation 2023-12-15 14:29:07 +03:00
06c7997491 list by pages and rate req limits 2023-12-15 13:00:59 +03:00
2f3a6e35e9 api fixes for list filters 2023-12-14 20:59:58 +03:00
e80d5145cf add filters to cli and client 2023-12-14 20:40:35 +03:00
30c361eb34 describe more metadata props 2023-12-13 22:24:55 +03:00
f7b1db27a3 add data container 2023-12-10 14:32:56 +03:00
a6af4ab4e8 add filters for courses 2023-12-10 14:24:43 +03:00
3733278d8c setup parser 2023-12-09 00:33:12 +03:00
20107503e0 create product at ydb 2023-12-04 01:24:24 +03:00
414dc87091 able to get product 2023-11-30 00:39:51 +03:00
606b94e35b make application with base logic 2023-11-26 15:39:34 +03:00
0553ea71c3 able to list products 2023-11-23 19:13:54 +03:00
f382d9e73b add metadata prefooter 2023-11-22 01:12:04 +03:00