@@ -65,6 +65,7 @@ type CreateRealizationRunInput struct {
6565 StoredAtLT time.Time `json:"storedAtLT"`
6666 ServicePeriodTo time.Time `json:"servicePeriodTo"`
6767 LineID * string `json:"lineId,omitempty"`
68+ InvoiceID * string `json:"invoiceId,omitempty"`
6869 MeteredQuantity alpacadecimal.Decimal `json:"meteredQuantity"`
6970 Totals totals.Totals `json:"totals"`
7071 NoFiatTransactionRequired bool `json:"noFiatTransactionRequired"`
@@ -108,6 +109,10 @@ func (r CreateRealizationRunInput) Validate() error {
108109 errs = append (errs , fmt .Errorf ("line id must be non-empty" ))
109110 }
110111
112+ if r .InvoiceID != nil && * r .InvoiceID == "" {
113+ errs = append (errs , fmt .Errorf ("invoice id must be non-empty" ))
114+ }
115+
111116 return models .NewNillableGenericValidationError (errors .Join (errs ... ))
112117}
113118
@@ -167,6 +172,7 @@ type RealizationRunBase struct {
167172
168173 FeatureID string `json:"featureId"`
169174 LineID * string `json:"lineId,omitempty"`
175+ InvoiceID * string `json:"invoiceId,omitempty"`
170176
171177 Type RealizationRunType `json:"type"`
172178 StoredAtLT time.Time `json:"storedAtLT"`
@@ -204,6 +210,10 @@ func (r RealizationRunBase) Validate() error {
204210 errs = append (errs , fmt .Errorf ("line id must be non-empty" ))
205211 }
206212
213+ if r .InvoiceID != nil && * r .InvoiceID == "" {
214+ errs = append (errs , fmt .Errorf ("invoice id must be non-empty" ))
215+ }
216+
207217 if err := r .Type .Validate (); err != nil {
208218 errs = append (errs , fmt .Errorf ("type: %w" , err ))
209219 }
0 commit comments