|
1 | 1 | import { |
2 | 2 | EnvelopeId, |
3 | | - SpecificaitonGroupId, |
| 3 | + Pack, |
| 4 | + PackId, |
| 5 | + SpecificaitonId, |
4 | 6 | Specification, |
5 | | - SpecificationGroup, |
6 | | - SpecificationId, |
7 | 7 | } from "@nhsdigital/nhs-notify-schemas-supplier-config/src/domain/specification"; |
8 | 8 | import { Version } from "@nhsdigital/nhs-notify-schemas-supplier-config/src/domain/common"; |
9 | 9 |
|
10 | | -const bauStandardC5: Specification = { |
11 | | - id: SpecificationId("bau-standard-c5"), |
| 10 | +const bauStandardC5: Pack = { |
| 11 | + id: PackId("bau-standard-c5"), |
12 | 12 | name: "BAU Standard Letter C5", |
13 | 13 | status: "PUBLISHED", |
14 | 14 | version: Version("1.0.0"), |
15 | 15 | createdAt: new Date("2023-01-01T00:00:00Z"), |
16 | 16 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
17 | | - specificationType: "LETTER_STANDARD", |
18 | | - pack: { |
| 17 | + assembly: { |
19 | 18 | envelopeId: EnvelopeId("envelope-nhs-c5-economy"), |
20 | 19 | }, |
21 | 20 | }; |
22 | 21 |
|
23 | | -const bauStandardC4: Specification = { |
24 | | - id: SpecificationId("bau-standard-c4"), |
| 22 | +const bauStandardC4: Pack = { |
| 23 | + id: PackId("bau-standard-c4"), |
25 | 24 | name: "BAU Standard Letter C4", |
26 | 25 | status: "PUBLISHED", |
27 | 26 | version: Version("1.0.0"), |
28 | 27 | createdAt: new Date("2023-01-01T00:00:00Z"), |
29 | 28 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
30 | | - specificationType: "LETTER_STANDARD", |
31 | | - pack: { |
| 29 | + assembly: { |
32 | 30 | envelopeId: EnvelopeId("envelope-nhs-c4-economy"), |
33 | 31 | }, |
34 | 32 | }; |
35 | 33 |
|
36 | | -const braille: Specification = { |
37 | | - id: SpecificationId("braille"), |
| 34 | +const braille: Pack = { |
| 35 | + id: PackId("braille"), |
38 | 36 | name: "Braille Letter", |
39 | 37 | status: "PUBLISHED", |
40 | 38 | version: Version("1.0.0"), |
41 | 39 | createdAt: new Date("2023-01-01T00:00:00Z"), |
42 | 40 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
43 | | - specificationType: "LETTER_BRAILLE", |
| 41 | + assembly: { |
| 42 | + features: ["BRAILLE"], |
| 43 | + }, |
44 | 44 | }; |
45 | 45 |
|
46 | | -const audio: Specification = { |
47 | | - id: SpecificationId("audio"), |
| 46 | +const audio: Pack = { |
| 47 | + id: PackId("audio"), |
48 | 48 | name: "Audio Letter", |
49 | 49 | status: "PUBLISHED", |
50 | 50 | version: Version("1.0.0"), |
51 | 51 | createdAt: new Date("2023-01-01T00:00:00Z"), |
52 | 52 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
53 | | - specificationType: "LETTER_AUDIO", |
| 53 | + assembly: { |
| 54 | + features: ["AUDIO"], |
| 55 | + }, |
54 | 56 | }; |
55 | 57 |
|
56 | | -const sameDay: Specification = { |
57 | | - id: SpecificationId("same-day"), |
| 58 | +const sameDay: Pack = { |
| 59 | + id: PackId("same-day"), |
58 | 60 | name: "Same Day Letter", |
59 | 61 | status: "PUBLISHED", |
60 | 62 | version: Version("1.0.0"), |
61 | 63 | createdAt: new Date("2023-01-01T00:00:00Z"), |
62 | 64 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
63 | | - specificationType: "LETTER_SAME_DAY", |
64 | | - pack: { |
| 65 | + assembly: { |
65 | 66 | envelopeId: EnvelopeId("envelope-nhs-c4-same-day"), |
66 | 67 | }, |
67 | 68 | }; |
68 | 69 |
|
69 | | -const digitrials1: Specification = { |
70 | | - id: SpecificationId("digitrials1"), |
| 70 | +const digitrials1: Pack = { |
| 71 | + id: PackId("digitrials1"), |
71 | 72 | name: "Digitrials Letter Pack 1", |
72 | 73 | status: "PUBLISHED", |
73 | 74 | version: Version("1.0.0"), |
74 | 75 | createdAt: new Date("2023-01-01T00:00:00Z"), |
75 | 76 | updatedAt: new Date("2023-01-01T00:00:00Z"), |
76 | | - specificationType: "LETTER_STANDARD", |
77 | | - pack: { |
| 77 | + assembly: { |
78 | 78 | envelopeId: EnvelopeId("digitrials-envelope1-c5"), |
| 79 | + features: ["ADMAIL"], |
79 | 80 | }, |
80 | 81 | }; |
81 | 82 |
|
82 | | -const specifications = { |
| 83 | +const packs = { |
83 | 84 | bauStandardC5, |
84 | 85 | bauStandardC4, |
85 | 86 | braille, |
86 | 87 | audio, |
87 | 88 | sameDay, |
88 | 89 | }; |
89 | 90 |
|
90 | | -const specificationGroups: Record<string, SpecificationGroup> = { |
| 91 | +const specifications: Record<string, Specification> = { |
91 | 92 | bauStandard: { |
92 | | - id: SpecificaitonGroupId("bau-standard"), |
| 93 | + id: SpecificaitonId("bau-standard"), |
93 | 94 | name: "BAU Standard Letter", |
94 | 95 | description: "BAU Standard Letter", |
95 | | - specificationIds: [bauStandardC5.id, bauStandardC4.id], |
| 96 | + packIds: [bauStandardC5.id, bauStandardC4.id], |
96 | 97 | specificationType: "LETTER_STANDARD", |
97 | 98 | status: "PUBLISHED", |
98 | 99 | }, |
99 | 100 | braille: { |
100 | | - id: SpecificaitonGroupId("braille"), |
| 101 | + id: SpecificaitonId("braille"), |
101 | 102 | name: "Braille Letter", |
102 | 103 | description: "Braille Letter", |
103 | | - specificationIds: [braille.id], |
| 104 | + packIds: [braille.id], |
104 | 105 | specificationType: "LETTER_BRAILLE", |
105 | 106 | status: "PUBLISHED", |
106 | 107 | }, |
107 | 108 | audio: { |
108 | | - id: SpecificaitonGroupId("audio"), |
| 109 | + id: SpecificaitonId("audio"), |
109 | 110 | name: "Audio Letter", |
110 | 111 | description: "Audio Letter", |
111 | | - specificationIds: [audio.id], |
| 112 | + packIds: [audio.id], |
112 | 113 | specificationType: "LETTER_AUDIO", |
113 | 114 | status: "PUBLISHED", |
114 | 115 | }, |
115 | 116 | sameDay: { |
116 | | - id: SpecificaitonGroupId("same-day"), |
| 117 | + id: SpecificaitonId("same-day"), |
117 | 118 | name: "Same Day Letter", |
118 | 119 | description: "Same Day Letter", |
119 | | - specificationIds: [sameDay.id], |
| 120 | + packIds: [sameDay.id], |
120 | 121 | specificationType: "LETTER_SAME_DAY", |
121 | 122 | status: "PUBLISHED", |
122 | 123 | }, |
123 | 124 | digitrials1: { |
124 | | - id: SpecificaitonGroupId("digitrials1"), |
125 | | - name: "Digitrials Letter Pack 1", |
| 125 | + id: SpecificaitonId("digitrials1"), |
| 126 | + name: "Digitrials Letter Specification 1", |
126 | 127 | description: "Digitrials Letter Pack 1", |
127 | | - specificationIds: [digitrials1.id], |
| 128 | + packIds: [digitrials1.id], |
128 | 129 | specificationType: "LETTER_STANDARD", |
129 | 130 | status: "PUBLISHED", |
130 | 131 | clientId: "digitrials", |
131 | 132 | campaignIds: ["digitrials-campaign-1"], |
132 | 133 | }, |
133 | 134 | }; |
134 | 135 |
|
135 | | -console.log(JSON.stringify({ specifications, specificationGroups }, null, 2)); |
| 136 | +console.log(JSON.stringify(specifications, null, 2)); |
0 commit comments