protected function defineFields(): FieldCollection
{ $fields =
new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new ApiAware(),
new PrimaryKey(),
new Required()),
(new FkField('customer_group_id', 'groupId', CustomerGroupDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('default_payment_method_id', 'defaultPaymentMethodId', PaymentMethodDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('sales_channel_id', 'salesChannelId', SalesChannelDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('language_id', 'languageId', LanguageDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('last_payment_method_id', 'lastPaymentMethodId', PaymentMethodDefinition::
class))->
addFlags(new ApiAware()),
(new FkField('default_billing_address_id', 'defaultBillingAddressId', CustomerAddressDefinition::
class))->
addFlags(new ApiAware(),
new Required(),
new NoConstraint()),
(new FkField('default_shipping_address_id', 'defaultShippingAddressId', CustomerAddressDefinition::
class))->
addFlags(new ApiAware(),
new Required(),
new NoConstraint()),
new AutoIncrementField(),
(new NumberRangeField('customer_number', 'customerNumber', 255
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new FkField('salutation_id', 'salutationId', SalutationDefinition::
class))->
addFlags(new ApiAware()),
(new StringField('first_name', 'firstName'
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING
)),
(new StringField('last_name', 'lastName'
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new StringField('company', 'company'
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new PasswordField('password', 'password', \PASSWORD_DEFAULT,
[], PasswordField::FOR_CUSTOMER
))->
removeFlag(ApiAware::
class),
(new EmailField('email', 'email'
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING, false
)),
(new StringField('title', 'title'
))->
addFlags(new ApiAware()),
(new ListField('vat_ids', 'vatIds', StringField::
class))->
addFlags(new ApiAware()),
(new StringField('affiliate_code', 'affiliateCode'
))->
addFlags(new ApiAware()),
(new StringField('campaign_code', 'campaignCode'
))->
addFlags(new ApiAware()),
(