return OrderTransactionCaptureDefinition::
class;
} protected function defineFields(): FieldCollection
{ // @deprecated tag:v6.6.0 - Variable $autoload will be removed in the next major as it will be false by default
$autoload = !Feature::
isActive('v6.6.0.0'
);
return new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new ApiAware(),
new PrimaryKey(),
new Required()),
(new VersionField())->
addFlags(new ApiAware()),
(new FkField('capture_id', 'captureId', OrderTransactionCaptureDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new ReferenceVersionField(OrderTransactionCaptureDefinition::
class, 'capture_version_id'
))->
addFlags(new ApiAware(),
new Required()),
(new StateMachineStateField('state_id', 'stateId', OrderTransactionCaptureRefundStates::STATE_MACHINE
))->
addFlags(new ApiAware(),
new Required()),
(new ManyToOneAssociationField('stateMachineState', 'state_id', StateMachineStateDefinition::
class, 'id',
$autoload))->
addFlags(new ApiAware()),
(new ManyToOneAssociationField('transactionCapture', 'capture_id', OrderTransactionCaptureDefinition::
class, 'id'
))->
addFlags(new ApiAware()),
(new OneToManyAssociationField('positions', OrderTransactionCaptureRefundPositionDefinition::
class, 'refund_id'
))->
addFlags(new ApiAware(),
new CascadeDelete()),
(new StringField('external_reference', 'externalReference'
))->
addFlags(new ApiAware()),
(new StringField('reason', 'reason'
))->
addFlags(new ApiAware()),
(new CalculatedPriceField('amount', 'amount'
))->
addFlags(new ApiAware(),
new Required()),
(new CustomFields())->
addFlags(new ApiAware()),
]);