From 4e82e09fdfa95b7f04786f00d8c8d129d1802f96 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Tue, 15 Mar 2022 12:12:12 +0100 Subject: [PATCH 1/2] [ADR][API] Update ADR for providing locales after changing the approach --- ...providing_locales_available_in_active_channel.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/adr/2021_07_05_api_providing_locales_available_in_active_channel.md b/adr/2021_07_05_api_providing_locales_available_in_active_channel.md index e7a68dfacd8..0f780337600 100644 --- a/adr/2021_07_05_api_providing_locales_available_in_active_channel.md +++ b/adr/2021_07_05_api_providing_locales_available_in_active_channel.md @@ -1,7 +1,8 @@ -# Using data provider for getting available locales in active channel for shop user +# Using Doctrine Collection extension for getting available locales in active channel for shop user -* Status: proposed -* Date: 2021-07-05 +* Status: accepted +* Propose date: 2021-07-05 +* Update date: 2022-03-15 ## Context and Problem Statement Customer should have access only to locales available in their channel @@ -16,11 +17,11 @@ Customer should have access only to locales available in their channel ### Using Data Provider -* Good, because we already have this approach for older resources * Good, because it is easy to implement * Bad, because using data providers omits extra Doctrine extensions like pagination ## Decision Outcome -Chosen option: Using Data Provider -Shops shouldn't have many locales for each channel, so lack of a pagination is smaller problem than creating overcomplicated query in Doctrine Collection extension +Chosen option: **"Using Doctrine Collection extension"** + +This option is consistent with current approach and does not omit Doctrine extensions like pagination. From ff3d798411b500ee809ba8941f1fc7ce52d3d041 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Tue, 15 Mar 2022 14:38:47 +0100 Subject: [PATCH 2/2] [ADR][API] Reject the old one and add the new ADR for providing locales after changing the approach --- ...ing_locales_available_in_active_channel.md | 14 ++++----- ...ing_locales_available_in_active_channel.md | 31 +++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 adr/2022_03_15_api_providing_locales_available_in_active_channel.md diff --git a/adr/2021_07_05_api_providing_locales_available_in_active_channel.md b/adr/2021_07_05_api_providing_locales_available_in_active_channel.md index 0f780337600..a8abfd35f89 100644 --- a/adr/2021_07_05_api_providing_locales_available_in_active_channel.md +++ b/adr/2021_07_05_api_providing_locales_available_in_active_channel.md @@ -1,8 +1,7 @@ -# Using Doctrine Collection extension for getting available locales in active channel for shop user +# Using data provider for getting available locales in active channel for shop user -* Status: accepted -* Propose date: 2021-07-05 -* Update date: 2022-03-15 +* Status: rejected +* Date: 2021-07-05 ## Context and Problem Statement Customer should have access only to locales available in their channel @@ -17,11 +16,12 @@ Customer should have access only to locales available in their channel ### Using Data Provider +* Good, because we already have this approach for older resources * Good, because it is easy to implement * Bad, because using data providers omits extra Doctrine extensions like pagination ## Decision Outcome -Chosen option: **"Using Doctrine Collection extension"** - -This option is consistent with current approach and does not omit Doctrine extensions like pagination. +Chosen option: Using Data Provider +Shops shouldn't have many locales for each channel, so lack of a pagination is smaller problem than creating overcomplicated +query in Doctrine Collection extension diff --git a/adr/2022_03_15_api_providing_locales_available_in_active_channel.md b/adr/2022_03_15_api_providing_locales_available_in_active_channel.md new file mode 100644 index 00000000000..039f7336134 --- /dev/null +++ b/adr/2022_03_15_api_providing_locales_available_in_active_channel.md @@ -0,0 +1,31 @@ +# Using Doctrine Collection extension for getting available locales in active channel for shop user + +* Status: accepted +* Date: 2022-03-15 + +## Context and Problem Statement +Customer should have access only to locales available in their channel + +## Considered Options + +### Using Doctrine Collection extension + +* Good, because it is consistent with the actual approach of modifying responses content +* Good, because it works with the rest of API extensions like pagination +* Bad, because locales don't have relation to channel, so using Doctrine Collection extension is complicated + +### Using Data Provider + +* Good, because it is easy to implement +* Bad, because using data providers omits extra Doctrine extensions like pagination + +## Decision Outcome + +Chosen option: **"Using Doctrine Collection extension"** + +This option is consistent with current approach and does not omit Doctrine extensions like pagination. + +## References + +* [Original ADR for this problem](2021_07_05_api_providing_locales_available_in_active_channel.md) +* [The implementation of changing the approach](https://github.com/Sylius/Sylius/pull/13333)