@@ -67,6 +67,7 @@ const InvoiceResource = z
6767 status : z . string ( ) ,
6868 date : z . string ( ) ,
6969 due_at : z . string ( ) ,
70+ paid_date : z . string ( ) ,
7071 created_at : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
7172 updated_at : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
7273 } )
@@ -76,7 +77,7 @@ const InvoiceDiscountType = z.enum(['percentage', 'fixed']);
7677const InvoiceStoreRequest = z
7778 . object ( {
7879 due_at : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
79- paid_at : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
80+ paid_date : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
8081 seller_name : z . string ( ) ,
8182 seller_vatin : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
8283 seller_address_line_1 : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
@@ -102,8 +103,13 @@ const InvoiceStoreRequest = z
102103 billing_period_end : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
103104 reference : z . string ( ) ,
104105 currency : z . string ( ) ,
105- tax_rate : z . number ( ) . int ( ) . optional ( ) ,
106- discount_amount : z . number ( ) . int ( ) . optional ( ) ,
106+ tax_rate : z . number ( ) . int ( ) . gte ( 0 ) . lte ( 2147483647 ) . optional ( ) ,
107+ discount_amount : z
108+ . number ( )
109+ . int ( )
110+ . gte ( 0 )
111+ . lte ( 9223372036854776000 )
112+ . optional ( ) ,
107113 discount_type : InvoiceDiscountType . optional ( ) ,
108114 footer : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
109115 notes : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
@@ -115,8 +121,12 @@ const InvoiceStoreRequest = z
115121 . object ( {
116122 name : z . string ( ) ,
117123 description : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
118- unit_price : z . number ( ) . int ( ) . gte ( 0 ) . lte ( 99999999 ) ,
119- quantity : z . number ( ) . gte ( 0 ) ,
124+ unit_price : z
125+ . number ( )
126+ . int ( )
127+ . gte ( 0 )
128+ . lte ( 9223372036854776000 ) ,
129+ quantity : z . number ( ) . gte ( 0 ) . lte ( 99999999 ) ,
120130 } )
121131 . passthrough ( )
122132 )
@@ -161,7 +171,7 @@ const DetailedInvoiceResource = z
161171 buyer_address_country : z . string ( ) ,
162172 buyer_phone : z . string ( ) ,
163173 buyer_email : z . string ( ) ,
164- paid_at : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
174+ paid_date : z . string ( ) ,
165175 due_at : z . string ( ) ,
166176 discount_type : z . string ( ) ,
167177 discount_amount : z . number ( ) . int ( ) ,
@@ -185,7 +195,7 @@ const InvoiceUpdateRequest = z
185195 . object ( {
186196 status : InvoiceStatus ,
187197 due_at : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
188- paid_at : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
198+ paid_date : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
189199 seller_name : z . string ( ) ,
190200 seller_vatin : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
191201 seller_address_line_1 : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
@@ -211,8 +221,8 @@ const InvoiceUpdateRequest = z
211221 billing_period_end : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
212222 reference : z . string ( ) ,
213223 currency : z . string ( ) ,
214- tax_rate : z . number ( ) . int ( ) ,
215- discount_amount : z . number ( ) . int ( ) ,
224+ tax_rate : z . number ( ) . int ( ) . gte ( 0 ) . lte ( 2147483647 ) ,
225+ discount_amount : z . number ( ) . int ( ) . gte ( 0 ) . lte ( 9223372036854776000 ) ,
216226 discount_type : InvoiceDiscountType ,
217227 footer : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
218228 notes : z . union ( [ z . string ( ) , z . null ( ) ] ) ,
@@ -224,8 +234,12 @@ const InvoiceUpdateRequest = z
224234 id : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
225235 name : z . string ( ) ,
226236 description : z . union ( [ z . string ( ) , z . null ( ) ] ) . optional ( ) ,
227- unit_price : z . number ( ) . int ( ) . gte ( 0 ) . lte ( 99999999 ) ,
228- quantity : z . number ( ) . gte ( 0 ) ,
237+ unit_price : z
238+ . number ( )
239+ . int ( )
240+ . gte ( 0 )
241+ . lte ( 9223372036854776000 ) ,
242+ quantity : z . number ( ) . gte ( 0 ) . lte ( 99999999 ) ,
229243 } )
230244 . passthrough ( )
231245 ) ,
0 commit comments