From 5006cb7082d4d2bb4fb0c59295bf273da188d06c Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 2 Oct 2023 11:19:08 +0200 Subject: [PATCH] added doleance fields to graphql #2246 --- .../graphql/ouatt_extension.base.graphqls | 8 +++ .../SchemaExtension/OuattSchemaExtension.php | 57 +++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls b/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls index 5b76378..c73aba4 100644 --- a/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls +++ b/src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls @@ -98,19 +98,23 @@ type Doleance implements NodeInterface { created: String changed: String #1 + date_leprobleme: Date leprobleme: String lenquete: String groupesinterets: [GroupeInterets] #2 + date_adresse: Date entite_addresse_doleance: String comment_ennonce_doleance: String aqui_addresse_doleance: String reception_traitement: [ReceptionTraitement] #3 + date_decision: Date entites_decisionnaires: String decision_formule: String mise_en_oeuvre_decision: [MiseEnoeuvreDecision] #4 + date_application: Date entite_adresse_application: String aqui_adresse_decision: String comment_formule_decision: String @@ -121,12 +125,14 @@ type Doleance implements NodeInterface { } type GroupeInterets { + date: Date groupe_interets: String accorder_interets: String formuler: String } type ReceptionTraitement { + date: Date entite_adressee: String doleance_formulee: String traite_doleance: String @@ -134,12 +140,14 @@ type ReceptionTraitement { } type MiseEnoeuvreDecision { + date: Date entite_adresse_decision: String formule_decision: String entite_metenoeuvre_decisio: String } type ReceptionsApplications { + date: Date applique_decision: String formule_decision_applic: String entite_recoit_decision: String diff --git a/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php b/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php index 702980c..88725b1 100644 --- a/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php +++ b/src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php @@ -885,6 +885,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { ->map('value', $builder->fromParent()) ->map('path', $builder->fromValue('field_le_probleme.value')) ); + // date_leprobleme: Date + $registry->addFieldResolver('Doleance', 'date_leprobleme', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_leprobleme')) + ); // lenquete: String $registry->addFieldResolver('Doleance', 'lenquete', $builder->produce('property_path') @@ -901,6 +908,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // #2 + // date_adresse_doleance: Date + $registry->addFieldResolver('Doleance', 'date_adresse', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_adresse_doleance')) + ); // entite_addresse_doleance: String $registry->addFieldResolver('Doleance', 'entite_addresse_doleance', $builder->produce('property_path') @@ -930,6 +944,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { ); // #3 + // field_date_decision: Date + $registry->addFieldResolver('Doleance', 'date_decision', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_decision')) + ); // entites_decisionnaires: String $registry->addFieldResolver('Doleance', 'entites_decisionnaires', $builder->produce('property_path') @@ -952,6 +973,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { ); // #4 + // date_adresse_decision: Date + $registry->addFieldResolver('Doleance', 'date_application', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:node')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_adresse_decision')) + ); // entite_addresse_application: String $registry->addFieldResolver('Doleance', 'entite_adresse_application', $builder->produce('property_path') @@ -1009,6 +1037,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // \____|_| \___/ \__,_| .__/ \___| |___|_| |_|\__\___|_| \___|\__|___/ // |_| protected function addGroupeInterets(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + + // field_date_groupe_interets: Date + $registry->addFieldResolver('GroupeInterets', 'date', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:paragraph')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_groupe_interets')) + ); // groupe_interets: String $registry->addFieldResolver('GroupeInterets', 'groupe_interets', $builder->produce('property_path') @@ -1039,6 +1075,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // |_| \_\___|\___\___| .__/ \__|_|\___/|_| |_| |_||_| \__,_|_|\__\___|_| |_| |_|\___|_| |_|\__| // |_| protected function addReceptionTraitement(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + // field_date_reception_traite: Date + $registry->addFieldResolver('ReceptionTraitement', 'date', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:paragraph')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_reception_traite')) + ); // entite_adressee: String $registry->addFieldResolver('ReceptionTraitement', 'entite_adressee', $builder->produce('property_path') @@ -1075,6 +1118,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // | | | | \__ \ __/ | |___| | | | (_) | __/ |_| |\ V /| | | __/ | |_| | __/ (__| \__ \ | (_) | | | | // |_| |_|_|___/\___| |_____|_| |_|\___/ \___|\__,_| \_/ |_| \___| |____/ \___|\___|_|___/_|\___/|_| |_| protected function addMiseEnoeuvreDecision(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + // field_date_miseeoeuvre_decision: Date + $registry->addFieldResolver('MiseEnoeuvreDecision', 'date', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:paragraph')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_miseeoeuvre_decision')) + ); // entite_adresse_decision: String $registry->addFieldResolver('MiseEnoeuvreDecision', 'entite_adresse_decision', $builder->produce('property_path') @@ -1105,6 +1155,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase { // |_| \_\___|\___\___| .__/ \__|_|\___/|_| |_|___/ /_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|___/ // |_| |_| |_| protected function addReceptionsApplications(ResolverRegistryInterface $registry, ResolverBuilder $builder) { + // field_date_date_traitement_decis: Date + $registry->addFieldResolver('ReceptionsApplications', 'date', + $builder->produce('property_path') + ->map('type', $builder->fromValue('entity:paragraph')) + ->map('value', $builder->fromParent()) + ->map('path', $builder->fromValue('field_date_date_traitement_decis')) + ); // applique_decision: String $registry->addFieldResolver('ReceptionsApplications', 'applique_decision', $builder->produce('property_path')