-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathabsence.ts
71 lines (65 loc) · 1.4 KB
/
absence.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import type { AsyncBelongsTo } from "@ember-data/model";
import Model, { attr, belongsTo } from "@ember-data/model";
import type { Moment, Duration } from "moment";
/**
* @module timed
* @submodule timed-models
* @public
*/
import moment from "moment";
import type AbsenceType from "timed/models/absence-type";
import type User from "timed/models/user";
/**
* The report model
*
* @class Report
* @extends DS.Model
* @public
*/
export default class Absence extends Model {
/**
* The comment
*
* @property {String} comment
* @public
*/
@attr("string", { defaultValue: "" })
declare comment: string;
/**
* The duration
*
* @property {moment.duration} duration
* @public
*/
@attr("django-duration", { defaultValue: () => moment.duration() })
declare duration: Duration;
/**
* The date
*
* @property {moment} date
* @public
*/
@attr("django-date")
declare date?: Moment;
/**
* The type of the absence
*
* @property {AbsenceType} absenceType
* @public
*/
@belongsTo("absence-type", { async: false, inverse: null })
declare absenceType: AbsenceType;
/**
* The user
*
* @property {User} user
* @public
*/
@belongsTo("user", { async: true, inverse: null })
declare user: AsyncBelongsTo<User>;
}
declare module "ember-data/types/registries/model" {
export default interface ModelRegistry {
absence: Absence;
}
}