jumbotron 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/app/deserializers/jumbotron/deserializers/public/sandbox_projection.rb +17 -0
- data/app/models/jumbotron/public.rb +2 -1
- data/app/services/jumbotron/services/public/assemble_sandbox_projection.rb +9 -0
- data/app/services/jumbotron/services/public/assemble_sandbox_projection_reset.rb +9 -0
- data/app/services/jumbotron/services/public/read_sandbox_projection.rb +32 -0
- data/app/workflows/jumbotron/workflows/sandbox/read_projection_workflow.rb +28 -0
- data/docs/upgrades/0.3.0.md +31 -0
- data/lib/jumbotron/client.rb +7 -0
- data/lib/jumbotron/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48040072e10a2363780b93b40c36c51e00683c247d616ae4cf8e0b245cca1815
|
|
4
|
+
data.tar.gz: 56fdebbcc73ab653ebf1293d7bc718bece9c24e035552e10a402d3d0cf4a34a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22e5abd65bafd78af1bb38568088c5c7180321e28dc527cd8dec35ea61300d55f789a3e8723d35f3df00ddc3ef3ae7bddd8bbb7e6a4e1aac256eb0665bf24275
|
|
7
|
+
data.tar.gz: 3deca6bd03bb5f95ddb485306ebd68fb33ced87215df67002a19f84f383ba748182d437d0581fa065043fe44bc60d605f2773af70a85884a596ab44c82a4d9ab
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jumbotron
|
|
4
|
+
module Deserializers
|
|
5
|
+
module Public
|
|
6
|
+
class SandboxProjection < CommandTower::Deserializers::ApplicationDeserializer
|
|
7
|
+
def call(params)
|
|
8
|
+
name = unwrap(fetch_param(params, :name))
|
|
9
|
+
return name if deserializer_result?(name)
|
|
10
|
+
return failure(errors: [{ code: "invalid_request", message: "name is required" }]) if name.blank?
|
|
11
|
+
|
|
12
|
+
success(Jumbotron::Public::SandboxProjectionRequest.new(name: name.to_s))
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -13,7 +13,8 @@ module Jumbotron
|
|
|
13
13
|
SandboxScheduleSelector = Data.define(:sport, :league, :season, :season_phase)
|
|
14
14
|
RegisterSandboxProjectionRequest = Data.define(:name, :source)
|
|
15
15
|
ResetSandboxProjectionRequest = Data.define(:sandbox, :start_week, :anchor_day, :now)
|
|
16
|
-
|
|
16
|
+
SandboxProjectionRequest = Data.define(:name)
|
|
17
|
+
SandboxProjection = Data.define(:name, :source_label, :source, :sandbox)
|
|
17
18
|
SandboxProjectionReset = Data.define(
|
|
18
19
|
:projection,
|
|
19
20
|
:source_anchor_date,
|
|
@@ -9,6 +9,7 @@ module Jumbotron
|
|
|
9
9
|
def call
|
|
10
10
|
context.public_projection = Jumbotron::Public::SandboxProjection.new(
|
|
11
11
|
name: projection.name,
|
|
12
|
+
source_label: source_label,
|
|
12
13
|
source: selector(projection.source_season, projection.source_anchor_phase.name),
|
|
13
14
|
sandbox: selector(projection.sandbox_season, projection.source_anchor_phase.name)
|
|
14
15
|
)
|
|
@@ -16,6 +17,14 @@ module Jumbotron
|
|
|
16
17
|
|
|
17
18
|
private
|
|
18
19
|
|
|
20
|
+
def source_label
|
|
21
|
+
[
|
|
22
|
+
projection.source_season.league.name.upcase,
|
|
23
|
+
projection.source_season.name,
|
|
24
|
+
projection.source_anchor_phase.name.titleize
|
|
25
|
+
].join(" ")
|
|
26
|
+
end
|
|
27
|
+
|
|
19
28
|
def selector(season, phase_name)
|
|
20
29
|
Jumbotron::Public::SandboxScheduleSelector.new(
|
|
21
30
|
sport: season.league.sport.name,
|
|
@@ -30,11 +30,20 @@ module Jumbotron
|
|
|
30
30
|
def projection_identity
|
|
31
31
|
Jumbotron::Public::SandboxProjection.new(
|
|
32
32
|
name: projection.name,
|
|
33
|
+
source_label: source_label,
|
|
33
34
|
source: selector(projection.source_season, projection.source_anchor_phase.name),
|
|
34
35
|
sandbox: selector(projection.sandbox_season, projection.source_anchor_phase.name)
|
|
35
36
|
)
|
|
36
37
|
end
|
|
37
38
|
|
|
39
|
+
def source_label
|
|
40
|
+
[
|
|
41
|
+
projection.source_season.league.name.upcase,
|
|
42
|
+
projection.source_season.name,
|
|
43
|
+
projection.source_anchor_phase.name.titleize
|
|
44
|
+
].join(" ")
|
|
45
|
+
end
|
|
46
|
+
|
|
38
47
|
def selector(season, phase_name)
|
|
39
48
|
Jumbotron::Public::SandboxScheduleSelector.new(
|
|
40
49
|
sport: season.league.sport.name,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jumbotron
|
|
4
|
+
module Services
|
|
5
|
+
module Public
|
|
6
|
+
class ReadSandboxProjection < CommandTower::Services::ApplicationService
|
|
7
|
+
validate :name, required: true
|
|
8
|
+
|
|
9
|
+
def call
|
|
10
|
+
projection = Jumbotron::SandboxProjection.includes(
|
|
11
|
+
:source_anchor_phase,
|
|
12
|
+
source_season: { league: :sport },
|
|
13
|
+
sandbox_season: { league: :sport }
|
|
14
|
+
).find_by(name:)
|
|
15
|
+
return reject if projection.nil?
|
|
16
|
+
|
|
17
|
+
context.projection = projection
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def reject
|
|
23
|
+
context.fail!(
|
|
24
|
+
application_error: Jumbotron::Errors::Public::NotFoundError.new(
|
|
25
|
+
details: { code: "sandbox_not_found", message: "sandbox projection was not found" }
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jumbotron
|
|
4
|
+
module Workflows
|
|
5
|
+
module Sandbox
|
|
6
|
+
class ReadProjectionWorkflow < CommandTower::Workflows::ApplicationWorkflow
|
|
7
|
+
include Jumbotron::Workflows::PublicRead
|
|
8
|
+
|
|
9
|
+
retry_strategy :none
|
|
10
|
+
|
|
11
|
+
def call(**kwargs)
|
|
12
|
+
deserialized = Jumbotron::Deserializers::Public::SandboxProjection.call(kwargs)
|
|
13
|
+
return map_deserializer_failure(deserialized) unless deserialized.success?
|
|
14
|
+
|
|
15
|
+
read = Jumbotron::Services::Public::ReadSandboxProjection.call(name: deserialized.input.name)
|
|
16
|
+
return map_service_failure(read) unless read.success?
|
|
17
|
+
|
|
18
|
+
assembled = Jumbotron::Services::Public::AssembleSandboxProjection.call(
|
|
19
|
+
projection: read.data[:projection]
|
|
20
|
+
)
|
|
21
|
+
return map_service_failure(assembled) unless assembled.success?
|
|
22
|
+
|
|
23
|
+
success(payload: { sandbox_projection: assembled.data[:public_projection] }, http_status: :ok)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Upgrade: Jumbotron 0.3.0
|
|
2
|
+
|
|
3
|
+
**From:** `0.2.0`
|
|
4
|
+
**To:** `0.3.0`
|
|
5
|
+
|
|
6
|
+
Minor release: additive public read access for named sandbox projections and stable source labeling for host administration.
|
|
7
|
+
|
|
8
|
+
## Host-facing change
|
|
9
|
+
|
|
10
|
+
| Change | Host impact |
|
|
11
|
+
|--------|-------------|
|
|
12
|
+
| `Jumbotron.client.sandbox_projection` | Reads a named sandbox projection through the public workflow/client boundary without exposing persistence. Unknown names return the existing structured public failure contract. |
|
|
13
|
+
| `SandboxProjection#source_label` | Public projection DTOs, including register/Reset results, now include a host-ready source label such as `NFL 2026 Regular Season`. |
|
|
14
|
+
| Public read validation | Named projection reads use the same deserializer/service/workflow architecture as existing public operations. |
|
|
15
|
+
|
|
16
|
+
## Upgrade checklist
|
|
17
|
+
|
|
18
|
+
1. Bump the gem to `0.3.0` (or `>= 0.3.0`).
|
|
19
|
+
2. No new migration. Hosts already on `0.2.0` do not need to copy or run Jumbotron migrations for this release.
|
|
20
|
+
3. Hosts may read the configured source before offering a destructive Reset:
|
|
21
|
+
|
|
22
|
+
```ruby
|
|
23
|
+
projection = Jumbotron.client.sandbox_projection(name: "nfl-sandbox")
|
|
24
|
+
projection.source_label
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## What is not in this release
|
|
28
|
+
|
|
29
|
+
- No sandbox projection or Reset persistence change.
|
|
30
|
+
- No ESPN public Game/Schedule/Consensus/CurrentLines contract change.
|
|
31
|
+
- No Pick'em administration UI or competitive-domain behavior.
|
data/lib/jumbotron/client.rb
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Jumbotron
|
|
4
4
|
class Client
|
|
5
|
+
def sandbox_projection(**)
|
|
6
|
+
Public::TranslateOutcome.call(
|
|
7
|
+
Workflows::Sandbox::ReadProjectionWorkflow.call(**),
|
|
8
|
+
payload_key: :sandbox_projection
|
|
9
|
+
)
|
|
10
|
+
end
|
|
11
|
+
|
|
5
12
|
def register_sandbox_projection(**)
|
|
6
13
|
Public::TranslateOutcome.call(
|
|
7
14
|
Workflows::Sandbox::RegisterProjectionWorkflow.call(**),
|
data/lib/jumbotron/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jumbotron
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- matt-taylor
|
|
@@ -133,6 +133,7 @@ files:
|
|
|
133
133
|
- app/deserializers/jumbotron/deserializers/public/includes.rb
|
|
134
134
|
- app/deserializers/jumbotron/deserializers/public/register_sandbox_projection.rb
|
|
135
135
|
- app/deserializers/jumbotron/deserializers/public/reset_sandbox_projection.rb
|
|
136
|
+
- app/deserializers/jumbotron/deserializers/public/sandbox_projection.rb
|
|
136
137
|
- app/deserializers/jumbotron/deserializers/public/schedule.rb
|
|
137
138
|
- app/deserializers/jumbotron/deserializers/public/schedule_groups.rb
|
|
138
139
|
- app/errors/jumbotron/error.rb
|
|
@@ -227,6 +228,7 @@ files:
|
|
|
227
228
|
- app/services/jumbotron/services/public/map_public_consensus_lines.rb
|
|
228
229
|
- app/services/jumbotron/services/public/map_public_current_lines.rb
|
|
229
230
|
- app/services/jumbotron/services/public/read_game.rb
|
|
231
|
+
- app/services/jumbotron/services/public/read_sandbox_projection.rb
|
|
230
232
|
- app/services/jumbotron/services/public/read_schedule.rb
|
|
231
233
|
- app/services/jumbotron/services/public/read_schedule_groups.rb
|
|
232
234
|
- app/services/jumbotron/services/public/resolve_current_lines_for_games.rb
|
|
@@ -249,6 +251,7 @@ files:
|
|
|
249
251
|
- app/workflows/jumbotron/workflows/read_game_workflow.rb
|
|
250
252
|
- app/workflows/jumbotron/workflows/read_schedule_groups_workflow.rb
|
|
251
253
|
- app/workflows/jumbotron/workflows/read_schedule_workflow.rb
|
|
254
|
+
- app/workflows/jumbotron/workflows/sandbox/read_projection_workflow.rb
|
|
252
255
|
- app/workflows/jumbotron/workflows/sandbox/register_projection_workflow.rb
|
|
253
256
|
- app/workflows/jumbotron/workflows/sandbox/reset_projection_workflow.rb
|
|
254
257
|
- app/workflows/jumbotron/workflows/synchronize_adapter_workflow.rb
|
|
@@ -269,6 +272,7 @@ files:
|
|
|
269
272
|
- docs/upgrades/0.1.3.md
|
|
270
273
|
- docs/upgrades/0.1.4.md
|
|
271
274
|
- docs/upgrades/0.2.0.md
|
|
275
|
+
- docs/upgrades/0.3.0.md
|
|
272
276
|
- lib/jumbotron.rb
|
|
273
277
|
- lib/jumbotron/client.rb
|
|
274
278
|
- lib/jumbotron/engine.rb
|