diff --git a/spec/support/graphiti/schema.json b/spec/support/graphiti/schema.json index d68149e..517d097 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,12 +1683,6 @@ "readable": "guarded", "writable": "guarded", "description": null - }, - "language": { - "type": "string", - "readable": true, - "writable": true, - "description": null } }, "extra_attributes": { @@ -1022,8 +1715,6 @@ "gender": { }, "birthday": { - }, - "language": { } }, "filters": { @@ -1217,21 +1908,6 @@ "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": [ @@ -1766,6 +2442,16 @@ } ], "endpoints": { + "/api/event_kinds": { + "actions": { + "index": { + "resource": "Event::KindResource" + }, + "show": { + "resource": "Event::KindResource" + } + } + }, "/api/events": { "actions": { "index": { @@ -1786,6 +2472,19 @@ } } }, + "/api/invoices": { + "actions": { + "index": { + "resource": "InvoiceResource" + }, + "show": { + "resource": "InvoiceResource" + }, + "update": { + "resource": "InvoiceResource" + } + } + }, "/api/people": { "actions": { "index": {