File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,23 @@ export const GetMIResponseResourceSchema = z
4545 } )
4646 . strict ( ) ;
4747
48+ // export const GetMIResponseResourceSchema = z
49+ // .object({
50+ // id: z.string(),
51+ // type: z.literal("ManagementInformation"),
52+ // attributes: z
53+ // .object({
54+ // lineItem: z.string(),
55+ // timestamp: z.string(),
56+ // quantity: z.number(),
57+ // specificationId: z.string().optional(),
58+ // groupId: z.string().optional(),
59+ // stockRemaining: z.number().optional(),
60+ // })
61+ // .strict(),
62+ // })
63+ // .strict();
64+
4865export const GetMIResponseSchema = makeDocumentSchema (
4966 GetMIResponseResourceSchema ,
5067) ;
Original file line number Diff line number Diff line change 11import { MIBase } from "@internal/datastore/src" ;
22import {
33 GetMIResponse ,
4- GetMIResponseResourceSchema ,
4+ GetMIResponseSchema ,
55 IncomingMI ,
66 PostMIRequest ,
77 PostMIResponse ,
@@ -36,8 +36,9 @@ export function mapToPostMIResponse(mi: MIBase): PostMIResponse {
3636}
3737
3838export function mapToGetMIResponse ( mi : MIBase ) : GetMIResponse {
39- return GetMIResponseResourceSchema . parse ( {
39+ return GetMIResponseSchema . parse ( {
4040 data : {
41+ id : mi . id ,
4142 type : "ManagementInformation" ,
4243 attributes : {
4344 lineItem : mi . lineItem ,
@@ -47,7 +48,6 @@ export function mapToGetMIResponse(mi: MIBase): GetMIResponse {
4748 groupId : mi . groupId ,
4849 stockRemaining : mi . stockRemaining ,
4950 } ,
50- id : mi . id ,
5151 } ,
5252 } ) ;
5353}
You can’t perform that action at this time.
0 commit comments