@nfcard/validation 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1170,6 +1170,7 @@ declare const configurationCreateSchema: z.ZodObject<{
1170
1170
  }>;
1171
1171
  quantity: z.ZodDefault<z.ZodNumber>;
1172
1172
  existingProfileId: z.ZodOptional<z.ZodString>;
1173
+ physicalTemplateId: z.ZodOptional<z.ZodString>;
1173
1174
  }, "strip", z.ZodTypeAny, {
1174
1175
  sessionId: string;
1175
1176
  userData: {
@@ -1276,6 +1277,7 @@ declare const configurationCreateSchema: z.ZodObject<{
1276
1277
  };
1277
1278
  quantity: number;
1278
1279
  existingProfileId?: string | undefined;
1280
+ physicalTemplateId?: string | undefined;
1279
1281
  }, {
1280
1282
  sessionId: string;
1281
1283
  userData: {
@@ -1382,6 +1384,7 @@ declare const configurationCreateSchema: z.ZodObject<{
1382
1384
  };
1383
1385
  quantity?: number | undefined;
1384
1386
  existingProfileId?: string | undefined;
1387
+ physicalTemplateId?: string | undefined;
1385
1388
  }>;
1386
1389
  declare const configurationUpdateSchema: z.ZodObject<{
1387
1390
  userData: z.ZodOptional<z.ZodObject<{
@@ -1902,6 +1905,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
1902
1905
  }>>;
1903
1906
  quantity: z.ZodOptional<z.ZodNumber>;
1904
1907
  existingProfileId: z.ZodOptional<z.ZodString>;
1908
+ physicalTemplateId: z.ZodOptional<z.ZodString>;
1905
1909
  }, "strip", z.ZodTypeAny, {
1906
1910
  userData?: {
1907
1911
  email: string;
@@ -2007,6 +2011,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
2007
2011
  } | undefined;
2008
2012
  quantity?: number | undefined;
2009
2013
  existingProfileId?: string | undefined;
2014
+ physicalTemplateId?: string | undefined;
2010
2015
  }, {
2011
2016
  userData?: {
2012
2017
  email: string;
@@ -2112,6 +2117,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
2112
2117
  } | undefined;
2113
2118
  quantity?: number | undefined;
2114
2119
  existingProfileId?: string | undefined;
2120
+ physicalTemplateId?: string | undefined;
2115
2121
  }>;
2116
2122
  declare const createOrderSchema: z.ZodObject<{
2117
2123
  configurationId: z.ZodString;
package/dist/index.js CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfcard/validation",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Shared Zod validation schemas for the NFCard product family.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.test.ts CHANGED
@@ -425,6 +425,29 @@ describe('validateConfiguration', () => {
425
425
  });
426
426
  expect(r.success).toBe(false);
427
427
  });
428
+
429
+ it('keeps physicalTemplateId when provided (NFCARD-3 Template path)', () => {
430
+ const r = configurationCreateSchema.safeParse({
431
+ sessionId: '550e8400-e29b-41d4-a716-446655440000',
432
+ userData: validUserData,
433
+ physicalConfig: validPhysicalConfig,
434
+ digitalConfig: validDigitalConfig,
435
+ physicalTemplateId: 'tpl-pvc-white',
436
+ });
437
+ expect(r.success).toBe(true);
438
+ if (r.success) expect(r.data.physicalTemplateId).toBe('tpl-pvc-white');
439
+ });
440
+
441
+ it('omits physicalTemplateId for the Custom path (optional)', () => {
442
+ const r = configurationCreateSchema.safeParse({
443
+ sessionId: '550e8400-e29b-41d4-a716-446655440000',
444
+ userData: validUserData,
445
+ physicalConfig: validPhysicalConfig,
446
+ digitalConfig: validDigitalConfig,
447
+ });
448
+ expect(r.success).toBe(true);
449
+ if (r.success) expect(r.data.physicalTemplateId).toBeUndefined();
450
+ });
428
451
  });
429
452
 
430
453
  // ── profileCreateSchema ─────────────────────────────────────────
package/src/index.ts CHANGED
Binary file