Skip to content

Commit ebb09fb

Browse files
authored
fix: use NATIONAL_ID reference type with valid alphanumeric format (#1234)
Companies House regex requires ^[A-Z]{0,2}\d{6,8}$ which doesn't match our demo references. Switch to NATIONAL_ID type (^[A-Z0-9]{5,20}$) and remove hyphens from external references. Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent e8a75b3 commit ebb09fb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/seed-demo/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ func registerParties(ctx context.Context, conn *grpc.ClientConn) (string, []stri
253253
PartyType: partyv1.PartyType_PARTY_TYPE_ORGANIZATION,
254254
LegalName: "UK Power Networks",
255255
DisplayName: "UKPN",
256-
ExternalReference: "UKPN-DNO-001",
257-
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_COMPANIES_HOUSE,
256+
ExternalReference: "UKPNDNO001",
257+
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_NATIONAL_ID,
258258
})
259259
if err != nil {
260260
return "", nil, nil, fmt.Errorf("register DNO: %w", err)
@@ -268,8 +268,8 @@ func registerParties(ctx context.Context, conn *grpc.ClientConn) (string, []stri
268268
PartyType: partyv1.PartyType_PARTY_TYPE_ORGANIZATION,
269269
LegalName: gsp.name,
270270
DisplayName: gsp.region,
271-
ExternalReference: "GSP-" + gsp.region,
272-
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_COMPANIES_HOUSE,
271+
ExternalReference: "GSP" + gsp.region,
272+
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_NATIONAL_ID,
273273
})
274274
if err != nil {
275275
return "", nil, nil, fmt.Errorf("register GSP %s: %w", gsp.region, err)
@@ -285,8 +285,8 @@ func registerParties(ctx context.Context, conn *grpc.ClientConn) (string, []stri
285285
PartyType: partyv1.PartyType_PARTY_TYPE_PERSON,
286286
LegalName: cust.legalName,
287287
DisplayName: cust.legalName,
288-
ExternalReference: fmt.Sprintf("CUST-%03d", i+1),
289-
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_COMPANIES_HOUSE,
288+
ExternalReference: fmt.Sprintf("CUST%03d", i+1),
289+
ExternalReferenceType: partyv1.ExternalReferenceType_EXTERNAL_REFERENCE_TYPE_NATIONAL_ID,
290290
})
291291
if err != nil {
292292
return "", nil, nil, fmt.Errorf("register customer %s: %w", cust.legalName, err)

0 commit comments

Comments
 (0)