From e3579d4d289ae64d0784da57b4e0a8310d9e65e8 Mon Sep 17 00:00:00 2001 From: Nijk <1615460+nijk@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:33:47 +0000 Subject: [PATCH 1/6] PAE-000: add PRN data model along with the api-definition for external PRN management (RPD tactical endpoints) --- .../api-definitions/external-manage-prns.yaml | 415 ++++++++++++++++++ docs/architecture/discovery/pepr-lld.md | 58 ++- 2 files changed, 470 insertions(+), 3 deletions(-) create mode 100644 docs/architecture/api-definitions/external-manage-prns.yaml diff --git a/docs/architecture/api-definitions/external-manage-prns.yaml b/docs/architecture/api-definitions/external-manage-prns.yaml new file mode 100644 index 0000000..fb90378 --- /dev/null +++ b/docs/architecture/api-definitions/external-manage-prns.yaml @@ -0,0 +1,415 @@ +openapi: 3.0.3 +info: + title: Packaging Recycling Notes API + description: API for external management of Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with accept/reject functionality + version: 1.0.0 + +tags: + - name: Packaging Recycling Notes + description: Operations related to Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) + +paths: + /v1/packaging-recycling-notes: + get: + tags: + - Packaging Recycling Notes + summary: List packaging recycling notes + description: Retrieves a list of Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with optional filtering by status and update date + operationId: listPackagingRecyclingNotes + parameters: + - name: statuses + in: query + required: true + description: Filter by one or more statuses (comma-separated) + schema: + type: array + items: + type: string + enum: + - awaiting_acceptance + - cancelled + style: form + explode: false + example: awaiting_acceptance,cancelled + - name: statusChangeFrom + in: query + required: false + description: Filter notes with status changes on or after this date-time (ISO 8601 format) + schema: + type: string + format: date-time + example: 2024-11-01T00:00:00Z + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/PackagingRecyclingNote' + total: + type: integer + description: Total number of items matching the filter criteria + example: 42 + '400': + description: Bad request - Invalid query parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v1/packaging-recycling-notes/{id}: + get: + tags: + - Packaging Recycling Notes + summary: Get packaging recycling note by ID + description: Retrieves a specific Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) using its unique identifier + operationId: getPackagingRecyclingNoteById + parameters: + - name: id + in: path + required: true + description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PackagingRecyclingNote' + '400': + description: Bad request - Invalid ID format + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Packaging recycling note not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v1/packaging-recycling-notes/{id}/accept: + post: + tags: + - Packaging Recycling Notes + summary: Accept a packaging recycling note + description: Accepts a Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) by its ID + operationId: acceptPackagingRecyclingNote + parameters: + - name: id + in: path + required: true + description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to accept + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + requestBody: + description: Optional acceptance details + required: false + content: + application/json: + schema: + type: object + properties: + acceptedAt: + type: string + format: date-time + description: Timestamp of acceptance (if different from current time) + example: 2024-12-01T10:30:00Z + responses: + '200': + description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) accepted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/PackagingRecyclingNote' + '400': + description: Bad request - Invalid ID format or invalid request body + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Packaging recycling note not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Conflict - Note has already been accepted or rejected + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v1/packaging-recycling-notes/{id}/reject: + post: + tags: + - Packaging Recycling Notes + summary: Reject a packaging recycling note + description: Rejects a Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) by its ID + operationId: rejectPackagingRecyclingNote + parameters: + - name: id + in: path + required: true + description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to reject + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + requestBody: + description: Rejection details + required: false + content: + application/json: + schema: + type: object + properties: + rejectedAt: + type: string + format: date-time + description: Timestamp of rejection (if different from current time) + example: 2024-12-01T10:30:00Z + responses: + '200': + description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) rejected successfully + content: + application/json: + schema: + $ref: '#/components/schemas/PackagingRecyclingNote' + '400': + description: Bad request - Invalid ID format or missing required fields + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Packaging recycling note not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Conflict - Note has already been accepted or rejected + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + +components: + schemas: + PackagingRecyclingNote: + type: object + required: + - id + - prnType + - issuedByOrganisation + - accreditation + - decemberWaste + - tonnageValue + - issuedToOrganisation + - status + properties: + id: + type: string + format: uuid + description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) + example: 123e4567-e89b-12d3-a456-426614174000 + prnNumber: + type: string + description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) number + maxLength: 20 + example: ER992415095748M + prnType: + type: string + enum: + - prn + - pern + description: Type of note - prn (Packaging Recycling Note) or pern (Packaging Export Recycling Note) + example: prn + issuedByOrganisation: + $ref: '#/components/schemas/Organisation' + accreditation: + $ref: '#/components/schemas/Accreditation' + decemberWaste: + type: boolean + description: Indicates whether this note includes December waste + example: true + tonnageValue: + type: integer + description: Tonnage value as an integer + example: 126 + minimum: 1 + issuerNotes: + type: string + description: Additional notes from the issuer + maxLength: 200 + example: T2E Reference 9201234 + issuedToOrganisation: + $ref: '#/components/schemas/Organisation' + authorisedBy: + type: string + description: Name or ID of the person who authorised/issued this PRN or PERN + example: John Smith + authorisedByPosition: + type: string + description: Position of the person who authorised/issued this PRN or PERN + example: Operations Director + authorisedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was authorised/issued + example: 2024-11-20T15:45:00Z + status: + type: string + enum: + - awaiting_authorisation + - awaiting_acceptance + - accepted + - awaiting_cancellation + - cancelled + - rejected + description: Current status of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) + example: awaiting_acceptance + acceptedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was accepted by the Producer or Compliance Scheme + example: 2024-12-01T10:30:00Z + rejectedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was rejected by the Producer or Compliance Scheme + example: 2024-12-01T10:30:00Z + cancelledAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was cancelled + example: 2024-12-01T11:00:00Z + + Error: + type: object + required: + - code + - message + properties: + code: + type: string + description: Error code + example: NOT_FOUND + message: + type: string + description: Human-readable error message + example: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) not found + + Accreditation: + type: object + required: + - id + - accreditationNumber + - accreditationYear + - material + properties: + id: + type: string + format: uuid + description: Unique identifier for the accreditation of the Reprocessor or Exporter + example: 456e7890-a12b-34c5-d678-901234567890 + accreditationNumber: + type: string + description: Accreditation Number of the Reprocessor or Exporter + example: R26ER1075628626-PL + accreditationYear: + type: integer + description: Year of accreditation + example: 2026 + minimum: 2000 + maximum: 2100 + material: + type: string + enum: + - aluminium + - fibre + - glass + - paper + - plastic + - steel + - wood + description: Type of packaging material being recycled or exported + example: plastic + glassRecyclingProcess: + type: string + enum: + - glass_re_melt + - glass_other + description: Glass recycling process type (only applicable when material is glass) + example: glass_re_melt + site: + type: string + description: Address of the reprocessing site (populated for reprocessors, not populated for exporters) + maxLength: 100 + example: 123 Recycling Way, Industrial Estate, Manchester, M1 2AB + + Organisation: + type: object + required: + - id + - idType + - name + properties: + id: + type: string + format: uuid + description: Unique identifier for the organisation + example: 987fcdeb-51a2-43f7-b123-456789abcdef + idType: + type: string + enum: + - waste-organisation-api + - epr-re-ex-organisation + description: Source system that the organisation ID belongs to + example: waste-organisation-api + name: + type: string + description: Organisation name + example: Green Recycling Solutions Ltd + tradingName: + type: string + description: Trading name of the organisation + example: Green Recycling diff --git a/docs/architecture/discovery/pepr-lld.md b/docs/architecture/discovery/pepr-lld.md index 8f9b961..2ee8ed4 100644 --- a/docs/architecture/discovery/pepr-lld.md +++ b/docs/architecture/discovery/pepr-lld.md @@ -188,7 +188,7 @@ Used to retrieve a packaging recycling note by ID for Operators to view the deta #### RPD Integration -We will likely need some endpoints for integration purposes with RPD, this is an unknown at this stage. +See the [RPD endpoint API definitions here](../api-definitions/external-manage-prns.yaml) ### Reports @@ -322,7 +322,7 @@ erDiagram USER-SUMMARY updatedBy enum type "received, processed, sentOn, exported" json data "reporting fields only" - WASTE-RECORD-VERSION versions + WASTE-RECORD-VERSION[] versions } WASTE-RECORD-VERSION { @@ -732,7 +732,59 @@ An example of an object in the Waste Balance collection ### PRN -TBD +```mermaid +erDiagram + PRN { + ObjectId _id PK + ObjectId organisationId FK + ObjectId registrationId FK + ObjectId accreditationId FK + int schemaVersion + ISO8601 createdAt + USER-SUMMARY createdBy + ISO8601 updatedAt + USER-SUMMARY updatedBy + bool isExport + bool isDecemberWaste + string prnNumber + int accreditationYear "4 digit year: YYYY" + int tonnage + string notes + PRN-ISSUED-TO-ORGANISATION issuedTo + ISO8601 authorisedAt + USER-SUMMARY-WITH-POSITION authorisedBy + PRN-STATUS-VERSION[] status + } + + PRN-ISSUED-TO-ORGANISATION { + ObjectId _id FK + string name + string tradingName + } + + PRN-STATUS-VERSION { + enum status "awaiting_authorisation, awaiting_acceptance, accepted, rejected, awaiting_cancellation, cancelled" + ISO8601 createdAt + USER-SUMMARY createdBy "nullable" + } + + USER-SUMMARY { + ObjectId _id PK + string name + } + + USER-SUMMARY-WITH-POSITION { + ObjectId _id PK + ObjectId organisationId FK + string name + string position + } + + PRN ||--|| PRN-ISSUED-TO-ORGANISATION : contains + PRN ||--|{ PRN-STATUS-VERSION : contains + PRN-STATUS-VERSION ||--|| USER-SUMMARY : contains + PRN ||--|| USER-SUMMARY-WITH-POSITION : contains +``` ### Report From d0e1a2ef31b3f366ea9d15038e5f3b86b865885c Mon Sep 17 00:00:00 2001 From: Nijk <1615460+nijk@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:16:26 +0000 Subject: [PATCH 2/6] PAE-000: update api definition --- .../api-definitions/external-manage-prns.yaml | 188 ++++++++++-------- lib/epr-backend | 2 +- 2 files changed, 106 insertions(+), 84 deletions(-) diff --git a/docs/architecture/api-definitions/external-manage-prns.yaml b/docs/architecture/api-definitions/external-manage-prns.yaml index fb90378..4710a53 100644 --- a/docs/architecture/api-definitions/external-manage-prns.yaml +++ b/docs/architecture/api-definitions/external-manage-prns.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Packaging Recycling Notes API - description: API for external management of Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with accept/reject functionality + description: API for managing Packaging Recycling Notes (PRN) and Packaging Export Recycling Notes (PERN) with accept/reject functionality version: 1.0.0 tags: @@ -142,10 +142,6 @@ paths: responses: '200': description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) accepted successfully - content: - application/json: - schema: - $ref: '#/components/schemas/PackagingRecyclingNote' '400': description: Bad request - Invalid ID format or invalid request body content: @@ -203,10 +199,6 @@ paths: responses: '200': description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) rejected successfully - content: - application/json: - schema: - $ref: '#/components/schemas/PackagingRecyclingNote' '400': description: Bad request - Invalid ID format or missing required fields content: @@ -238,38 +230,38 @@ components: type: object required: - id - - prnType + - isExport - issuedByOrganisation - accreditation - - decemberWaste + - isDecemberWaste - tonnageValue - issuedToOrganisation - status properties: id: type: string - format: uuid - description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) - example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) (24-character hexadecimal ObjectId) + example: 507f1f77bcf86cd799439011 prnNumber: type: string description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) number maxLength: 20 example: ER992415095748M - prnType: - type: string - enum: - - prn - - pern - description: Type of note - prn (Packaging Recycling Note) or pern (Packaging Export Recycling Note) - example: prn + status: + $ref: '#/components/schemas/Status' issuedByOrganisation: $ref: '#/components/schemas/Organisation' + issuedToOrganisation: + $ref: '#/components/schemas/Organisation' accreditation: $ref: '#/components/schemas/Accreditation' - decemberWaste: + isDecemberWaste: type: boolean - description: Indicates whether this note includes December waste + description: Indicates whether this note relates to waste received during December + example: true + isExport: + type: boolean + description: Indicates if this is a Packaging Export Recycling Note (PERN). False indicates a Packaging Recycling Note (PRN) example: true tonnageValue: type: integer @@ -281,47 +273,6 @@ components: description: Additional notes from the issuer maxLength: 200 example: T2E Reference 9201234 - issuedToOrganisation: - $ref: '#/components/schemas/Organisation' - authorisedBy: - type: string - description: Name or ID of the person who authorised/issued this PRN or PERN - example: John Smith - authorisedByPosition: - type: string - description: Position of the person who authorised/issued this PRN or PERN - example: Operations Director - authorisedAt: - type: string - format: date-time - description: Timestamp when the PRN or PERN was authorised/issued - example: 2024-11-20T15:45:00Z - status: - type: string - enum: - - awaiting_authorisation - - awaiting_acceptance - - accepted - - awaiting_cancellation - - cancelled - - rejected - description: Current status of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) - example: awaiting_acceptance - acceptedAt: - type: string - format: date-time - description: Timestamp when the PRN or PERN was accepted by the Producer or Compliance Scheme - example: 2024-12-01T10:30:00Z - rejectedAt: - type: string - format: date-time - description: Timestamp when the PRN or PERN was rejected by the Producer or Compliance Scheme - example: 2024-12-01T10:30:00Z - cancelledAt: - type: string - format: date-time - description: Timestamp when the PRN or PERN was cancelled - example: 2024-12-01T11:00:00Z Error: type: object @@ -348,13 +299,12 @@ components: properties: id: type: string - format: uuid - description: Unique identifier for the accreditation of the Reprocessor or Exporter - example: 456e7890-a12b-34c5-d678-901234567890 + description: Unique identifier for the accreditation of the Reprocessor or Exporter (24-character hexadecimal ObjectId) + example: 507f1f77bcf86cd799439011 accreditationNumber: type: string description: Accreditation Number of the Reprocessor or Exporter - example: R26ER1075628626-PL + example: A26ER1075628626-PL accreditationYear: type: integer description: Year of accreditation @@ -380,31 +330,19 @@ components: - glass_other description: Glass recycling process type (only applicable when material is glass) example: glass_re_melt - site: - type: string - description: Address of the reprocessing site (populated for reprocessors, not populated for exporters) - maxLength: 100 - example: 123 Recycling Way, Industrial Estate, Manchester, M1 2AB + siteAddress: + $ref: '#/components/schemas/Address' Organisation: type: object required: - id - - idType - name properties: id: type: string - format: uuid - description: Unique identifier for the organisation + description: Unique identifier for the organisation (either a UUID or a 24-character hexadecimal ObjectId) example: 987fcdeb-51a2-43f7-b123-456789abcdef - idType: - type: string - enum: - - waste-organisation-api - - epr-re-ex-organisation - description: Source system that the organisation ID belongs to - example: waste-organisation-api name: type: string description: Organisation name @@ -413,3 +351,87 @@ components: type: string description: Trading name of the organisation example: Green Recycling + + UserSummary: + type: object + required: + - name + properties: + name: + type: string + description: Name of the user + example: John Smith + position: + type: string + description: Position or job title of the user + example: Operations Director + + Status: + type: object + required: + - currentStatus + properties: + currentStatus: + type: string + enum: + - awaiting_authorisation + - awaiting_acceptance + - accepted + - awaiting_cancellation + - cancelled + - rejected + description: Current status of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) + example: awaiting_acceptance + authorisedBy: + $ref: '#/components/schemas/UserSummary' + authorisedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was authorised/issued + example: 2024-11-20T15:45:00Z + acceptedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was accepted by the Producer or Compliance Scheme + example: 2024-12-01T10:30:00Z + rejectedAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was rejected by the Producer or Compliance Scheme + example: 2024-12-01T10:30:00Z + cancelledAt: + type: string + format: date-time + description: Timestamp when the PRN or PERN was cancelled + example: 2024-12-01T11:00:00Z + + Address: + type: object + required: + - line1 + - postcode + properties: + line1: + type: string + description: First line of the address + example: 123 Recycling Way + line2: + type: string + description: Second line of the address + example: Industrial Estate + town: + type: string + description: Town or city + example: Manchester + county: + type: string + description: County or region + example: Greater Manchester + postcode: + type: string + description: Postal code + example: M1 2AB + country: + type: string + description: Country + example: United Kingdom diff --git a/lib/epr-backend b/lib/epr-backend index 4bbd587..607e631 160000 --- a/lib/epr-backend +++ b/lib/epr-backend @@ -1 +1 @@ -Subproject commit 4bbd587111011be4bdedcad35f9b90f75a6f47fc +Subproject commit 607e631cea27ac9535dd9ae2fd04743fa0f9e6af From cb3b912def2c6b7d1abd815dd17a91d35b0ed69e Mon Sep 17 00:00:00 2001 From: franv-1 Date: Mon, 8 Dec 2025 18:55:16 +0000 Subject: [PATCH 3/6] Update external-manage-prns.yaml --- .../api-definitions/external-manage-prns.yaml | 63 ++++++++++++++----- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/docs/architecture/api-definitions/external-manage-prns.yaml b/docs/architecture/api-definitions/external-manage-prns.yaml index 4710a53..c00dddd 100644 --- a/docs/architecture/api-definitions/external-manage-prns.yaml +++ b/docs/architecture/api-definitions/external-manage-prns.yaml @@ -31,7 +31,7 @@ paths: style: form explode: false example: awaiting_acceptance,cancelled - - name: statusChangeFrom + - name: dateFrom in: query required: false description: Filter notes with status changes on or after this date-time (ISO 8601 format) @@ -39,6 +39,28 @@ paths: type: string format: date-time example: 2024-11-01T00:00:00Z + - name: dateTo + in: query + required: false + description: Filter notes with status changes on or before this date-time (ISO 8601 format) + schema: + type: string + format: date-time + example: 2024-12-31T23:59:59Z + - name: limit + in: query + required: false + description: Maximum number of records to return per page. If not provided, the default value defined in the Re/Ex configuration will be used. If the provided limit exceeds the Re/Ex maximum, your result set may be truncated. + schema: + type: integer + example: 50 + - name: cursor + in: query + required: false + description: Pagination cursor from previous response (use the nextCursor value to get the next page) + schema: + type: string + example: 507f1f77bcf86cd799439012 responses: '200': description: Successful response @@ -46,15 +68,22 @@ paths: application/json: schema: type: object + required: + - items + - hasMore properties: items: type: array items: $ref: '#/components/schemas/PackagingRecyclingNote' - total: - type: integer - description: Total number of items matching the filter criteria - example: 42 + nextCursor: + type: string + description: Cursor for retrieving the next page of results. Pass this value as the 'cursor' parameter in the next request. Only present when hasMore is true. + example: 507f1f77bcf86cd799439012 + hasMore: + type: boolean + description: Indicates if more results are available beyond this page + example: true '400': description: Bad request - Invalid query parameters content: @@ -79,11 +108,10 @@ paths: - name: id in: path required: true - description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) + description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) (24-character hexadecimal ObjectId) schema: type: string - format: uuid - example: 123e4567-e89b-12d3-a456-426614174000 + example: 507f1f77bcf86cd799439011 responses: '200': description: Successful response @@ -121,11 +149,10 @@ paths: - name: id in: path required: true - description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to accept + description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to accept (24-character hexadecimal ObjectId) schema: type: string - format: uuid - example: 123e4567-e89b-12d3-a456-426614174000 + example: 507f1f77bcf86cd799439011 requestBody: description: Optional acceptance details required: false @@ -178,11 +205,10 @@ paths: - name: id in: path required: true - description: Unique identifier of the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to reject + description: Unique identifier for the Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) to reject (24-character hexadecimal ObjectId) schema: type: string - format: uuid - example: 123e4567-e89b-12d3-a456-426614174000 + example: 507f1f77bcf86cd799439011 requestBody: description: Rejection details required: false @@ -230,13 +256,13 @@ components: type: object required: - id - - isExport + - status - issuedByOrganisation + - issuedToOrganisation - accreditation - isDecemberWaste + - isExport - tonnageValue - - issuedToOrganisation - - status properties: id: type: string @@ -250,10 +276,13 @@ components: status: $ref: '#/components/schemas/Status' issuedByOrganisation: + description: The Reprocessor or Exporter Organisation that has Issued this PRN or PERN $ref: '#/components/schemas/Organisation' issuedToOrganisation: + description: The Producer or Compliance Scheme Organisation that is receiving this PRN or PERN $ref: '#/components/schemas/Organisation' accreditation: + description: The Accreditation details of the Reprocessor or Exporter under which this PRN or PERN is issued $ref: '#/components/schemas/Accreditation' isDecemberWaste: type: boolean From f2dc970c6f3633fd862abb45cf858053d96226da Mon Sep 17 00:00:00 2001 From: Nijk <1615460+nijk@users.noreply.github.com> Date: Tue, 9 Dec 2025 14:18:20 +0000 Subject: [PATCH 4/6] PAE-000: update LDM based on PR review discussion --- .../forms-data-logical-data-model.md | 28 ++++--------------- lib/epr-backend | 2 +- lib/epr-frontend | 2 +- lib/epr-re-ex-admin-frontend | 2 +- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/docs/architecture/discovery/forms-data-logical-data-model.md b/docs/architecture/discovery/forms-data-logical-data-model.md index 4683678..4b30054 100644 --- a/docs/architecture/discovery/forms-data-logical-data-model.md +++ b/docs/architecture/discovery/forms-data-logical-data-model.md @@ -173,8 +173,7 @@ erDiagram string fullName string email string phone - string role - string title + string jobTitle } USER-LOGIN-DETAILS{ @@ -289,7 +288,7 @@ erDiagram { "fullName": "Luke Skywalker", "email": "luke.skywalker@starwars.com", - "title": "Director", + "jobTitle": "Director", "phone": "1234567890" } ], @@ -329,7 +328,7 @@ erDiagram { "fullName": "Luke Skywalker", "email": "anakin.skywalker@starwars.com", - "title": "Partner", + "jobTitle": "Partner", "phone": "823456789" } ], @@ -370,7 +369,7 @@ erDiagram { "fullName": "Yoda", "email": "yoda@starwars.com", - "title": "PRN signatory", + "jobTitle": "PRN signatory", "phone": "1234567890" } ], @@ -381,11 +380,6 @@ erDiagram "percentSpent": 20 } ] - }, - "noticeAddress": { - "line1": "7 Glass processing site", - "town": "London", - "postcode": "SW2A 0AA" } }, { @@ -416,7 +410,7 @@ erDiagram { "fullName": "Yoda", "email": "yoda@starwars.com", - "title": "PRN signatory", + "jobTitle": "PRN signatory", "phone": "1234567890" } ], @@ -427,11 +421,6 @@ erDiagram "percentSpent": 20 } ] - }, - "noticeAddress": { - "line1": "7a", - "town": "London", - "postcode": "SW2A 0AA" } }, { @@ -463,7 +452,7 @@ erDiagram { "fullName": "Princess Leia", "email": "princess.leia@starwars.com", - "title": "PRN signatory", + "jobTitle": "PRN signatory", "phone": "7234567890" } ], @@ -473,11 +462,6 @@ erDiagram "percentSpent": 10 } ] - }, - "noticeAddress": { - "line1": "7a", - "town": "London", - "postcode": "SW2A 0AA" } } ], diff --git a/lib/epr-backend b/lib/epr-backend index 607e631..8e08f29 160000 --- a/lib/epr-backend +++ b/lib/epr-backend @@ -1 +1 @@ -Subproject commit 607e631cea27ac9535dd9ae2fd04743fa0f9e6af +Subproject commit 8e08f291d0832a1f637daae9eac19212aaea3f0e diff --git a/lib/epr-frontend b/lib/epr-frontend index 6ced87c..b2d63d6 160000 --- a/lib/epr-frontend +++ b/lib/epr-frontend @@ -1 +1 @@ -Subproject commit 6ced87c6d6bb2487745653121b6ef08ca9d1377c +Subproject commit b2d63d68865149a941307d74a9a26825e1a5901d diff --git a/lib/epr-re-ex-admin-frontend b/lib/epr-re-ex-admin-frontend index dcb6783..5683578 160000 --- a/lib/epr-re-ex-admin-frontend +++ b/lib/epr-re-ex-admin-frontend @@ -1 +1 @@ -Subproject commit dcb67834fe742243735e61bfc004b26e531a35b6 +Subproject commit 568357832c7e2da7b071c4d0a4057bfb221733f0 From ca01f1201faa48ac008080a5a7251b2676e3e660 Mon Sep 17 00:00:00 2001 From: franv-1 Date: Tue, 9 Dec 2025 14:18:23 +0000 Subject: [PATCH 5/6] Update external-manage-prns.yaml --- .../api-definitions/external-manage-prns.yaml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/architecture/api-definitions/external-manage-prns.yaml b/docs/architecture/api-definitions/external-manage-prns.yaml index c00dddd..b6cc2d2 100644 --- a/docs/architecture/api-definitions/external-manage-prns.yaml +++ b/docs/architecture/api-definitions/external-manage-prns.yaml @@ -325,6 +325,7 @@ components: - accreditationNumber - accreditationYear - material + - submittedToRegulator properties: id: type: string @@ -352,6 +353,15 @@ components: - wood description: Type of packaging material being recycled or exported example: plastic + submittedToRegulator: + type: string + enum: + - ea + - nrw + - sepa + - niea + description: Environmental regulator - ea (Environment Agency), nrw (Natural Resources Wales), sepa (Scottish Environment Protection Agency), niea (Northern Ireland Environment Agency) + example: ea glassRecyclingProcess: type: string enum: @@ -384,15 +394,15 @@ components: UserSummary: type: object required: - - name + - fullName properties: - name: + fullName: type: string - description: Name of the user + description: Full name of the user example: John Smith - position: + jobTitle: type: string - description: Position or job title of the user + description: Job title of the user example: Operations Director Status: From a68e3719e7c05a6d1d4a8d2cc319ca129877b93f Mon Sep 17 00:00:00 2001 From: franv-1 Date: Tue, 9 Dec 2025 14:47:33 +0000 Subject: [PATCH 6/6] Update external-manage-prns.yaml --- docs/architecture/api-definitions/external-manage-prns.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture/api-definitions/external-manage-prns.yaml b/docs/architecture/api-definitions/external-manage-prns.yaml index b6cc2d2..0cdf60f 100644 --- a/docs/architecture/api-definitions/external-manage-prns.yaml +++ b/docs/architecture/api-definitions/external-manage-prns.yaml @@ -167,7 +167,7 @@ paths: description: Timestamp of acceptance (if different from current time) example: 2024-12-01T10:30:00Z responses: - '200': + '204': description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) accepted successfully '400': description: Bad request - Invalid ID format or invalid request body @@ -223,7 +223,7 @@ paths: description: Timestamp of rejection (if different from current time) example: 2024-12-01T10:30:00Z responses: - '200': + '204': description: Packaging Recycling Note (PRN) or Packaging Export Recycling Note (PERN) rejected successfully '400': description: Bad request - Invalid ID format or missing required fields