From 6c90d39dae58f905e174076ed6b137f6a9ddc244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:32:17 -0500 Subject: [PATCH] new business entity --- dataconnect/connector/business/mutations.gql | 47 ++++++++++++++++++ dataconnect/connector/business/queries.gql | 51 ++++++++++++++++++++ dataconnect/schema/business.gql | 34 +++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 dataconnect/connector/business/mutations.gql create mode 100644 dataconnect/connector/business/queries.gql create mode 100644 dataconnect/schema/business.gql diff --git a/dataconnect/connector/business/mutations.gql b/dataconnect/connector/business/mutations.gql new file mode 100644 index 00000000..9be33782 --- /dev/null +++ b/dataconnect/connector/business/mutations.gql @@ -0,0 +1,47 @@ +mutation CreateBusiness( + $businessName: String!, + $contactName: String!, + $email: String, + $sector: BusinessSector, + $rateGroup: BusinessRateGroup!, + $status: BusinessStatus +) @auth(level: USER) { + business_insert( + data: { + businessName: $businessName + contactName: $contactName + email: $email + sector: $sector + rateGroup: $rateGroup + status: $status + } + ) +} + +mutation UpdateBusiness( + $id: UUID!, + $businessName: String, + $contactName: String, + $email: String, + $sector: BusinessSector, + $rateGroup: BusinessRateGroup, + $status: BusinessStatus +) @auth(level: USER) { + business_update( + id: $id, + data: { + businessName: $businessName + contactName: $contactName + email: $email + sector: $sector + rateGroup: $rateGroup + status: $status + } + ) +} + +mutation DeleteBusiness( + $id: UUID! +) @auth(level: USER) { + business_delete(id: $id) +} diff --git a/dataconnect/connector/business/queries.gql b/dataconnect/connector/business/queries.gql new file mode 100644 index 00000000..3b721dc8 --- /dev/null +++ b/dataconnect/connector/business/queries.gql @@ -0,0 +1,51 @@ +query listBusiness @auth(level: USER) { + business { + id + businessName + contactName + email + sector + rateGroup + status + } +} + +query getBusinessById( + $id: UUID! +) @auth(level: USER) { + business(id: $id) { + id + businessName + contactName + email + sector + rateGroup + status + } +} + +query filterBusiness( + $businessName: String, + $contactName: String, + $sector: BusinessSector, + $rateGroup: BusinessRateGroup, + $status: BusinessStatus +) @auth(level: USER) { + business( + where: { + businessName: { eq: $businessName } + contactName: { eq: $contactName } + sector: { eq: $sector } + rateGroup: { eq: $rateGroup } + status: { eq: $status } + } + ) { + id + businessName + contactName + email + sector + rateGroup + status + } +} diff --git a/dataconnect/schema/business.gql b/dataconnect/schema/business.gql new file mode 100644 index 00000000..b517aaf6 --- /dev/null +++ b/dataconnect/schema/business.gql @@ -0,0 +1,34 @@ +enum BusinessSector { + BON_APPETIT + EUREST + ARAMARK + EPICUREAN_GROUP + CHARTWELLS + OTHER +} + +enum BusinessRateGroup { + STANDARD + PREMIUM + ENTERPRISE + CUSTOM +} + +enum BusinessStatus { + ACTIVE + INACTIVE + PENDING +} + +type Business @table(name: "business") { + id: UUID! @default(expr: "uuidV4()") + businessName: String! + contactName: String! + email: String + sector: BusinessSector + rateGroup: BusinessRateGroup! + status: BusinessStatus + createdDate: Timestamp @default(expr: "request.time") + updatedDate: Timestamp @default(expr: "request.time") + createdBy: String @default(expr: "auth.uid") +}