-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature 107: Refactor Backend Structure #141
Conversation
a5875a2
to
6cacb79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS this file/ the entire feature still required? now that the search is in the features/assets/search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until #99 is finished, the old search is still in use. We will most likely need a cleanup issue afterwards to remove things like this file, but for now, it's still required.
static parse(value: string): LocalDate { | ||
const parts = value.split('-'); | ||
if (parts.length !== 3) { | ||
throw new Error(`failed to parse LocalDate (expected 3 parts, but got ${parts})`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parts.length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
private constructor(date: Date) { | ||
this.year = date.getFullYear(); | ||
this.month = date.getMonth() + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why -1 and then +1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaScript's Date
stores the month with a zero-based index (e.g. January = 0
, December = 11
, etc.). Everything else, i.e. days and years, are one-based. To use the same system for all three components, I increase the month when storing it in LocalDate
.
# Conflicts: # apps/server-asset-sg/project.json # package.json Move app routes into specific features Collect user CRUD operations in `UserRepo` Update NestJs to `10.x` Add role guard Move user APIs into `/api/users` path Move contact routes into `/api/contacts` Refactor asset API Move NestJS utils into ` core` Fix `ElasticSearchAsset.titleOriginal` not supporting `null` values Fix `LocalDate.parse` error message
b01c8b0
to
dc513da
Compare
Resolves #107, resolves #129.
Restructures the backend (
server-asset-sg
) by feature.fp-ts
into normal TypeScript interfaces. The main exceptions to this areasset-edit
(now found in theasset-old
feature) and the OCR file api.AppController
, since the frontend still depends on it.*.repo.ts
file.