@@ -36,22 +36,44 @@ class ApiConfiguration < Preferences::Configuration
36
36
:covered_by_store_credit , :display_total_applicable_store_credit ,
37
37
:order_total_after_store_credit , :display_order_total_after_store_credit ,
38
38
:total_applicable_store_credit , :display_total_available_store_credit ,
39
- :display_store_credit_remaining_after_capture , :canceler_id
39
+ :display_store_credit_remaining_after_capture , :canceler_id , :customer_metadata
40
40
]
41
41
42
- preference :line_item_attributes , :array , default : [ :id , :quantity , :price , :variant_id ]
42
+ preference :line_item_attributes , :array , default : [ :id , :quantity , :price , :variant_id , :customer_metadata ]
43
+
44
+ # Spree::Api::Config.metadata_api_parameters contains the models
45
+ # to which the admin_metadata attribute is added
46
+ preference :metadata_api_parameters , :array , default : [
47
+ [ :order , 'Spree::Order' ] ,
48
+ [ :customer_return , 'Spree::CustomerReturn' ] ,
49
+ [ :payment , 'Spree::Payment' ] ,
50
+ [ :return_authorization , 'Spree::ReturnAuthorization' ] ,
51
+ [ :shipment , 'Spree::Shipment' ] ,
52
+ [ :user , 'Spree.user_class' ] ,
53
+ [ :line_item , 'Spree::LineItem' ]
54
+ ]
55
+
56
+ # Spree::Api::Config.metadata_permit_parameters contains the models
57
+ # to which the admin_metadata attribute is permitted
58
+ preference :metadata_permit_parameters , :array , default : [
59
+ :Order ,
60
+ :CustomerReturn ,
61
+ :Payment ,
62
+ :ReturnAuthorization ,
63
+ :Shipment
64
+ ]
43
65
44
66
preference :option_type_attributes , :array , default : [ :id , :name , :presentation , :position ]
45
67
46
68
preference :payment_attributes , :array , default : [
47
69
:id , :source_type , :source_id , :amount , :display_amount ,
48
70
:payment_method_id , :state , :avs_response , :created_at ,
49
- :updated_at
71
+ :updated_at , :customer_metadata
50
72
]
51
73
52
74
preference :payment_method_attributes , :array , default : [ :id , :name , :description ]
53
75
54
- preference :shipment_attributes , :array , default : [ :id , :tracking , :tracking_url , :number , :cost , :shipped_at , :state ]
76
+ preference :shipment_attributes , :array , default : [ :id , :tracking , :tracking_url , :number , :cost , :shipped_at , :state , :customer_metadata ]
55
77
56
78
preference :taxonomy_attributes , :array , default : [ :id , :name ]
57
79
@@ -81,11 +103,11 @@ class ApiConfiguration < Preferences::Configuration
81
103
]
82
104
83
105
preference :customer_return_attributes , :array , default : [
84
- :id , :number , :stock_location_id , :created_at , :updated_at
106
+ :id , :number , :stock_location_id , :created_at , :updated_at , :customer_metadata
85
107
]
86
108
87
109
preference :return_authorization_attributes , :array , default : [
88
- :id , :number , :state , :order_id , :memo , :created_at , :updated_at
110
+ :id , :number , :state , :order_id , :memo , :created_at , :updated_at , :customer_metadata
89
111
]
90
112
91
113
preference :creditcard_attributes , :array , default : [
@@ -96,7 +118,7 @@ class ApiConfiguration < Preferences::Configuration
96
118
:id , :month , :year , :cc_type , :last_digits , :name
97
119
]
98
120
99
- preference :user_attributes , :array , default : [ :id , :email , :created_at , :updated_at ]
121
+ preference :user_attributes , :array , default : [ :id , :email , :created_at , :updated_at , :customer_metadata ]
100
122
101
123
preference :property_attributes , :array , default : [ :id , :name , :presentation ]
102
124
@@ -132,7 +154,7 @@ def promotion_attributes=(value)
132
154
133
155
preference :store_credit_history_attributes , :array , default : [
134
156
:display_amount , :display_user_total_amount , :display_action ,
135
- :display_event_date , :display_remaining_amount
157
+ :display_event_date , :display_remaining_amount , :customer_metadata
136
158
]
137
159
138
160
preference :variant_property_attributes , :array , default : [
0 commit comments