movie.ts
1.43 KB
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
import { Model } from "pinia-orm";
import { Credit } from "~/models/credit";
export class Movie extends Model {
/**
*
* @return {string}
*/
static get entity() {
return "Movie";
}
/**
*
* @return {string}
*/
static get primaryKey() {
return "id";
}
static fields() {
return {
// Attributs.
id: this.number(null),
adult: this.boolean(false),
backdrop_path: this.string(null),
belongs_to_collection: this.attr(null),
budget: this.number(null),
genre_ids: this.attr([]),
genres: this.attr([]),
homepage: this.string(null),
imdb_id: this.string(null),
origin_country: this.attr([]),
original_language: this.string(null),
original_title: this.string(null),
overview: this.string(null),
popularity: this.number(null),
poster_path: this.string(null),
production_companies: this.attr([]),
production_cuntries: this.attr([]),
release_date: this.string(null),
revenue: this.number(null),
runtime: this.number(null),
spoken_languages: this.attr([]),
status: this.string(null),
tagline: this.string(null),
title: this.string(null),
video: this.boolean(false),
vote_average: this.number(null),
vote_count: this.number(null),
// Relations.
credit: this.hasOne(Credit, "movie_id", "id"),
};
}
static piniaOptions = {
persist: true,
};
}