From 2d01cfd707770382d7239f9dc491b3e0a4b3fe80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Illi-Zuberb=C3=BChler?= Date: Fri, 19 Apr 2024 17:23:53 +0200 Subject: [PATCH] Update graphiti schema.json to match core changes, refs #2537 (#17) --- .ruby-version | 2 +- .tool-versions | 2 +- spec/support/graphiti/schema.json | 945 ++++++++++++++++++++++++++---- 3 files changed, 847 insertions(+), 102 deletions(-) diff --git a/.ruby-version b/.ruby-version index 8ffc1ad..06eda28 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 \ No newline at end of file +3.2.3 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index d294ebb..f093f89 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -ruby 3.0.6 +ruby 3.2.3 nodejs 16.15.0 yarn 1.22.19 diff --git a/spec/support/graphiti/schema.json b/spec/support/graphiti/schema.json index 515b655..04f43f4 100644 --- a/spec/support/graphiti/schema.json +++ b/spec/support/graphiti/schema.json @@ -143,6 +143,268 @@ ] } }, + { + "name": "Event::CourseResource", + "type": "courses", + "graphql_entrypoint": "courses", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null + }, + "group_ids": { + "type": "array_of_integers", + "readable": true, + "writable": false, + "description": null + }, + "type": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "kind_id": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "name": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "description": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "application_conditions": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "motto": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "cost": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "location": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "application_opening_at": { + "type": "date", + "readable": true, + "writable": false, + "description": null + }, + "application_closing_at": { + "type": "date", + "readable": true, + "writable": false, + "description": null + }, + "application_contact_id": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "external_application_link": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "maximum_participants": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "created_at": { + "type": "datetime", + "readable": true, + "writable": false, + "description": null + }, + "updated_at": { + "type": "datetime", + "readable": true, + "writable": false, + "description": null + }, + "state": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "training_days": { + "type": "float", + "readable": true, + "writable": false, + "description": null + }, + "applicant_count": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "participant_count": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "minimum_participants": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "number": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "teamer_count": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "kind_id": { + "type": "integer", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "updated_at": { + "type": "datetime", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "type": { + "type": "string", + "operators": [ + "eq" + ] + }, + "group_id": { + "type": "integer", + "operators": [ + "eq", + "not_eq" + ] + }, + "before_or_on": { + "type": "date", + "operators": [ + "eq" + ], + "single": true + }, + "after_or_on": { + "type": "date", + "operators": [ + "eq" + ], + "single": true + }, + "state": { + "type": "string", + "operators": [ + "eq", + "not_eq", + "eql", + "not_eql", + "prefix", + "not_prefix", + "suffix", + "not_suffix", + "match", + "not_match" + ] + } + }, + "relationships": { + "contact": { + "type": "belongs_to", + "description": null, + "resource": "PersonResource" + }, + "dates": { + "type": "has_many", + "description": null, + "resource": "Event::DateResource" + }, + "kind": { + "type": "belongs_to", + "description": null, + "resource": "Event::KindResource" + }, + "leaders": { + "type": "has_many", + "description": null, + "resource": "Person::NameResource" + } + }, + "stats": { + "total": [ + "count" + ] + } + }, { "name": "Event::DateResource", "type": "dates", @@ -155,31 +417,175 @@ "writable": true, "description": null }, - "event_id": { - "type": "integer", + "event_id": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "label": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "location": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "start_at": { + "type": "datetime", + "readable": true, + "writable": false, + "description": null + }, + "finish_at": { + "type": "datetime", + "readable": true, + "writable": false, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "event_id": { + "type": "integer", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + } + }, + "relationships": { + "event": { + "type": "belongs_to", + "description": null, + "resource": "EventResource" + } + }, + "stats": { + "total": [ + "count" + ] + } + }, + { + "name": "Event::KindCategoryResource", + "type": "event_kind_categories", + "graphql_entrypoint": "kindCategories", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null + }, + "label": { + "type": "string", + "readable": true, + "writable": false, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + } + }, + "relationships": { + }, + "stats": { + "total": [ + "count" + ] + } + }, + { + "name": "Event::KindResource", + "type": "event_kinds", + "graphql_entrypoint": "kinds", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null + }, + "label": { + "type": "string", "readable": true, "writable": false, "description": null }, - "label": { + "short_name": { "type": "string", "readable": true, "writable": false, "description": null }, - "location": { + "general_information": { "type": "string", "readable": true, "writable": false, "description": null }, - "start_at": { + "application_conditions": { + "type": "string", + "readable": true, + "writable": false, + "description": null + }, + "minimum_age": { + "type": "integer", + "readable": true, + "writable": false, + "description": null + }, + "created_at": { "type": "datetime", "readable": true, "writable": false, "description": null }, - "finish_at": { + "updated_at": { "type": "datetime", "readable": true, "writable": false, @@ -203,24 +609,13 @@ "lt", "lte" ] - }, - "event_id": { - "type": "integer", - "operators": [ - "eq", - "not_eq", - "gt", - "gte", - "lt", - "lte" - ] } }, "relationships": { - "event": { + "kind_category": { "type": "belongs_to", "description": null, - "resource": "EventResource" + "resource": "Event::KindCategoryResource" } }, "stats": { @@ -265,13 +660,13 @@ "writable": false, "description": null }, - "state": { + "description": { "type": "string", "readable": true, "writable": false, "description": null }, - "number": { + "application_conditions": { "type": "string", "readable": true, "writable": false, @@ -307,26 +702,14 @@ "writable": false, "description": null }, - "participant_count": { - "type": "integer", - "readable": true, - "writable": false, - "description": null - }, - "training_days": { - "type": "float", - "readable": true, - "writable": false, - "description": null - }, "application_contact_id": { "type": "integer", "readable": true, "writable": false, "description": null }, - "applicant_count": { - "type": "integer", + "external_application_link": { + "type": "string", "readable": true, "writable": false, "description": null @@ -379,21 +762,6 @@ "lte" ] }, - "state": { - "type": "string", - "operators": [ - "eq", - "not_eq", - "eql", - "not_eql", - "prefix", - "not_prefix", - "suffix", - "not_suffix", - "match", - "not_match" - ] - }, "updated_at": { "type": "datetime", "operators": [ @@ -449,7 +817,12 @@ "total": [ "count" ] - } + }, + "polymorphic": true, + "children": [ + "EventResource", + "Event::CourseResource" + ] }, { "name": "GroupResource", @@ -783,23 +1156,220 @@ ], "single": true }, - "self_registration_url": { + "self_registration_url": { + "type": "string", + "operators": [ + "eq", + "not_eq", + "eql", + "not_eql", + "prefix", + "not_prefix", + "suffix", + "not_suffix", + "match", + "not_match" + ] + }, + "archived_at": { + "type": "datetime", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "created_at": { + "type": "datetime", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "updated_at": { + "type": "datetime", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "deleted_at": { + "type": "datetime", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] + }, + "with_deleted": { + "type": "boolean", + "operators": [ + "eq" + ], + "single": true + }, + "with_archived": { + "type": "boolean", + "operators": [ + "eq" + ], + "single": true + } + }, + "relationships": { + "contact": { + "type": "belongs_to", + "description": null, + "resource": "PersonResource" + }, + "creator": { + "type": "belongs_to", + "description": null, + "resource": "PersonResource" + }, + "updater": { + "type": "belongs_to", + "description": null, + "resource": "PersonResource" + }, + "deleter": { + "type": "belongs_to", + "description": null, + "resource": "PersonResource" + }, + "parent": { + "type": "belongs_to", + "description": null, + "resource": "GroupResource" + }, + "layer_group": { + "type": "belongs_to", + "description": null, + "resource": "GroupResource" + }, + "phone_numbers": { + "type": "has_many", + "description": null, + "resource": "PhoneNumberResource" + }, + "social_accounts": { + "type": "has_many", + "description": null, + "resource": "SocialAccountResource" + }, + "additional_emails": { + "type": "has_many", + "description": null, + "resource": "AdditionalEmailResource" + } + }, + "stats": { + "total": [ + "count" + ] + } + }, + { + "name": "InvoiceItemResource", + "type": "invoice_items", + "graphql_entrypoint": "invoiceItems", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null + }, + "invoice_id": { + "type": "integer", + "readable": true, + "writable": true, + "description": null + }, + "name": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "description": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "unit_cost": { + "type": "float", + "readable": true, + "writable": true, + "description": null + }, + "vat_rate": { + "type": "float", + "readable": true, + "writable": true, + "description": null + }, + "cost": { + "type": "integer", + "readable": true, + "writable": true, + "description": null + }, + "count": { + "type": "integer", + "readable": true, + "writable": true, + "description": null + }, + "cost_center": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "account": { "type": "string", + "readable": true, + "writable": true, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", "operators": [ "eq", "not_eq", - "eql", - "not_eql", - "prefix", - "not_prefix", - "suffix", - "not_suffix", - "match", - "not_match" + "gt", + "gte", + "lt", + "lte" ] }, - "archived_at": { - "type": "datetime", + "invoice_id": { + "type": "integer", "operators": [ "eq", "not_eq", @@ -808,9 +1378,109 @@ "lt", "lte" ] + } + }, + "relationships": { + "invoice": { + "type": "belongs_to", + "description": null, + "resource": "InvoiceResource" + } + }, + "stats": { + "total": [ + "count" + ] + } + }, + { + "name": "InvoiceResource", + "type": "invoices", + "graphql_entrypoint": "invoices", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null }, - "created_at": { - "type": "datetime", + "title": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "description": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "state": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "group_id": { + "type": "integer", + "readable": true, + "writable": true, + "description": null + }, + "recipient_id": { + "type": "integer", + "readable": true, + "writable": true, + "description": null + }, + "due_at": { + "type": "date", + "readable": true, + "writable": true, + "description": null + }, + "issued_at": { + "type": "date", + "readable": true, + "writable": true, + "description": null + }, + "recipient_email": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "payment_information": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "payment_purpose": { + "type": "string", + "readable": true, + "writable": true, + "description": null + }, + "hide_total": { + "type": "boolean", + "readable": true, + "writable": true, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", "operators": [ "eq", "not_eq", @@ -820,8 +1490,8 @@ "lte" ] }, - "updated_at": { - "type": "datetime", + "group_id": { + "type": "integer", "operators": [ "eq", "not_eq", @@ -831,8 +1501,8 @@ "lte" ] }, - "deleted_at": { - "type": "datetime", + "recipient_id": { + "type": "integer", "operators": [ "eq", "not_eq", @@ -841,54 +1511,83 @@ "lt", "lte" ] - }, - "with_deleted": { - "type": "boolean", - "operators": [ - "eq" - ], - "single": true - }, - "with_archived": { - "type": "boolean", - "operators": [ - "eq" - ], - "single": true } }, "relationships": { - "contact": { + "group": { "type": "belongs_to", "description": null, - "resource": "PersonResource" + "resource": "GroupResource" }, - "creator": { + "recipient": { "type": "belongs_to", "description": null, "resource": "PersonResource" }, - "updater": { - "type": "belongs_to", + "invoice_items": { + "type": "has_many", "description": null, - "resource": "PersonResource" + "resource": "InvoiceItemResource" + } + }, + "stats": { + "total": [ + "count" + ] + } + }, + { + "name": "Person::NameResource", + "type": "person-name", + "graphql_entrypoint": "names", + "description": null, + "attributes": { + "id": { + "type": "integer_id", + "readable": true, + "writable": true, + "description": null }, - "deleter": { - "type": "belongs_to", - "description": null, - "resource": "PersonResource" + "first_name": { + "type": "string", + "readable": true, + "writable": false, + "description": null }, - "parent": { - "type": "belongs_to", - "description": null, - "resource": "GroupResource" + "last_name": { + "type": "string", + "readable": true, + "writable": false, + "description": null + } + }, + "extra_attributes": { + }, + "sorts": { + "id": { + } + }, + "filters": { + "id": { + "type": "integer_id", + "operators": [ + "eq", + "not_eq", + "gt", + "gte", + "lt", + "lte" + ] }, - "layer_group": { - "type": "belongs_to", - "description": null, - "resource": "GroupResource" + "leads_course_id": { + "type": "integer", + "operators": [ + "eq" + ] } }, + "relationships": { + }, "stats": { "total": [ "count" @@ -984,6 +1683,12 @@ "readable": "guarded", "writable": "guarded", "description": null + }, + "language": { + "type": "string", + "readable": true, + "writable": true, + "description": null } }, "extra_attributes": { @@ -1016,6 +1721,8 @@ "gender": { }, "birthday": { + }, + "language": { } }, "filters": { @@ -1209,6 +1916,21 @@ "lte" ] }, + "language": { + "type": "string", + "operators": [ + "eq", + "not_eq", + "eql", + "not_eql", + "prefix", + "not_prefix", + "suffix", + "not_suffix", + "match", + "not_match" + ] + }, "updated_at": { "type": "datetime", "operators": [ @@ -1743,6 +2465,16 @@ } ], "endpoints": { + "/api/event_kinds": { + "actions": { + "index": { + "resource": "Event::KindResource" + }, + "show": { + "resource": "Event::KindResource" + } + } + }, "/api/events": { "actions": { "index": { @@ -1763,6 +2495,19 @@ } } }, + "/api/invoices": { + "actions": { + "index": { + "resource": "InvoiceResource" + }, + "show": { + "resource": "InvoiceResource" + }, + "update": { + "resource": "InvoiceResource" + } + } + }, "/api/people": { "actions": { "index": {