hecks 2.4.0 → 2.5.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9df85914ab1de8512f099777f6129d4ed2c75fa26cb29de9162fb82ddc66b6ee
|
|
4
|
+
data.tar.gz: 6e171cfe202477bded39de3591ffa009b5738136e28444d042d408db1888d99a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8cd2ea1bd846b0064d56e6309e8cd99e2a0b8c7d2dfe368a021e2af7c5b8a377068ade46e6367d63e844a5eb735f4067d12fc29ce3a63f10dcf1c03545a4388c
|
|
7
|
+
data.tar.gz: b0dea44c43a300f81ea80c1917852e90b12093c9ee2e651f032bf0b06bc89bca88c1165ddb72f2c69653cd89e2e74006779325dd478fa28c44d9b130b714fbbb
|
|
@@ -48,8 +48,22 @@ module Hecks
|
|
|
48
48
|
# vocabulary), not commands.
|
|
49
49
|
PAYMENTS = "payments".freeze
|
|
50
50
|
|
|
51
|
+
# Scheduling sessions and taking registrations for them — recognised
|
|
52
|
+
# by declaration, not the literal aggregate names "Event" and
|
|
53
|
+
# "Registration". rust/host's event and registration routes dispatch
|
|
54
|
+
# these verbs; the aggregates they name are the event and the
|
|
55
|
+
# registration.
|
|
56
|
+
REGISTRATIONS = "registrations".freeze
|
|
57
|
+
|
|
58
|
+
# A business's connection to its payment processor: connect it, drop
|
|
59
|
+
# it, pause it, and switch taking payments on or off — recognised by
|
|
60
|
+
# declaration, not the literal name "PaymentConnection". rust/host's
|
|
61
|
+
# payments routes dispatch these verbs; the connection aggregate is
|
|
62
|
+
# the one `connect` names.
|
|
63
|
+
PAYMENT_CONNECTION = "payment_connection".freeze
|
|
64
|
+
|
|
51
65
|
CONTRACTS = {
|
|
52
|
-
AUTHORIZATION
|
|
66
|
+
AUTHORIZATION => {
|
|
53
67
|
# every assignment an actor holds, current or historical
|
|
54
68
|
assignments: :query,
|
|
55
69
|
# the command that grants an actor a role
|
|
@@ -57,7 +71,7 @@ module Hecks
|
|
|
57
71
|
# every grant of one role acting as another
|
|
58
72
|
transitions: :query
|
|
59
73
|
}.freeze,
|
|
60
|
-
MEMBERSHIP
|
|
74
|
+
MEMBERSHIP => {
|
|
61
75
|
# recognize a person who may eventually sign in
|
|
62
76
|
admit: :command,
|
|
63
77
|
# grant an admitted person a role (the access-grant half)
|
|
@@ -65,7 +79,7 @@ module Hecks
|
|
|
65
79
|
# every admitted person, for the admin listing
|
|
66
80
|
people: :query
|
|
67
81
|
}.freeze,
|
|
68
|
-
IDENTITY
|
|
82
|
+
IDENTITY => {
|
|
69
83
|
# mint a stable identity, independent of how it authenticated
|
|
70
84
|
register: :command,
|
|
71
85
|
# associate an (issuer, subject) pair with that identity
|
|
@@ -73,7 +87,7 @@ module Hecks
|
|
|
73
87
|
# look up the identity an authenticated pair resolves to
|
|
74
88
|
resolve: :query
|
|
75
89
|
}.freeze,
|
|
76
|
-
NEWSLETTER
|
|
90
|
+
NEWSLETTER => {
|
|
77
91
|
# a guest signs up; the aggregate it names is the subscriber
|
|
78
92
|
subscribe: :command,
|
|
79
93
|
# attach a display name to an existing subscriber
|
|
@@ -83,20 +97,42 @@ module Hecks
|
|
|
83
97
|
# a subscriber leaves from the emailed link
|
|
84
98
|
unsubscribe: :command
|
|
85
99
|
}.freeze,
|
|
86
|
-
NEWSLETTER_ISSUES
|
|
100
|
+
NEWSLETTER_ISSUES => {
|
|
87
101
|
# mark an issue sent; the issue aggregate is the one it names
|
|
88
102
|
send_issue: :command,
|
|
89
103
|
# record one email handed to the mail provider; the delivery
|
|
90
104
|
# aggregate is the one it names
|
|
91
105
|
record_delivery: :command
|
|
92
106
|
}.freeze,
|
|
93
|
-
PAYMENTS
|
|
107
|
+
PAYMENTS => {
|
|
94
108
|
# start a payment; the aggregate it names is the payment
|
|
95
109
|
initiate: :command,
|
|
96
110
|
# the processor reports the money arrived
|
|
97
111
|
succeeded: :port_operation,
|
|
98
112
|
# the processor reports the payment failed or expired
|
|
99
113
|
failed: :port_operation
|
|
114
|
+
}.freeze,
|
|
115
|
+
REGISTRATIONS => {
|
|
116
|
+
# schedule a session; the aggregate it names is the event
|
|
117
|
+
schedule: :command,
|
|
118
|
+
# a guest asks for a place; the aggregate it names is the registration
|
|
119
|
+
request: :command
|
|
120
|
+
}.freeze,
|
|
121
|
+
PAYMENT_CONNECTION => {
|
|
122
|
+
# link the processor account; the aggregate it names is the connection
|
|
123
|
+
connect: :command,
|
|
124
|
+
# link a different processor account after a disconnect
|
|
125
|
+
reconnect: :command,
|
|
126
|
+
# drop the link
|
|
127
|
+
disconnect: :command,
|
|
128
|
+
# pause the connection without dropping it
|
|
129
|
+
suspend: :command,
|
|
130
|
+
# lift a pause
|
|
131
|
+
resume: :command,
|
|
132
|
+
# switch taking payments on
|
|
133
|
+
enable: :command,
|
|
134
|
+
# switch taking payments off
|
|
135
|
+
disable: :command
|
|
100
136
|
}.freeze
|
|
101
137
|
}.freeze
|
|
102
138
|
end
|
|
@@ -305,6 +305,15 @@ Hecks.bluebook "Bluebook", version: "1" do
|
|
|
305
305
|
member keyword: "provides", context: "Bluebook", at: "", named: "failed", kind: "text", required: "false", fills: "provides"
|
|
306
306
|
member keyword: "provides", context: "Bluebook", at: "", named: "send_issue", kind: "text", required: "false", fills: "provides"
|
|
307
307
|
member keyword: "provides", context: "Bluebook", at: "", named: "record_delivery", kind: "text", required: "false", fills: "provides"
|
|
308
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "schedule", kind: "text", required: "false", fills: "provides"
|
|
309
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "request", kind: "text", required: "false", fills: "provides"
|
|
310
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "connect", kind: "text", required: "false", fills: "provides"
|
|
311
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "reconnect", kind: "text", required: "false", fills: "provides"
|
|
312
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "disconnect", kind: "text", required: "false", fills: "provides"
|
|
313
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "suspend", kind: "text", required: "false", fills: "provides"
|
|
314
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "resume", kind: "text", required: "false", fills: "provides"
|
|
315
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "enable", kind: "text", required: "false", fills: "provides"
|
|
316
|
+
member keyword: "provides", context: "Bluebook", at: "", named: "disable", kind: "text", required: "false", fills: "provides"
|
|
308
317
|
member keyword: "aggregate", context: "Bluebook", at: "1", named: "", kind: "text", required: "true", fills: "name"
|
|
309
318
|
member keyword: "read_model", context: "Bluebook", at: "1", named: "", kind: "text", required: "true", fills: "name"
|
|
310
319
|
member keyword: "policy", context: "Bluebook", at: "1", named: "", kind: "text", required: "true", fills: "name"
|
|
@@ -230,6 +230,52 @@ module Hecks
|
|
|
230
230
|
}
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
+
# Same seam as `newsletter` — which chapter answers scheduling sessions
|
|
234
|
+
# and taking registrations (`Registry#registrations_provider_for`), with
|
|
235
|
+
# its declared verbs qualified and the event and registration aggregates
|
|
236
|
+
# named off them. `{}` when nothing this domain attaches provides
|
|
237
|
+
# registrations.
|
|
238
|
+
# @param registry [Runtime::Registry] the booted registry `domain_name` is loaded in
|
|
239
|
+
# @param domain_name [String] the domain to export the registrations binding for
|
|
240
|
+
# @return [Hash{Symbol => String, nil}] `:provider` (name), `:schedule`, `:request`
|
|
241
|
+
# (qualified verbs), `:event_aggregate` and `:registration_aggregate` (each verb's own
|
|
242
|
+
# leading qualified aggregate name); `{}` if nothing this domain attaches provides
|
|
243
|
+
# registrations
|
|
244
|
+
def registrations(registry, domain_name)
|
|
245
|
+
provider = registry.registrations_provider_for(domain_name)
|
|
246
|
+
return {} unless provider
|
|
247
|
+
|
|
248
|
+
capability = Bluebook::Capabilities::REGISTRATIONS
|
|
249
|
+
schedule = provider.provided_verb(capability, :schedule)
|
|
250
|
+
request = provider.provided_verb(capability, :request)
|
|
251
|
+
{
|
|
252
|
+
provider: provider.name,
|
|
253
|
+
schedule: schedule,
|
|
254
|
+
request: request,
|
|
255
|
+
event_aggregate: schedule&.split(".")&.first,
|
|
256
|
+
registration_aggregate: request&.split(".")&.first
|
|
257
|
+
}
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Which chapter owns the payment-processor connection
|
|
261
|
+
# (`Registry#payment_connection_provider_for`), with its declared verbs
|
|
262
|
+
# qualified and the connection aggregate named off `connect`. `{}` when
|
|
263
|
+
# nothing this domain attaches provides payment_connection.
|
|
264
|
+
# @param registry [Runtime::Registry] the booted registry `domain_name` is loaded in
|
|
265
|
+
# @param domain_name [String] the domain to export the payment-connection binding for
|
|
266
|
+
# @return [Hash{Symbol => String, nil}] `:provider` (name), one qualified verb per contract key
|
|
267
|
+
# (`:connect`, `:reconnect`, `:disconnect`, `:suspend`, `:resume`, `:enable`, `:disable`) and
|
|
268
|
+
# `:aggregate` (`:connect`'s own leading qualified aggregate name); `{}` if nothing this
|
|
269
|
+
# domain attaches provides payment_connection
|
|
270
|
+
def payment_connection(registry, domain_name)
|
|
271
|
+
provider = registry.payment_connection_provider_for(domain_name)
|
|
272
|
+
return {} unless provider
|
|
273
|
+
|
|
274
|
+
capability = Bluebook::Capabilities::PAYMENT_CONNECTION
|
|
275
|
+
verbs = Bluebook::Capabilities::CONTRACTS.fetch(capability).keys.to_h { |key| [key, provider.provided_verb(capability, key)] }
|
|
276
|
+
{ provider: provider.name, **verbs, aggregate: verbs[:connect]&.split(".")&.first }
|
|
277
|
+
end
|
|
278
|
+
|
|
233
279
|
# Same seam as `newsletter` — which chapter takes payments
|
|
234
280
|
# (`Registry#payments_provider_for`), with its declared verbs
|
|
235
281
|
# qualified and the paying aggregate named off `initiate`. rust/host
|
|
@@ -403,6 +403,28 @@ module Hecks
|
|
|
403
403
|
vendored_provider_for(domain, Bluebook::Capabilities::NEWSLETTER_ISSUES)
|
|
404
404
|
end
|
|
405
405
|
|
|
406
|
+
# The chapter that answers scheduling sessions and taking registrations
|
|
407
|
+
# for `domain` — resolved the same way as `payments_provider_for`, by what
|
|
408
|
+
# it declares (`provides "registrations"`). Nil when none does.
|
|
409
|
+
#
|
|
410
|
+
# @param domain [String, Symbol] the domain whose registrations chapter is being resolved
|
|
411
|
+
# @return [Bluebook::Chapter, nil] the chapter that answers `domain`'s registrations,
|
|
412
|
+
# or nil if none does
|
|
413
|
+
def registrations_provider_for(domain)
|
|
414
|
+
vendored_provider_for(domain, Bluebook::Capabilities::REGISTRATIONS)
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# The chapter that owns the business's payment-processor connection for
|
|
418
|
+
# `domain` — resolved by what it declares (`provides "payment_connection"`).
|
|
419
|
+
# Nil when none does.
|
|
420
|
+
#
|
|
421
|
+
# @param domain [String, Symbol] the domain whose payment-connection chapter is being resolved
|
|
422
|
+
# @return [Bluebook::Chapter, nil] the chapter that owns `domain`'s payment connection,
|
|
423
|
+
# or nil if none does
|
|
424
|
+
def payment_connection_provider_for(domain)
|
|
425
|
+
vendored_provider_for(domain, Bluebook::Capabilities::PAYMENT_CONNECTION)
|
|
426
|
+
end
|
|
427
|
+
|
|
406
428
|
# The chapter that takes payments for `domain` — the domain's own
|
|
407
429
|
# chapter, a framework member, or a vendored embryonaut bluebook it
|
|
408
430
|
# attaches, that declares `provides "payments"`. Nil when none does.
|
data/lib/hecks/version.rb
CHANGED