Skip to content

Commit d0e1a2e

Browse files
committed
PAE-000: update api definition
1 parent e3579d4 commit d0e1a2e

File tree

2 files changed

+106
-84
lines changed

2 files changed

+106
-84
lines changed

docs/architecture/api-definitions/external-manage-prns.yaml

Lines changed: 105 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.3
22
info:
33
title: Packaging Recycling Notes API
4-
description: API for external management of Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with accept/reject functionality
4+
description: API for managing Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with accept/reject functionality
55
version: 1.0.0
66

77
tags:
@@ -142,10 +142,6 @@ paths:
142142
responses:
143143
'200':
144144
description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) accepted successfully
145-
content:
146-
application/json:
147-
schema:
148-
$ref: '#/components/schemas/PackagingRecyclingNote'
149145
'400':
150146
description: Bad request - Invalid ID format or invalid request body
151147
content:
@@ -203,10 +199,6 @@ paths:
203199
responses:
204200
'200':
205201
description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) rejected successfully
206-
content:
207-
application/json:
208-
schema:
209-
$ref: '#/components/schemas/PackagingRecyclingNote'
210202
'400':
211203
description: Bad request - Invalid ID format or missing required fields
212204
content:
@@ -238,38 +230,38 @@ components:
238230
type: object
239231
required:
240232
- id
241-
- prnType
233+
- isExport
242234
- issuedByOrganisation
243235
- accreditation
244-
- decemberWaste
236+
- isDecemberWaste
245237
- tonnageValue
246238
- issuedToOrganisation
247239
- status
248240
properties:
249241
id:
250242
type: string
251-
format: uuid
252-
description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN)
253-
example: 123e4567-e89b-12d3-a456-426614174000
243+
description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) (24-character hexadecimal ObjectId)
244+
example: 507f1f77bcf86cd799439011
254245
prnNumber:
255246
type: string
256247
description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) number
257248
maxLength: 20
258249
example: ER992415095748M
259-
prnType:
260-
type: string
261-
enum:
262-
- prn
263-
- pern
264-
description: Type of note - prn (Packaging Recycling Note) or pern (Packaging Export Recycling Note)
265-
example: prn
250+
status:
251+
$ref: '#/components/schemas/Status'
266252
issuedByOrganisation:
267253
$ref: '#/components/schemas/Organisation'
254+
issuedToOrganisation:
255+
$ref: '#/components/schemas/Organisation'
268256
accreditation:
269257
$ref: '#/components/schemas/Accreditation'
270-
decemberWaste:
258+
isDecemberWaste:
271259
type: boolean
272-
description: Indicates whether this note includes December waste
260+
description: Indicates whether this note relates to waste received during December
261+
example: true
262+
isExport:
263+
type: boolean
264+
description: Indicates if this is a Packaging Export Recycling Note (PERN). False indicates a Packaging Recycling Note (PRN)
273265
example: true
274266
tonnageValue:
275267
type: integer
@@ -281,47 +273,6 @@ components:
281273
description: Additional notes from the issuer
282274
maxLength: 200
283275
example: T2E Reference 9201234
284-
issuedToOrganisation:
285-
$ref: '#/components/schemas/Organisation'
286-
authorisedBy:
287-
type: string
288-
description: Name or ID of the person who authorised/issued this PRN or PERN
289-
example: John Smith
290-
authorisedByPosition:
291-
type: string
292-
description: Position of the person who authorised/issued this PRN or PERN
293-
example: Operations Director
294-
authorisedAt:
295-
type: string
296-
format: date-time
297-
description: Timestamp when the PRN or PERN was authorised/issued
298-
example: 2024-11-20T15:45:00Z
299-
status:
300-
type: string
301-
enum:
302-
- awaiting_authorisation
303-
- awaiting_acceptance
304-
- accepted
305-
- awaiting_cancellation
306-
- cancelled
307-
- rejected
308-
description: Current status of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN)
309-
example: awaiting_acceptance
310-
acceptedAt:
311-
type: string
312-
format: date-time
313-
description: Timestamp when the PRN or PERN was accepted by the Producer or Compliance Scheme
314-
example: 2024-12-01T10:30:00Z
315-
rejectedAt:
316-
type: string
317-
format: date-time
318-
description: Timestamp when the PRN or PERN was rejected by the Producer or Compliance Scheme
319-
example: 2024-12-01T10:30:00Z
320-
cancelledAt:
321-
type: string
322-
format: date-time
323-
description: Timestamp when the PRN or PERN was cancelled
324-
example: 2024-12-01T11:00:00Z
325276

326277
Error:
327278
type: object
@@ -348,13 +299,12 @@ components:
348299
properties:
349300
id:
350301
type: string
351-
format: uuid
352-
description: Unique identifier for the accreditation of the Reprocessor or Exporter
353-
example: 456e7890-a12b-34c5-d678-901234567890
302+
description: Unique identifier for the accreditation of the Reprocessor or Exporter (24-character hexadecimal ObjectId)
303+
example: 507f1f77bcf86cd799439011
354304
accreditationNumber:
355305
type: string
356306
description: Accreditation Number of the Reprocessor or Exporter
357-
example: R26ER1075628626-PL
307+
example: A26ER1075628626-PL
358308
accreditationYear:
359309
type: integer
360310
description: Year of accreditation
@@ -380,31 +330,19 @@ components:
380330
- glass_other
381331
description: Glass recycling process type (only applicable when material is glass)
382332
example: glass_re_melt
383-
site:
384-
type: string
385-
description: Address of the reprocessing site (populated for reprocessors, not populated for exporters)
386-
maxLength: 100
387-
example: 123 Recycling Way, Industrial Estate, Manchester, M1 2AB
333+
siteAddress:
334+
$ref: '#/components/schemas/Address'
388335

389336
Organisation:
390337
type: object
391338
required:
392339
- id
393-
- idType
394340
- name
395341
properties:
396342
id:
397343
type: string
398-
format: uuid
399-
description: Unique identifier for the organisation
344+
description: Unique identifier for the organisation (either a UUID or a 24-character hexadecimal ObjectId)
400345
example: 987fcdeb-51a2-43f7-b123-456789abcdef
401-
idType:
402-
type: string
403-
enum:
404-
- waste-organisation-api
405-
- epr-re-ex-organisation
406-
description: Source system that the organisation ID belongs to
407-
example: waste-organisation-api
408346
name:
409347
type: string
410348
description: Organisation name
@@ -413,3 +351,87 @@ components:
413351
type: string
414352
description: Trading name of the organisation
415353
example: Green Recycling
354+
355+
UserSummary:
356+
type: object
357+
required:
358+
- name
359+
properties:
360+
name:
361+
type: string
362+
description: Name of the user
363+
example: John Smith
364+
position:
365+
type: string
366+
description: Position or job title of the user
367+
example: Operations Director
368+
369+
Status:
370+
type: object
371+
required:
372+
- currentStatus
373+
properties:
374+
currentStatus:
375+
type: string
376+
enum:
377+
- awaiting_authorisation
378+
- awaiting_acceptance
379+
- accepted
380+
- awaiting_cancellation
381+
- cancelled
382+
- rejected
383+
description: Current status of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN)
384+
example: awaiting_acceptance
385+
authorisedBy:
386+
$ref: '#/components/schemas/UserSummary'
387+
authorisedAt:
388+
type: string
389+
format: date-time
390+
description: Timestamp when the PRN or PERN was authorised/issued
391+
example: 2024-11-20T15:45:00Z
392+
acceptedAt:
393+
type: string
394+
format: date-time
395+
description: Timestamp when the PRN or PERN was accepted by the Producer or Compliance Scheme
396+
example: 2024-12-01T10:30:00Z
397+
rejectedAt:
398+
type: string
399+
format: date-time
400+
description: Timestamp when the PRN or PERN was rejected by the Producer or Compliance Scheme
401+
example: 2024-12-01T10:30:00Z
402+
cancelledAt:
403+
type: string
404+
format: date-time
405+
description: Timestamp when the PRN or PERN was cancelled
406+
example: 2024-12-01T11:00:00Z
407+
408+
Address:
409+
type: object
410+
required:
411+
- line1
412+
- postcode
413+
properties:
414+
line1:
415+
type: string
416+
description: First line of the address
417+
example: 123 Recycling Way
418+
line2:
419+
type: string
420+
description: Second line of the address
421+
example: Industrial Estate
422+
town:
423+
type: string
424+
description: Town or city
425+
example: Manchester
426+
county:
427+
type: string
428+
description: County or region
429+
example: Greater Manchester
430+
postcode:
431+
type: string
432+
description: Postal code
433+
example: M1 2AB
434+
country:
435+
type: string
436+
description: Country
437+
example: United Kingdom

0 commit comments

Comments
 (0)