new ManyToOneAssociationField('lastPaymentMethod', 'last_payment_method_id', PaymentMethodDefinition::
class, 'id', false
))->
addFlags(new ApiAware()),
(new ManyToOneAssociationField('defaultBillingAddress', 'default_billing_address_id', CustomerAddressDefinition::
class, 'id', false
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING
)),
(new ManyToOneAssociationField('activeBillingAddress', 'active_billing_address_id', CustomerAddressDefinition::
class, 'id', false
))->
addFlags(new ApiAware(SalesChannelApiSource::
class),
new Runtime()),
(new ManyToOneAssociationField('defaultShippingAddress', 'default_shipping_address_id', CustomerAddressDefinition::
class, 'id', false
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING
)),
(new ManyToOneAssociationField('activeShippingAddress', 'active_shipping_address_id', CustomerAddressDefinition::
class, 'id', false
))->
addFlags(new ApiAware(SalesChannelApiSource::
class),
new Runtime()),
(new ManyToOneAssociationField('salutation', 'salutation_id', SalutationDefinition::
class, 'id', false
))->
addFlags(new ApiAware()),
(new OneToManyAssociationField('addresses', CustomerAddressDefinition::
class, 'customer_id', 'id'
))->
addFlags(new ApiAware(),
new CascadeDelete()),
(new OneToManyAssociationField('orderCustomers', OrderCustomerDefinition::
class, 'customer_id', 'id'
))->
addFlags(new SetNullOnDelete()),
(new ManyToManyAssociationField('tags', TagDefinition::
class, CustomerTagDefinition::
class, 'customer_id', 'tag_id'
))->
addFlags(new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING
)),
new ManyToManyAssociationField('promotions', PromotionDefinition::
class, PromotionPersonaCustomerDefinition::
class, 'customer_id', 'promotion_id'
),
new OneToManyAssociationField('productReviews', ProductReviewDefinition::
class, 'customer_id'
),
new OneToOneAssociationField('recoveryCustomer', 'id', 'customer_id', CustomerRecoveryDefinition::
class, false
),
new RemoteAddressField('remote_address', 'remoteAddress'
),
(new ManyToManyIdField('tag_ids', 'tagIds', 'tags'
))->
addFlags(new ApiAware()),
new FkField('requested_customer_group_id', 'requestedGroupId', CustomerGroupDefinition::
class),
new ManyToOneAssociationField('requestedGroup', 'requested_customer_group_id', CustomerGroupDefinition::
class, 'id', false
),
new FkField('bound_sales_channel_id', 'boundSalesChannelId', SalesChannelDefinition::
class),
(new StringField('account_type', 'accountType'
))->
addFlags(new ApiAware(),
new Required()),
new ManyToOneAssociationField('boundSalesChannel', 'bound_sales_channel_id', SalesChannelDefinition::
class, 'id', false
),
(new OneToManyAssociationField('wishlists', CustomerWishlistDefinition::
class, 'customer_id'
))->
addFlags(new CascadeDelete()),
(new CreatedByField([Context::SYSTEM_SCOPE, Context::CRUD_API_SCOPE
]))->
addFlags(new ApiAware()),
(new UpdatedByField([Context::SYSTEM_SCOPE, Context::CRUD_API_SCOPE
]))->
addFlags(new ApiAware()),
new ManyToOneAssociationField('createdBy', 'created_by_id', UserDefinition::
class, 'id', false
),