-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(frontend): convert models, services, transforms, adapters an…
…d serializers to typescript
- Loading branch information
Showing
62 changed files
with
1,014 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { AsyncHasMany } from "@ember-data/model"; | ||
import Model, { attr, belongsTo, hasMany } from "@ember-data/model"; | ||
import type { Duration } from "moment"; | ||
import type AbsenceCredit from "timed/models/absence-credit"; | ||
import type AbsenceType from "timed/models/absence-type"; | ||
import type User from "timed/models/user"; | ||
|
||
export default class AbsenceBalance extends Model { | ||
@attr("number") | ||
declare credit?: number; | ||
@attr("number") | ||
declare usedDays?: number; | ||
@attr("django-duration") | ||
declare usedDuration?: Duration; | ||
@attr("number") | ||
declare balance?: number; | ||
@belongsTo("user", { async: false, inverse: "absenceBalances" }) | ||
declare user: User; | ||
@belongsTo("absence-type", { async: false, inverse: "absenceBalances" }) | ||
declare absenceType: AbsenceType; | ||
@hasMany("absence-credit", { async: true, inverse: null }) | ||
declare absenceCredits: AsyncHasMany<AbsenceCredit>; | ||
} | ||
|
||
declare module "ember-data/types/registries/model" { | ||
export default interface ModelRegistry { | ||
"absence-balance": AbsenceBalance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.