Skip to content

Commit 2653bd8

Browse files
committed
fix: specs
1 parent 204dfcb commit 2653bd8

File tree

2 files changed

+124
-1
lines changed

2 files changed

+124
-1
lines changed

OPENAPI_DOC.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15750,6 +15750,75 @@ paths:
1575015750
application/json:
1575115751
schema:
1575215752
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
15753+
/api/engine/v2/signage/playlists/{id}/approve:
15754+
post:
15755+
summary: approve a playlist for publication on displays
15756+
tags:
15757+
- Playlist
15758+
operationId: PlaceOS::Api::Playlist_approve_media
15759+
parameters:
15760+
- name: id
15761+
in: path
15762+
required: true
15763+
schema:
15764+
type: string
15765+
responses:
15766+
200:
15767+
description: OK
15768+
content:
15769+
application/json:
15770+
schema:
15771+
$ref: '#/components/schemas/Bool'
15772+
409:
15773+
description: Conflict
15774+
content:
15775+
application/json:
15776+
schema:
15777+
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
15778+
401:
15779+
description: Unauthorized
15780+
content:
15781+
application/json:
15782+
schema:
15783+
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
15784+
403:
15785+
description: Forbidden
15786+
404:
15787+
description: Not Found
15788+
content:
15789+
application/json:
15790+
schema:
15791+
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
15792+
408:
15793+
description: Request Timeout
15794+
content:
15795+
application/json:
15796+
schema:
15797+
$ref: '#/components/schemas/PlaceOS__Api__Application__CommonError'
15798+
400:
15799+
description: Bad Request
15800+
content:
15801+
application/json:
15802+
schema:
15803+
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
15804+
422:
15805+
description: Unprocessable Entity
15806+
content:
15807+
application/json:
15808+
schema:
15809+
$ref: '#/components/schemas/PlaceOS__Api__Application__ParameterError'
15810+
406:
15811+
description: Not Acceptable
15812+
content:
15813+
application/json:
15814+
schema:
15815+
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
15816+
415:
15817+
description: Unsupported Media Type
15818+
content:
15819+
application/json:
15820+
schema:
15821+
$ref: '#/components/schemas/PlaceOS__Api__Application__ContentError'
1575315822
/api/engine/v2/signage/playlists/{id}/media:
1575415823
get:
1575515824
summary: get the current list of media for the playlist
@@ -21240,6 +21309,10 @@ components:
2124021309
type: integer
2124121310
format: Int64
2124221311
nullable: true
21312+
logged_out_at:
21313+
type: string
21314+
format: date-time
21315+
nullable: true
2124321316
work_preferences:
2124421317
type: array
2124521318
items:
@@ -22484,6 +22557,13 @@ components:
2248422557
makebreak:
2248522558
type: boolean
2248622559
nullable: true
22560+
analytics_enabled:
22561+
type: boolean
22562+
nullable: true
22563+
analytics_interval_minutes:
22564+
type: integer
22565+
format: Int32
22566+
nullable: true
2248722567
uri:
2248822568
type: string
2248922569
nullable: true
@@ -23362,6 +23442,13 @@ components:
2336223442
makebreak:
2336323443
type: boolean
2336423444
nullable: true
23445+
analytics_enabled:
23446+
type: boolean
23447+
nullable: true
23448+
analytics_interval_minutes:
23449+
type: integer
23450+
format: Int32
23451+
nullable: true
2336523452
uri:
2336623453
type: string
2336723454
nullable: true
@@ -25327,6 +25414,19 @@ components:
2532725414
user_name:
2532825415
type: string
2532925416
nullable: true
25417+
approved:
25418+
type: boolean
25419+
nullable: true
25420+
approved_by_id:
25421+
type: string
25422+
nullable: true
25423+
approved_by_name:
25424+
type: string
25425+
nullable: true
25426+
approved_by_email:
25427+
type: string
25428+
format: email
25429+
nullable: true
2533025430
items:
2533125431
type: array
2533225432
items:
@@ -25793,6 +25893,13 @@ components:
2579325893
makebreak:
2579425894
type: boolean
2579525895
nullable: true
25896+
analytics_enabled:
25897+
type: boolean
25898+
nullable: true
25899+
analytics_interval_minutes:
25900+
type: integer
25901+
format: Int32
25902+
nullable: true
2579625903
uri:
2579725904
type: string
2579825905
nullable: true
@@ -27923,6 +28030,10 @@ components:
2792328030
type: integer
2792428031
format: Int64
2792528032
nullable: true
28033+
logged_out_at:
28034+
type: string
28035+
format: date-time
28036+
nullable: true
2792628037
work_preferences:
2792728038
type: array
2792828039
items:
@@ -28506,6 +28617,13 @@ components:
2850628617
makebreak:
2850728618
type: boolean
2850828619
nullable: true
28620+
analytics_enabled:
28621+
type: boolean
28622+
nullable: true
28623+
analytics_interval_minutes:
28624+
type: integer
28625+
format: Int32
28626+
nullable: true
2850928627
uri:
2851028628
type: string
2851128629
nullable: true

spec/controllers/signage_spec.cr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ module PlaceOS::Api
109109
item2.play_count.should eq 2
110110
end
111111

112-
it "can approve digital signage playlists" do
112+
it "can approve digital signage playlists", focus: true do
113113
revision = Model::Generator.revision
114114

115115
item = Model::Generator.item
@@ -143,6 +143,9 @@ module PlaceOS::Api
143143
json["playlist_config"][playlist_id][0]["id"].should eq playlist_id
144144
json["playlist_config"][playlist_id][1].should eq [] of String
145145

146+
# skip forward a moment to avoid a 304
147+
sleep 1
148+
146149
# we should now approve the playlist
147150
approved = client.post(
148151
path: "#{Signage.base_route}/playlists/#{playlist_id}/approve",
@@ -156,6 +159,8 @@ module PlaceOS::Api
156159
revision.approved.should be_true
157160
revision.updated_at.should_not eq updated_at
158161

162+
system.playlists_last_updated.should eq revision.updated_at
163+
159164
# the route should have modified
160165
headers["If-Modified-Since"] = result.headers["Last-Modified"]
161166
result = client.get(

0 commit comments

Comments
 (0)