feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
75
backend/dataconnect/example/business/mutations.gql
Normal file
75
backend/dataconnect/example/business/mutations.gql
Normal file
@@ -0,0 +1,75 @@
|
||||
mutation createBusiness(
|
||||
$businessName: String!,
|
||||
$contactName: String,
|
||||
$userId: String!,
|
||||
$companyLogoUrl: String,
|
||||
$phone: String,
|
||||
$email: String,
|
||||
$hubBuilding: String,
|
||||
$address: String,
|
||||
$city: String,
|
||||
$area: BusinessArea,
|
||||
$sector: BusinessSector,
|
||||
$rateGroup: BusinessRateGroup!,
|
||||
$status: BusinessStatus!,
|
||||
$notes: String
|
||||
) @auth(level: USER) {
|
||||
business_insert(
|
||||
data: {
|
||||
businessName: $businessName,
|
||||
contactName: $contactName,
|
||||
userId: $userId,
|
||||
companyLogoUrl: $companyLogoUrl,
|
||||
phone: $phone,
|
||||
email: $email,
|
||||
hubBuilding: $hubBuilding,
|
||||
address: $address,
|
||||
city: $city,
|
||||
area: $area,
|
||||
sector: $sector,
|
||||
rateGroup: $rateGroup,
|
||||
status: $status,
|
||||
notes: $notes
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateBusiness(
|
||||
$id: UUID!,
|
||||
$businessName: String,
|
||||
$contactName: String,
|
||||
$companyLogoUrl: String,
|
||||
$phone: String,
|
||||
$email: String,
|
||||
$hubBuilding: String,
|
||||
$address: String,
|
||||
$city: String,
|
||||
$area: BusinessArea,
|
||||
$sector: BusinessSector,
|
||||
$rateGroup: BusinessRateGroup,
|
||||
$status: BusinessStatus,
|
||||
$notes: String
|
||||
) @auth(level: USER) {
|
||||
business_update(
|
||||
id: $id,
|
||||
data: {
|
||||
businessName: $businessName,
|
||||
contactName: $contactName,
|
||||
companyLogoUrl: $companyLogoUrl,
|
||||
phone: $phone,
|
||||
email: $email,
|
||||
hubBuilding: $hubBuilding,
|
||||
address: $address,
|
||||
city: $city,
|
||||
area: $area,
|
||||
sector: $sector,
|
||||
rateGroup: $rateGroup,
|
||||
status: $status,
|
||||
notes: $notes
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteBusiness($id: UUID!) @auth(level: USER) {
|
||||
business_delete(id: $id)
|
||||
}
|
||||
65
backend/dataconnect/example/business/queries.gql
Normal file
65
backend/dataconnect/example/business/queries.gql
Normal file
@@ -0,0 +1,65 @@
|
||||
query listBusinesses @auth(level: USER) {
|
||||
businesses {
|
||||
id
|
||||
businessName
|
||||
contactName
|
||||
userId
|
||||
companyLogoUrl
|
||||
phone
|
||||
email
|
||||
hubBuilding
|
||||
address
|
||||
city
|
||||
area
|
||||
sector
|
||||
rateGroup
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
query getBusinessesByUserId($userId: String!) @auth(level: USER) {
|
||||
businesses(where: { userId: { eq: $userId } }) {
|
||||
id
|
||||
businessName
|
||||
contactName
|
||||
userId
|
||||
companyLogoUrl
|
||||
phone
|
||||
email
|
||||
hubBuilding
|
||||
address
|
||||
city
|
||||
area
|
||||
sector
|
||||
rateGroup
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
query getBusinessById($id: UUID!) @auth(level: USER) {
|
||||
business(id: $id) {
|
||||
id
|
||||
businessName
|
||||
contactName
|
||||
userId
|
||||
companyLogoUrl
|
||||
phone
|
||||
email
|
||||
hubBuilding
|
||||
address
|
||||
city
|
||||
area
|
||||
sector
|
||||
rateGroup
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user