@earbug/db-models 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccessControlPreference.d.ts +14 -0
- package/dist/AccessControlPreference.js +42 -0
- package/dist/AppUser.d.ts +15 -1
- package/dist/AppUser.js +6 -0
- package/dist/CanonGenre.d.ts +12 -0
- package/dist/CanonTrack.d.ts +12 -0
- package/dist/PlatformUserPlaylist.d.ts +3 -1
- package/dist/PlatformUserPlaylist.js +6 -0
- package/dist/RadioShow.d.ts +80 -0
- package/dist/RadioShow.js +93 -0
- package/dist/RadioShowGenres.d.ts +29 -0
- package/dist/RadioShowGenres.js +53 -0
- package/dist/RadioShowMedia.d.ts +30 -0
- package/dist/RadioShowMedia.js +89 -0
- package/dist/RadioShowPlacement.d.ts +35 -0
- package/dist/RadioShowPlacement.js +69 -0
- package/dist/RadioShowPublishRequests.d.ts +26 -0
- package/dist/RadioShowPublishRequests.js +80 -0
- package/dist/init-models.d.ts +20 -2
- package/dist/init-models.js +40 -2
- package/models/AccessControlPreference.ts +53 -0
- package/models/AppUser.ts +22 -1
- package/models/CanonGenre.ts +13 -0
- package/models/CanonTrack.ts +13 -0
- package/models/PlatformUserPlaylist.ts +9 -1
- package/models/RadioShow.ts +151 -0
- package/models/RadioShowGenres.ts +81 -0
- package/models/RadioShowMedia.ts +93 -0
- package/models/RadioShowPlacement.ts +103 -0
- package/models/RadioShowPublishRequests.ts +80 -0
- package/models/init-models.ts +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { RadioShowGenres, RadioShowGenresId } from './RadioShowGenres';
|
|
5
|
+
import type { RadioShowMedia, RadioShowMediaId } from './RadioShowMedia';
|
|
6
|
+
import type { RadioShowPlacement, RadioShowPlacementId } from './RadioShowPlacement';
|
|
7
|
+
import type { RadioShowPublishRequests, RadioShowPublishRequestsId } from './RadioShowPublishRequests';
|
|
8
|
+
|
|
9
|
+
export interface RadioShowAttributes {
|
|
10
|
+
creatorUserId: string;
|
|
11
|
+
scheduledRelease?: Date;
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
deleted?: boolean;
|
|
15
|
+
id: string;
|
|
16
|
+
createDate: Date;
|
|
17
|
+
updateDate: Date;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type RadioShowPk = "id";
|
|
21
|
+
export type RadioShowId = RadioShow[RadioShowPk];
|
|
22
|
+
export type RadioShowOptionalAttributes = "scheduledRelease" | "description" | "deleted" | "id" | "createDate" | "updateDate";
|
|
23
|
+
export type RadioShowCreationAttributes = Optional<RadioShowAttributes, RadioShowOptionalAttributes>;
|
|
24
|
+
|
|
25
|
+
export class RadioShow extends Model<RadioShowAttributes, RadioShowCreationAttributes> implements RadioShowAttributes {
|
|
26
|
+
creatorUserId!: string;
|
|
27
|
+
scheduledRelease?: Date;
|
|
28
|
+
title!: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
deleted?: boolean;
|
|
31
|
+
id!: string;
|
|
32
|
+
createDate!: Date;
|
|
33
|
+
updateDate!: Date;
|
|
34
|
+
|
|
35
|
+
// RadioShow belongsTo AppUser via creatorUserId
|
|
36
|
+
creatorUser!: AppUser;
|
|
37
|
+
getCreatorUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
38
|
+
setCreatorUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
39
|
+
createCreatorUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
40
|
+
// RadioShow hasMany RadioShowGenres via radioShowId
|
|
41
|
+
radioShowGenres!: RadioShowGenres[];
|
|
42
|
+
getRadioShowGenres!: Sequelize.HasManyGetAssociationsMixin<RadioShowGenres>;
|
|
43
|
+
setRadioShowGenres!: Sequelize.HasManySetAssociationsMixin<RadioShowGenres, RadioShowGenresId>;
|
|
44
|
+
addRadioShowGenre!: Sequelize.HasManyAddAssociationMixin<RadioShowGenres, RadioShowGenresId>;
|
|
45
|
+
addRadioShowGenres!: Sequelize.HasManyAddAssociationsMixin<RadioShowGenres, RadioShowGenresId>;
|
|
46
|
+
createRadioShowGenre!: Sequelize.HasManyCreateAssociationMixin<RadioShowGenres>;
|
|
47
|
+
removeRadioShowGenre!: Sequelize.HasManyRemoveAssociationMixin<RadioShowGenres, RadioShowGenresId>;
|
|
48
|
+
removeRadioShowGenres!: Sequelize.HasManyRemoveAssociationsMixin<RadioShowGenres, RadioShowGenresId>;
|
|
49
|
+
hasRadioShowGenre!: Sequelize.HasManyHasAssociationMixin<RadioShowGenres, RadioShowGenresId>;
|
|
50
|
+
hasRadioShowGenres!: Sequelize.HasManyHasAssociationsMixin<RadioShowGenres, RadioShowGenresId>;
|
|
51
|
+
countRadioShowGenres!: Sequelize.HasManyCountAssociationsMixin;
|
|
52
|
+
// RadioShow hasMany RadioShowMedia via radioShowId
|
|
53
|
+
radioShowMedia!: RadioShowMedia[];
|
|
54
|
+
getRadioShowMedia!: Sequelize.HasManyGetAssociationsMixin<RadioShowMedia>;
|
|
55
|
+
setRadioShowMedia!: Sequelize.HasManySetAssociationsMixin<RadioShowMedia, RadioShowMediaId>;
|
|
56
|
+
addRadioShowMedium!: Sequelize.HasManyAddAssociationMixin<RadioShowMedia, RadioShowMediaId>;
|
|
57
|
+
addRadioShowMedia!: Sequelize.HasManyAddAssociationsMixin<RadioShowMedia, RadioShowMediaId>;
|
|
58
|
+
createRadioShowMedium!: Sequelize.HasManyCreateAssociationMixin<RadioShowMedia>;
|
|
59
|
+
removeRadioShowMedium!: Sequelize.HasManyRemoveAssociationMixin<RadioShowMedia, RadioShowMediaId>;
|
|
60
|
+
removeRadioShowMedia!: Sequelize.HasManyRemoveAssociationsMixin<RadioShowMedia, RadioShowMediaId>;
|
|
61
|
+
hasRadioShowMedium!: Sequelize.HasManyHasAssociationMixin<RadioShowMedia, RadioShowMediaId>;
|
|
62
|
+
hasRadioShowMedia!: Sequelize.HasManyHasAssociationsMixin<RadioShowMedia, RadioShowMediaId>;
|
|
63
|
+
countRadioShowMedia!: Sequelize.HasManyCountAssociationsMixin;
|
|
64
|
+
// RadioShow hasMany RadioShowPlacement via radioShowId
|
|
65
|
+
radioShowPlacements!: RadioShowPlacement[];
|
|
66
|
+
getRadioShowPlacements!: Sequelize.HasManyGetAssociationsMixin<RadioShowPlacement>;
|
|
67
|
+
setRadioShowPlacements!: Sequelize.HasManySetAssociationsMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
68
|
+
addRadioShowPlacement!: Sequelize.HasManyAddAssociationMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
69
|
+
addRadioShowPlacements!: Sequelize.HasManyAddAssociationsMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
70
|
+
createRadioShowPlacement!: Sequelize.HasManyCreateAssociationMixin<RadioShowPlacement>;
|
|
71
|
+
removeRadioShowPlacement!: Sequelize.HasManyRemoveAssociationMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
72
|
+
removeRadioShowPlacements!: Sequelize.HasManyRemoveAssociationsMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
73
|
+
hasRadioShowPlacement!: Sequelize.HasManyHasAssociationMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
74
|
+
hasRadioShowPlacements!: Sequelize.HasManyHasAssociationsMixin<RadioShowPlacement, RadioShowPlacementId>;
|
|
75
|
+
countRadioShowPlacements!: Sequelize.HasManyCountAssociationsMixin;
|
|
76
|
+
// RadioShow hasMany RadioShowPublishRequests via radioShowId
|
|
77
|
+
radioShowPublishRequests!: RadioShowPublishRequests[];
|
|
78
|
+
getRadioShowPublishRequests!: Sequelize.HasManyGetAssociationsMixin<RadioShowPublishRequests>;
|
|
79
|
+
setRadioShowPublishRequests!: Sequelize.HasManySetAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
80
|
+
addRadioShowPublishRequest!: Sequelize.HasManyAddAssociationMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
81
|
+
addRadioShowPublishRequests!: Sequelize.HasManyAddAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
82
|
+
createRadioShowPublishRequest!: Sequelize.HasManyCreateAssociationMixin<RadioShowPublishRequests>;
|
|
83
|
+
removeRadioShowPublishRequest!: Sequelize.HasManyRemoveAssociationMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
84
|
+
removeRadioShowPublishRequests!: Sequelize.HasManyRemoveAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
85
|
+
hasRadioShowPublishRequest!: Sequelize.HasManyHasAssociationMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
86
|
+
hasRadioShowPublishRequests!: Sequelize.HasManyHasAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
|
|
87
|
+
countRadioShowPublishRequests!: Sequelize.HasManyCountAssociationsMixin;
|
|
88
|
+
|
|
89
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShow {
|
|
90
|
+
return RadioShow.init({
|
|
91
|
+
creatorUserId: {
|
|
92
|
+
type: DataTypes.UUID,
|
|
93
|
+
allowNull: false,
|
|
94
|
+
references: {
|
|
95
|
+
model: 'app_user',
|
|
96
|
+
key: 'id'
|
|
97
|
+
},
|
|
98
|
+
field: 'creator_user_id'
|
|
99
|
+
},
|
|
100
|
+
scheduledRelease: {
|
|
101
|
+
type: DataTypes.DATE,
|
|
102
|
+
allowNull: true,
|
|
103
|
+
field: 'scheduled_release'
|
|
104
|
+
},
|
|
105
|
+
title: {
|
|
106
|
+
type: DataTypes.STRING(40),
|
|
107
|
+
allowNull: false
|
|
108
|
+
},
|
|
109
|
+
description: {
|
|
110
|
+
type: DataTypes.STRING(512),
|
|
111
|
+
allowNull: true
|
|
112
|
+
},
|
|
113
|
+
deleted: {
|
|
114
|
+
type: DataTypes.BOOLEAN,
|
|
115
|
+
allowNull: true
|
|
116
|
+
},
|
|
117
|
+
id: {
|
|
118
|
+
type: DataTypes.UUID,
|
|
119
|
+
allowNull: false,
|
|
120
|
+
defaultValue: DataTypes.UUIDV4,
|
|
121
|
+
primaryKey: true
|
|
122
|
+
},
|
|
123
|
+
createDate: {
|
|
124
|
+
type: DataTypes.DATE,
|
|
125
|
+
allowNull: false,
|
|
126
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
127
|
+
field: 'create_date'
|
|
128
|
+
},
|
|
129
|
+
updateDate: {
|
|
130
|
+
type: DataTypes.DATE,
|
|
131
|
+
allowNull: false,
|
|
132
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
133
|
+
field: 'update_date'
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
sequelize,
|
|
137
|
+
tableName: 'radio_show',
|
|
138
|
+
schema: 'eb',
|
|
139
|
+
timestamps: false,
|
|
140
|
+
indexes: [
|
|
141
|
+
{
|
|
142
|
+
name: "radio_show_pkey",
|
|
143
|
+
unique: true,
|
|
144
|
+
fields: [
|
|
145
|
+
{ name: "id" },
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { CanonGenre, CanonGenreId } from './CanonGenre';
|
|
4
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
5
|
+
|
|
6
|
+
export interface RadioShowGenresAttributes {
|
|
7
|
+
canonGenreId: string;
|
|
8
|
+
radioShowId: string;
|
|
9
|
+
title: string;
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RadioShowGenresPk = "id";
|
|
14
|
+
export type RadioShowGenresId = RadioShowGenres[RadioShowGenresPk];
|
|
15
|
+
export type RadioShowGenresOptionalAttributes = "id";
|
|
16
|
+
export type RadioShowGenresCreationAttributes = Optional<RadioShowGenresAttributes, RadioShowGenresOptionalAttributes>;
|
|
17
|
+
|
|
18
|
+
export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowGenresCreationAttributes> implements RadioShowGenresAttributes {
|
|
19
|
+
canonGenreId!: string;
|
|
20
|
+
radioShowId!: string;
|
|
21
|
+
title!: string;
|
|
22
|
+
id!: string;
|
|
23
|
+
|
|
24
|
+
// RadioShowGenres belongsTo CanonGenre via canonGenreId
|
|
25
|
+
canonGenre!: CanonGenre;
|
|
26
|
+
getCanonGenre!: Sequelize.BelongsToGetAssociationMixin<CanonGenre>;
|
|
27
|
+
setCanonGenre!: Sequelize.BelongsToSetAssociationMixin<CanonGenre, CanonGenreId>;
|
|
28
|
+
createCanonGenre!: Sequelize.BelongsToCreateAssociationMixin<CanonGenre>;
|
|
29
|
+
// RadioShowGenres belongsTo RadioShow via radioShowId
|
|
30
|
+
radioShow!: RadioShow;
|
|
31
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
32
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
33
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
34
|
+
|
|
35
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowGenres {
|
|
36
|
+
return RadioShowGenres.init({
|
|
37
|
+
canonGenreId: {
|
|
38
|
+
type: DataTypes.UUID,
|
|
39
|
+
allowNull: false,
|
|
40
|
+
references: {
|
|
41
|
+
model: 'canon_genre',
|
|
42
|
+
key: 'id'
|
|
43
|
+
},
|
|
44
|
+
field: 'canon_genre_id'
|
|
45
|
+
},
|
|
46
|
+
radioShowId: {
|
|
47
|
+
type: DataTypes.UUID,
|
|
48
|
+
allowNull: false,
|
|
49
|
+
references: {
|
|
50
|
+
model: 'radio_show',
|
|
51
|
+
key: 'id'
|
|
52
|
+
},
|
|
53
|
+
field: 'radio_show_id'
|
|
54
|
+
},
|
|
55
|
+
title: {
|
|
56
|
+
type: DataTypes.STRING(40),
|
|
57
|
+
allowNull: false
|
|
58
|
+
},
|
|
59
|
+
id: {
|
|
60
|
+
type: DataTypes.UUID,
|
|
61
|
+
allowNull: false,
|
|
62
|
+
defaultValue: DataTypes.UUIDV4,
|
|
63
|
+
primaryKey: true
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
sequelize,
|
|
67
|
+
tableName: 'radio_show_genres',
|
|
68
|
+
schema: 'eb',
|
|
69
|
+
timestamps: false,
|
|
70
|
+
indexes: [
|
|
71
|
+
{
|
|
72
|
+
name: "radio_show_genres_pkey",
|
|
73
|
+
unique: true,
|
|
74
|
+
fields: [
|
|
75
|
+
{ name: "id" },
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
4
|
+
|
|
5
|
+
export interface RadioShowMediaAttributes {
|
|
6
|
+
radioShowId: string;
|
|
7
|
+
originalMediaType?: number;
|
|
8
|
+
s3VideoUrl?: string;
|
|
9
|
+
s3AudioUrl: string;
|
|
10
|
+
approved?: boolean;
|
|
11
|
+
id: string;
|
|
12
|
+
createDate: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type RadioShowMediaPk = "id";
|
|
16
|
+
export type RadioShowMediaId = RadioShowMedia[RadioShowMediaPk];
|
|
17
|
+
export type RadioShowMediaOptionalAttributes = "originalMediaType" | "s3VideoUrl" | "approved" | "id" | "createDate";
|
|
18
|
+
export type RadioShowMediaCreationAttributes = Optional<RadioShowMediaAttributes, RadioShowMediaOptionalAttributes>;
|
|
19
|
+
|
|
20
|
+
export class RadioShowMedia extends Model<RadioShowMediaAttributes, RadioShowMediaCreationAttributes> implements RadioShowMediaAttributes {
|
|
21
|
+
radioShowId!: string;
|
|
22
|
+
originalMediaType?: number;
|
|
23
|
+
s3VideoUrl?: string;
|
|
24
|
+
s3AudioUrl!: string;
|
|
25
|
+
approved?: boolean;
|
|
26
|
+
id!: string;
|
|
27
|
+
createDate!: Date;
|
|
28
|
+
|
|
29
|
+
// RadioShowMedia belongsTo RadioShow via radioShowId
|
|
30
|
+
radioShow!: RadioShow;
|
|
31
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
32
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
33
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
34
|
+
|
|
35
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowMedia {
|
|
36
|
+
return RadioShowMedia.init({
|
|
37
|
+
radioShowId: {
|
|
38
|
+
type: DataTypes.UUID,
|
|
39
|
+
allowNull: false,
|
|
40
|
+
references: {
|
|
41
|
+
model: 'radio_show',
|
|
42
|
+
key: 'id'
|
|
43
|
+
},
|
|
44
|
+
field: 'radio_show_id'
|
|
45
|
+
},
|
|
46
|
+
originalMediaType: {
|
|
47
|
+
type: DataTypes.INTEGER,
|
|
48
|
+
allowNull: true,
|
|
49
|
+
field: 'original_media_type'
|
|
50
|
+
},
|
|
51
|
+
s3VideoUrl: {
|
|
52
|
+
type: DataTypes.TEXT,
|
|
53
|
+
allowNull: true,
|
|
54
|
+
field: 's3_video_url'
|
|
55
|
+
},
|
|
56
|
+
s3AudioUrl: {
|
|
57
|
+
type: DataTypes.TEXT,
|
|
58
|
+
allowNull: false,
|
|
59
|
+
field: 's3_audio_url'
|
|
60
|
+
},
|
|
61
|
+
approved: {
|
|
62
|
+
type: DataTypes.BOOLEAN,
|
|
63
|
+
allowNull: true
|
|
64
|
+
},
|
|
65
|
+
id: {
|
|
66
|
+
type: DataTypes.UUID,
|
|
67
|
+
allowNull: false,
|
|
68
|
+
defaultValue: DataTypes.UUIDV4,
|
|
69
|
+
primaryKey: true
|
|
70
|
+
},
|
|
71
|
+
createDate: {
|
|
72
|
+
type: DataTypes.DATE,
|
|
73
|
+
allowNull: false,
|
|
74
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
75
|
+
field: 'create_date'
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
sequelize,
|
|
79
|
+
tableName: 'radio_show_media',
|
|
80
|
+
schema: 'eb',
|
|
81
|
+
timestamps: false,
|
|
82
|
+
indexes: [
|
|
83
|
+
{
|
|
84
|
+
name: "radio_show_media_pkey",
|
|
85
|
+
unique: true,
|
|
86
|
+
fields: [
|
|
87
|
+
{ name: "id" },
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { CanonTrack, CanonTrackId } from './CanonTrack';
|
|
4
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
5
|
+
|
|
6
|
+
export interface RadioShowPlacementAttributes {
|
|
7
|
+
radioShowId: string;
|
|
8
|
+
canonTrackId?: string;
|
|
9
|
+
radioShowMediaId?: string;
|
|
10
|
+
seqNum: number;
|
|
11
|
+
startTime?: string;
|
|
12
|
+
endTime?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type RadioShowPlacementPk = "id";
|
|
17
|
+
export type RadioShowPlacementId = RadioShowPlacement[RadioShowPlacementPk];
|
|
18
|
+
export type RadioShowPlacementOptionalAttributes = "canonTrackId" | "radioShowMediaId" | "startTime" | "endTime" | "id";
|
|
19
|
+
export type RadioShowPlacementCreationAttributes = Optional<RadioShowPlacementAttributes, RadioShowPlacementOptionalAttributes>;
|
|
20
|
+
|
|
21
|
+
export class RadioShowPlacement extends Model<RadioShowPlacementAttributes, RadioShowPlacementCreationAttributes> implements RadioShowPlacementAttributes {
|
|
22
|
+
radioShowId!: string;
|
|
23
|
+
canonTrackId?: string;
|
|
24
|
+
radioShowMediaId?: string;
|
|
25
|
+
seqNum!: number;
|
|
26
|
+
startTime?: string;
|
|
27
|
+
endTime?: string;
|
|
28
|
+
id!: string;
|
|
29
|
+
|
|
30
|
+
// RadioShowPlacement belongsTo CanonTrack via canonTrackId
|
|
31
|
+
canonTrack!: CanonTrack;
|
|
32
|
+
getCanonTrack!: Sequelize.BelongsToGetAssociationMixin<CanonTrack>;
|
|
33
|
+
setCanonTrack!: Sequelize.BelongsToSetAssociationMixin<CanonTrack, CanonTrackId>;
|
|
34
|
+
createCanonTrack!: Sequelize.BelongsToCreateAssociationMixin<CanonTrack>;
|
|
35
|
+
// RadioShowPlacement belongsTo RadioShow via radioShowId
|
|
36
|
+
radioShow!: RadioShow;
|
|
37
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
38
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
39
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
40
|
+
|
|
41
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowPlacement {
|
|
42
|
+
return RadioShowPlacement.init({
|
|
43
|
+
radioShowId: {
|
|
44
|
+
type: DataTypes.UUID,
|
|
45
|
+
allowNull: false,
|
|
46
|
+
references: {
|
|
47
|
+
model: 'radio_show',
|
|
48
|
+
key: 'id'
|
|
49
|
+
},
|
|
50
|
+
field: 'radio_show_id'
|
|
51
|
+
},
|
|
52
|
+
canonTrackId: {
|
|
53
|
+
type: DataTypes.UUID,
|
|
54
|
+
allowNull: true,
|
|
55
|
+
references: {
|
|
56
|
+
model: 'canon_track',
|
|
57
|
+
key: 'id'
|
|
58
|
+
},
|
|
59
|
+
field: 'canon_track_id'
|
|
60
|
+
},
|
|
61
|
+
radioShowMediaId: {
|
|
62
|
+
type: DataTypes.UUID,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
field: 'radio_show_media_id'
|
|
65
|
+
},
|
|
66
|
+
seqNum: {
|
|
67
|
+
type: DataTypes.INTEGER,
|
|
68
|
+
allowNull: false,
|
|
69
|
+
field: 'seq_num'
|
|
70
|
+
},
|
|
71
|
+
startTime: {
|
|
72
|
+
type: DataTypes.TIME,
|
|
73
|
+
allowNull: true,
|
|
74
|
+
field: 'start_time'
|
|
75
|
+
},
|
|
76
|
+
endTime: {
|
|
77
|
+
type: DataTypes.TIME,
|
|
78
|
+
allowNull: true,
|
|
79
|
+
field: 'end_time'
|
|
80
|
+
},
|
|
81
|
+
id: {
|
|
82
|
+
type: DataTypes.UUID,
|
|
83
|
+
allowNull: false,
|
|
84
|
+
defaultValue: DataTypes.UUIDV4,
|
|
85
|
+
primaryKey: true
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
sequelize,
|
|
89
|
+
tableName: 'radio_show_placement',
|
|
90
|
+
schema: 'eb',
|
|
91
|
+
timestamps: false,
|
|
92
|
+
indexes: [
|
|
93
|
+
{
|
|
94
|
+
name: "radio_show_placement_pkey",
|
|
95
|
+
unique: true,
|
|
96
|
+
fields: [
|
|
97
|
+
{ name: "id" },
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
4
|
+
|
|
5
|
+
export interface RadioShowPublishRequestsAttributes {
|
|
6
|
+
radioShowId: string;
|
|
7
|
+
approved?: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
createDate: Date;
|
|
10
|
+
updateDate: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RadioShowPublishRequestsPk = "id";
|
|
14
|
+
export type RadioShowPublishRequestsId = RadioShowPublishRequests[RadioShowPublishRequestsPk];
|
|
15
|
+
export type RadioShowPublishRequestsOptionalAttributes = "approved" | "id" | "createDate" | "updateDate";
|
|
16
|
+
export type RadioShowPublishRequestsCreationAttributes = Optional<RadioShowPublishRequestsAttributes, RadioShowPublishRequestsOptionalAttributes>;
|
|
17
|
+
|
|
18
|
+
export class RadioShowPublishRequests extends Model<RadioShowPublishRequestsAttributes, RadioShowPublishRequestsCreationAttributes> implements RadioShowPublishRequestsAttributes {
|
|
19
|
+
radioShowId!: string;
|
|
20
|
+
approved?: boolean;
|
|
21
|
+
id!: string;
|
|
22
|
+
createDate!: Date;
|
|
23
|
+
updateDate!: Date;
|
|
24
|
+
|
|
25
|
+
// RadioShowPublishRequests belongsTo RadioShow via radioShowId
|
|
26
|
+
radioShow!: RadioShow;
|
|
27
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
28
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
29
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
30
|
+
|
|
31
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowPublishRequests {
|
|
32
|
+
return RadioShowPublishRequests.init({
|
|
33
|
+
radioShowId: {
|
|
34
|
+
type: DataTypes.UUID,
|
|
35
|
+
allowNull: false,
|
|
36
|
+
references: {
|
|
37
|
+
model: 'radio_show',
|
|
38
|
+
key: 'id'
|
|
39
|
+
},
|
|
40
|
+
field: 'radio_show_id'
|
|
41
|
+
},
|
|
42
|
+
approved: {
|
|
43
|
+
type: DataTypes.BOOLEAN,
|
|
44
|
+
allowNull: true
|
|
45
|
+
},
|
|
46
|
+
id: {
|
|
47
|
+
type: DataTypes.UUID,
|
|
48
|
+
allowNull: false,
|
|
49
|
+
defaultValue: DataTypes.UUIDV4,
|
|
50
|
+
primaryKey: true
|
|
51
|
+
},
|
|
52
|
+
createDate: {
|
|
53
|
+
type: DataTypes.DATE,
|
|
54
|
+
allowNull: false,
|
|
55
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
56
|
+
field: 'create_date'
|
|
57
|
+
},
|
|
58
|
+
updateDate: {
|
|
59
|
+
type: DataTypes.DATE,
|
|
60
|
+
allowNull: false,
|
|
61
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
62
|
+
field: 'update_date'
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
sequelize,
|
|
66
|
+
tableName: 'radio_show_publish_requests',
|
|
67
|
+
schema: 'eb',
|
|
68
|
+
timestamps: false,
|
|
69
|
+
indexes: [
|
|
70
|
+
{
|
|
71
|
+
name: "radio_show_publish_requests_pkey",
|
|
72
|
+
unique: true,
|
|
73
|
+
fields: [
|
|
74
|
+
{ name: "id" },
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
package/models/init-models.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Sequelize } from "sequelize";
|
|
2
|
+
import { AccessControlPreference as _AccessControlPreference } from "./AccessControlPreference";
|
|
3
|
+
import type { AccessControlPreferenceAttributes, AccessControlPreferenceCreationAttributes } from "./AccessControlPreference";
|
|
2
4
|
import { AppUser as _AppUser } from "./AppUser";
|
|
3
5
|
import type { AppUserAttributes, AppUserCreationAttributes } from "./AppUser";
|
|
4
6
|
import { AppUserDevice as _AppUserDevice } from "./AppUserDevice";
|
|
@@ -131,6 +133,16 @@ import { PlaybackStatus as _PlaybackStatus } from "./PlaybackStatus";
|
|
|
131
133
|
import type { PlaybackStatusAttributes, PlaybackStatusCreationAttributes } from "./PlaybackStatus";
|
|
132
134
|
import { PlaybackStatusType as _PlaybackStatusType } from "./PlaybackStatusType";
|
|
133
135
|
import type { PlaybackStatusTypeAttributes, PlaybackStatusTypeCreationAttributes } from "./PlaybackStatusType";
|
|
136
|
+
import { RadioShow as _RadioShow } from "./RadioShow";
|
|
137
|
+
import type { RadioShowAttributes, RadioShowCreationAttributes } from "./RadioShow";
|
|
138
|
+
import { RadioShowGenres as _RadioShowGenres } from "./RadioShowGenres";
|
|
139
|
+
import type { RadioShowGenresAttributes, RadioShowGenresCreationAttributes } from "./RadioShowGenres";
|
|
140
|
+
import { RadioShowMedia as _RadioShowMedia } from "./RadioShowMedia";
|
|
141
|
+
import type { RadioShowMediaAttributes, RadioShowMediaCreationAttributes } from "./RadioShowMedia";
|
|
142
|
+
import { RadioShowPlacement as _RadioShowPlacement } from "./RadioShowPlacement";
|
|
143
|
+
import type { RadioShowPlacementAttributes, RadioShowPlacementCreationAttributes } from "./RadioShowPlacement";
|
|
144
|
+
import { RadioShowPublishRequests as _RadioShowPublishRequests } from "./RadioShowPublishRequests";
|
|
145
|
+
import type { RadioShowPublishRequestsAttributes, RadioShowPublishRequestsCreationAttributes } from "./RadioShowPublishRequests";
|
|
134
146
|
import { State as _State } from "./State";
|
|
135
147
|
import type { StateAttributes, StateCreationAttributes } from "./State";
|
|
136
148
|
import { TrackDeletionReason as _TrackDeletionReason } from "./TrackDeletionReason";
|
|
@@ -143,6 +155,7 @@ import { UserContacts as _UserContacts } from "./UserContacts";
|
|
|
143
155
|
import type { UserContactsAttributes, UserContactsCreationAttributes } from "./UserContacts";
|
|
144
156
|
|
|
145
157
|
export {
|
|
158
|
+
_AccessControlPreference as AccessControlPreference,
|
|
146
159
|
_AppUser as AppUser,
|
|
147
160
|
_AppUserDevice as AppUserDevice,
|
|
148
161
|
_AppUserFollowRelation as AppUserFollowRelation,
|
|
@@ -209,6 +222,11 @@ export {
|
|
|
209
222
|
_PlatformUserPlaylistTrack as PlatformUserPlaylistTrack,
|
|
210
223
|
_PlaybackStatus as PlaybackStatus,
|
|
211
224
|
_PlaybackStatusType as PlaybackStatusType,
|
|
225
|
+
_RadioShow as RadioShow,
|
|
226
|
+
_RadioShowGenres as RadioShowGenres,
|
|
227
|
+
_RadioShowMedia as RadioShowMedia,
|
|
228
|
+
_RadioShowPlacement as RadioShowPlacement,
|
|
229
|
+
_RadioShowPublishRequests as RadioShowPublishRequests,
|
|
212
230
|
_State as State,
|
|
213
231
|
_TrackDeletionReason as TrackDeletionReason,
|
|
214
232
|
_UnmatchedAlbum as UnmatchedAlbum,
|
|
@@ -217,6 +235,8 @@ export {
|
|
|
217
235
|
};
|
|
218
236
|
|
|
219
237
|
export type {
|
|
238
|
+
AccessControlPreferenceAttributes,
|
|
239
|
+
AccessControlPreferenceCreationAttributes,
|
|
220
240
|
AppUserAttributes,
|
|
221
241
|
AppUserCreationAttributes,
|
|
222
242
|
AppUserDeviceAttributes,
|
|
@@ -349,6 +369,16 @@ export type {
|
|
|
349
369
|
PlaybackStatusCreationAttributes,
|
|
350
370
|
PlaybackStatusTypeAttributes,
|
|
351
371
|
PlaybackStatusTypeCreationAttributes,
|
|
372
|
+
RadioShowAttributes,
|
|
373
|
+
RadioShowCreationAttributes,
|
|
374
|
+
RadioShowGenresAttributes,
|
|
375
|
+
RadioShowGenresCreationAttributes,
|
|
376
|
+
RadioShowMediaAttributes,
|
|
377
|
+
RadioShowMediaCreationAttributes,
|
|
378
|
+
RadioShowPlacementAttributes,
|
|
379
|
+
RadioShowPlacementCreationAttributes,
|
|
380
|
+
RadioShowPublishRequestsAttributes,
|
|
381
|
+
RadioShowPublishRequestsCreationAttributes,
|
|
352
382
|
StateAttributes,
|
|
353
383
|
StateCreationAttributes,
|
|
354
384
|
TrackDeletionReasonAttributes,
|
|
@@ -362,6 +392,7 @@ export type {
|
|
|
362
392
|
};
|
|
363
393
|
|
|
364
394
|
export function initModels(sequelize: Sequelize) {
|
|
395
|
+
const AccessControlPreference = _AccessControlPreference.initModel(sequelize);
|
|
365
396
|
const AppUser = _AppUser.initModel(sequelize);
|
|
366
397
|
const AppUserDevice = _AppUserDevice.initModel(sequelize);
|
|
367
398
|
const AppUserFollowRelation = _AppUserFollowRelation.initModel(sequelize);
|
|
@@ -428,6 +459,11 @@ export function initModels(sequelize: Sequelize) {
|
|
|
428
459
|
const PlatformUserPlaylistTrack = _PlatformUserPlaylistTrack.initModel(sequelize);
|
|
429
460
|
const PlaybackStatus = _PlaybackStatus.initModel(sequelize);
|
|
430
461
|
const PlaybackStatusType = _PlaybackStatusType.initModel(sequelize);
|
|
462
|
+
const RadioShow = _RadioShow.initModel(sequelize);
|
|
463
|
+
const RadioShowGenres = _RadioShowGenres.initModel(sequelize);
|
|
464
|
+
const RadioShowMedia = _RadioShowMedia.initModel(sequelize);
|
|
465
|
+
const RadioShowPlacement = _RadioShowPlacement.initModel(sequelize);
|
|
466
|
+
const RadioShowPublishRequests = _RadioShowPublishRequests.initModel(sequelize);
|
|
431
467
|
const State = _State.initModel(sequelize);
|
|
432
468
|
const TrackDeletionReason = _TrackDeletionReason.initModel(sequelize);
|
|
433
469
|
const UnmatchedAlbum = _UnmatchedAlbum.initModel(sequelize);
|
|
@@ -502,6 +538,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
502
538
|
AppUser.hasMany(PlatformUserAlbum, { as: "platformUserAlbums", foreignKey: "appUserId"});
|
|
503
539
|
PlatformUserPlaylist.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
504
540
|
AppUser.hasMany(PlatformUserPlaylist, { as: "platformUserPlaylists", foreignKey: "appUserId"});
|
|
541
|
+
RadioShow.belongsTo(AppUser, { as: "creatorUser", foreignKey: "creatorUserId"});
|
|
542
|
+
AppUser.hasMany(RadioShow, { as: "radioShows", foreignKey: "creatorUserId"});
|
|
505
543
|
UserContacts.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
506
544
|
AppUser.hasMany(UserContacts, { as: "userContacts", foreignKey: "appUserId"});
|
|
507
545
|
CanonAlbumExternalReferenceRelation.belongsTo(CanonAlbum, { as: "canonAlbum", foreignKey: "canonAlbumId"});
|
|
@@ -530,6 +568,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
530
568
|
CanonGenre.hasMany(CanonToPlatformGenreRelation, { as: "canonToPlatformGenreRelations", foreignKey: "canonGenreId"});
|
|
531
569
|
JukeboxCanonGenreRelation.belongsTo(CanonGenre, { as: "canonGenre", foreignKey: "canonGenreId"});
|
|
532
570
|
CanonGenre.hasMany(JukeboxCanonGenreRelation, { as: "jukeboxCanonGenreRelations", foreignKey: "canonGenreId"});
|
|
571
|
+
RadioShowGenres.belongsTo(CanonGenre, { as: "canonGenre", foreignKey: "canonGenreId"});
|
|
572
|
+
CanonGenre.hasMany(RadioShowGenres, { as: "radioShowGenres", foreignKey: "canonGenreId"});
|
|
533
573
|
CanonAlbumLabelRelation.belongsTo(CanonLabel, { as: "canonLabel", foreignKey: "canonLabelId"});
|
|
534
574
|
CanonLabel.hasMany(CanonAlbumLabelRelation, { as: "canonAlbumLabelRelations", foreignKey: "canonLabelId"});
|
|
535
575
|
CanonLabelExternalReferenceRelation.belongsTo(CanonLabel, { as: "canonLabel", foreignKey: "canonLabelId"});
|
|
@@ -546,6 +586,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
546
586
|
CanonTrack.hasMany(CanonToPlatformTrackRelation, { as: "canonToPlatformTrackRelations", foreignKey: "canonTrackId"});
|
|
547
587
|
JukeboxQueueEntry.belongsTo(CanonTrack, { as: "track", foreignKey: "trackId"});
|
|
548
588
|
CanonTrack.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackId"});
|
|
589
|
+
RadioShowPlacement.belongsTo(CanonTrack, { as: "canonTrack", foreignKey: "canonTrackId"});
|
|
590
|
+
CanonTrack.hasMany(RadioShowPlacement, { as: "radioShowPlacements", foreignKey: "canonTrackId"});
|
|
549
591
|
CanonAlbumExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
|
|
550
592
|
ExternalReference.hasMany(CanonAlbumExternalReferenceRelation, { as: "canonAlbumExternalReferenceRelations", foreignKey: "externalReferenceId"});
|
|
551
593
|
CanonArtistExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
|
|
@@ -660,6 +702,14 @@ export function initModels(sequelize: Sequelize) {
|
|
|
660
702
|
PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId"});
|
|
661
703
|
JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
|
|
662
704
|
PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
|
|
705
|
+
RadioShowGenres.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
706
|
+
RadioShow.hasMany(RadioShowGenres, { as: "radioShowGenres", foreignKey: "radioShowId"});
|
|
707
|
+
RadioShowMedia.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
708
|
+
RadioShow.hasMany(RadioShowMedia, { as: "radioShowMedia", foreignKey: "radioShowId"});
|
|
709
|
+
RadioShowPlacement.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
710
|
+
RadioShow.hasMany(RadioShowPlacement, { as: "radioShowPlacements", foreignKey: "radioShowId"});
|
|
711
|
+
RadioShowPublishRequests.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
712
|
+
RadioShow.hasMany(RadioShowPublishRequests, { as: "radioShowPublishRequests", foreignKey: "radioShowId"});
|
|
663
713
|
AppUser.belongsTo(State, { as: "state", foreignKey: "stateId"});
|
|
664
714
|
State.hasMany(AppUser, { as: "appUsers", foreignKey: "stateId"});
|
|
665
715
|
PlatformUserPlaylist.belongsTo(State, { as: "state", foreignKey: "stateId"});
|
|
@@ -670,6 +720,7 @@ export function initModels(sequelize: Sequelize) {
|
|
|
670
720
|
TrackDeletionReason.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackDeletionReasonId"});
|
|
671
721
|
|
|
672
722
|
return {
|
|
723
|
+
AccessControlPreference: AccessControlPreference,
|
|
673
724
|
AppUser: AppUser,
|
|
674
725
|
AppUserDevice: AppUserDevice,
|
|
675
726
|
AppUserFollowRelation: AppUserFollowRelation,
|
|
@@ -736,6 +787,11 @@ export function initModels(sequelize: Sequelize) {
|
|
|
736
787
|
PlatformUserPlaylistTrack: PlatformUserPlaylistTrack,
|
|
737
788
|
PlaybackStatus: PlaybackStatus,
|
|
738
789
|
PlaybackStatusType: PlaybackStatusType,
|
|
790
|
+
RadioShow: RadioShow,
|
|
791
|
+
RadioShowGenres: RadioShowGenres,
|
|
792
|
+
RadioShowMedia: RadioShowMedia,
|
|
793
|
+
RadioShowPlacement: RadioShowPlacement,
|
|
794
|
+
RadioShowPublishRequests: RadioShowPublishRequests,
|
|
739
795
|
State: State,
|
|
740
796
|
TrackDeletionReason: TrackDeletionReason,
|
|
741
797
|
UnmatchedAlbum: UnmatchedAlbum,
|