Skip to content

Commit 87a0a40

Browse files
authored
Merge pull request #167 from Ecwid/customer-language
ECWID-94050 Added lang field into customer entities
2 parents db96899 + 624e9ee commit 87a0a40

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCustomer.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ fun FetchedCustomer.toUpdated(): UpdatedCustomer {
1212
taxId = taxId,
1313
taxIdValid = taxIdValid,
1414
taxExempt = taxExempt,
15-
acceptMarketing = acceptMarketing
15+
acceptMarketing = acceptMarketing,
16+
lang = lang,
1617
)
1718
}
1819

src/main/kotlin/com/ecwid/apiclient/v3/dto/customer/request/UpdatedCustomer.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ data class UpdatedCustomer(
1313
val taxId: String? = null,
1414
val taxIdValid: Boolean? = null,
1515
val taxExempt: Boolean? = null,
16-
val acceptMarketing: Boolean? = null
16+
val acceptMarketing: Boolean? = null,
17+
val lang: String? = null,
1718
) : ApiUpdatedDTO {
1819

1920
data class BillingPerson(

src/main/kotlin/com/ecwid/apiclient/v3/dto/customer/result/FetchedCustomer.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ data class FetchedCustomer(
1717
val taxId: String? = null,
1818
val taxIdValid: Boolean? = null,
1919
val taxExempt: Boolean? = null,
20-
val acceptMarketing: Boolean? = null
20+
val acceptMarketing: Boolean? = null,
21+
val lang: String? = null,
2122
) : ApiFetchedDTO {
2223

2324
data class BillingPerson(

src/test/kotlin/com/ecwid/apiclient/v3/entity/CustomersTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ private fun generateTestCustomerForCreate(customerGroupId: Int?): UpdatedCustome
378378
taxId = randomAlphanumeric(8),
379379
taxIdValid = randomBoolean(),
380380
taxExempt = randomBoolean(),
381-
acceptMarketing = randomBoolean()
381+
acceptMarketing = randomBoolean(),
382+
lang = "en",
382383
)
383384
}
384385

@@ -400,7 +401,8 @@ private fun generateTestCustomerForUpdate(
400401
taxId = randomAlphanumeric(8),
401402
taxIdValid = randomBoolean(),
402403
taxExempt = randomBoolean(),
403-
acceptMarketing = randomBoolean()
404+
acceptMarketing = randomBoolean(),
405+
lang = "ru",
404406
)
405407
}
406408

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCustomerRules.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ package com.ecwid.apiclient.v3.rule.nullablepropertyrules
22

33
import com.ecwid.apiclient.v3.dto.customer.result.FetchedCustomer
44
import com.ecwid.apiclient.v3.rule.NullablePropertyRule
5+
import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable
56
import com.ecwid.apiclient.v3.rule.NullablePropertyRule.IgnoreNullable
67

78
val fetchedCustomerNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
89
IgnoreNullable(FetchedCustomer::acceptMarketing),
910
IgnoreNullable(FetchedCustomer::billingPerson),
1011
IgnoreNullable(FetchedCustomer::customerGroupId),
1112
IgnoreNullable(FetchedCustomer::customerGroupName),
13+
AllowNullable(FetchedCustomer::lang),
1214
IgnoreNullable(FetchedCustomer::registered),
1315
IgnoreNullable(FetchedCustomer::shippingAddresses),
1416
IgnoreNullable(FetchedCustomer::taxExempt),

0 commit comments

Comments
 (0)