-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasyncapi.yaml
270 lines (270 loc) · 8.32 KB
/
asyncapi.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
asyncapi: 3.0.0
info:
title: FFC Payment Statement Publisher
version: 1.0.2
description: Publish PDF payment statements for Future Farming
channels:
ffc-doc-statement-publish/ffc-doc-statement-publisher:
address: ffc-doc-statement-publish/ffc-doc-statement-publisher
messages:
subscribeToPublisher.message.0:
$ref: '#/components/messages/PublishRequest'
subscribeToPublisher.message.1:
$ref: '#/components/messages/DelinkedPublishRequest'
ffc-doc-statement-crm:
address: ffc-doc-statement-crm
messages:
publishToCrm.message:
$ref: '#/components/messages/CrmInvalidEmailResponse'
operations:
subscribeToPublisher:
action: send
channel:
$ref: '#/channels/ffc-doc-statement-publish~1ffc-doc-statement-publisher'
summary: Subscribe to publisher
messages:
- $ref: >-
#/channels/ffc-doc-statement-publish~1ffc-doc-statement-publisher/messages/subscribeToPublisher.message.0
- $ref: >-
#/channels/ffc-doc-statement-publish~1ffc-doc-statement-publisher/messages/subscribeToPublisher.message.1
publishToCrm:
action: receive
channel:
$ref: '#/channels/ffc-doc-statement-crm'
summary: Publish to CRM
messages:
- $ref: '#/channels/ffc-doc-statement-crm/messages/publishToCrm.message'
components:
messages:
DelinkedPublishRequest:
title: Delinked Publish request
name: Delinked payment statement publish request
contentType: application/json
payload:
$ref: '#/components/schemas/DelinkedPublishRequest'
CrmInvalidEmailResponse:
title: Invalid Email Response
name: Payment statement invalid email response
contentType: application/json
payload:
$ref: '#/components/schemas/CrmInvalidEmailResponse'
PublishRequest:
title: Publish request
name: Payment statement publish request
contentType: application/json
payload:
$ref: '#/components/schemas/PublishRequest'
schemas:
DelinkedPublishRequest:
type: object
required:
- address
- businessName
- documentReference
- filename
- frn
- sbi
properties:
address:
$ref: '#/components/schemas/Address'
businessName:
$ref: '#/components/schemas/BusinessName'
documentReference:
$ref: '#/components/schemas/DocumentReference'
email:
$ref: '#/components/schemas/Email'
filename:
$ref: '#/components/schemas/FilenameDelinked'
frn:
$ref: '#/components/schemas/FRN'
sbi:
$ref: '#/components/schemas/SBI'
scheme:
$ref: '#/components/schemas/SchemeDelinked'
CrmInvalidEmailResponse:
type: object
required:
- email
- errorMessage
- frn
properties:
email:
$ref: '#/components/schemas/Email'
errorMessage:
$ref: '#/components/schemas/ErrorMessage'
frn:
$ref: '#/components/schemas/FRN'
PublishRequest:
type: object
required:
- address
- businessName
- documentReference
- filename
- frn
- sbi
- scheme
properties:
address:
$ref: '#/components/schemas/Address'
businessName:
$ref: '#/components/schemas/BusinessName'
documentReference:
$ref: '#/components/schemas/DocumentReference'
email:
$ref: '#/components/schemas/Email'
filename:
$ref: '#/components/schemas/Filename'
frn:
$ref: '#/components/schemas/FRN'
sbi:
$ref: '#/components/schemas/SBI'
scheme:
$ref: '#/components/schemas/Scheme'
Address:
type: object
properties:
line1:
type: string
description: The first line of the address
example: 1 The Street
line2:
type: string
description: The second line of the address
example: The Area
line3:
type: string
description: The third line of the address
example: The Town
line4:
type: string
description: The fourth line of the address
example: The Region
line5:
type: string
description: The fifth line of the address
example: The County
postcode:
type: string
description: The postcode
example: AB1 2CD
AgreementNumber:
type: string
description: The agreement number
example: SFI1234567
BusinessName:
type: string
description: The business name
example: FFC Ltd
DocumentReference:
type: number
description: Unique identifier of the document
minimum: 1
example: 1
Email:
type: string
description: The business email address
example: farm@farms.com
ErrorMessage:
type: string
description: The invalid email reasoning
enum:
- The statement cannot be emailed as no email address was provided.
- >-
We failed to send the statement because the email address provided was
invalid.
example: >-
We failed to send the statement because the email address provided was
invalid.
FRN:
type: number
description: Firm Reference Number
minimum: 1000000000
maximum: 9999999999
example: 1234567890
FilenameDelinked:
type: string
description: >-
PDF filename, formatted as product code using 3 to 6 uppercase
characters, descriptor in PascalCase, Scheme ID using 3 to 6 uppercase
characters, Scheme Year using 4 digits, FRN using 10 digits, date and
time using 16 digits and then .pdf. All separated by underscore.
example: FFC_PaymentStatement_DP_2023_1234567890_2022080515301212.pdf
pattern: >-
^[A-Z]{3,6}\_[A-Z]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\_[A-Z]{3,6}_\d{4}_\d{10}_\d{16}\.pdf$
Filename:
type: string
description: >-
PDF filename, formatted as product code using 3 to 6 uppercase
characters, descriptor in PascalCase, Scheme ID using 3 to 6 uppercase
characters, Scheme Year using 4 digits, FRN using 10 digits, date and
time using 16 digits and then .pdf. All separated by underscore.
example: FFC_PaymentStatement_SFI_2022_1234567890_2022080515301212.pdf
pattern: >-
^[A-Z]{3,6}\_[A-Z]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\_[A-Z]{3,6}_\d{4}_\d{10}_\d{16}\.pdf$
SBI:
type: number
description: Single Business Identifier
minimum: 105000000
maximum: 999999999
example: 123456789
Scheme:
type: object
required:
- agreementNumber
- frequency
- name
- shortName
- year
properties:
agreementNumber:
$ref: '#/components/schemas/AgreementNumber'
frequency:
$ref: '#/components/schemas/SchemeFrequency'
name:
$ref: '#/components/schemas/SchemeName'
shortName:
$ref: '#/components/schemas/SchemeShortName'
year:
$ref: '#/components/schemas/SchemeYear'
SchemeDelinked:
type: object
required:
- name
- shortName
- year
properties:
name:
$ref: '#/components/schemas/SchemeNameDelinked'
shortName:
$ref: '#/components/schemas/SchemeShortNameDelinked'
year:
$ref: '#/components/schemas/SchemeYearDelinked'
SchemeNameDelinked:
type: string
description: The name of the scheme
example: Delinked payments
SchemeName:
type: string
description: The name of the scheme
example: Sustainable Farming Incentive
SchemeShortNameDelinked:
type: string
description: The short name of the scheme
example: DP
SchemeShortName:
type: string
description: The short name of the scheme
example: SFI
SchemeYearDelinked:
type: string
description: The marketing year
example: '2023'
SchemeYear:
type: string
description: The marketing year
example: '2022'
SchemeFrequency:
type: string
description: The frequency of payments
example: Quarterly