Clean old base44 project reference architecture
This commit is contained in:
@@ -1,51 +0,0 @@
|
|||||||
mutation CreateActivityLog(
|
|
||||||
$title: String!,
|
|
||||||
$description: String!,
|
|
||||||
$activityType: ActivityType!,
|
|
||||||
$userId: String!,
|
|
||||||
$isRead: Boolean,
|
|
||||||
$iconType: String,
|
|
||||||
$iconColor: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_insert(
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
activityType: $activityType
|
|
||||||
userId: $userId
|
|
||||||
isRead: $isRead
|
|
||||||
iconType: $iconType
|
|
||||||
iconColor: $iconColor
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateActivityLog(
|
|
||||||
$id: UUID!,
|
|
||||||
$title: String,
|
|
||||||
$description: String,
|
|
||||||
$activityType: ActivityType,
|
|
||||||
$userId: String,
|
|
||||||
$isRead: Boolean,
|
|
||||||
$iconType: String,
|
|
||||||
$iconColor: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
title: $title
|
|
||||||
description: $description
|
|
||||||
activityType: $activityType
|
|
||||||
userId: $userId
|
|
||||||
isRead: $isRead
|
|
||||||
iconType: $iconType
|
|
||||||
iconColor: $iconColor
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteActivityLog(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
query listActivityLog @auth(level: USER) {
|
|
||||||
activityLogs {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
activityType
|
|
||||||
userId
|
|
||||||
isRead
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getActivityLogById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLog(id: $id) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
activityType
|
|
||||||
userId
|
|
||||||
isRead
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterActivityLog(
|
|
||||||
$userId: String,
|
|
||||||
$activityType: ActivityType,
|
|
||||||
$isRead: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
activityLogs(
|
|
||||||
where: {
|
|
||||||
userId: { eq: $userId }
|
|
||||||
activityType: { eq: $activityType }
|
|
||||||
isRead: { eq: $isRead }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
description
|
|
||||||
activityType
|
|
||||||
userId
|
|
||||||
isRead
|
|
||||||
iconType
|
|
||||||
iconColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
mutation CreateAssignment(
|
|
||||||
$assignmentNumber: String,
|
|
||||||
$orderId: UUID!,
|
|
||||||
$workforceId: UUID!,
|
|
||||||
$vendorId: UUID!,
|
|
||||||
$role: String!,
|
|
||||||
$assignmentStatus: AssignmentStatus!,
|
|
||||||
$scheduledStart: Timestamp!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment_insert(
|
|
||||||
data: {
|
|
||||||
assignmentNumber: $assignmentNumber
|
|
||||||
orderId: $orderId
|
|
||||||
workforceId: $workforceId
|
|
||||||
vendorId: $vendorId
|
|
||||||
role: $role
|
|
||||||
assignmentStatus: $assignmentStatus
|
|
||||||
scheduledStart: $scheduledStart
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateAssignment(
|
|
||||||
$id: UUID!,
|
|
||||||
$assignmentNumber: String,
|
|
||||||
$orderId: UUID,
|
|
||||||
$workforceId: UUID,
|
|
||||||
$vendorId: UUID,
|
|
||||||
$role: String,
|
|
||||||
$assignmentStatus: AssignmentStatus,
|
|
||||||
$scheduledStart: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
assignmentNumber: $assignmentNumber
|
|
||||||
orderId: $orderId
|
|
||||||
workforceId: $workforceId
|
|
||||||
vendorId: $vendorId
|
|
||||||
role: $role
|
|
||||||
assignmentStatus: $assignmentStatus
|
|
||||||
scheduledStart: $scheduledStart
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteAssignment(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# dataconnect/connector/assignment/queries.gql
|
|
||||||
|
|
||||||
query listAssignment @auth(level: USER) {
|
|
||||||
assignments {
|
|
||||||
id
|
|
||||||
assignmentNumber
|
|
||||||
orderId
|
|
||||||
workforceId
|
|
||||||
vendorId
|
|
||||||
role
|
|
||||||
assignmentStatus
|
|
||||||
scheduledStart
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getAssignmentById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignment(id: $id) {
|
|
||||||
id
|
|
||||||
assignmentNumber
|
|
||||||
orderId
|
|
||||||
workforceId
|
|
||||||
vendorId
|
|
||||||
role
|
|
||||||
assignmentStatus
|
|
||||||
scheduledStart
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterAssignment(
|
|
||||||
$assignmentNumber: String,
|
|
||||||
$orderId: UUID,
|
|
||||||
$workforceId: UUID,
|
|
||||||
$vendorId: UUID,
|
|
||||||
$assignmentStatus: AssignmentStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
assignments(
|
|
||||||
where: {
|
|
||||||
assignmentNumber: { eq: $assignmentNumber }
|
|
||||||
orderId: { eq: $orderId }
|
|
||||||
workforceId: { eq: $workforceId }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
assignmentStatus: { eq: $assignmentStatus }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
assignmentNumber
|
|
||||||
orderId
|
|
||||||
workforceId
|
|
||||||
vendorId
|
|
||||||
role
|
|
||||||
assignmentStatus
|
|
||||||
scheduledStart
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
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)
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
query listBusiness @auth(level: USER) {
|
|
||||||
businesses {
|
|
||||||
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) {
|
|
||||||
businesses(
|
|
||||||
where: {
|
|
||||||
businessName: { eq: $businessName }
|
|
||||||
contactName: { eq: $contactName }
|
|
||||||
sector: { eq: $sector }
|
|
||||||
rateGroup: { eq: $rateGroup }
|
|
||||||
status: { eq: $status }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
businessName
|
|
||||||
contactName
|
|
||||||
email
|
|
||||||
sector
|
|
||||||
rateGroup
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
mutation CreateCertification(
|
|
||||||
$employeeName: String!,
|
|
||||||
$certificationName: String!,
|
|
||||||
$certificationType: CertificationType,
|
|
||||||
$status: CertificationStatus,
|
|
||||||
$expiryDate: String!,
|
|
||||||
$validationStatus: CertificationValidationStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certification_insert(
|
|
||||||
data: {
|
|
||||||
employeeName: $employeeName
|
|
||||||
certificationName: $certificationName
|
|
||||||
certificationType: $certificationType
|
|
||||||
status: $status
|
|
||||||
expiryDate: $expiryDate
|
|
||||||
validationStatus: $validationStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateCertification(
|
|
||||||
$id: UUID!,
|
|
||||||
$employeeName: String,
|
|
||||||
$certificationName: String,
|
|
||||||
$certificationType: CertificationType,
|
|
||||||
$status: CertificationStatus,
|
|
||||||
$expiryDate: String,
|
|
||||||
$validationStatus: CertificationValidationStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certification_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
employeeName: $employeeName
|
|
||||||
certificationName: $certificationName
|
|
||||||
certificationType: $certificationType
|
|
||||||
status: $status
|
|
||||||
expiryDate: $expiryDate
|
|
||||||
validationStatus: $validationStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteCertification(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certification_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
query listCertification @auth(level: USER) {
|
|
||||||
certifications {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
certificationName
|
|
||||||
certificationType
|
|
||||||
status
|
|
||||||
expiryDate
|
|
||||||
validationStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getCertificationById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certification(id: $id) {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
certificationName
|
|
||||||
certificationType
|
|
||||||
status
|
|
||||||
expiryDate
|
|
||||||
validationStatus
|
|
||||||
createdDate
|
|
||||||
updatedDate
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterCertification(
|
|
||||||
$employeeName: String,
|
|
||||||
$certificationName: String,
|
|
||||||
$certificationType: CertificationType,
|
|
||||||
$status: CertificationStatus,
|
|
||||||
$validationStatus: CertificationValidationStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
certifications(
|
|
||||||
where: {
|
|
||||||
employeeName: { eq: $employeeName }
|
|
||||||
certificationName: { eq: $certificationName }
|
|
||||||
certificationType: { eq: $certificationType }
|
|
||||||
status: { eq: $status }
|
|
||||||
validationStatus: { eq: $validationStatus }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
certificationName
|
|
||||||
certificationType
|
|
||||||
status
|
|
||||||
expiryDate
|
|
||||||
validationStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
connectorId: krow-connector
|
|
||||||
generate:
|
|
||||||
javascriptSdk:
|
|
||||||
- outputDir: ../../frontend-web/src/dataconnect-generated
|
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ../../frontend-web
|
|
||||||
react: true
|
|
||||||
angular: false
|
|
||||||
- outputDir: ../../internal-api-harness/src/dataconnect-generated
|
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ../../internal-api-harness
|
|
||||||
react: true
|
|
||||||
angular: false
|
|
||||||
- outputDir: ../../frontend-web-free/src/dataconnect-generated
|
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ../../frontend-web-free
|
|
||||||
react: true
|
|
||||||
angular: false
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
mutation CreateConversation(
|
|
||||||
$participants: String!,
|
|
||||||
$conversationType: ConversationType!,
|
|
||||||
$relatedTo: UUID!,
|
|
||||||
$status: ConversationStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_insert(
|
|
||||||
data: {
|
|
||||||
participants: $participants
|
|
||||||
conversationType: $conversationType
|
|
||||||
relatedTo: $relatedTo
|
|
||||||
status: $status
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateConversation(
|
|
||||||
$id: UUID!,
|
|
||||||
$participants: String,
|
|
||||||
$conversationType: ConversationType,
|
|
||||||
$relatedTo: UUID,
|
|
||||||
$status: ConversationStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
participants: $participants
|
|
||||||
conversationType: $conversationType
|
|
||||||
relatedTo: $relatedTo
|
|
||||||
status: $status
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteConversation(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
# dataconnect/connector/conversation/queries.gql
|
|
||||||
|
|
||||||
query listConversation @auth(level: USER) {
|
|
||||||
conversations {
|
|
||||||
id
|
|
||||||
participants
|
|
||||||
conversationType
|
|
||||||
relatedTo
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getConversationById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversation(id: $id) {
|
|
||||||
id
|
|
||||||
participants
|
|
||||||
conversationType
|
|
||||||
relatedTo
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterConversation(
|
|
||||||
$conversationType: ConversationType,
|
|
||||||
$status: ConversationStatus,
|
|
||||||
$relatedTo: UUID
|
|
||||||
) @auth(level: USER) {
|
|
||||||
conversations(
|
|
||||||
where: {
|
|
||||||
conversationType: { eq: $conversationType }
|
|
||||||
status: { eq: $status }
|
|
||||||
relatedTo: { eq: $relatedTo }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
participants
|
|
||||||
conversationType
|
|
||||||
relatedTo
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation CreateEnterprise(
|
|
||||||
$enterpriseNumber: String!,
|
|
||||||
$enterpriseName: String!,
|
|
||||||
$enterpriseCode: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
enterprise_insert(
|
|
||||||
data: {
|
|
||||||
enterpriseNumber: $enterpriseNumber
|
|
||||||
enterpriseName: $enterpriseName
|
|
||||||
enterpriseCode: $enterpriseCode
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateEnterprise(
|
|
||||||
$id: UUID!,
|
|
||||||
$enterpriseNumber: String,
|
|
||||||
$enterpriseName: String,
|
|
||||||
$enterpriseCode: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
enterprise_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
enterpriseNumber: $enterpriseNumber
|
|
||||||
enterpriseName: $enterpriseName
|
|
||||||
enterpriseCode: $enterpriseCode
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteEnterprise(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
enterprise_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
query listEnterprise @auth(level: USER) {
|
|
||||||
enterprises {
|
|
||||||
id
|
|
||||||
enterpriseNumber
|
|
||||||
enterpriseName
|
|
||||||
enterpriseCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getEnterpriseById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
enterprise(id: $id) {
|
|
||||||
id
|
|
||||||
enterpriseNumber
|
|
||||||
enterpriseName
|
|
||||||
enterpriseCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterEnterprise(
|
|
||||||
$enterpriseNumber: String,
|
|
||||||
$enterpriseName: String,
|
|
||||||
$enterpriseCode: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
enterprises(
|
|
||||||
where: {
|
|
||||||
enterpriseNumber: { eq: $enterpriseNumber }
|
|
||||||
enterpriseName: { eq: $enterpriseName }
|
|
||||||
enterpriseCode: { eq: $enterpriseCode }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
enterpriseNumber
|
|
||||||
enterpriseName
|
|
||||||
enterpriseCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
mutation CreateEvent(
|
|
||||||
$eventName: String!,
|
|
||||||
$isRapid: Boolean,
|
|
||||||
$isRecurring: Boolean,
|
|
||||||
$isMultiDay: Boolean,
|
|
||||||
$recurrenceType: RecurrenceType,
|
|
||||||
$recurrenceStartDate: Timestamp,
|
|
||||||
$recurrenceEndDate: Timestamp,
|
|
||||||
$scatterDates: Any,
|
|
||||||
$multiDayStartDate: Timestamp,
|
|
||||||
$multiDayEndDate: Timestamp,
|
|
||||||
$bufferTimeBefore: Float,
|
|
||||||
$bufferTimeAfter: Float,
|
|
||||||
$conflictDetectionEnabled: Boolean,
|
|
||||||
$detectedConflicts: Any,
|
|
||||||
$businessId: UUID!,
|
|
||||||
$businessName: String,
|
|
||||||
$vendorId: String,
|
|
||||||
$vendorName: String,
|
|
||||||
$hub: String,
|
|
||||||
$eventLocation: String,
|
|
||||||
$contractType: ContractType,
|
|
||||||
$poReference: String,
|
|
||||||
$status: EventStatus!,
|
|
||||||
$date: String!,
|
|
||||||
$shifts: Any,
|
|
||||||
$addons: Any,
|
|
||||||
$total: Float,
|
|
||||||
$clientName: String,
|
|
||||||
$clientEmail: String,
|
|
||||||
$clientPhone: String,
|
|
||||||
$invoiceId: UUID,
|
|
||||||
$notes: String,
|
|
||||||
$requested: Int,
|
|
||||||
$assignedStaff: Any,
|
|
||||||
$department: String,
|
|
||||||
$createdBy: String,
|
|
||||||
$orderType: String,
|
|
||||||
$recurringStartDate: String,
|
|
||||||
$recurringEndDate: String,
|
|
||||||
$recurringDays: Any,
|
|
||||||
$permanentStartDate: String,
|
|
||||||
$permanentDays: Any,
|
|
||||||
$includeBackup: Boolean,
|
|
||||||
$backupStaffCount: Int,
|
|
||||||
$recurringTime: String,
|
|
||||||
$permanentTime: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
event_insert(
|
|
||||||
data: {
|
|
||||||
eventName: $eventName
|
|
||||||
isRapid: $isRapid
|
|
||||||
isRecurring: $isRecurring
|
|
||||||
isMultiDay: $isMultiDay
|
|
||||||
recurrenceType: $recurrenceType
|
|
||||||
recurrenceStartDate: $recurrenceStartDate
|
|
||||||
recurrenceEndDate: $recurrenceEndDate
|
|
||||||
scatterDates: $scatterDates
|
|
||||||
multiDayStartDate: $multiDayStartDate
|
|
||||||
multiDayEndDate: $multiDayEndDate
|
|
||||||
bufferTimeBefore: $bufferTimeBefore
|
|
||||||
bufferTimeAfter: $bufferTimeAfter
|
|
||||||
conflictDetectionEnabled: $conflictDetectionEnabled
|
|
||||||
detectedConflicts: $detectedConflicts
|
|
||||||
businessId: $businessId
|
|
||||||
businessName: $businessName
|
|
||||||
vendorId: $vendorId
|
|
||||||
vendorName: $vendorName
|
|
||||||
hub: $hub
|
|
||||||
eventLocation: $eventLocation
|
|
||||||
contractType: $contractType
|
|
||||||
poReference: $poReference
|
|
||||||
status: $status
|
|
||||||
date: $date
|
|
||||||
shifts: $shifts
|
|
||||||
addons: $addons
|
|
||||||
total: $total
|
|
||||||
clientName: $clientName
|
|
||||||
clientEmail: $clientEmail
|
|
||||||
clientPhone: $clientPhone
|
|
||||||
invoiceId: $invoiceId
|
|
||||||
notes: $notes
|
|
||||||
orderType: $orderType
|
|
||||||
requested: $requested
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
department: $department
|
|
||||||
createdBy: $createdBy
|
|
||||||
recurringStartDate: $recurringStartDate
|
|
||||||
recurringEndDate: $recurringEndDate
|
|
||||||
recurringDays: $recurringDays
|
|
||||||
permanentStartDate: $permanentStartDate
|
|
||||||
permanentDays: $permanentDays
|
|
||||||
includeBackup: $includeBackup
|
|
||||||
backupStaffCount: $backupStaffCount
|
|
||||||
recurringTime: $recurringTime
|
|
||||||
permanentTime: $permanentTime
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mutation UpdateEvent(
|
|
||||||
$id: UUID!,
|
|
||||||
$eventName: String,
|
|
||||||
$isRapid: Boolean,
|
|
||||||
$isRecurring: Boolean,
|
|
||||||
$isMultiDay: Boolean,
|
|
||||||
$recurrenceType: RecurrenceType,
|
|
||||||
$recurrenceStartDate: Timestamp,
|
|
||||||
$recurrenceEndDate: Timestamp,
|
|
||||||
$scatterDates: Any,
|
|
||||||
$multiDayStartDate: Timestamp,
|
|
||||||
$multiDayEndDate: Timestamp,
|
|
||||||
$bufferTimeBefore: Float,
|
|
||||||
$bufferTimeAfter: Float,
|
|
||||||
$conflictDetectionEnabled: Boolean,
|
|
||||||
$detectedConflicts: Any,
|
|
||||||
$businessId: UUID,
|
|
||||||
$businessName: String,
|
|
||||||
$vendorId: String,
|
|
||||||
$vendorName: String,
|
|
||||||
$hub: String,
|
|
||||||
$eventLocation: String,
|
|
||||||
$contractType: ContractType,
|
|
||||||
$poReference: String,
|
|
||||||
$status: EventStatus,
|
|
||||||
$date: String,
|
|
||||||
$shifts: Any,
|
|
||||||
$addons: Any,
|
|
||||||
$total: Float,
|
|
||||||
$clientName: String,
|
|
||||||
$clientEmail: String,
|
|
||||||
$clientPhone: String,
|
|
||||||
$invoiceId: UUID,
|
|
||||||
$notes: String,
|
|
||||||
$requested: Int,
|
|
||||||
$orderType: String,
|
|
||||||
$department: String,
|
|
||||||
$assignedStaff: Any,
|
|
||||||
$createdBy: String,
|
|
||||||
$recurringStartDate: String,
|
|
||||||
$recurringEndDate: String,
|
|
||||||
$recurringDays: Any,
|
|
||||||
$permanentStartDate: String,
|
|
||||||
$permanentDays: Any,
|
|
||||||
$includeBackup: Boolean,
|
|
||||||
$backupStaffCount: Int,
|
|
||||||
$recurringTime: String,
|
|
||||||
$permanentTime: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
event_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
eventName: $eventName
|
|
||||||
isRapid: $isRapid
|
|
||||||
isRecurring: $isRecurring
|
|
||||||
isMultiDay: $isMultiDay
|
|
||||||
recurrenceType: $recurrenceType
|
|
||||||
recurrenceStartDate: $recurrenceStartDate
|
|
||||||
recurrenceEndDate: $recurrenceEndDate
|
|
||||||
scatterDates: $scatterDates
|
|
||||||
multiDayStartDate: $multiDayStartDate
|
|
||||||
multiDayEndDate: $multiDayEndDate
|
|
||||||
bufferTimeBefore: $bufferTimeBefore
|
|
||||||
bufferTimeAfter: $bufferTimeAfter
|
|
||||||
conflictDetectionEnabled: $conflictDetectionEnabled
|
|
||||||
detectedConflicts: $detectedConflicts
|
|
||||||
businessId: $businessId
|
|
||||||
businessName: $businessName
|
|
||||||
vendorId: $vendorId
|
|
||||||
vendorName: $vendorName
|
|
||||||
hub: $hub
|
|
||||||
eventLocation: $eventLocation
|
|
||||||
contractType: $contractType
|
|
||||||
poReference: $poReference
|
|
||||||
status: $status
|
|
||||||
date: $date
|
|
||||||
shifts: $shifts
|
|
||||||
addons: $addons
|
|
||||||
total: $total
|
|
||||||
clientName: $clientName
|
|
||||||
clientEmail: $clientEmail
|
|
||||||
clientPhone: $clientPhone
|
|
||||||
invoiceId: $invoiceId
|
|
||||||
notes: $notes
|
|
||||||
orderType: $orderType
|
|
||||||
requested: $requested
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
department: $department
|
|
||||||
createdBy: $createdBy
|
|
||||||
recurringStartDate: $recurringStartDate
|
|
||||||
recurringEndDate: $recurringEndDate
|
|
||||||
recurringDays: $recurringDays
|
|
||||||
permanentStartDate: $permanentStartDate
|
|
||||||
permanentDays: $permanentDays
|
|
||||||
includeBackup: $includeBackup
|
|
||||||
backupStaffCount: $backupStaffCount
|
|
||||||
recurringTime: $recurringTime
|
|
||||||
permanentTime: $permanentTime
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteEvent(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
event_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,193 +0,0 @@
|
|||||||
query listEvents (
|
|
||||||
$orderByDate: OrderDirection
|
|
||||||
$orderByCreatedDate: OrderDirection,
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
events(
|
|
||||||
orderBy: [
|
|
||||||
{ date: $orderByDate }
|
|
||||||
{ createdDate: $orderByCreatedDate }
|
|
||||||
]
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
date
|
|
||||||
isRapid
|
|
||||||
isRecurring
|
|
||||||
isMultiDay
|
|
||||||
recurrenceType
|
|
||||||
recurrenceStartDate
|
|
||||||
recurrenceEndDate
|
|
||||||
scatterDates
|
|
||||||
multiDayStartDate
|
|
||||||
multiDayEndDate
|
|
||||||
bufferTimeBefore
|
|
||||||
bufferTimeAfter
|
|
||||||
conflictDetectionEnabled
|
|
||||||
detectedConflicts
|
|
||||||
businessId
|
|
||||||
businessName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
hub
|
|
||||||
eventLocation
|
|
||||||
contractType
|
|
||||||
poReference
|
|
||||||
shifts
|
|
||||||
addons
|
|
||||||
total
|
|
||||||
clientName
|
|
||||||
clientEmail
|
|
||||||
clientPhone
|
|
||||||
invoiceId
|
|
||||||
notes
|
|
||||||
requested
|
|
||||||
assignedStaff
|
|
||||||
orderType
|
|
||||||
department
|
|
||||||
createdBy
|
|
||||||
recurringStartDate
|
|
||||||
recurringEndDate
|
|
||||||
recurringDays
|
|
||||||
permanentStartDate
|
|
||||||
permanentDays
|
|
||||||
includeBackup
|
|
||||||
backupStaffCount
|
|
||||||
recurringTime
|
|
||||||
permanentTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getEventById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
event(id: $id) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
date
|
|
||||||
isRapid
|
|
||||||
isRecurring
|
|
||||||
isMultiDay
|
|
||||||
recurrenceType
|
|
||||||
recurrenceStartDate
|
|
||||||
recurrenceEndDate
|
|
||||||
scatterDates
|
|
||||||
multiDayStartDate
|
|
||||||
multiDayEndDate
|
|
||||||
bufferTimeBefore
|
|
||||||
bufferTimeAfter
|
|
||||||
conflictDetectionEnabled
|
|
||||||
detectedConflicts
|
|
||||||
businessId
|
|
||||||
businessName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
hub
|
|
||||||
eventLocation
|
|
||||||
contractType
|
|
||||||
poReference
|
|
||||||
shifts
|
|
||||||
addons
|
|
||||||
total
|
|
||||||
clientName
|
|
||||||
clientEmail
|
|
||||||
clientPhone
|
|
||||||
invoiceId
|
|
||||||
notes
|
|
||||||
requested
|
|
||||||
orderType
|
|
||||||
department
|
|
||||||
assignedStaff
|
|
||||||
recurringStartDate
|
|
||||||
recurringEndDate
|
|
||||||
recurringDays
|
|
||||||
permanentStartDate
|
|
||||||
permanentDays
|
|
||||||
includeBackup
|
|
||||||
backupStaffCount
|
|
||||||
recurringTime
|
|
||||||
permanentTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterEvents(
|
|
||||||
$status: EventStatus,
|
|
||||||
$businessId: UUID,
|
|
||||||
$vendorId: String,
|
|
||||||
$isRecurring: Boolean,
|
|
||||||
$isRapid: Boolean,
|
|
||||||
$isMultiDay: Boolean,
|
|
||||||
$recurrenceType: RecurrenceType,
|
|
||||||
$date: String,
|
|
||||||
$hub: String,
|
|
||||||
$eventLocation: String,
|
|
||||||
$contractType: ContractType,
|
|
||||||
$clientEmail: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
events(
|
|
||||||
where: {
|
|
||||||
status: { eq: $status }
|
|
||||||
businessId: { eq: $businessId }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
isRecurring: { eq: $isRecurring }
|
|
||||||
isRapid: { eq: $isRapid }
|
|
||||||
isMultiDay: { eq: $isMultiDay }
|
|
||||||
recurrenceType: { eq: $recurrenceType }
|
|
||||||
date: { eq: $date }
|
|
||||||
hub: { eq: $hub }
|
|
||||||
eventLocation: { eq: $eventLocation }
|
|
||||||
contractType: { eq: $contractType }
|
|
||||||
clientEmail: { eq: $clientEmail }
|
|
||||||
}) {
|
|
||||||
id
|
|
||||||
eventName
|
|
||||||
status
|
|
||||||
date
|
|
||||||
isRapid
|
|
||||||
isRecurring
|
|
||||||
isMultiDay
|
|
||||||
recurrenceType
|
|
||||||
recurrenceStartDate
|
|
||||||
recurrenceEndDate
|
|
||||||
scatterDates
|
|
||||||
multiDayStartDate
|
|
||||||
multiDayEndDate
|
|
||||||
bufferTimeBefore
|
|
||||||
bufferTimeAfter
|
|
||||||
conflictDetectionEnabled
|
|
||||||
detectedConflicts
|
|
||||||
businessId
|
|
||||||
businessName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
hub
|
|
||||||
eventLocation
|
|
||||||
contractType
|
|
||||||
poReference
|
|
||||||
shifts
|
|
||||||
addons
|
|
||||||
total
|
|
||||||
clientName
|
|
||||||
clientEmail
|
|
||||||
clientPhone
|
|
||||||
invoiceId
|
|
||||||
notes
|
|
||||||
requested
|
|
||||||
assignedStaff
|
|
||||||
orderType
|
|
||||||
department
|
|
||||||
createdBy
|
|
||||||
recurringStartDate
|
|
||||||
recurringEndDate
|
|
||||||
recurringDays
|
|
||||||
permanentStartDate
|
|
||||||
permanentDays
|
|
||||||
includeBackup
|
|
||||||
backupStaffCount
|
|
||||||
recurringTime
|
|
||||||
permanentTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
mutation CreateInvoice(
|
|
||||||
$invoiceNumber: String!,
|
|
||||||
$amount: Float!,
|
|
||||||
$status: InvoiceStatus!,
|
|
||||||
$issueDate: Timestamp!,
|
|
||||||
$dueDate: Timestamp!,
|
|
||||||
$disputedItems: String,
|
|
||||||
$isAutoGenerated: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice_insert(
|
|
||||||
data: {
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
amount: $amount
|
|
||||||
status: $status
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
disputedItems: $disputedItems
|
|
||||||
isAutoGenerated: $isAutoGenerated
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateInvoice(
|
|
||||||
$id: UUID!,
|
|
||||||
$invoiceNumber: String,
|
|
||||||
$amount: Float,
|
|
||||||
$status: InvoiceStatus,
|
|
||||||
$issueDate: Timestamp,
|
|
||||||
$dueDate: Timestamp,
|
|
||||||
$disputedItems: String,
|
|
||||||
$isAutoGenerated: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
invoiceNumber: $invoiceNumber
|
|
||||||
amount: $amount
|
|
||||||
status: $status
|
|
||||||
issueDate: $issueDate
|
|
||||||
dueDate: $dueDate
|
|
||||||
disputedItems: $disputedItems
|
|
||||||
isAutoGenerated: $isAutoGenerated
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteInvoice(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
query listInvoice @auth(level: USER) {
|
|
||||||
invoices {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
disputedItems
|
|
||||||
isAutoGenerated
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getInvoiceById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoice(id: $id) {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
disputedItems
|
|
||||||
isAutoGenerated
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterInvoices(
|
|
||||||
$invoiceNumber: String,
|
|
||||||
$status: InvoiceStatus,
|
|
||||||
$isAutoGenerated: Boolean,
|
|
||||||
$amount: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
invoices(
|
|
||||||
where: {
|
|
||||||
invoiceNumber: { eq: $invoiceNumber }
|
|
||||||
status: { eq: $status }
|
|
||||||
isAutoGenerated: { eq: $isAutoGenerated }
|
|
||||||
amount: { eq: $amount }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
invoiceNumber
|
|
||||||
amount
|
|
||||||
status
|
|
||||||
issueDate
|
|
||||||
dueDate
|
|
||||||
isAutoGenerated
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
mutation CreateMessage(
|
|
||||||
$conversationId: UUID!,
|
|
||||||
$senderName: String!,
|
|
||||||
$content: String!,
|
|
||||||
$readBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message_insert(
|
|
||||||
data: {
|
|
||||||
conversationId: $conversationId
|
|
||||||
senderName: $senderName
|
|
||||||
content: $content
|
|
||||||
readBy: $readBy
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateMessage(
|
|
||||||
$id: UUID!,
|
|
||||||
$conversationId: UUID,
|
|
||||||
$senderName: String,
|
|
||||||
$content: String,
|
|
||||||
$readBy: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
conversationId: $conversationId
|
|
||||||
senderName: $senderName
|
|
||||||
content: $content
|
|
||||||
readBy: $readBy
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteMessage(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
query listMessage @auth(level: USER) {
|
|
||||||
messages {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderName
|
|
||||||
content
|
|
||||||
readBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getMessageById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
message(id: $id) {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderName
|
|
||||||
content
|
|
||||||
readBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterMessage(
|
|
||||||
$conversationId: UUID,
|
|
||||||
$senderName: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
messages(
|
|
||||||
where: {
|
|
||||||
conversationId: { eq: $conversationId }
|
|
||||||
senderName: { eq: $senderName }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
conversationId
|
|
||||||
senderName
|
|
||||||
content
|
|
||||||
readBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
mutation CreateOrder(
|
|
||||||
$orderNumber: String!,
|
|
||||||
$partnerId: UUID!,
|
|
||||||
$orderType: OrderType,
|
|
||||||
$orderStatus: OrderStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order_insert(
|
|
||||||
data: {
|
|
||||||
orderNumber: $orderNumber
|
|
||||||
partnerId: $partnerId
|
|
||||||
orderType: $orderType
|
|
||||||
orderStatus: $orderStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateOrder(
|
|
||||||
$id: UUID!,
|
|
||||||
$orderNumber: String,
|
|
||||||
$partnerId: UUID,
|
|
||||||
$orderType: OrderType,
|
|
||||||
$orderStatus: OrderStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
orderNumber: $orderNumber
|
|
||||||
partnerId: $partnerId
|
|
||||||
orderType: $orderType
|
|
||||||
orderStatus: $orderStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteOrder(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
query listOrder @auth(level: USER) {
|
|
||||||
orders {
|
|
||||||
id
|
|
||||||
orderNumber
|
|
||||||
partnerId
|
|
||||||
orderType
|
|
||||||
orderStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getOrderById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
order(id: $id) {
|
|
||||||
id
|
|
||||||
orderNumber
|
|
||||||
partnerId
|
|
||||||
orderType
|
|
||||||
orderStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterOrder(
|
|
||||||
$orderNumber: String,
|
|
||||||
$partnerId: UUID,
|
|
||||||
$orderType: OrderType,
|
|
||||||
$orderStatus: OrderStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
orders(
|
|
||||||
where: {
|
|
||||||
orderNumber: { eq: $orderNumber }
|
|
||||||
partnerId: { eq: $partnerId }
|
|
||||||
orderType: { eq: $orderType }
|
|
||||||
orderStatus: { eq: $orderStatus }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
orderNumber
|
|
||||||
partnerId
|
|
||||||
orderType
|
|
||||||
orderStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation CreatePartner(
|
|
||||||
$partnerName: String!,
|
|
||||||
$partnerNumber: String!,
|
|
||||||
$partnerType: PartnerType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
partner_insert(
|
|
||||||
data: {
|
|
||||||
partnerName: $partnerName
|
|
||||||
partnerNumber: $partnerNumber
|
|
||||||
partnerType: $partnerType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdatePartner(
|
|
||||||
$id: UUID!,
|
|
||||||
$partnerName: String,
|
|
||||||
$partnerNumber: String,
|
|
||||||
$partnerType: PartnerType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
partner_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
partnerName: $partnerName
|
|
||||||
partnerNumber: $partnerNumber
|
|
||||||
partnerType: $partnerType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeletePartner(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
partner_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
# dataconnect/connector/partner/queries.gql
|
|
||||||
|
|
||||||
query listPartner @auth(level: USER) {
|
|
||||||
partners {
|
|
||||||
id
|
|
||||||
partnerName
|
|
||||||
partnerNumber
|
|
||||||
partnerType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getPartnerById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
partner(id: $id) {
|
|
||||||
id
|
|
||||||
partnerName
|
|
||||||
partnerNumber
|
|
||||||
partnerType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterPartner(
|
|
||||||
$partnerName: String,
|
|
||||||
$partnerNumber: String,
|
|
||||||
$partnerType: PartnerType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
partners(
|
|
||||||
where: {
|
|
||||||
partnerName: { eq: $partnerName }
|
|
||||||
partnerNumber: { eq: $partnerNumber }
|
|
||||||
partnerType: { eq: $partnerType }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
partnerName
|
|
||||||
partnerNumber
|
|
||||||
partnerType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation CreateSector(
|
|
||||||
$sectorNumber: String!,
|
|
||||||
$sectorName: String!,
|
|
||||||
$sectorType: SectorType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
sector_insert(
|
|
||||||
data: {
|
|
||||||
sectorNumber: $sectorNumber
|
|
||||||
sectorName: $sectorName
|
|
||||||
sectorType: $sectorType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateSector(
|
|
||||||
$id: UUID!,
|
|
||||||
$sectorNumber: String,
|
|
||||||
$sectorName: String,
|
|
||||||
$sectorType: SectorType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
sector_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
sectorNumber: $sectorNumber
|
|
||||||
sectorName: $sectorName
|
|
||||||
sectorType: $sectorType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteSector(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
sector_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
query listSector @auth(level: USER) {
|
|
||||||
sectors {
|
|
||||||
id
|
|
||||||
sectorNumber
|
|
||||||
sectorName
|
|
||||||
sectorType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getSectorById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
sector(id: $id) {
|
|
||||||
id
|
|
||||||
sectorNumber
|
|
||||||
sectorName
|
|
||||||
sectorType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterSector(
|
|
||||||
$sectorNumber: String,
|
|
||||||
$sectorName: String,
|
|
||||||
$sectorType: SectorType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
sectors(
|
|
||||||
where: {
|
|
||||||
sectorNumber: { eq: $sectorNumber }
|
|
||||||
sectorName: { eq: $sectorName }
|
|
||||||
sectorType: { eq: $sectorType }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
sectorNumber
|
|
||||||
sectorName
|
|
||||||
sectorType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
mutation CreateShift(
|
|
||||||
$shiftName: String!,
|
|
||||||
$startDate: Timestamp!,
|
|
||||||
$endDate: Timestamp,
|
|
||||||
$assignedStaff: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift_insert(
|
|
||||||
data: {
|
|
||||||
shiftName: $shiftName
|
|
||||||
startDate: $startDate
|
|
||||||
endDate: $endDate
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateShift(
|
|
||||||
$id: UUID!,
|
|
||||||
$shiftName: String,
|
|
||||||
$startDate: Timestamp,
|
|
||||||
$endDate: Timestamp,
|
|
||||||
$assignedStaff: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
shiftName: $shiftName
|
|
||||||
startDate: $startDate
|
|
||||||
endDate: $endDate
|
|
||||||
assignedStaff: $assignedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteShift(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
query listShift @auth(level: USER) {
|
|
||||||
shifts {
|
|
||||||
id
|
|
||||||
shiftName
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
assignedStaff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getShiftById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shift(id: $id) {
|
|
||||||
id
|
|
||||||
shiftName
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
assignedStaff
|
|
||||||
createdDate
|
|
||||||
updatedDate
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterShift(
|
|
||||||
$shiftName: String,
|
|
||||||
$startDate: Timestamp,
|
|
||||||
$endDate: Timestamp
|
|
||||||
) @auth(level: USER) {
|
|
||||||
shifts(
|
|
||||||
where: {
|
|
||||||
shiftName: { eq: $shiftName }
|
|
||||||
startDate: { eq: $startDate }
|
|
||||||
endDate: { eq: $endDate }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
shiftName
|
|
||||||
startDate
|
|
||||||
endDate
|
|
||||||
assignedStaff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
mutation CreateStaff(
|
|
||||||
$employeeName: String!,
|
|
||||||
$vendorId: String,
|
|
||||||
$vendorName: String,
|
|
||||||
$manager: String,
|
|
||||||
$contactNumber: String,
|
|
||||||
$phone:String # nuevo,
|
|
||||||
$email: String,
|
|
||||||
$department: StaffDepartment,
|
|
||||||
$hubLocation: String,
|
|
||||||
$eventLocation:String, # nuevo
|
|
||||||
$address:String, # nuevo
|
|
||||||
$city:String, # nuevo
|
|
||||||
$track: String,
|
|
||||||
$position: String,
|
|
||||||
$position2:String, # nuevo
|
|
||||||
$initial:String, # nuevo
|
|
||||||
$profileType: ProfileType,
|
|
||||||
$employmentType: EmploymentType,
|
|
||||||
$english: EnglishLevel,
|
|
||||||
$rate: Float,
|
|
||||||
$rating: Float,
|
|
||||||
$reliabilityScore: Int,
|
|
||||||
$backgroundCheckStatus: BackgroundCheckStatus,
|
|
||||||
$notes: String,
|
|
||||||
$accountingComments:String, # nuevo
|
|
||||||
$shiftCoveragePercentage:Int, # nuevo
|
|
||||||
$cancellationCount:Int, # nuevo
|
|
||||||
$noShowCount:Int, # nuevo
|
|
||||||
$totalShifts:Int, # nuevo
|
|
||||||
$invoiced:Boolean, # nuevo
|
|
||||||
$englishRequired:Boolean, # nuevo
|
|
||||||
$checkIn:String, # nuevo
|
|
||||||
$scheduleDays:String, # nuevo
|
|
||||||
$replacedBy:String, # nuevo
|
|
||||||
$action:String, # nuevo
|
|
||||||
$ro:String, # nuevo
|
|
||||||
$mon:String, # nuevo
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff_insert(
|
|
||||||
data: {
|
|
||||||
employeeName: $employeeName
|
|
||||||
vendorId: $vendorId
|
|
||||||
vendorName: $vendorName
|
|
||||||
manager: $manager
|
|
||||||
contactNumber: $contactNumber
|
|
||||||
phone:$phone
|
|
||||||
email: $email
|
|
||||||
department: $department
|
|
||||||
hubLocation: $hubLocation
|
|
||||||
eventLocation:$eventLocation
|
|
||||||
address:$address
|
|
||||||
city:$city
|
|
||||||
track: $track
|
|
||||||
position: $position
|
|
||||||
position2:$position2
|
|
||||||
initial:$initial
|
|
||||||
profileType: $profileType
|
|
||||||
employmentType: $employmentType
|
|
||||||
english: $english
|
|
||||||
rate: $rate
|
|
||||||
rating: $rating
|
|
||||||
reliabilityScore: $reliabilityScore
|
|
||||||
backgroundCheckStatus: $backgroundCheckStatus
|
|
||||||
notes: $notes
|
|
||||||
accountingComments:$accountingComments
|
|
||||||
shiftCoveragePercentage:$shiftCoveragePercentage
|
|
||||||
cancellationCount:$cancellationCount
|
|
||||||
noShowCount:$noShowCount
|
|
||||||
totalShifts:$totalShifts
|
|
||||||
invoiced:$invoiced
|
|
||||||
englishRequired:$englishRequired
|
|
||||||
checkIn:$checkIn
|
|
||||||
scheduleDays:$scheduleDays
|
|
||||||
replacedBy:$replacedBy
|
|
||||||
action:$action
|
|
||||||
ro:$ro
|
|
||||||
mon:$mon
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateStaff(
|
|
||||||
$id: UUID!,
|
|
||||||
$employeeName: String,
|
|
||||||
$vendorId: String,
|
|
||||||
$vendorName: String,
|
|
||||||
$manager: String,
|
|
||||||
$contactNumber: String,
|
|
||||||
$phone: String,
|
|
||||||
$email: String,
|
|
||||||
$department: StaffDepartment,
|
|
||||||
$hubLocation: String,
|
|
||||||
$eventLocation: String,
|
|
||||||
$address: String,
|
|
||||||
$city: String,
|
|
||||||
$track: String,
|
|
||||||
$position: String,
|
|
||||||
$position2:String,
|
|
||||||
$initial:String,
|
|
||||||
$profileType: ProfileType,
|
|
||||||
$employmentType: EmploymentType,
|
|
||||||
$english: EnglishLevel,
|
|
||||||
$englishRequired:Boolean # nuevo
|
|
||||||
$rate: Float,
|
|
||||||
$rating: Float,
|
|
||||||
$reliabilityScore: Int,
|
|
||||||
$backgroundCheckStatus: BackgroundCheckStatus,
|
|
||||||
$notes: String,
|
|
||||||
$accountingComments:String,
|
|
||||||
$shiftCoveragePercentage:Int,
|
|
||||||
$cancellationCount:Int,
|
|
||||||
$noShowCount:Int,
|
|
||||||
$totalShifts:Int,
|
|
||||||
$invoiced:Boolean,
|
|
||||||
$checkIn:String,
|
|
||||||
$scheduleDays:String,
|
|
||||||
$replacedBy:String,
|
|
||||||
$action:String,
|
|
||||||
$ro:String,
|
|
||||||
$mon:String,
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
employeeName: $employeeName
|
|
||||||
vendorId: $vendorId
|
|
||||||
vendorName: $vendorName
|
|
||||||
manager: $manager
|
|
||||||
contactNumber: $contactNumber
|
|
||||||
phone:$phone # nuevo
|
|
||||||
email: $email
|
|
||||||
department: $department
|
|
||||||
hubLocation: $hubLocation
|
|
||||||
eventLocation:$eventLocation # nuevo
|
|
||||||
address:$address # nuevo
|
|
||||||
city:$city # nuevo
|
|
||||||
track: $track
|
|
||||||
position: $position
|
|
||||||
position2:$position2 # nuevo
|
|
||||||
initial:$initial # nuevo
|
|
||||||
profileType: $profileType
|
|
||||||
employmentType: $employmentType
|
|
||||||
english: $english
|
|
||||||
englishRequired:$englishRequired # nuevo
|
|
||||||
rate: $rate
|
|
||||||
rating: $rating
|
|
||||||
reliabilityScore: $reliabilityScore
|
|
||||||
backgroundCheckStatus: $backgroundCheckStatus
|
|
||||||
notes: $notes
|
|
||||||
accountingComments:$accountingComments # nuevo
|
|
||||||
shiftCoveragePercentage:$shiftCoveragePercentage # nuevo
|
|
||||||
cancellationCount:$cancellationCount # nuevo
|
|
||||||
noShowCount:$noShowCount # nuevo
|
|
||||||
totalShifts:$totalShifts # nuevo
|
|
||||||
invoiced:$invoiced # nuevo
|
|
||||||
checkIn:$checkIn # nuevo
|
|
||||||
scheduleDays:$scheduleDays # nuevo
|
|
||||||
replacedBy:$replacedBy # nuevo
|
|
||||||
action:$action # nuevo
|
|
||||||
ro:$ro # nuevo
|
|
||||||
mon:$mon # nuevo
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteStaff(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
query listStaff @auth(level: USER) {
|
|
||||||
staffs {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
manager
|
|
||||||
contactNumber
|
|
||||||
phone # nuevo
|
|
||||||
email
|
|
||||||
department
|
|
||||||
hubLocation
|
|
||||||
eventLocation # nuevo
|
|
||||||
address # nuevo
|
|
||||||
city # nuevo
|
|
||||||
track
|
|
||||||
position
|
|
||||||
position2
|
|
||||||
initial # nuevo
|
|
||||||
profileType
|
|
||||||
employmentType
|
|
||||||
english
|
|
||||||
englishRequired # nuevo
|
|
||||||
rate
|
|
||||||
rating
|
|
||||||
reliabilityScore
|
|
||||||
backgroundCheckStatus
|
|
||||||
notes
|
|
||||||
accountingComments # nuevo
|
|
||||||
shiftCoveragePercentage # nuevo
|
|
||||||
cancellationCount # nuevo
|
|
||||||
noShowCount # nuevo
|
|
||||||
totalShifts # nuevo
|
|
||||||
invoiced # nuevo
|
|
||||||
checkIn # nuevo
|
|
||||||
scheduleDays # nuevo
|
|
||||||
replacedBy # nuevo
|
|
||||||
action # nuevo
|
|
||||||
ro # nuevo
|
|
||||||
mon # nuevo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getStaffById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staff(id: $id) {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
manager
|
|
||||||
contactNumber
|
|
||||||
phone # nuevo
|
|
||||||
email
|
|
||||||
department
|
|
||||||
hubLocation
|
|
||||||
eventLocation # nuevo
|
|
||||||
address # nuevo
|
|
||||||
city # nuevo
|
|
||||||
track
|
|
||||||
position
|
|
||||||
position2 # nuevo
|
|
||||||
initial # nuevo
|
|
||||||
profileType
|
|
||||||
employmentType
|
|
||||||
english
|
|
||||||
rate
|
|
||||||
rating
|
|
||||||
reliabilityScore
|
|
||||||
backgroundCheckStatus
|
|
||||||
notes
|
|
||||||
accountingComments # nuevo
|
|
||||||
shiftCoveragePercentage # nuevo
|
|
||||||
cancellationCount # nuevo
|
|
||||||
noShowCount # nuevo
|
|
||||||
totalShifts # nuevo
|
|
||||||
invoiced # nuevo
|
|
||||||
englishRequired # nuevo
|
|
||||||
checkIn # nuevo
|
|
||||||
scheduleDays # nuevo
|
|
||||||
replacedBy # nuevo
|
|
||||||
action # nuevo
|
|
||||||
ro # nuevo
|
|
||||||
mon # nuevo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterStaff(
|
|
||||||
$employeeName: String,
|
|
||||||
$vendorId: String,
|
|
||||||
$department: StaffDepartment,
|
|
||||||
$employmentType: EmploymentType,
|
|
||||||
$english: EnglishLevel,
|
|
||||||
$backgroundCheckStatus: BackgroundCheckStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
staffs(
|
|
||||||
where: {
|
|
||||||
employeeName: { eq: $employeeName }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
department: { eq: $department }
|
|
||||||
employmentType: { eq: $employmentType }
|
|
||||||
english: { eq: $english }
|
|
||||||
backgroundCheckStatus: { eq: $backgroundCheckStatus }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
employeeName
|
|
||||||
vendorId
|
|
||||||
vendorName
|
|
||||||
department
|
|
||||||
hubLocation
|
|
||||||
eventLocation # nuevo
|
|
||||||
position
|
|
||||||
position2
|
|
||||||
employmentType
|
|
||||||
english
|
|
||||||
rate
|
|
||||||
rating
|
|
||||||
reliabilityScore
|
|
||||||
backgroundCheckStatus
|
|
||||||
notes
|
|
||||||
invoiced # nuevo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
mutation CreateTeam(
|
|
||||||
$teamName: String!,
|
|
||||||
$ownerId: String!,
|
|
||||||
$ownerName: String!,
|
|
||||||
$ownerRole: TeamOwnerRole!,
|
|
||||||
$favoriteStaff: String,
|
|
||||||
$blockedStaff: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team_insert(
|
|
||||||
data: {
|
|
||||||
teamName: $teamName
|
|
||||||
ownerId: $ownerId
|
|
||||||
ownerName: $ownerName
|
|
||||||
ownerRole: $ownerRole
|
|
||||||
favoriteStaff: $favoriteStaff
|
|
||||||
blockedStaff: $blockedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateTeam(
|
|
||||||
$id: UUID!,
|
|
||||||
$teamName: String,
|
|
||||||
$ownerId: String,
|
|
||||||
$ownerName: String,
|
|
||||||
$ownerRole: TeamOwnerRole,
|
|
||||||
$favoriteStaff: String,
|
|
||||||
$blockedStaff: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
teamName: $teamName
|
|
||||||
ownerId: $ownerId
|
|
||||||
ownerName: $ownerName
|
|
||||||
ownerRole: $ownerRole
|
|
||||||
favoriteStaff: $favoriteStaff
|
|
||||||
blockedStaff: $blockedStaff
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteTeam(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
query listTeam (
|
|
||||||
$orderByCreatedDate: OrderDirection
|
|
||||||
$limit: Int
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teams(
|
|
||||||
orderBy: { createdDate: $orderByCreatedDate }
|
|
||||||
limit: $limit
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
team(id: $id) {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterTeam(
|
|
||||||
$teamName: String,
|
|
||||||
$ownerId: String,
|
|
||||||
$ownerRole: TeamOwnerRole
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teams(
|
|
||||||
where: {
|
|
||||||
teamName: { eq: $teamName }
|
|
||||||
ownerId: { eq: $ownerId }
|
|
||||||
ownerRole: { eq: $ownerRole }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamName
|
|
||||||
ownerId
|
|
||||||
ownerName
|
|
||||||
ownerRole
|
|
||||||
favoriteStaff
|
|
||||||
blockedStaff
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation CreateTeamHub(
|
|
||||||
$teamId: UUID!,
|
|
||||||
$hubName: String!,
|
|
||||||
$departments: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub_insert(
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
hubName: $hubName
|
|
||||||
departments: $departments
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateTeamHub(
|
|
||||||
$id: UUID!,
|
|
||||||
$teamId: UUID,
|
|
||||||
$hubName: String,
|
|
||||||
$departments: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
hubName: $hubName
|
|
||||||
departments: $departments
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteTeamHub(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
query listTeamHub @auth(level: USER) {
|
|
||||||
teamHubs {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
departments
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamHubById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHub(id: $id) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
departments
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterTeamHub(
|
|
||||||
$teamId: UUID,
|
|
||||||
$hubName: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamHubs(
|
|
||||||
where: {
|
|
||||||
teamId: { eq: $teamId }
|
|
||||||
hubName: { eq: $hubName }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
hubName
|
|
||||||
departments
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
mutation CreateTeamMember(
|
|
||||||
$teamId: UUID!,
|
|
||||||
$memberName: String!,
|
|
||||||
$email: String!,
|
|
||||||
$role: TeamMemberRole,
|
|
||||||
$isActive: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_insert(
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
memberName: $memberName
|
|
||||||
email: $email
|
|
||||||
role: $role
|
|
||||||
isActive: $isActive
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateTeamMember(
|
|
||||||
$id: UUID!,
|
|
||||||
$teamId: UUID,
|
|
||||||
$memberName: String,
|
|
||||||
$email: String,
|
|
||||||
$role: TeamMemberRole,
|
|
||||||
$isActive: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
memberName: $memberName
|
|
||||||
email: $email
|
|
||||||
role: $role
|
|
||||||
isActive: $isActive
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteTeamMember(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
query listTeamMember @auth(level: USER) {
|
|
||||||
teamMembers {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
memberName
|
|
||||||
email
|
|
||||||
role
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamMemberById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMember(id: $id) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
memberName
|
|
||||||
email
|
|
||||||
role
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterTeamMember(
|
|
||||||
$teamId: UUID,
|
|
||||||
$memberName: String,
|
|
||||||
$email: String,
|
|
||||||
$role: TeamMemberRole,
|
|
||||||
$isActive: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMembers(
|
|
||||||
where: {
|
|
||||||
teamId: { eq: $teamId }
|
|
||||||
memberName: { eq: $memberName }
|
|
||||||
email: { eq: $email }
|
|
||||||
role: { eq: $role }
|
|
||||||
isActive: { eq: $isActive }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
memberName
|
|
||||||
email
|
|
||||||
role
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
mutation CreateTeamMemberInvite(
|
|
||||||
$teamId: UUID!,
|
|
||||||
$email: String!,
|
|
||||||
$inviteStatus: TeamMemberInviteStatus!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMemberInvite_insert(
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
email: $email
|
|
||||||
inviteStatus: $inviteStatus
|
|
||||||
# inviteCode se genera por default con uuidV4()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateTeamMemberInvite(
|
|
||||||
$id: UUID!,
|
|
||||||
$teamId: UUID,
|
|
||||||
$email: String,
|
|
||||||
$inviteStatus: TeamMemberInviteStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMemberInvite_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
teamId: $teamId
|
|
||||||
email: $email
|
|
||||||
inviteStatus: $inviteStatus
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteTeamMemberInvite(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMemberInvite_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
query listTeamMemberInvite @auth(level: USER) {
|
|
||||||
teamMemberInvites {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
inviteCode
|
|
||||||
email
|
|
||||||
inviteStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getTeamMemberInviteById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMemberInvite(id: $id) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
inviteCode
|
|
||||||
email
|
|
||||||
inviteStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterTeamMemberInvite(
|
|
||||||
$teamId: UUID,
|
|
||||||
$email: String,
|
|
||||||
$inviteStatus: TeamMemberInviteStatus
|
|
||||||
) @auth(level: USER) {
|
|
||||||
teamMemberInvites(
|
|
||||||
where: {
|
|
||||||
teamId: { eq: $teamId }
|
|
||||||
email: { eq: $email }
|
|
||||||
inviteStatus: { eq: $inviteStatus }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
teamId
|
|
||||||
inviteCode
|
|
||||||
email
|
|
||||||
inviteStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
mutation CreateUser(
|
|
||||||
$id: String!, # Firebase UID
|
|
||||||
$email: String!,
|
|
||||||
$fullName: String!,
|
|
||||||
$role: UserBaseRole!,
|
|
||||||
$userRole: String,
|
|
||||||
$photoUrl: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_insert(
|
|
||||||
data: {
|
|
||||||
id: $id
|
|
||||||
email: $email
|
|
||||||
fullName: $fullName
|
|
||||||
role: $role
|
|
||||||
userRole: $userRole
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateUser(
|
|
||||||
$id: String!,
|
|
||||||
$email: String,
|
|
||||||
$fullName: String,
|
|
||||||
$role: UserBaseRole,
|
|
||||||
$userRole: String,
|
|
||||||
$photoUrl: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
email: $email
|
|
||||||
fullName: $fullName
|
|
||||||
role: $role
|
|
||||||
userRole: $userRole
|
|
||||||
photoUrl: $photoUrl
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteUser(
|
|
||||||
$id: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
query listUsers @auth(level: USER) {
|
|
||||||
users {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
createdDate
|
|
||||||
updatedDate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getUserById(
|
|
||||||
$id: String!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
user(id: $id) {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterUsers(
|
|
||||||
$id: String,
|
|
||||||
$email: String,
|
|
||||||
$role: UserBaseRole,
|
|
||||||
$userRole: String
|
|
||||||
) @auth(level: USER) {
|
|
||||||
users(
|
|
||||||
where: {
|
|
||||||
id: { eq: $id }
|
|
||||||
email: { eq: $email }
|
|
||||||
role: { eq: $role }
|
|
||||||
userRole: { eq: $userRole }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
email
|
|
||||||
fullName
|
|
||||||
role
|
|
||||||
userRole
|
|
||||||
photoUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
52
dataconnect/connector/vendor/mutations.gql
vendored
52
dataconnect/connector/vendor/mutations.gql
vendored
@@ -1,52 +0,0 @@
|
|||||||
mutation CreateVendor(
|
|
||||||
$vendorNumber: String!,
|
|
||||||
$legalName: String!,
|
|
||||||
$region: VendorRegion!,
|
|
||||||
$platformType: VendorPlatformType!,
|
|
||||||
$primaryContactEmail: String!,
|
|
||||||
$approvalStatus: VendorApprovalStatus!,
|
|
||||||
$isActive: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendor_insert(
|
|
||||||
data: {
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
legalName: $legalName
|
|
||||||
region: $region
|
|
||||||
platformType: $platformType
|
|
||||||
primaryContactEmail: $primaryContactEmail
|
|
||||||
approvalStatus: $approvalStatus
|
|
||||||
isActive: $isActive
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateVendor(
|
|
||||||
$id: UUID!,
|
|
||||||
$vendorNumber: String,
|
|
||||||
$legalName: String,
|
|
||||||
$region: VendorRegion,
|
|
||||||
$platformType: VendorPlatformType,
|
|
||||||
$primaryContactEmail: String,
|
|
||||||
$approvalStatus: VendorApprovalStatus,
|
|
||||||
$isActive: Boolean
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendor_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
vendorNumber: $vendorNumber
|
|
||||||
legalName: $legalName
|
|
||||||
region: $region
|
|
||||||
platformType: $platformType
|
|
||||||
primaryContactEmail: $primaryContactEmail
|
|
||||||
approvalStatus: $approvalStatus
|
|
||||||
isActive: $isActive
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteVendor(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendor_delete(id: $id)
|
|
||||||
}
|
|
||||||
|
|
||||||
57
dataconnect/connector/vendor/queries.gql
vendored
57
dataconnect/connector/vendor/queries.gql
vendored
@@ -1,57 +0,0 @@
|
|||||||
query listVendor @auth(level: USER) {
|
|
||||||
vendors {
|
|
||||||
id
|
|
||||||
vendorNumber
|
|
||||||
legalName
|
|
||||||
region
|
|
||||||
platformType
|
|
||||||
primaryContactEmail
|
|
||||||
approvalStatus
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getVendorById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendor(id: $id) {
|
|
||||||
id
|
|
||||||
vendorNumber
|
|
||||||
legalName
|
|
||||||
region
|
|
||||||
platformType
|
|
||||||
primaryContactEmail
|
|
||||||
approvalStatus
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterVendors(
|
|
||||||
$region: VendorRegion,
|
|
||||||
$approvalStatus: VendorApprovalStatus,
|
|
||||||
$isActive: Boolean,
|
|
||||||
$vendorNumber:String,
|
|
||||||
$primaryContactEmail:String,
|
|
||||||
$legalName: String,
|
|
||||||
$platformType: VendorPlatformType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendors(where:{
|
|
||||||
region: { eq: $region }
|
|
||||||
approvalStatus: { eq: $approvalStatus }
|
|
||||||
isActive: { eq: $isActive }
|
|
||||||
vendorNumber: { eq: $vendorNumber }
|
|
||||||
primaryContactEmail: { eq: $primaryContactEmail }
|
|
||||||
legalName: { eq: $legalName }
|
|
||||||
platformType: { eq: $platformType }
|
|
||||||
|
|
||||||
}) {
|
|
||||||
id
|
|
||||||
vendorNumber
|
|
||||||
legalName
|
|
||||||
region
|
|
||||||
platformType
|
|
||||||
primaryContactEmail
|
|
||||||
approvalStatus
|
|
||||||
isActive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
mutation CreateVendorDefaultSetting(
|
|
||||||
$vendorName: String!,
|
|
||||||
$defaultMarkupPercentage: Float!,
|
|
||||||
$defaultVendorFeePercentage: Float!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorDefaultSetting_insert(
|
|
||||||
data: {
|
|
||||||
vendorName: $vendorName
|
|
||||||
defaultMarkupPercentage: $defaultMarkupPercentage
|
|
||||||
defaultVendorFeePercentage: $defaultVendorFeePercentage
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateVendorDefaultSetting(
|
|
||||||
$id: UUID!,
|
|
||||||
$vendorName: String,
|
|
||||||
$defaultMarkupPercentage: Float,
|
|
||||||
$defaultVendorFeePercentage: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorDefaultSetting_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
vendorName: $vendorName
|
|
||||||
defaultMarkupPercentage: $defaultMarkupPercentage
|
|
||||||
defaultVendorFeePercentage: $defaultVendorFeePercentage
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteVendorDefaultSetting(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorDefaultSetting_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
query listVendorDefaultSettings @auth(level: USER) {
|
|
||||||
vendorDefaultSettings {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
defaultMarkupPercentage
|
|
||||||
defaultVendorFeePercentage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getVendorDefaultSettingById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorDefaultSetting(id: $id) {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
defaultMarkupPercentage
|
|
||||||
defaultVendorFeePercentage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterVendorDefaultSettings(
|
|
||||||
$vendorName: String,
|
|
||||||
$defaultMarkupPercentage: Float,
|
|
||||||
$defaultVendorFeePercentage: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorDefaultSettings(
|
|
||||||
where: {
|
|
||||||
vendorName: { eq: $vendorName }
|
|
||||||
defaultMarkupPercentage: { eq: $defaultMarkupPercentage }
|
|
||||||
defaultVendorFeePercentage: { eq: $defaultVendorFeePercentage }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
defaultMarkupPercentage
|
|
||||||
defaultVendorFeePercentage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
mutation CreateVendorRate(
|
|
||||||
$vendorName: String!,
|
|
||||||
$category: VendorRateCategory!,
|
|
||||||
$roleName: String!,
|
|
||||||
$employeeWage: Float!,
|
|
||||||
$markupPercentage: Float,
|
|
||||||
$vendorFeePercentage: Float,
|
|
||||||
$clientRate: Float!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorRate_insert(
|
|
||||||
data: {
|
|
||||||
vendorName: $vendorName
|
|
||||||
category: $category
|
|
||||||
roleName: $roleName
|
|
||||||
employeeWage: $employeeWage
|
|
||||||
markupPercentage: $markupPercentage
|
|
||||||
vendorFeePercentage: $vendorFeePercentage
|
|
||||||
clientRate: $clientRate
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateVendorRate(
|
|
||||||
$id: UUID!,
|
|
||||||
$vendorName: String,
|
|
||||||
$category: VendorRateCategory,
|
|
||||||
$roleName: String,
|
|
||||||
$employeeWage: Float,
|
|
||||||
$markupPercentage: Float,
|
|
||||||
$vendorFeePercentage: Float,
|
|
||||||
$clientRate: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorRate_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
vendorName: $vendorName
|
|
||||||
category: $category
|
|
||||||
roleName: $roleName
|
|
||||||
employeeWage: $employeeWage
|
|
||||||
markupPercentage: $markupPercentage
|
|
||||||
vendorFeePercentage: $vendorFeePercentage
|
|
||||||
clientRate: $clientRate
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteVendorRate(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorRate_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
query listVendorRate @auth(level: USER) {
|
|
||||||
vendorRates {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
category
|
|
||||||
roleName
|
|
||||||
employeeWage
|
|
||||||
markupPercentage
|
|
||||||
vendorFeePercentage
|
|
||||||
clientRate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getVendorRateById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorRate(id: $id) {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
category
|
|
||||||
roleName
|
|
||||||
employeeWage
|
|
||||||
markupPercentage
|
|
||||||
vendorFeePercentage
|
|
||||||
clientRate
|
|
||||||
createdDate
|
|
||||||
updatedDate
|
|
||||||
createdBy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterVendorRates(
|
|
||||||
$vendorName: String,
|
|
||||||
$category: VendorRateCategory,
|
|
||||||
$roleName: String,
|
|
||||||
$minClientRate: Float,
|
|
||||||
$maxClientRate: Float
|
|
||||||
) @auth(level: USER) {
|
|
||||||
vendorRates(
|
|
||||||
where: {
|
|
||||||
vendorName: { eq: $vendorName }
|
|
||||||
category: { eq: $category }
|
|
||||||
roleName: { eq: $roleName }
|
|
||||||
clientRate: { ge: $minClientRate, le: $maxClientRate }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
vendorName
|
|
||||||
category
|
|
||||||
roleName
|
|
||||||
employeeWage
|
|
||||||
markupPercentage
|
|
||||||
vendorFeePercentage
|
|
||||||
clientRate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
mutation CreateWorkforce(
|
|
||||||
$workforceNumber: String!,
|
|
||||||
$vendorId: UUID!,
|
|
||||||
$firstName: String!,
|
|
||||||
$lastName: String!,
|
|
||||||
$employmentType: WorkforceEmploymentType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
workforce_insert(
|
|
||||||
data: {
|
|
||||||
workforceNumber: $workforceNumber
|
|
||||||
vendorId: $vendorId
|
|
||||||
firstName: $firstName
|
|
||||||
lastName: $lastName
|
|
||||||
employmentType: $employmentType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation UpdateWorkforce(
|
|
||||||
$id: UUID!,
|
|
||||||
$workforceNumber: String,
|
|
||||||
$vendorId: UUID,
|
|
||||||
$firstName: String,
|
|
||||||
$lastName: String,
|
|
||||||
$employmentType: WorkforceEmploymentType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
workforce_update(
|
|
||||||
id: $id,
|
|
||||||
data: {
|
|
||||||
workforceNumber: $workforceNumber
|
|
||||||
vendorId: $vendorId
|
|
||||||
firstName: $firstName
|
|
||||||
lastName: $lastName
|
|
||||||
employmentType: $employmentType
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutation DeleteWorkforce(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
workforce_delete(id: $id)
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
query listWorkforce @auth(level: USER) {
|
|
||||||
workforces {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
vendorId
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
employmentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query getWorkforceById(
|
|
||||||
$id: UUID!
|
|
||||||
) @auth(level: USER) {
|
|
||||||
workforce(id: $id) {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
vendorId
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
employmentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
query filterWorkforce(
|
|
||||||
$workforceNumber: String,
|
|
||||||
$vendorId: UUID,
|
|
||||||
$firstName: String,
|
|
||||||
$lastName: String,
|
|
||||||
$employmentType: WorkforceEmploymentType
|
|
||||||
) @auth(level: USER) {
|
|
||||||
workforces(
|
|
||||||
where: {
|
|
||||||
workforceNumber: { eq: $workforceNumber }
|
|
||||||
vendorId: { eq: $vendorId }
|
|
||||||
firstName: { eq: $firstName }
|
|
||||||
lastName: { eq: $lastName }
|
|
||||||
employmentType: { eq: $employmentType }
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
workforceNumber
|
|
||||||
vendorId
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
employmentType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
specVersion: "v1"
|
|
||||||
serviceId: "krow-workforce-db"
|
|
||||||
location: "us-central1"
|
|
||||||
schema:
|
|
||||||
source: "./schema"
|
|
||||||
datasource:
|
|
||||||
postgresql:
|
|
||||||
database: "krow_db"
|
|
||||||
cloudSql:
|
|
||||||
instanceId: "krow-sql"
|
|
||||||
# schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly.
|
|
||||||
# schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect.
|
|
||||||
connectorDirs: ["./connector"]
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
connectorId: example
|
|
||||||
generate:
|
|
||||||
javascriptSdk:
|
|
||||||
- outputDir: ../../frontend-web/src/dataconnect-generated
|
|
||||||
package: "@dataconnect/generated"
|
|
||||||
packageJsonDir: ../../frontend-web
|
|
||||||
react: true
|
|
||||||
angular: false
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# Example mutations for a simple movie app
|
|
||||||
|
|
||||||
# Create a movie based on user input
|
|
||||||
mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!)
|
|
||||||
@auth(level: USER_EMAIL_VERIFIED, insecureReason: "Any email verified users can create a new movie.") {
|
|
||||||
movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl })
|
|
||||||
}
|
|
||||||
|
|
||||||
# Upsert (update or insert) a user's username based on their auth.uid
|
|
||||||
mutation UpsertUser($username: String!) @auth(level: USER) {
|
|
||||||
# The "auth.uid" server value ensures that users can only register their own user.
|
|
||||||
user_upsert(data: { id_expr: "auth.uid", username: $username })
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add a review for a movie
|
|
||||||
mutation AddReview($movieId: UUID!, $rating: Int!, $reviewText: String!)
|
|
||||||
@auth(level: USER) {
|
|
||||||
review_upsert(
|
|
||||||
data: {
|
|
||||||
userId_expr: "auth.uid"
|
|
||||||
movieId: $movieId
|
|
||||||
rating: $rating
|
|
||||||
reviewText: $reviewText
|
|
||||||
# reviewDate defaults to today in the schema. No need to set it manually.
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Logged in user can delete their review for a movie
|
|
||||||
mutation DeleteReview($movieId: UUID!) @auth(level: USER) {
|
|
||||||
# The "auth.uid" server value ensures that users can only delete their own reviews.
|
|
||||||
review_delete(key: { userId_expr: "auth.uid", movieId: $movieId })
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# Example queries for a simple movie app.
|
|
||||||
|
|
||||||
# @auth() directives control who can call each operation.
|
|
||||||
# Anyone should be able to list all movies, so the auth level is set to PUBLIC
|
|
||||||
query ListMovies @auth(level: PUBLIC, insecureReason: "Anyone can list all movies.") {
|
|
||||||
movies {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
imageUrl
|
|
||||||
genre
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# List all users, only admins should be able to list all users, so we use NO_ACCESS
|
|
||||||
query ListUsers @auth(level: NO_ACCESS) {
|
|
||||||
users {
|
|
||||||
id
|
|
||||||
username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Logged in users can list all their reviews and movie titles associated with the review
|
|
||||||
# Since the query uses the uid of the current authenticated user, we set auth level to USER
|
|
||||||
query ListUserReviews @auth(level: USER) {
|
|
||||||
user(key: { id_expr: "auth.uid" }) {
|
|
||||||
id
|
|
||||||
username
|
|
||||||
# <field>_on_<foreign_key_field> makes it easy to grab info from another table
|
|
||||||
# Here, we use it to grab all the reviews written by the user.
|
|
||||||
reviews: reviews_on_user {
|
|
||||||
rating
|
|
||||||
reviewDate
|
|
||||||
reviewText
|
|
||||||
movie {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get movie by id
|
|
||||||
query GetMovieById($id: UUID!) @auth(level: PUBLIC, insecureReason: "Anyone can get a movie by id.") {
|
|
||||||
movie(id: $id) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
imageUrl
|
|
||||||
genre
|
|
||||||
metadata: movieMetadata_on_movie {
|
|
||||||
rating
|
|
||||||
releaseYear
|
|
||||||
description
|
|
||||||
}
|
|
||||||
reviews: reviews_on_movie {
|
|
||||||
reviewText
|
|
||||||
reviewDate
|
|
||||||
rating
|
|
||||||
user {
|
|
||||||
id
|
|
||||||
username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Search for movies, actors, and reviews
|
|
||||||
query SearchMovie($titleInput: String, $genre: String) @auth(level: PUBLIC, insecureReason: "Anyone can search for movies.") {
|
|
||||||
movies(
|
|
||||||
where: {
|
|
||||||
_and: [{ genre: { eq: $genre } }, { title: { contains: $titleInput } }]
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
genre
|
|
||||||
imageUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
# Example schema for simple movie review app
|
|
||||||
|
|
||||||
# User table is keyed by Firebase Auth UID.
|
|
||||||
type User @table {
|
|
||||||
# `@default(expr: "auth.uid")` sets it to Firebase Auth UID during insert and upsert.
|
|
||||||
id: String! @default(expr: "auth.uid")
|
|
||||||
username: String! @col(dataType: "varchar(50)")
|
|
||||||
# The `user: User!` field in the Review table generates the following one-to-many query field.
|
|
||||||
# reviews_on_user: [Review!]!
|
|
||||||
# The `Review` join table the following many-to-many query field.
|
|
||||||
# movies_via_Review: [Movie!]!
|
|
||||||
}
|
|
||||||
|
|
||||||
# Movie is keyed by a randomly generated UUID.
|
|
||||||
type Movie @table {
|
|
||||||
# If you do not pass a 'key' to `@table`, Data Connect automatically adds the following 'id' column.
|
|
||||||
# Feel free to uncomment and customize it.
|
|
||||||
# id: UUID! @default(expr: "uuidV4()")
|
|
||||||
title: String!
|
|
||||||
imageUrl: String!
|
|
||||||
genre: String
|
|
||||||
}
|
|
||||||
|
|
||||||
# MovieMetadata is a metadata attached to a Movie.
|
|
||||||
# Movie <-> MovieMetadata is a one-to-one relationship
|
|
||||||
type MovieMetadata @table {
|
|
||||||
# @unique ensures each Movie can only one MovieMetadata.
|
|
||||||
movie: Movie! @unique
|
|
||||||
# The movie field adds the following foreign key field. Feel free to uncomment and customize it.
|
|
||||||
# movieId: UUID!
|
|
||||||
rating: Float
|
|
||||||
releaseYear: Int
|
|
||||||
description: String
|
|
||||||
}
|
|
||||||
|
|
||||||
# Reviews is a join table between User and Movie.
|
|
||||||
# It has a composite primary keys `userUid` and `movieId`.
|
|
||||||
# A user can leave reviews for many movies. A movie can have reviews from many users.
|
|
||||||
# User <-> Review is a one-to-many relationship
|
|
||||||
# Movie <-> Review is a one-to-many relationship
|
|
||||||
# Movie <-> User is a many-to-many relationship
|
|
||||||
type Review @table(name: "Reviews", key: ["movie", "user"]) {
|
|
||||||
user: User!
|
|
||||||
# The user field adds the following foreign key field. Feel free to uncomment and customize it.
|
|
||||||
# userUid: String!
|
|
||||||
movie: Movie!
|
|
||||||
# The movie field adds the following foreign key field. Feel free to uncomment and customize it.
|
|
||||||
# movieId: UUID!
|
|
||||||
rating: Int
|
|
||||||
reviewText: String
|
|
||||||
reviewDate: Date! @default(expr: "request.time")
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
enum VendorRateCategory {
|
|
||||||
KITCHEN_AND_CULINARY
|
|
||||||
CONCESSIONS
|
|
||||||
FACILITIES
|
|
||||||
BARTENDING
|
|
||||||
SECURITY
|
|
||||||
EVENT_STAFF
|
|
||||||
MANAGEMENT
|
|
||||||
TECHNICAL
|
|
||||||
OTHER
|
|
||||||
}
|
|
||||||
|
|
||||||
type VendorRate @table(name: "vendor_rates") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
vendorName: String!
|
|
||||||
category: VendorRateCategory!
|
|
||||||
roleName: String!
|
|
||||||
employeeWage: Float!
|
|
||||||
markupPercentage: Float
|
|
||||||
vendorFeePercentage: Float
|
|
||||||
clientRate: Float!
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
enum ActivityType {
|
|
||||||
EVENT_CREATED
|
|
||||||
EVENT_UPDATED
|
|
||||||
STAFF_ASSIGNED
|
|
||||||
INVOICE_PAID
|
|
||||||
INVOICE_CREATED
|
|
||||||
VENDOR_APPROVED
|
|
||||||
MESSAGE_RECEIVED
|
|
||||||
}
|
|
||||||
|
|
||||||
type ActivityLog @table(name: "activity_logs") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
title: String!
|
|
||||||
description: String!
|
|
||||||
activityType: ActivityType!
|
|
||||||
userId: String! # user_id (FK lógica a User.id)
|
|
||||||
isRead: Boolean @default(expr: "false")
|
|
||||||
iconType: String
|
|
||||||
iconColor: String
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
enum AssignmentStatus {
|
|
||||||
PENDING
|
|
||||||
CONFIRMED
|
|
||||||
CHECKED_IN
|
|
||||||
IN_PROGRESS
|
|
||||||
COMPLETED
|
|
||||||
CANCELLED
|
|
||||||
NO_SHOW
|
|
||||||
}
|
|
||||||
|
|
||||||
type Assignment @table(name: "assignments") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
assignmentNumber: String
|
|
||||||
orderId: UUID! # order_id (FK lógica a Order.id)
|
|
||||||
workforceId: UUID! # workforce_id (FK lógica a Workforce.id)
|
|
||||||
vendorId: UUID! # vendor_id (FK lógica a Vendor.id)
|
|
||||||
role: String!
|
|
||||||
assignmentStatus: AssignmentStatus!
|
|
||||||
scheduledStart: Timestamp!
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
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")
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
enum CertificationType {
|
|
||||||
LEGAL
|
|
||||||
OPERATIONAL
|
|
||||||
SAFETY
|
|
||||||
TRAINING
|
|
||||||
LICENSE
|
|
||||||
OTHER
|
|
||||||
}
|
|
||||||
|
|
||||||
enum CertificationStatus {
|
|
||||||
CURRENT
|
|
||||||
EXPIRING_SOON
|
|
||||||
EXPIRED
|
|
||||||
PENDING_VALIDATION
|
|
||||||
}
|
|
||||||
|
|
||||||
enum CertificationValidationStatus {
|
|
||||||
APPROVED
|
|
||||||
PENDING_EXPERT_REVIEW
|
|
||||||
REJECTED
|
|
||||||
AI_VERIFIED
|
|
||||||
AI_FLAGGED
|
|
||||||
MANUAL_REVIEW_NEEDED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Certification @table(name: "certification") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
employeeName: String!
|
|
||||||
certificationName: String!
|
|
||||||
certificationType: CertificationType
|
|
||||||
status: CertificationStatus
|
|
||||||
expiryDate: String!
|
|
||||||
validationStatus: CertificationValidationStatus
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
enum ConversationType {
|
|
||||||
CLIENT_VENDOR
|
|
||||||
STAFF_CLIENT
|
|
||||||
STAFF_ADMIN
|
|
||||||
VENDOR_ADMIN
|
|
||||||
CLIENT_ADMIN
|
|
||||||
GROUP_STAFF
|
|
||||||
GROUP_EVENT_STAFF
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ConversationStatus {
|
|
||||||
ACTIVE
|
|
||||||
ARCHIVED
|
|
||||||
CLOSED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Conversation @table(name: "conversations") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
participants: String! # participants (jsonb -> String, required array of strings)
|
|
||||||
conversationType: ConversationType!
|
|
||||||
relatedTo: UUID! # related_to (generic FK as string)
|
|
||||||
status: ConversationStatus
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
type Enterprise @table(name: "enterprise") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
enterpriseNumber: String!
|
|
||||||
enterpriseName: String!
|
|
||||||
enterpriseCode: String!
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
|
|
||||||
enum EventStatus {
|
|
||||||
DRAFT
|
|
||||||
ACTIVE
|
|
||||||
PENDING
|
|
||||||
ASSIGNED
|
|
||||||
CONFIRMED
|
|
||||||
COMPLETED
|
|
||||||
CANCELED
|
|
||||||
PARTIAL
|
|
||||||
PARTIAL_STAFFED
|
|
||||||
FULLY_STAFFED
|
|
||||||
EVENT_CREATED
|
|
||||||
}
|
|
||||||
|
|
||||||
enum RecurrenceType {
|
|
||||||
SINGLE
|
|
||||||
DATE_RANGE
|
|
||||||
SCATTER
|
|
||||||
}
|
|
||||||
|
|
||||||
#enums cant start by a number, reason of C1099
|
|
||||||
enum ContractType {
|
|
||||||
W2
|
|
||||||
C1099
|
|
||||||
TEMP
|
|
||||||
CONTRACT
|
|
||||||
}
|
|
||||||
|
|
||||||
type Event @table(name: "events") {
|
|
||||||
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
eventName: String!
|
|
||||||
isRapid: Boolean @default(expr: "false")
|
|
||||||
isRecurring: Boolean @default(expr: "false")
|
|
||||||
isMultiDay: Boolean @default(expr: "false")
|
|
||||||
recurrenceType: RecurrenceType
|
|
||||||
recurrenceStartDate: Timestamp
|
|
||||||
recurrenceEndDate: Timestamp
|
|
||||||
scatterDates: Any
|
|
||||||
multiDayStartDate: Timestamp
|
|
||||||
multiDayEndDate: Timestamp
|
|
||||||
bufferTimeBefore: Float @default(expr: "0")
|
|
||||||
bufferTimeAfter: Float @default(expr: "0")
|
|
||||||
conflictDetectionEnabled: Boolean @default(expr: "true")
|
|
||||||
detectedConflicts: Any
|
|
||||||
businessId: UUID!
|
|
||||||
businessName: String
|
|
||||||
vendorId: String @default(expr: "auth.uid")
|
|
||||||
vendorName: String
|
|
||||||
hub: String
|
|
||||||
eventLocation: String
|
|
||||||
contractType: ContractType
|
|
||||||
poReference: String
|
|
||||||
status: EventStatus!
|
|
||||||
date: String!
|
|
||||||
shifts: Any
|
|
||||||
addons: Any
|
|
||||||
total: Float
|
|
||||||
clientName: String
|
|
||||||
clientEmail: String
|
|
||||||
clientPhone: String
|
|
||||||
invoiceId: UUID
|
|
||||||
notes: String
|
|
||||||
requested: Int @default(expr: "0")
|
|
||||||
assignedStaff: Any
|
|
||||||
orderType: String
|
|
||||||
department: String
|
|
||||||
recurringStartDate: String
|
|
||||||
recurringEndDate: String
|
|
||||||
recurringDays: Any
|
|
||||||
permanentStartDate: String
|
|
||||||
permanentDays: Any
|
|
||||||
includeBackup: Boolean
|
|
||||||
backupStaffCount: Int
|
|
||||||
recurringTime: String
|
|
||||||
permanentTime: String
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
enum InvoiceStatus {
|
|
||||||
DRAFT
|
|
||||||
PENDING_REVIEW
|
|
||||||
APPROVED
|
|
||||||
DISPUTED
|
|
||||||
UNDER_REVIEW
|
|
||||||
RESOLVED
|
|
||||||
OVERDUE
|
|
||||||
PAID
|
|
||||||
RECONCILED
|
|
||||||
CANCELLED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Invoice @table(name: "invoices") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
invoiceNumber: String!
|
|
||||||
amount: Float!
|
|
||||||
status: InvoiceStatus!
|
|
||||||
issueDate: Timestamp!
|
|
||||||
dueDate: Timestamp!
|
|
||||||
disputedItems: String
|
|
||||||
isAutoGenerated: Boolean @default(expr: "false") # is_auto_generated
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
type Message @table(name: "messages") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
conversationId: UUID! # conversation_id (FK lógica a Conversation.id)
|
|
||||||
senderName: String!
|
|
||||||
content: String!
|
|
||||||
readBy: String # read_by (jsonb -> String, array de user IDs)
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
enum OrderType {
|
|
||||||
STANDARD
|
|
||||||
LAST_MINUTE
|
|
||||||
EMERGENCY
|
|
||||||
RECURRING
|
|
||||||
}
|
|
||||||
|
|
||||||
enum OrderStatus {
|
|
||||||
DRAFT
|
|
||||||
SUBMITTED
|
|
||||||
CONFIRMED
|
|
||||||
IN_PROGRESS
|
|
||||||
COMPLETED
|
|
||||||
CANCELLED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Order @table(name: "orders") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
orderNumber: String!
|
|
||||||
partnerId: UUID!
|
|
||||||
orderType: OrderType
|
|
||||||
orderStatus: OrderStatus
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
enum PartnerType {
|
|
||||||
CORPORATE
|
|
||||||
EDUCATION
|
|
||||||
HEALTHCARE
|
|
||||||
SPORTS_ENTERTAINMENT
|
|
||||||
GOVERNMENT
|
|
||||||
}
|
|
||||||
|
|
||||||
type Partner @table(name: "partner") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
partnerName: String!
|
|
||||||
partnerNumber: String!
|
|
||||||
partnerType: PartnerType # partner_type
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
enum SectorType {
|
|
||||||
FOOD_SERVICE
|
|
||||||
FACILITIES
|
|
||||||
HEALTHCARE
|
|
||||||
EDUCATION
|
|
||||||
CORPORATE
|
|
||||||
SPORTS_ENTERTAINMENT
|
|
||||||
}
|
|
||||||
|
|
||||||
type Sector @table(name: "sector") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
sectorNumber: String!
|
|
||||||
sectorName: String!
|
|
||||||
sectorType: SectorType
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
type Shift @table(name: "shifts") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
shiftName: String!
|
|
||||||
startDate: Timestamp!
|
|
||||||
endDate: Timestamp
|
|
||||||
assignedStaff: String # assigned_staff (jsonb -> String, array de objects)
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
enum EmploymentType {
|
|
||||||
FULL_TIME
|
|
||||||
PART_TIME
|
|
||||||
ON_CALL
|
|
||||||
WEEKENDS
|
|
||||||
SPECIFIC_DAYS
|
|
||||||
SEASONAL
|
|
||||||
MEDICAL_LEAVE
|
|
||||||
}
|
|
||||||
|
|
||||||
enum StaffDepartment {
|
|
||||||
OPERATIONS
|
|
||||||
SALES
|
|
||||||
HR
|
|
||||||
FINANCE
|
|
||||||
IT
|
|
||||||
MARKETING
|
|
||||||
CUSTOMER_SERVICE
|
|
||||||
LOGISTICS
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ProfileType {
|
|
||||||
SKILLED
|
|
||||||
BEGINNER
|
|
||||||
CROSS_TRAINED
|
|
||||||
}
|
|
||||||
|
|
||||||
enum EnglishLevel {
|
|
||||||
FLUENT
|
|
||||||
INTERMEDIATE
|
|
||||||
BASIC
|
|
||||||
NONE
|
|
||||||
}
|
|
||||||
|
|
||||||
enum BackgroundCheckStatus {
|
|
||||||
PENDING
|
|
||||||
CLEARED
|
|
||||||
FAILED
|
|
||||||
EXPIRED
|
|
||||||
NOT_REQUIRED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Staff @table(name: "staffs") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
employeeName: String! @col(name: "employee_name")
|
|
||||||
initial:String@col(name:"initial") # nuevo
|
|
||||||
vendorId: String @default(expr: "auth.uid")#String @col(name: "vendor_id") # vendor_id (FK lógica a Vendor.id)
|
|
||||||
vendorName: String @col(name: "vendor_name")
|
|
||||||
manager: String
|
|
||||||
contactNumber: String @col(name: "contact_number")
|
|
||||||
phone: String @col(name:"phone") # nuevo
|
|
||||||
email: String
|
|
||||||
department: StaffDepartment
|
|
||||||
hubLocation: String @col(name: "hub_location")
|
|
||||||
eventLocation:String@col(name:"event_location") # nuevo
|
|
||||||
address:String@col(name:"address") # nuevo
|
|
||||||
city:String@col(name:"city") # nuevo
|
|
||||||
track: String
|
|
||||||
position: String
|
|
||||||
position2: String @col(name:"position_2") # nuevo
|
|
||||||
profileType: ProfileType @col(name: "profile_type")
|
|
||||||
employmentType: EmploymentType @col(name: "employment_type")
|
|
||||||
english: EnglishLevel
|
|
||||||
rate: Float
|
|
||||||
rating: Float
|
|
||||||
reliabilityScore: Int @col(name: "reliability_score")
|
|
||||||
backgroundCheckStatus: BackgroundCheckStatus @col(name: "background_check_status")
|
|
||||||
notes: String
|
|
||||||
accountingComments: String @col(name:"accounting_comments") # nuevo
|
|
||||||
shiftCoveragePercentage: Int @col(name:"shift_coverage_percentage") # nuevo
|
|
||||||
cancellationCount: Int @col(name:"cancellation_count") # nuevo
|
|
||||||
noShowCount: Int @col(name:"no_show_count") # nuevo
|
|
||||||
totalShifts: Int @col(name:"total_shifts") # nuevo
|
|
||||||
invoiced: Boolean @default(expr:"false") # nuevo
|
|
||||||
englishRequired: Boolean @col(name:"english_required")@default(expr:"false") # nuevo
|
|
||||||
checkIn: String @col(name:"check_in") # nuevo
|
|
||||||
scheduleDays: String @col(name:"schedule_days") # nuevo
|
|
||||||
replacedBy: String @col(name:"replaced_by") # nuevo
|
|
||||||
action: String # nuevo
|
|
||||||
ro: String # nuevo
|
|
||||||
mon: String # nuevo
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
enum TeamOwnerRole {
|
|
||||||
ADMIN
|
|
||||||
PROCUREMENT
|
|
||||||
OPERATOR
|
|
||||||
SECTOR
|
|
||||||
CLIENT
|
|
||||||
VENDOR
|
|
||||||
WORKFORCE
|
|
||||||
}
|
|
||||||
|
|
||||||
type Team @table(name: "team") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
teamName: String!
|
|
||||||
ownerId: String!
|
|
||||||
ownerName: String!
|
|
||||||
ownerRole: TeamOwnerRole!
|
|
||||||
favoriteStaff: String
|
|
||||||
blockedStaff: String
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
type TeamHub @table(name: "team_hubs") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
teamId: UUID!
|
|
||||||
hubName: String!
|
|
||||||
departments: String
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
enum TeamMemberRole {
|
|
||||||
ADMIN
|
|
||||||
MANAGER
|
|
||||||
MEMBER
|
|
||||||
VIEWER
|
|
||||||
}
|
|
||||||
|
|
||||||
type TeamMember @table(name: "team_members") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
teamId: UUID!
|
|
||||||
memberName: String!
|
|
||||||
email: String!
|
|
||||||
role: TeamMemberRole
|
|
||||||
isActive: Boolean @default(expr: "true")
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
enum TeamMemberInviteStatus {
|
|
||||||
PENDING
|
|
||||||
ACCEPTED
|
|
||||||
EXPIRED
|
|
||||||
CANCELLED
|
|
||||||
}
|
|
||||||
|
|
||||||
type TeamMemberInvite @table(name: "team_member_invites") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
teamId: UUID!
|
|
||||||
inviteCode: String! @default(expr: "uuidV4()")
|
|
||||||
email: String!
|
|
||||||
inviteStatus: TeamMemberInviteStatus!
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
enum UserBaseRole {
|
|
||||||
ADMIN
|
|
||||||
USER
|
|
||||||
}
|
|
||||||
|
|
||||||
type User @table(name: "users") {
|
|
||||||
id: String! # user_id / uid de Firebase
|
|
||||||
email: String!
|
|
||||||
fullName: String!
|
|
||||||
role: UserBaseRole!
|
|
||||||
userRole: String
|
|
||||||
photoUrl: String
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
enum VendorRegion {
|
|
||||||
NATIONAL
|
|
||||||
BAY_AREA
|
|
||||||
SOUTHERN_CALIFORNIA
|
|
||||||
NORTHERN_CALIFORNIA
|
|
||||||
WEST
|
|
||||||
EAST
|
|
||||||
MIDWEST
|
|
||||||
SOUTH
|
|
||||||
}
|
|
||||||
|
|
||||||
enum VendorPlatformType {
|
|
||||||
FULL_PLATFORM
|
|
||||||
BUILDING_PLATFORM
|
|
||||||
PARTIAL_TECH
|
|
||||||
TRADITIONAL
|
|
||||||
}
|
|
||||||
|
|
||||||
enum VendorApprovalStatus {
|
|
||||||
PENDING
|
|
||||||
APPROVED
|
|
||||||
SUSPENDED
|
|
||||||
TERMINATED
|
|
||||||
}
|
|
||||||
|
|
||||||
type Vendor @table(name: "vendors") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
vendorNumber: String!
|
|
||||||
legalName: String!
|
|
||||||
region: VendorRegion!
|
|
||||||
platformType: VendorPlatformType!
|
|
||||||
primaryContactEmail: String!
|
|
||||||
approvalStatus: VendorApprovalStatus!
|
|
||||||
isActive: Boolean @default(value: true)
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
type VendorDefaultSetting @table(name: "vendor_default_settings") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
vendorName: String!
|
|
||||||
defaultMarkupPercentage: Float!
|
|
||||||
defaultVendorFeePercentage: Float!
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# enums cant start by a number, reason of W1099
|
|
||||||
enum WorkforceEmploymentType {
|
|
||||||
W2
|
|
||||||
W1099
|
|
||||||
TEMPORARY
|
|
||||||
CONTRACT
|
|
||||||
}
|
|
||||||
|
|
||||||
type Workforce @table(name: "workforce") {
|
|
||||||
id: UUID! @default(expr: "uuidV4()")
|
|
||||||
workforceNumber: String!
|
|
||||||
vendorId: UUID! # vendor_id (FK lógica a Vendor.id)
|
|
||||||
firstName: String!
|
|
||||||
lastName: String!
|
|
||||||
employmentType: WorkforceEmploymentType # employment_type
|
|
||||||
createdDate: Timestamp @default(expr: "request.time")
|
|
||||||
updatedDate: Timestamp @default(expr: "request.time")
|
|
||||||
createdBy: String @default(expr: "auth.uid")
|
|
||||||
}
|
|
||||||
@@ -1,279 +0,0 @@
|
|||||||
mutation @transaction {
|
|
||||||
movie_insertMany(
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440000",
|
|
||||||
title: "Quantum Paradox",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fquantum_paradox.jpeg?alt=media&token=4142e2a1-bf43-43b5-b7cf-6616be3fd4e3",
|
|
||||||
genre: "sci-fi"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440001",
|
|
||||||
title: "The Lone Outlaw",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Flone_outlaw.jpeg?alt=media&token=15525ffc-208f-4b59-b506-ae8348e06e85",
|
|
||||||
genre: "western"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440002",
|
|
||||||
title: "Celestial Harmony",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fcelestial_harmony.jpeg?alt=media&token=3edf1cf9-c2f5-4c75-9819-36ff6a734c9a",
|
|
||||||
genre: "romance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440003",
|
|
||||||
title: "Noir Mystique",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fnoir_mystique.jpeg?alt=media&token=3299adba-cb98-4302-8b23-aeb679a4f913",
|
|
||||||
genre: "mystery"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440004",
|
|
||||||
title: "The Forgotten Island",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fforgotten_island.jpeg?alt=media&token=bc2b16e1-caed-4649-952c-73b6113f205c",
|
|
||||||
genre: "adventure"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440005",
|
|
||||||
title: "Digital Nightmare",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fdigital_nightmare.jpeg?alt=media&token=335ec842-1ca4-4b09-abd1-e96d9f5c0c2f",
|
|
||||||
genre: "horror"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440006",
|
|
||||||
title: "Eclipse of Destiny",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Feclipse_destiny.jpeg?alt=media&token=346649b3-cb5c-4d7e-b0d4-6f02e3df5959",
|
|
||||||
genre: "fantasy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440007",
|
|
||||||
title: "Heart of Steel",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fheart_steel.jpeg?alt=media&token=17883d71-329b-415a-86f8-dd4d9e941d7f",
|
|
||||||
genre: "sci-fi"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440008",
|
|
||||||
title: "Rise of the Crimson Empire",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Frise_crimson_empire.jpeg?alt=media&token=6faa73ad-7504-4146-8f3a-50b90f607f33",
|
|
||||||
genre: "action"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440009",
|
|
||||||
title: "Silent Waves",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fsilent_waves.jpeg?alt=media&token=bd626bf1-ec60-4e57-aa07-87ba14e35bb7",
|
|
||||||
genre: "drama"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440010",
|
|
||||||
title: "Echoes of the Past",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fecho_of_past.jpeg?alt=media&token=d866aa27-8534-4d72-8988-9da4a1b9e452",
|
|
||||||
genre: "historical"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440011",
|
|
||||||
title: "Beyond the Horizon",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fbeyond_horizon.jpeg?alt=media&token=31493973-0692-4e6e-8b88-afb1aaea17ee",
|
|
||||||
genre: "sci-fi"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440012",
|
|
||||||
title: "Shadows and Lies",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fshadows_lies.jpeg?alt=media&token=01afb80d-caee-47f8-a00e-aea8b9e459a2",
|
|
||||||
genre: "crime"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440013",
|
|
||||||
title: "The Last Symphony",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Flast_symphony.jpeg?alt=media&token=f9bf80cd-3d8e-4e24-8503-7feb11f4e397",
|
|
||||||
genre: "drama"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440014",
|
|
||||||
title: "Moonlit Crusade",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fmoonlit_crusade.jpeg?alt=media&token=b13241f5-d7d0-4370-b651-07847ad99dc2",
|
|
||||||
genre: "fantasy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440015",
|
|
||||||
title: "Abyss of the Deep",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fabyss_deep.jpeg?alt=media&token=2417321d-2451-4ec0-9ed6-6297042170e6",
|
|
||||||
genre: "horror"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440017",
|
|
||||||
title: "The Infinite Knot",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Finfinite_knot.jpeg?alt=media&token=93d54d93-d933-4663-a6fe-26b707ef823e",
|
|
||||||
genre: "romance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "550e8400-e29b-41d4-a716-446655440019",
|
|
||||||
title: "Veil of Illusion",
|
|
||||||
imageUrl: "https://firebasestorage.googleapis.com/v0/b/fdc-web-quickstart.appspot.com/o/movie%2Fveil_illusion.jpeg?alt=media&token=7bf09a3c-c531-478a-9d02-5d99fca9393b",
|
|
||||||
genre: "mystery"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
movieMetadata_insertMany(
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440000",
|
|
||||||
rating: 7.9,
|
|
||||||
releaseYear: 2025,
|
|
||||||
description: "A group of scientists accidentally open a portal to a parallel universe, causing a rift in time. As the team races to close the portal, they encounter alternate versions of themselves, leading to shocking revelations."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440001",
|
|
||||||
rating: 8.2,
|
|
||||||
releaseYear: 2023,
|
|
||||||
description: "In the lawless Wild West, a mysterious gunslinger with a hidden past takes on a corrupt sheriff and his band of outlaws to bring justice to a small town."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440002",
|
|
||||||
rating: 7.5,
|
|
||||||
releaseYear: 2024,
|
|
||||||
description: "Two astronauts, stationed on a remote space station, fall in love amidst the isolation of deep space. But when a mysterious signal disrupts their communication, they must find a way to reconnect and survive."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440003",
|
|
||||||
rating: 8.0,
|
|
||||||
releaseYear: 2022,
|
|
||||||
description: "A private detective gets caught up in a web of lies, deception, and betrayal while investigating the disappearance of a famous actress in 1940s Hollywood."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440004",
|
|
||||||
rating: 7.6,
|
|
||||||
releaseYear: 2025,
|
|
||||||
description: "An explorer leads an expedition to a remote island rumored to be home to mythical creatures. As the team ventures deeper into the island, they uncover secrets that change the course of history."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440005",
|
|
||||||
rating: 6.9,
|
|
||||||
releaseYear: 2024,
|
|
||||||
description: "A tech-savvy teenager discovers a cursed app that brings nightmares to life. As the horrors of the digital world cross into reality, she must find a way to break the curse before it's too late."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440006",
|
|
||||||
rating: 8.1,
|
|
||||||
releaseYear: 2026,
|
|
||||||
description: "In a kingdom on the brink of war, a prophecy speaks of an eclipse that will grant power to the rightful ruler. As factions vie for control, a young warrior must decide where his true loyalty lies."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440007",
|
|
||||||
rating: 7.7,
|
|
||||||
releaseYear: 2023,
|
|
||||||
description: "A brilliant scientist creates a robot with a human heart. As the robot struggles to understand emotions, it becomes entangled in a plot that could change the fate of humanity."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440008",
|
|
||||||
rating: 8.4,
|
|
||||||
releaseYear: 2025,
|
|
||||||
description: "A legendary warrior rises to challenge the tyrannical rule of a powerful empire. As rebellion brews, the warrior must unite different factions to lead an uprising."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440009",
|
|
||||||
rating: 8.2,
|
|
||||||
releaseYear: 2024,
|
|
||||||
description: "A talented pianist, who loses his hearing in a tragic accident, must rediscover his passion for music with the help of a young music teacher who believes in him."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440010",
|
|
||||||
rating: 7.8,
|
|
||||||
releaseYear: 2023,
|
|
||||||
description: "A historian stumbles upon an ancient artifact that reveals hidden truths about an empire long forgotten. As she deciphers the clues, a shadowy organization tries to stop her from unearthing the past."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440011",
|
|
||||||
rating: 8.5,
|
|
||||||
releaseYear: 2026,
|
|
||||||
description: "In the future, Earth's best pilots are sent on a mission to explore a mysterious planet beyond the solar system. What they find changes humanity's understanding of the universe forever."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440012",
|
|
||||||
rating: 7.9,
|
|
||||||
releaseYear: 2022,
|
|
||||||
description: "A young detective with a dark past investigates a series of mysterious murders in a city plagued by corruption. As she digs deeper, she realizes nothing is as it seems."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440013",
|
|
||||||
rating: 8.0,
|
|
||||||
releaseYear: 2024,
|
|
||||||
description: "An aging composer struggling with memory loss attempts to complete his final symphony. With the help of a young prodigy, he embarks on an emotional journey through his memories and legacy."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440014",
|
|
||||||
rating: 8.3,
|
|
||||||
releaseYear: 2025,
|
|
||||||
description: "A knight is chosen by an ancient order to embark on a quest under the light of the full moon. Facing mythical beasts and treacherous landscapes, he seeks a relic that could save his kingdom."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440015",
|
|
||||||
rating: 7.2,
|
|
||||||
releaseYear: 2023,
|
|
||||||
description: "When a group of marine biologists descends into the unexplored depths of the ocean, they encounter a terrifying and ancient force. Now, they must survive as the abyss comes alive."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440017",
|
|
||||||
rating: 7.4,
|
|
||||||
releaseYear: 2026,
|
|
||||||
description: "Two souls destined to meet across multiple lifetimes struggle to find each other in a chaotic world. With each incarnation, they get closer, but time itself becomes their greatest obstacle."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440019",
|
|
||||||
rating: 7.8,
|
|
||||||
releaseYear: 2022,
|
|
||||||
description: "A magician-turned-detective uses his skills in illusion to solve crimes. When a series of murders leaves the city in fear, he must reveal the truth hidden behind a veil of deceit."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
user_insertMany(
|
|
||||||
data: [
|
|
||||||
{ id: "SnLgOC3lN4hcIl69s53cW0Q8R1T2", username: "sherlock_h" },
|
|
||||||
{ id: "fep4fXpGWsaRpuphq9CIrBIXQ0S2", username: "hercule_p" },
|
|
||||||
{ id: "TBedjwCX0Jf955Uuoxk6k74sY0l1", username: "jane_d" }
|
|
||||||
]
|
|
||||||
)
|
|
||||||
review_insertMany(
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
userId: "SnLgOC3lN4hcIl69s53cW0Q8R1T2",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440000",
|
|
||||||
rating: 5,
|
|
||||||
reviewText: "An incredible movie with a mind-blowing plot!",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userId: "fep4fXpGWsaRpuphq9CIrBIXQ0S2",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440001",
|
|
||||||
rating: 5,
|
|
||||||
reviewText: "A revolutionary film that changed cinema forever.",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userId: "TBedjwCX0Jf955Uuoxk6k74sY0l1",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440002",
|
|
||||||
rating: 5,
|
|
||||||
reviewText: "A visually stunning and emotionally impactful movie.",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userId: "SnLgOC3lN4hcIl69s53cW0Q8R1T2",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440003",
|
|
||||||
rating: 4,
|
|
||||||
reviewText: "A fantastic superhero film with great performances.",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userId: "fep4fXpGWsaRpuphq9CIrBIXQ0S2",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440004",
|
|
||||||
rating: 5,
|
|
||||||
reviewText: "An amazing film that keeps you on the edge of your seat.",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userId: "TBedjwCX0Jf955Uuoxk6k74sY0l1",
|
|
||||||
movieId: "550e8400-e29b-41d4-a716-446655440005",
|
|
||||||
rating: 5,
|
|
||||||
reviewText: "An absolute classic with unforgettable dialogue.",
|
|
||||||
reviewDate: "2025-10-01"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
scalar UUID
|
|
||||||
scalar Timestamp
|
|
||||||
scalar JSON
|
|
||||||
|
|
||||||
enum EventStatus {
|
|
||||||
DRAFT
|
|
||||||
ACTIVE
|
|
||||||
PENDING
|
|
||||||
ASSIGNED
|
|
||||||
CONFIRMED
|
|
||||||
COMPLETED
|
|
||||||
CANCELED
|
|
||||||
}
|
|
||||||
|
|
||||||
enum RecurrenceType {
|
|
||||||
SINGLE
|
|
||||||
DATE_RANGE
|
|
||||||
SCATTER
|
|
||||||
}
|
|
||||||
|
|
||||||
type Event @table(name: "events") {
|
|
||||||
|
|
||||||
id: UUID! @col(name: "id", primaryKey: true) @default(expr: "uuidV4()")
|
|
||||||
eventName: String!
|
|
||||||
isRecurring: Boolean!
|
|
||||||
recurrenceType: RecurrenceType
|
|
||||||
businessId: UUID!
|
|
||||||
vendorId: UUID
|
|
||||||
status: EventStatus!
|
|
||||||
date: Timestamp!
|
|
||||||
shifts: JSON @col(dataType: "jsonb")
|
|
||||||
total: Float
|
|
||||||
requested: Int
|
|
||||||
assignedStaff: JSON @col(dataType: "jsonb")
|
|
||||||
createdDate: Timestamp @default(expr: "now()")
|
|
||||||
updatedDate: Timestamp @updateAt
|
|
||||||
createdBy: String
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
input CreateEventInput {
|
|
||||||
eventName: String!
|
|
||||||
isRecurring: Boolean!
|
|
||||||
recurrenceType: RecurrenceType
|
|
||||||
businessId: UUID!
|
|
||||||
vendorId: UUID
|
|
||||||
status: EventStatus!
|
|
||||||
date: Timestamp!
|
|
||||||
shifts: JSON
|
|
||||||
total: Float
|
|
||||||
requested: Int
|
|
||||||
assignedStaff: JSON
|
|
||||||
}
|
|
||||||
|
|
||||||
type Mutation {
|
|
||||||
createEvent(input: CreateEventInput!): Event @auth
|
|
||||||
}
|
|
||||||
|
|
||||||
type Query {
|
|
||||||
listEvents: [Event!] @auth
|
|
||||||
}
|
|
||||||
|
|
||||||
26
frontend-web-free/.gitignore
vendored
26
frontend-web-free/.gitignore
vendored
@@ -1,26 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
|
|
||||||
.env
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# Base44 App
|
|
||||||
|
|
||||||
|
|
||||||
This app was created automatically by Base44.
|
|
||||||
It's a Vite+React app that communicates with the Base44 API.
|
|
||||||
|
|
||||||
## Running the app
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Building the app
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information and support, please contact Base44 support at app@base44.com.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://ui.shadcn.com/schema.json",
|
|
||||||
"style": "new-york",
|
|
||||||
"rsc": false,
|
|
||||||
"tsx": false,
|
|
||||||
"tailwind": {
|
|
||||||
"config": "tailwind.config.js",
|
|
||||||
"css": "src/index.css",
|
|
||||||
"baseColor": "neutral",
|
|
||||||
"cssVariables": true,
|
|
||||||
"prefix": ""
|
|
||||||
},
|
|
||||||
"aliases": {
|
|
||||||
"components": "@/components",
|
|
||||||
"utils": "@/lib/utils",
|
|
||||||
"ui": "@/components/ui",
|
|
||||||
"lib": "@/lib",
|
|
||||||
"hooks": "@/hooks"
|
|
||||||
},
|
|
||||||
"iconLibrary": "lucide"
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import js from '@eslint/js'
|
|
||||||
import globals from 'globals'
|
|
||||||
import react from 'eslint-plugin-react'
|
|
||||||
import reactHooks from 'eslint-plugin-react-hooks'
|
|
||||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
||||||
|
|
||||||
export default [
|
|
||||||
{ ignores: ['dist'] },
|
|
||||||
{
|
|
||||||
files: ['**/*.{js,jsx}'],
|
|
||||||
languageOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
globals: globals.browser,
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 'latest',
|
|
||||||
ecmaFeatures: { jsx: true },
|
|
||||||
sourceType: 'module',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
settings: { react: { version: '18.3' } },
|
|
||||||
plugins: {
|
|
||||||
react,
|
|
||||||
'react-hooks': reactHooks,
|
|
||||||
'react-refresh': reactRefresh,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
...js.configs.recommended.rules,
|
|
||||||
...react.configs.recommended.rules,
|
|
||||||
...react.configs['jsx-runtime'].rules,
|
|
||||||
...reactHooks.configs.recommended.rules,
|
|
||||||
'react/jsx-no-target-blank': 'off',
|
|
||||||
'react-refresh/only-export-components': [
|
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="https://base44.com/logo_v2.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Base44 APP</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
<script type="module" src="/src/main.jsx"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
},
|
|
||||||
"jsx": "react-jsx"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*.js", "src/**/*.jsx"]
|
|
||||||
}
|
|
||||||
9985
frontend-web-free/package-lock.json
generated
9985
frontend-web-free/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,82 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "base44-app",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite",
|
|
||||||
"build": "vite build",
|
|
||||||
"lint": "eslint .",
|
|
||||||
"preview": "vite preview"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@base44/sdk": "^0.1.2",
|
|
||||||
"@dataconnect/generated": "file:src/dataconnect-generated",
|
|
||||||
"@hello-pangea/dnd": "^18.0.1",
|
|
||||||
"@hookform/resolvers": "^4.1.2",
|
|
||||||
"@radix-ui/react-accordion": "^1.2.3",
|
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.6",
|
|
||||||
"@radix-ui/react-aspect-ratio": "^1.1.2",
|
|
||||||
"@radix-ui/react-avatar": "^1.1.3",
|
|
||||||
"@radix-ui/react-checkbox": "^1.1.4",
|
|
||||||
"@radix-ui/react-collapsible": "^1.1.3",
|
|
||||||
"@radix-ui/react-context-menu": "^2.2.6",
|
|
||||||
"@radix-ui/react-dialog": "^1.1.6",
|
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
||||||
"@radix-ui/react-hover-card": "^1.1.6",
|
|
||||||
"@radix-ui/react-label": "^2.1.2",
|
|
||||||
"@radix-ui/react-menubar": "^1.1.6",
|
|
||||||
"@radix-ui/react-navigation-menu": "^1.2.5",
|
|
||||||
"@radix-ui/react-popover": "^1.1.6",
|
|
||||||
"@radix-ui/react-progress": "^1.1.2",
|
|
||||||
"@radix-ui/react-radio-group": "^1.2.3",
|
|
||||||
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
||||||
"@radix-ui/react-select": "^2.1.6",
|
|
||||||
"@radix-ui/react-separator": "^1.1.2",
|
|
||||||
"@radix-ui/react-slider": "^1.2.3",
|
|
||||||
"@radix-ui/react-slot": "^1.1.2",
|
|
||||||
"@radix-ui/react-switch": "^1.1.3",
|
|
||||||
"@radix-ui/react-tabs": "^1.1.3",
|
|
||||||
"@radix-ui/react-toggle": "^1.1.2",
|
|
||||||
"@radix-ui/react-toggle-group": "^1.1.2",
|
|
||||||
"@radix-ui/react-tooltip": "^1.1.8",
|
|
||||||
"class-variance-authority": "^0.7.1",
|
|
||||||
"clsx": "^2.1.1",
|
|
||||||
"cmdk": "^1.0.0",
|
|
||||||
"date-fns": "^3.6.0",
|
|
||||||
"embla-carousel-react": "^8.5.2",
|
|
||||||
"framer-motion": "^12.4.7",
|
|
||||||
"input-otp": "^1.4.2",
|
|
||||||
"lucide-react": "^0.475.0",
|
|
||||||
"next-themes": "^0.4.4",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-day-picker": "^8.10.1",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"react-hook-form": "^7.54.2",
|
|
||||||
"react-resizable-panels": "^2.1.7",
|
|
||||||
"react-router-dom": "^7.2.0",
|
|
||||||
"recharts": "^2.15.1",
|
|
||||||
"sonner": "^2.0.1",
|
|
||||||
"tailwind-merge": "^3.0.2",
|
|
||||||
"tailwindcss-animate": "^1.0.7",
|
|
||||||
"vaul": "^1.1.2",
|
|
||||||
"zod": "^3.24.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@eslint/js": "^9.19.0",
|
|
||||||
"@flydotio/dockerfile": "^0.7.8",
|
|
||||||
"@types/node": "^22.13.5",
|
|
||||||
"@types/react": "^18.2.66",
|
|
||||||
"@types/react-dom": "^18.2.22",
|
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
|
||||||
"autoprefixer": "^10.4.20",
|
|
||||||
"eslint": "^9.19.0",
|
|
||||||
"eslint-plugin-react": "^7.37.4",
|
|
||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
|
||||||
"eslint-plugin-react-refresh": "^0.4.18",
|
|
||||||
"globals": "^15.14.0",
|
|
||||||
"postcss": "^8.5.3",
|
|
||||||
"tailwindcss": "^3.4.17",
|
|
||||||
"vite": "^6.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import './App.css'
|
|
||||||
import Pages from "@/pages/index.jsx"
|
|
||||||
import { Toaster } from "@/components/ui/toaster"
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Pages />
|
|
||||||
<Toaster />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/*import { createClient } from '@base44/sdk';
|
|
||||||
// import { getAccessToken } from '@base44/sdk/utils/auth-utils';
|
|
||||||
|
|
||||||
// Create a client with authentication required
|
|
||||||
export const base44 = createClient({
|
|
||||||
appId: "68fc6cf01386035c266e7a5d",
|
|
||||||
requiresAuth: true // Ensure authentication is required for all operations
|
|
||||||
});*/
|
|
||||||
|
|
||||||
import { krowSDK } from "@/api/krowSDK";
|
|
||||||
export const base44 = krowSDK;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import { auth } from "../firebase";
|
|
||||||
|
|
||||||
const apiClient = axios.create({
|
|
||||||
baseURL: import.meta.env.VITE_API_BASE_URL, // You will need to add this to your .env file
|
|
||||||
});
|
|
||||||
|
|
||||||
apiClient.interceptors.request.use(
|
|
||||||
async (config) => {
|
|
||||||
const user = auth.currentUser;
|
|
||||||
if (user) {
|
|
||||||
const token = await user.getIdToken();
|
|
||||||
config.headers.Authorization = `Bearer ${token}`;
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export default apiClient;
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
import { base44 } from './base44Client';
|
|
||||||
|
|
||||||
|
|
||||||
export const Staff = base44.entities.Staff;
|
|
||||||
|
|
||||||
export const Event = base44.entities.Event;
|
|
||||||
|
|
||||||
export const Business = base44.entities.Business;
|
|
||||||
|
|
||||||
export const Shift = base44.entities.Shift;
|
|
||||||
|
|
||||||
export const Conversation = base44.entities.Conversation;
|
|
||||||
|
|
||||||
export const Message = base44.entities.Message;
|
|
||||||
|
|
||||||
export const VendorRate = base44.entities.VendorRate;
|
|
||||||
|
|
||||||
export const VendorDefaultSettings = base44.entities.VendorDefaultSettings;
|
|
||||||
|
|
||||||
export const Invoice = base44.entities.Invoice;
|
|
||||||
|
|
||||||
export const ActivityLog = base44.entities.ActivityLog;
|
|
||||||
|
|
||||||
export const Team = base44.entities.Team;
|
|
||||||
|
|
||||||
export const TeamMember = base44.entities.TeamMember;
|
|
||||||
|
|
||||||
export const TeamHub = base44.entities.TeamHub;
|
|
||||||
|
|
||||||
export const Vendor = base44.entities.Vendor;
|
|
||||||
|
|
||||||
export const Enterprise = base44.entities.Enterprise;
|
|
||||||
|
|
||||||
export const Sector = base44.entities.Sector;
|
|
||||||
|
|
||||||
export const Partner = base44.entities.Partner;
|
|
||||||
|
|
||||||
export const Order = base44.entities.Order;
|
|
||||||
|
|
||||||
export const Assignment = base44.entities.Assignment;
|
|
||||||
|
|
||||||
export const Workforce = base44.entities.Workforce;
|
|
||||||
|
|
||||||
export const RateCard = base44.entities.RateCard;
|
|
||||||
|
|
||||||
export const CompliancePackage = base44.entities.CompliancePackage;
|
|
||||||
|
|
||||||
export const Scorecard = base44.entities.Scorecard;
|
|
||||||
|
|
||||||
export const VendorSectorLink = base44.entities.VendorSectorLink;
|
|
||||||
|
|
||||||
export const VendorPartnerLink = base44.entities.VendorPartnerLink;
|
|
||||||
|
|
||||||
export const OrderVendorInvite = base44.entities.OrderVendorInvite;
|
|
||||||
|
|
||||||
export const Site = base44.entities.Site;
|
|
||||||
|
|
||||||
export const VendorInvite = base44.entities.VendorInvite;
|
|
||||||
|
|
||||||
export const Certification = base44.entities.Certification;
|
|
||||||
|
|
||||||
export const TeamMemberInvite = base44.entities.TeamMemberInvite;
|
|
||||||
|
|
||||||
export const VendorDocumentReview = base44.entities.VendorDocumentReview;
|
|
||||||
|
|
||||||
export const Task = base44.entities.Task;
|
|
||||||
|
|
||||||
export const TaskComment = base44.entities.TaskComment;
|
|
||||||
|
|
||||||
export const WorkerAvailability = base44.entities.WorkerAvailability;
|
|
||||||
|
|
||||||
export const ShiftProposal = base44.entities.ShiftProposal;
|
|
||||||
|
|
||||||
export const VendorRateBook = base44.entities.VendorRateBook;
|
|
||||||
|
|
||||||
export const VendorNetworkApproval = base44.entities.VendorNetworkApproval;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// auth sdk:
|
|
||||||
export const User = base44.auth;
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import { base44 } from './base44Client';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const Core = base44.integrations.Core;
|
|
||||||
|
|
||||||
export const InvokeLLM = base44.integrations.Core.InvokeLLM;
|
|
||||||
|
|
||||||
export const SendEmail = base44.integrations.Core.SendEmail;
|
|
||||||
|
|
||||||
export const UploadFile = base44.integrations.Core.UploadFile;
|
|
||||||
|
|
||||||
export const GenerateImage = base44.integrations.Core.GenerateImage;
|
|
||||||
|
|
||||||
export const ExtractDataFromUploadedFile = base44.integrations.Core.ExtractDataFromUploadedFile;
|
|
||||||
|
|
||||||
export const CreateFileSignedUrl = base44.integrations.Core.CreateFileSignedUrl;
|
|
||||||
|
|
||||||
export const UploadPrivateFile = base44.integrations.Core.UploadPrivateFile;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,830 +0,0 @@
|
|||||||
import apiClient from './client';
|
|
||||||
import { auth, dataConnect } from '../firebase';
|
|
||||||
import { signOut } from 'firebase/auth';
|
|
||||||
|
|
||||||
import * as dcSdk from '@dataconnect/generated'; // listEvents, createEvent, etc.
|
|
||||||
|
|
||||||
const MOCK_USER_ROLE_KEY = 'krow_mock_user_role';
|
|
||||||
|
|
||||||
// --- Auth Module ---
|
|
||||||
const authModule = {
|
|
||||||
/**
|
|
||||||
* Fetches the currently authenticated user's profile from the backend.
|
|
||||||
* @returns {Promise<object>} The user profile.
|
|
||||||
*/
|
|
||||||
me: async () => {
|
|
||||||
// 1. Firebase auth user
|
|
||||||
const fbUser = auth.currentUser;
|
|
||||||
|
|
||||||
if (!fbUser) {
|
|
||||||
return null; // NO ESTÁ LOGGEADO
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Attempt to load matching Krow User from DataConnect
|
|
||||||
// (because your Krow user metadata is stored in the "users" table)
|
|
||||||
let krowUser = null;
|
|
||||||
try {
|
|
||||||
const response = await dcSdk.getUserById(dataConnect, { id: fbUser.uid });
|
|
||||||
krowUser = response.data?.user || null;
|
|
||||||
} catch (err) {
|
|
||||||
console.warn("Krow user not found in DataConnect, returning Firebase-only info.");
|
|
||||||
}
|
|
||||||
|
|
||||||
let mockRole = null;
|
|
||||||
mockRole = localStorage.getItem(MOCK_USER_ROLE_KEY);
|
|
||||||
|
|
||||||
// 3. Build unified "me" object
|
|
||||||
return {
|
|
||||||
id: fbUser.uid,
|
|
||||||
email: fbUser.email,
|
|
||||||
fullName: krowUser?.fullName || fbUser.displayName || null,
|
|
||||||
role: krowUser?.role || "user",
|
|
||||||
user_role: mockRole || krowUser?.userRole || null,
|
|
||||||
firebase: fbUser,
|
|
||||||
krow: krowUser
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs the user out.
|
|
||||||
* @param {string} [redirectUrl] - Optional URL to redirect to after logout.
|
|
||||||
*/
|
|
||||||
logout: async (redirectUrl) => {
|
|
||||||
|
|
||||||
localStorage.removeItem(MOCK_USER_ROLE_KEY);
|
|
||||||
|
|
||||||
await signOut(auth);
|
|
||||||
if (redirectUrl) {
|
|
||||||
window.location.href = redirectUrl;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if a user is currently authenticated.
|
|
||||||
* @returns {boolean} True if a user is authenticated.
|
|
||||||
*/
|
|
||||||
isAuthenticated: () => {
|
|
||||||
return !!auth.currentUser;
|
|
||||||
},
|
|
||||||
|
|
||||||
// ==============================
|
|
||||||
// FIX: auth.updateMe para soportar RoleSwitcher (antes lo hacía el mock base44)
|
|
||||||
// ==============================
|
|
||||||
/**
|
|
||||||
* Updates current user metadata (including role/user_role).
|
|
||||||
* Used by RoleSwitcher to change between ADMIN / VENDOR / etc.
|
|
||||||
* @param {{ user_role?: string, role?: string, fullName?: string }} data
|
|
||||||
* @returns {Promise<object>} updated "me" object
|
|
||||||
*/
|
|
||||||
updateMe: async (data) => {
|
|
||||||
const fbUser = auth.currentUser;
|
|
||||||
if (!fbUser) {
|
|
||||||
throw new Error("Not authenticated");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.user_role) {
|
|
||||||
try {
|
|
||||||
localStorage.setItem(MOCK_USER_ROLE_KEY, data.user_role);
|
|
||||||
} catch (err) {
|
|
||||||
console.warn("Krow user role could not be saved to localStorage.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return authModule.me();
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// --- Core Integrations Module ---
|
|
||||||
const coreIntegrationsModule = {
|
|
||||||
/**
|
|
||||||
* Sends an email.
|
|
||||||
* @param {object} params - { to, subject, body }
|
|
||||||
* @returns {Promise<object>} API response.
|
|
||||||
*/
|
|
||||||
SendEmail: async (params) => {
|
|
||||||
const { data } = await apiClient.post('/sendEmail', params);
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invokes a large language model.
|
|
||||||
* @param {object} params - { prompt, response_json_schema, file_urls }
|
|
||||||
* @returns {Promise<object>} API response.
|
|
||||||
*/
|
|
||||||
InvokeLLM: async (params) => {
|
|
||||||
const { data } = await apiClient.post('/invokeLLM', params);
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Uploads a public file.
|
|
||||||
* @param {File} file - The file to upload.
|
|
||||||
* @returns {Promise<object>} API response with file_url.
|
|
||||||
*/
|
|
||||||
UploadFile: async ({ file }) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', file);
|
|
||||||
const { data } = await apiClient.post('/uploadFile', formData, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Uploads a private file.
|
|
||||||
* @param {File} file - The file to upload.
|
|
||||||
* @returns {Promise<object>} API response with file_uri.
|
|
||||||
*/
|
|
||||||
UploadPrivateFile: async ({ file }) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', file);
|
|
||||||
const { data } = await apiClient.post('/uploadPrivateFile', formData, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a temporary signed URL for a private file.
|
|
||||||
* @param {object} params - { file_uri, expires_in }
|
|
||||||
* @returns {Promise<object>} API response with signed_url.
|
|
||||||
*/
|
|
||||||
CreateFileSignedUrl: async (params) => {
|
|
||||||
const { data } = await apiClient.post('/createSignedUrl', params);
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const dataconnectEntityConfig = {
|
|
||||||
User: {
|
|
||||||
list: 'listUsers',
|
|
||||||
get: 'getUserById',
|
|
||||||
create: 'createUser',
|
|
||||||
update: 'updateUser',
|
|
||||||
delete: 'deleteUser',
|
|
||||||
filter: 'filterUsers',
|
|
||||||
},
|
|
||||||
Event: {
|
|
||||||
list: 'listEvents',
|
|
||||||
create: 'createEvent',
|
|
||||||
get: 'getEventById',
|
|
||||||
update: 'updateEvent',
|
|
||||||
delete: 'deleteEvent',
|
|
||||||
filter: 'filterEvents',
|
|
||||||
},
|
|
||||||
|
|
||||||
Staff: {
|
|
||||||
list: 'listStaff',
|
|
||||||
create: 'createStaff',
|
|
||||||
get: 'getStaffById',
|
|
||||||
update: 'updateStaff',
|
|
||||||
delete: 'deleteStaff',
|
|
||||||
filter: 'filterStaff',
|
|
||||||
},
|
|
||||||
|
|
||||||
Vendor: {
|
|
||||||
list: 'listVendor',
|
|
||||||
get: 'getVendorById',
|
|
||||||
create: 'createVendor',
|
|
||||||
update: 'updateVendor',
|
|
||||||
delete: 'deleteVendor',
|
|
||||||
filter: 'filterVendors',
|
|
||||||
},
|
|
||||||
|
|
||||||
VendorRate: {
|
|
||||||
list: 'listVendorRate',
|
|
||||||
get: 'getVendorRateById',
|
|
||||||
create: 'createVendorRate',
|
|
||||||
update: 'updateVendorRate',
|
|
||||||
delete: 'deleteVendorRate',
|
|
||||||
filter: 'filterVendorRates',
|
|
||||||
},
|
|
||||||
|
|
||||||
VendorDefaultSetting:{
|
|
||||||
list: 'listVendorDefaultSettings',
|
|
||||||
get: 'getVendorDefaultSettingById',
|
|
||||||
create: 'createVendorDefaultSetting',
|
|
||||||
update: 'updateVendorDefaultSetting',
|
|
||||||
delete: 'deleteVendorDefaultSetting',
|
|
||||||
filter: 'filterVendorDefaultSettings',
|
|
||||||
},
|
|
||||||
|
|
||||||
Invoice:{
|
|
||||||
list: 'listInvoice',
|
|
||||||
get: 'getInvoiceById',
|
|
||||||
create: 'createInvoice',
|
|
||||||
update: 'updateInvoice',
|
|
||||||
delete: 'deleteInvoice',
|
|
||||||
filter: 'filterInvoices',
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
Business:{
|
|
||||||
list: 'listBusiness',
|
|
||||||
get: 'getBusinessById',
|
|
||||||
create: 'createBusiness',
|
|
||||||
update: 'updateBusiness',
|
|
||||||
delete: 'deleteBusiness',
|
|
||||||
filter: 'filterBusiness',
|
|
||||||
},
|
|
||||||
|
|
||||||
Certification:{
|
|
||||||
list: 'listCertification',
|
|
||||||
get: 'getCertificationById',
|
|
||||||
create: 'createCertification',
|
|
||||||
update: 'updateCertification',
|
|
||||||
delete: 'deleteCertification',
|
|
||||||
filter: 'filterCertification',
|
|
||||||
},
|
|
||||||
|
|
||||||
Team:{
|
|
||||||
list: 'listTeam',
|
|
||||||
get: 'getTeamById',
|
|
||||||
create: 'createTeam',
|
|
||||||
update: 'updateTeam',
|
|
||||||
delete: 'deleteTeam',
|
|
||||||
filter: 'filterTeam',
|
|
||||||
},
|
|
||||||
|
|
||||||
TeamMember: {
|
|
||||||
list: 'listTeamMember',
|
|
||||||
get: 'getTeamMemberById',
|
|
||||||
create: 'createTeamMember',
|
|
||||||
update: 'updateTeamMember',
|
|
||||||
delete: 'deleteTeamMember',
|
|
||||||
filter: 'filterTeamMember',
|
|
||||||
},
|
|
||||||
|
|
||||||
TeamHub: {
|
|
||||||
list: 'listTeamHub',
|
|
||||||
get: 'getTeamHubById',
|
|
||||||
create: 'createTeamHub',
|
|
||||||
update: 'updateTeamHub',
|
|
||||||
delete: 'deleteTeamHub',
|
|
||||||
filter: 'filterTeamHub',
|
|
||||||
},
|
|
||||||
|
|
||||||
TeamMemberInvite: {
|
|
||||||
list: 'listTeamMemberInvite',
|
|
||||||
get: 'getTeamMemberInviteById',
|
|
||||||
create: 'createTeamMemberInvite',
|
|
||||||
update: 'updateTeamMemberInvite',
|
|
||||||
delete: 'deleteTeamMemberInvite',
|
|
||||||
filter: 'filterTeamMemberInvite',
|
|
||||||
},
|
|
||||||
|
|
||||||
Conversation:{
|
|
||||||
list: 'listConversation',
|
|
||||||
get: 'getConversationById',
|
|
||||||
create: 'createConversation',
|
|
||||||
update: 'updateConversation',
|
|
||||||
delete: 'deleteConversation',
|
|
||||||
filter: 'filterConversation',
|
|
||||||
},
|
|
||||||
|
|
||||||
Message:{
|
|
||||||
list: 'listMessage',
|
|
||||||
get: 'getMessageById',
|
|
||||||
create: 'createMessage',
|
|
||||||
update: 'updateMessage',
|
|
||||||
delete: 'deleteMessage',
|
|
||||||
filter: 'filterMessage',
|
|
||||||
},
|
|
||||||
|
|
||||||
ActivityLog:{
|
|
||||||
list: 'listActivityLog',
|
|
||||||
get: 'getActivityLogById',
|
|
||||||
create: 'createActivityLog',
|
|
||||||
update: 'updateActivityLog',
|
|
||||||
delete: 'deleteActivityLog',
|
|
||||||
filter: 'filterActivityLog',
|
|
||||||
},
|
|
||||||
|
|
||||||
Enterprise:{
|
|
||||||
list: 'listEnterprise',
|
|
||||||
get: 'getEnterpriseById',
|
|
||||||
create: 'createEnterprise',
|
|
||||||
update: 'updateEnterprise',
|
|
||||||
delete: 'deleteEnterprise',
|
|
||||||
filter: 'filterEnterprise',
|
|
||||||
},
|
|
||||||
|
|
||||||
Sector:{
|
|
||||||
list: 'listSector',
|
|
||||||
get: 'getSectorById',
|
|
||||||
create: 'createSector',
|
|
||||||
update: 'updateSector',
|
|
||||||
delete: 'deleteSector',
|
|
||||||
filter: 'filterSector'
|
|
||||||
},
|
|
||||||
|
|
||||||
Partner:{
|
|
||||||
list: 'listPartner',
|
|
||||||
get: 'getPartnerById',
|
|
||||||
create: 'createPartner',
|
|
||||||
update: 'updatePartner',
|
|
||||||
delete: 'deletePartner',
|
|
||||||
filter: 'filterPartner'
|
|
||||||
},
|
|
||||||
|
|
||||||
Order:{
|
|
||||||
list: 'listOrder',
|
|
||||||
get: 'getOrderById',
|
|
||||||
create: 'createOrder',
|
|
||||||
update: 'updateOrder',
|
|
||||||
delete: 'deleteOrder',
|
|
||||||
filter: 'filterOrder'
|
|
||||||
},
|
|
||||||
|
|
||||||
Shift:{
|
|
||||||
list: 'listShift',
|
|
||||||
get: 'getShiftById',
|
|
||||||
create: 'createShift',
|
|
||||||
update: 'updateShift',
|
|
||||||
delete: 'deleteShift',
|
|
||||||
filter: 'filterShift'
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// Helper for methods not implemented
|
|
||||||
const notImplemented = (entityName, method) => async () => {
|
|
||||||
throw new Error(`${entityName}.${method} is not implemented yet for Data Connect`);
|
|
||||||
};
|
|
||||||
|
|
||||||
// helper para normalizar siempre a array (list + filter devolverán arrays)
|
|
||||||
const normalizeResultToArray = (res) => {
|
|
||||||
// if it is an array, perfect
|
|
||||||
if (Array.isArray(res)) return res;
|
|
||||||
if (!res || typeof res !== 'object') return [];
|
|
||||||
|
|
||||||
const data = res.data;
|
|
||||||
if (data && typeof data === 'object') {
|
|
||||||
const keys = Object.keys(data);
|
|
||||||
if (keys.length === 0) return [];
|
|
||||||
const firstValue = data[keys[0]];
|
|
||||||
|
|
||||||
if (Array.isArray(firstValue)) return firstValue;
|
|
||||||
if (firstValue == null) return [];
|
|
||||||
// if it is a single object, return it as an array
|
|
||||||
return [firstValue];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// --- Entities Module ( Data Connect, without REST Base44) ---
|
|
||||||
const entitiesModule = {};
|
|
||||||
|
|
||||||
// --- Helper to convert snake_case to camelCase recursively ---
|
|
||||||
const toCamel = (value) => {
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
return value.map(toCamel);
|
|
||||||
}
|
|
||||||
if (value && typeof value === "object") {
|
|
||||||
return Object.entries(value).reduce((acc, [key, val]) => {
|
|
||||||
const camelKey = key.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
||||||
acc[camelKey] = toCamel(val);
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
// --- Helper to convert camelCase to snake_case recursively ---
|
|
||||||
const toSnake = (value) => {
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
return value.map(toSnake);
|
|
||||||
}
|
|
||||||
if (value && typeof value === "object") {
|
|
||||||
return Object.entries(value).reduce((acc, [key, val]) => {
|
|
||||||
const snakeKey = key
|
|
||||||
.replace(/([A-Z])/g, "_$1")
|
|
||||||
.replace(/([a-z])([0-9]+)/g, "$1_$2")
|
|
||||||
.toLowerCase();
|
|
||||||
acc[snakeKey] = toSnake(val);
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Object.entries(dataconnectEntityConfig).forEach(([entityName, ops]) => {
|
|
||||||
entitiesModule[entityName] = {
|
|
||||||
|
|
||||||
get: notImplemented(entityName, 'get'),
|
|
||||||
update: notImplemented(entityName, 'update'),
|
|
||||||
delete: notImplemented(entityName, 'delete'),
|
|
||||||
filter: notImplemented(entityName, 'filter'),
|
|
||||||
list: notImplemented(entityName, 'list'),
|
|
||||||
create: notImplemented(entityName, 'create'),
|
|
||||||
|
|
||||||
// list
|
|
||||||
...(ops.list && {
|
|
||||||
list: async (...args) => {
|
|
||||||
/*const fn = dcSdk[ops.list];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.list}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let sort;
|
|
||||||
let limit;
|
|
||||||
let baseVariables; // por si algún list usa variables (como Team)
|
|
||||||
|
|
||||||
if (args.length === 1) {
|
|
||||||
const [a0] = args;
|
|
||||||
if (typeof a0 === "string") {
|
|
||||||
// list('-created_date')
|
|
||||||
sort = a0;
|
|
||||||
} else if (a0 && typeof a0 === "object" && !Array.isArray(a0)) {
|
|
||||||
// list({ ...vars }) -> reservado para queries que acepten variables
|
|
||||||
baseVariables = a0;
|
|
||||||
}
|
|
||||||
} else if (args.length === 2) {
|
|
||||||
const [a0, a1] = args;
|
|
||||||
if (typeof a0 === "string" && typeof a1 === "number") {
|
|
||||||
// list('-created_date', 50)
|
|
||||||
sort = a0;
|
|
||||||
limit = a1;
|
|
||||||
} else if (a0 && typeof a0 === "object" && !Array.isArray(a0)) {
|
|
||||||
// list({ ...vars }, '-created_date')
|
|
||||||
baseVariables = a0;
|
|
||||||
if (typeof a1 === "string") sort = a1;
|
|
||||||
}
|
|
||||||
} else if (args.length >= 3) {
|
|
||||||
const [a0, a1, a2] = args;
|
|
||||||
if (a0 && typeof a0 === "object" && !Array.isArray(a0)) {
|
|
||||||
// list({ ...vars }, '-created_date', 50)
|
|
||||||
baseVariables = a0;
|
|
||||||
if (typeof a1 === "string") sort = a1;
|
|
||||||
if (typeof a2 === "number") limit = a2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let variables = baseVariables;
|
|
||||||
|
|
||||||
if (entityName === "Team") {
|
|
||||||
variables = variables || {};
|
|
||||||
if (sort) {
|
|
||||||
const desc = sort.startsWith("-");
|
|
||||||
variables.orderByCreatedDate = desc ? "DESC" : "ASC";
|
|
||||||
}
|
|
||||||
if (typeof limit === "number") {
|
|
||||||
variables.limit = limit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await fn(dataConnect, variables);
|
|
||||||
let items = normalizeResultToArray(res);
|
|
||||||
|
|
||||||
// para entidades que NO tienen orderBy/limit en el query,
|
|
||||||
// aplicamos sort/limit en el front como fallback.
|
|
||||||
if (entityName !== "Team" && sort) {
|
|
||||||
const desc = sort.startsWith("-");
|
|
||||||
const field = desc ? sort.slice(1) : sort; // '-created_date' -> 'created_date'
|
|
||||||
|
|
||||||
items = items.slice().sort((a, b) => {
|
|
||||||
const av = a?.[field];
|
|
||||||
const bv = b?.[field];
|
|
||||||
|
|
||||||
if (av == null && bv == null) return 0;
|
|
||||||
if (av == null) return 1;
|
|
||||||
if (bv == null) return -1;
|
|
||||||
|
|
||||||
const da = new Date(av);
|
|
||||||
const db = new Date(bv);
|
|
||||||
if (!isNaN(da) && !isNaN(db)) {
|
|
||||||
return desc ? db - da : da - db;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (av < bv) return desc ? 1 : -1;
|
|
||||||
if (av > bv) return desc ? -1 : 1;
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityName !== "Team" && typeof limit === "number") {
|
|
||||||
items = items.slice(0, limit);
|
|
||||||
}
|
|
||||||
//console.log(items)
|
|
||||||
//return items;
|
|
||||||
*/
|
|
||||||
const fn = dcSdk[ops.list];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.list}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// --- Lógica de parseo de argumentos (se mantiene para compatibilidad) ---
|
|
||||||
let sort;
|
|
||||||
let limit;
|
|
||||||
let baseVariables;
|
|
||||||
|
|
||||||
if (args.length === 1) {
|
|
||||||
const [a0] = args;
|
|
||||||
if (typeof a0 === "string") sort = a0;
|
|
||||||
else if (a0 && typeof a0 === "object") baseVariables = a0;
|
|
||||||
} else if (args.length === 2) {
|
|
||||||
const [a0, a1] = args;
|
|
||||||
if (typeof a0 === "string" && typeof a1 === "number") {
|
|
||||||
sort = a0;
|
|
||||||
limit = a1;
|
|
||||||
} else if (a0 && typeof a0 === "object") {
|
|
||||||
baseVariables = a0;
|
|
||||||
if (typeof a1 === "string") sort = a1;
|
|
||||||
}
|
|
||||||
} else if (args.length >= 3) {
|
|
||||||
const [a0, a1, a2] = args;
|
|
||||||
if (a0 && typeof a0 === "object") {
|
|
||||||
baseVariables = a0;
|
|
||||||
if (typeof a1 === "string") sort = a1;
|
|
||||||
if (typeof a2 === "number") limit = a2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- FIX: Se llama al backend SIN parámetros de orden/límite ---
|
|
||||||
// Se asume que la mayoría de queries 'list' no aceptan variables, solo se pasan si existen.
|
|
||||||
|
|
||||||
//const res = await fn(dataConnect, baseVariables);
|
|
||||||
const res = await fn(dataConnect, baseVariables);
|
|
||||||
|
|
||||||
let items = normalizeResultToArray(res);
|
|
||||||
|
|
||||||
// --- FIX: SE RESTAURA el ordenamiento y límite en el CLIENTE ---
|
|
||||||
// Esto es necesario hasta que el backend pueda manejar estos parámetros.
|
|
||||||
if (sort) {
|
|
||||||
const isDesc = sort.startsWith("-");
|
|
||||||
const field = isDesc ? sort.slice(1) : sort;
|
|
||||||
|
|
||||||
items = items.slice().sort((a, b) => {
|
|
||||||
const av = a?.[field];
|
|
||||||
const bv = b?.[field];
|
|
||||||
|
|
||||||
if (av == null && bv == null) return 0;
|
|
||||||
if (av == null) return 1;
|
|
||||||
if (bv == null) return -1;
|
|
||||||
|
|
||||||
const da = new Date(av);
|
|
||||||
const db = new Date(bv);
|
|
||||||
if (!isNaN(da) && !isNaN(db)) {
|
|
||||||
return isDesc ? db - da : da - db;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (av < bv) return isDesc ? 1 : -1;
|
|
||||||
if (av > bv) return isDesc ? -1 : 1;
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof limit === "number") {
|
|
||||||
items = items.slice(0, limit);
|
|
||||||
}
|
|
||||||
return items.map(toSnake);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('list staff failed', err);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
// create
|
|
||||||
...(ops.create && {
|
|
||||||
create: async (params) => {
|
|
||||||
const fn = dcSdk[ops.create];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.create}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!params || typeof params !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
`${entityName}.create expects an object with the fields to insert`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let payload;
|
|
||||||
|
|
||||||
if (params.data && typeof params.data === 'object') {
|
|
||||||
// caso nuevo: create({ data: { ... } })
|
|
||||||
payload = params.data;
|
|
||||||
} else {
|
|
||||||
// caso legacy: create({ ...fields })
|
|
||||||
payload = params;
|
|
||||||
}
|
|
||||||
|
|
||||||
//converting to camelCase for data connect
|
|
||||||
payload = toCamel(payload);
|
|
||||||
|
|
||||||
return fn(dataConnect, payload);
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
//get
|
|
||||||
...(ops.get && {
|
|
||||||
get: async (params) => {
|
|
||||||
const fn = dcSdk[ops.get];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.get}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!params || typeof params !== 'object') {
|
|
||||||
throw new Error(`${entityName}.get expects an object of variables (e.g. { id })`);
|
|
||||||
}
|
|
||||||
|
|
||||||
//return fn(dataConnect, params);
|
|
||||||
const result = await fn(dataConnect, params);
|
|
||||||
return toSnake(result);
|
|
||||||
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
//update
|
|
||||||
...(ops.update && {
|
|
||||||
update: async (id,params) => {
|
|
||||||
const fn = dcSdk[ops.update];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.update}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!params || typeof params !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
`${entityName}.update expects an object of variables matching the GraphQL mutation`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//const { id, data } = params;
|
|
||||||
let data = params;
|
|
||||||
|
|
||||||
if (!id) {
|
|
||||||
throw new Error(`${entityName}.update requires an "id" field`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data || typeof data !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
`${entityName}.update requires a "data" object with the fields to update`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data && typeof data === "object") {
|
|
||||||
data = toCamel(data);
|
|
||||||
}
|
|
||||||
const vars = { id, ...data };
|
|
||||||
|
|
||||||
return fn(dataConnect, vars);
|
|
||||||
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
|
|
||||||
// delete
|
|
||||||
...(ops.delete && {
|
|
||||||
delete: async (params) => {
|
|
||||||
const fn = dcSdk[ops.delete];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.delete}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!params || typeof params !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
`${entityName}.delete expects an object like { id }`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const { id } = params;
|
|
||||||
|
|
||||||
if (!id) {
|
|
||||||
throw new Error(`${entityName}.delete requires an "id" field`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Data Connect solo espera { id } como variables
|
|
||||||
return fn(dataConnect, { id });
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
|
|
||||||
// filter
|
|
||||||
...(ops.filter && {
|
|
||||||
filter: async (...args) => {
|
|
||||||
const fn = dcSdk[ops.filter];
|
|
||||||
if (typeof fn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.filter}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIX: soportar firma vieja: filter(filters, sort, limit)
|
|
||||||
const [params, sort, limit] = args;
|
|
||||||
// FIX: soportar firma vieja: filter(filters, sort, limit)
|
|
||||||
|
|
||||||
if (!params) {
|
|
||||||
if (ops.list) {//if no params, call to list()
|
|
||||||
const listFn = dcSdk[ops.list];
|
|
||||||
if (typeof listFn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.list}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//return listFn(dataConnect);
|
|
||||||
//fix
|
|
||||||
const resList = await listFn(dataConnect);
|
|
||||||
return normalizeResultToArray(resList);
|
|
||||||
//fix
|
|
||||||
}
|
|
||||||
throw new Error(`${entityName}.filter expects params or a list operation`);
|
|
||||||
}
|
|
||||||
const rawFilters = params.filters ?? params;
|
|
||||||
const variables = {};
|
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(rawFilters)) {//cleaning undefined/null/'' values
|
|
||||||
if (value !== undefined && value !== null && value !== '') {
|
|
||||||
variables[key] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if no valid filters, call to list()
|
|
||||||
if (Object.keys(variables).length === 0) {
|
|
||||||
if (ops.list) {
|
|
||||||
const listFn = dcSdk[ops.list];
|
|
||||||
if (typeof listFn !== 'function') {
|
|
||||||
throw new Error(
|
|
||||||
`Data Connect operation "${ops.list}" not found for entity "${entityName}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//return listFn(dataConnect);
|
|
||||||
//fix
|
|
||||||
const resList = await listFn(dataConnect);
|
|
||||||
return normalizeResultToArray(resList);
|
|
||||||
//fix
|
|
||||||
}
|
|
||||||
throw new Error(`${entityName}.filter received no valid filters and no list operation`);
|
|
||||||
}
|
|
||||||
|
|
||||||
//return fn(dataConnect, variables);
|
|
||||||
//fix
|
|
||||||
const res = await fn(dataConnect, variables);
|
|
||||||
|
|
||||||
// FIX: normalizar a array (activityLogs[], messages[], etc.)
|
|
||||||
let items = normalizeResultToArray(res);
|
|
||||||
|
|
||||||
// FIX: soportar sort tipo '-created_date' o 'created_date'
|
|
||||||
if (sort) {
|
|
||||||
const desc = sort.startsWith('-');
|
|
||||||
const field = desc ? sort.slice(1) : sort;
|
|
||||||
|
|
||||||
items = items.slice().sort((a, b) => {
|
|
||||||
const av = a?.[field];
|
|
||||||
const bv = b?.[field];
|
|
||||||
|
|
||||||
if (av == null && bv == null) return 0;
|
|
||||||
if (av == null) return 1;
|
|
||||||
if (bv == null) return -1;
|
|
||||||
|
|
||||||
// Intentar tratarlos como fecha si parecen fechas
|
|
||||||
const da = new Date(av);
|
|
||||||
const db = new Date(bv);
|
|
||||||
if (!isNaN(da) && !isNaN(db)) {
|
|
||||||
return desc ? db - da : da - db;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback: comparación normal
|
|
||||||
if (av < bv) return desc ? 1 : -1;
|
|
||||||
if (av > bv) return desc ? -1 : 1;
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIX: soportar limit (ej: 50)
|
|
||||||
if (typeof limit === 'number') {
|
|
||||||
items = items.slice(0, limit);
|
|
||||||
}
|
|
||||||
|
|
||||||
return items;
|
|
||||||
//fix
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// --- Main SDK Export ---
|
|
||||||
export const krowSDK = {
|
|
||||||
auth: authModule,
|
|
||||||
integrations: {
|
|
||||||
Core: coreIntegrationsModule,
|
|
||||||
},
|
|
||||||
entities: entitiesModule,
|
|
||||||
};
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Navigate } from 'react-router-dom';
|
|
||||||
import { useAuth } from '@/hooks/useAuth';
|
|
||||||
import { Loader2 } from 'lucide-react';
|
|
||||||
|
|
||||||
export default function ProtectedRoute({ children }) {
|
|
||||||
const { user, loading } = useAuth();
|
|
||||||
|
|
||||||
if (loading) {
|
|
||||||
return (
|
|
||||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100">
|
|
||||||
<div className="text-center">
|
|
||||||
<Loader2 className="w-12 h-12 text-[#0A39DF] animate-spin mx-auto mb-4" />
|
|
||||||
<p className="text-slate-600 font-medium">Loading...</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!user) {
|
|
||||||
return <Navigate to="/login" replace />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Navigate } from 'react-router-dom';
|
|
||||||
import { useAuth } from '@/hooks/useAuth';
|
|
||||||
import { Loader2 } from 'lucide-react';
|
|
||||||
|
|
||||||
export default function PublicRoute({ children }) {
|
|
||||||
const { user, loading } = useAuth();
|
|
||||||
|
|
||||||
if (loading) {
|
|
||||||
return (
|
|
||||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100">
|
|
||||||
<div className="text-center">
|
|
||||||
<Loader2 className="w-12 h-12 text-[#0A39DF] animate-spin mx-auto mb-4" />
|
|
||||||
<p className="text-slate-600 font-medium">Loading...</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user) {
|
|
||||||
return <Navigate to="/" replace />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Card, CardContent } from "@/components/ui/card";
|
|
||||||
import { Badge } from "@/components/ui/badge";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Building2, MapPin, Briefcase, Phone, Mail, TrendingUp, Clock, Award, Users, Eye, Edit2, DollarSign } from "lucide-react";
|
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import { createPageUrl } from "@/utils";
|
|
||||||
|
|
||||||
export default function BusinessCard({ company, metrics, isListView = false, onView, onEdit }) {
|
|
||||||
const { companyName, logo, sector, monthlySpend, totalStaff, location, serviceType, phone, email, technology, performance, gradeColor, clientGrade, isActive, lastOrderDate, rateCard, businessId } = company;
|
|
||||||
|
|
||||||
if (isListView) {
|
|
||||||
return (
|
|
||||||
<Card className="border-slate-200 shadow-sm hover:shadow-md transition-all">
|
|
||||||
<CardContent className="p-4">
|
|
||||||
<div className="flex items-center gap-4">
|
|
||||||
{/* Logo */}
|
|
||||||
<div className="flex-shrink-0">
|
|
||||||
{logo ? (
|
|
||||||
<img src={logo} alt={companyName} className="w-16 h-16 rounded-lg object-cover border-2 border-slate-200" />
|
|
||||||
) : (
|
|
||||||
<div className="w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-700 rounded-lg flex items-center justify-center">
|
|
||||||
<Building2 className="w-8 h-8 text-white" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Company Info */}
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<div className="flex items-center gap-2 mb-1">
|
|
||||||
<h3 className="text-lg font-bold text-slate-900 truncate">{companyName}</h3>
|
|
||||||
<div className={`px-3 py-1 ${gradeColor} rounded-lg font-bold text-white text-sm`}>
|
|
||||||
{clientGrade}
|
|
||||||
</div>
|
|
||||||
{isActive === false && (
|
|
||||||
<Badge className="bg-slate-300 text-slate-700 text-xs">Inactive</Badge>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 mb-2">{serviceType}</p>
|
|
||||||
<div className="flex items-center gap-4 text-xs text-slate-500">
|
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
<MapPin className="w-3 h-3" />
|
|
||||||
{location}
|
|
||||||
</span>
|
|
||||||
<span>Monthly: ${(monthlySpend / 1000).toFixed(0)}k</span>
|
|
||||||
<span>{totalStaff} Staff</span>
|
|
||||||
{lastOrderDate && (
|
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
<Clock className="w-3 h-3" />
|
|
||||||
Last: {new Date(lastOrderDate).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* All Performance Metrics */}
|
|
||||||
<div className="flex items-center gap-4 flex-shrink-0">
|
|
||||||
<div className="text-center">
|
|
||||||
<p className="text-xs text-slate-500 mb-1">Cancellations</p>
|
|
||||||
<p className="text-lg font-bold text-orange-700">{performance.cancelRate}%</p>
|
|
||||||
</div>
|
|
||||||
<div className="text-center">
|
|
||||||
<p className="text-xs text-slate-500 mb-1">On-Time</p>
|
|
||||||
<p className="text-lg font-bold text-blue-700">{performance.onTimeRate}%</p>
|
|
||||||
</div>
|
|
||||||
<div className="text-center">
|
|
||||||
<p className="text-xs text-slate-500 mb-1">Rapid Orders</p>
|
|
||||||
<p className="text-lg font-bold text-purple-700">{performance.rapidOrders}</p>
|
|
||||||
</div>
|
|
||||||
<div className="text-center min-w-[80px]">
|
|
||||||
<p className="text-xs text-slate-500 mb-1">Main Position</p>
|
|
||||||
<p className="text-sm font-bold text-green-700 truncate">{performance.mainPosition}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Rate Card Badge */}
|
|
||||||
{rateCard && (
|
|
||||||
<div className="flex-shrink-0">
|
|
||||||
<Link to={`${createPageUrl("EditBusiness")}?id=${businessId}&tab=services`}>
|
|
||||||
<Badge className="bg-emerald-100 text-emerald-700 border border-emerald-200 hover:bg-emerald-200 cursor-pointer px-3 py-1.5">
|
|
||||||
<DollarSign className="w-3 h-3 mr-1 inline" />
|
|
||||||
{rateCard}
|
|
||||||
</Badge>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Actions */}
|
|
||||||
<div className="flex items-center gap-2 flex-shrink-0">
|
|
||||||
<Button variant="outline" size="sm" onClick={onView} className="border-blue-600 text-blue-600 hover:bg-blue-50">
|
|
||||||
<Eye className="w-4 h-4 mr-1" />
|
|
||||||
View
|
|
||||||
</Button>
|
|
||||||
<Button variant="outline" size="sm" onClick={onEdit} className="border-slate-300 hover:bg-slate-50">
|
|
||||||
<Edit2 className="w-4 h-4 mr-1" />
|
|
||||||
Edit
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Card className="border-slate-200 shadow-lg hover:shadow-xl transition-all overflow-hidden">
|
|
||||||
{/* Header - Blue Gradient */}
|
|
||||||
<div className="bg-gradient-to-br from-blue-600 to-blue-800 p-6 relative">
|
|
||||||
<div className="flex items-start justify-between mb-4">
|
|
||||||
<div className="flex items-center gap-4">
|
|
||||||
{logo ? (
|
|
||||||
<img src={logo} alt={companyName} className="w-16 h-16 rounded-xl object-cover border-2 border-white shadow-md bg-white p-1" />
|
|
||||||
) : (
|
|
||||||
<div className="w-16 h-16 bg-white rounded-xl flex items-center justify-center shadow-md">
|
|
||||||
<Building2 className="w-8 h-8 text-blue-600" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div>
|
|
||||||
<h3 className="text-2xl font-bold text-white mb-1">{companyName}</h3>
|
|
||||||
<Badge className="bg-white/20 text-white border-white/40 text-xs">
|
|
||||||
# N/A
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className={`px-4 py-2 ${gradeColor} rounded-xl font-bold text-2xl text-white shadow-lg`}>
|
|
||||||
{clientGrade}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p className="text-blue-100 text-sm font-medium">{serviceType}</p>
|
|
||||||
|
|
||||||
{/* Metrics Row */}
|
|
||||||
<div className="grid grid-cols-3 gap-3 mt-4">
|
|
||||||
<div className="bg-white/10 backdrop-blur-sm rounded-lg p-4">
|
|
||||||
<p className="text-blue-200 text-xs font-medium mb-1">Monthly Sales</p>
|
|
||||||
<p className="text-white text-2xl font-bold">${(monthlySpend / 1000).toFixed(0)}k</p>
|
|
||||||
</div>
|
|
||||||
<div className="bg-white/10 backdrop-blur-sm rounded-lg p-4">
|
|
||||||
<p className="text-blue-200 text-xs font-medium mb-1">Total Staff</p>
|
|
||||||
<p className="text-white text-2xl font-bold">{totalStaff}</p>
|
|
||||||
</div>
|
|
||||||
<div className="bg-white/10 backdrop-blur-sm rounded-lg p-4">
|
|
||||||
<p className="text-blue-200 text-xs font-medium mb-1">Last Order</p>
|
|
||||||
<p className="text-white text-lg font-bold">
|
|
||||||
{lastOrderDate
|
|
||||||
? new Date(lastOrderDate).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })
|
|
||||||
: 'None'}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Content */}
|
|
||||||
<CardContent className="p-6 bg-slate-50">
|
|
||||||
{/* Company Information */}
|
|
||||||
<div className="mb-6">
|
|
||||||
<h4 className="text-xs font-bold text-slate-500 uppercase tracking-wider mb-3">COMPANY INFORMATION</h4>
|
|
||||||
<div className="space-y-3">
|
|
||||||
<div className="flex items-start gap-3">
|
|
||||||
<MapPin className="w-5 h-5 text-slate-400 mt-0.5 flex-shrink-0" />
|
|
||||||
<div>
|
|
||||||
<p className="font-semibold text-slate-900">{location}</p>
|
|
||||||
<p className="text-sm text-slate-500">California</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-start gap-3">
|
|
||||||
<Briefcase className="w-5 h-5 text-slate-400 mt-0.5 flex-shrink-0" />
|
|
||||||
<div>
|
|
||||||
<p className="font-semibold text-slate-900">{serviceType}</p>
|
|
||||||
<p className="text-sm text-slate-500">Primary Service</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-start gap-3">
|
|
||||||
<Phone className="w-5 h-5 text-slate-400 mt-0.5 flex-shrink-0" />
|
|
||||||
<p className="text-slate-900">{phone}</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-start gap-3">
|
|
||||||
<Mail className="w-5 h-5 text-slate-400 mt-0.5 flex-shrink-0" />
|
|
||||||
<p className="text-slate-900 break-all">{email}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Rate Card & Technology */}
|
|
||||||
<div className="mb-6">
|
|
||||||
<h4 className="text-xs font-bold text-slate-500 uppercase tracking-wider mb-3">RATE CARD & TECHNOLOGY</h4>
|
|
||||||
<div className="flex flex-wrap gap-2">
|
|
||||||
{rateCard ? (
|
|
||||||
<Link to={`${createPageUrl("EditBusiness")}?id=${businessId}&tab=services`}>
|
|
||||||
<Badge className="bg-emerald-50 text-emerald-700 border border-emerald-200 text-xs cursor-pointer hover:bg-emerald-100">
|
|
||||||
<DollarSign className="w-3 h-3 mr-1 inline" />
|
|
||||||
{rateCard}
|
|
||||||
</Badge>
|
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<Badge className="bg-slate-100 text-slate-500 border border-slate-200 text-xs">
|
|
||||||
No Rate Card
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
{technology?.isUsingKROW ? (
|
|
||||||
<Badge className="bg-blue-50 text-blue-700 border border-blue-200 text-xs">
|
|
||||||
Using KROW
|
|
||||||
</Badge>
|
|
||||||
) : (
|
|
||||||
<Badge className="bg-amber-50 text-amber-700 border border-amber-200 text-xs cursor-pointer hover:bg-amber-100">
|
|
||||||
Invite to KROW
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Performance Metrics */}
|
|
||||||
<div className="mb-4">
|
|
||||||
<h4 className="text-xs font-bold text-slate-500 uppercase tracking-wider mb-3">PERFORMANCE METRICS</h4>
|
|
||||||
<div className="grid grid-cols-2 gap-4">
|
|
||||||
{/* Cancellation Rate */}
|
|
||||||
<div className="bg-white rounded-lg p-4 border border-slate-200">
|
|
||||||
<div className="flex items-center gap-2 mb-2">
|
|
||||||
<TrendingUp className="w-4 h-4 text-orange-600" />
|
|
||||||
<p className="text-xs font-semibold text-slate-600">Cancellations</p>
|
|
||||||
</div>
|
|
||||||
<p className="text-3xl font-bold text-orange-600 mb-2">{performance.cancelRate}%</p>
|
|
||||||
<div className="w-full h-2 bg-orange-100 rounded-full overflow-hidden">
|
|
||||||
<div className="h-full bg-orange-600 rounded-full transition-all" style={{ width: `${performance.cancelRate}%` }}></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* On-Time Ordering */}
|
|
||||||
<div className="bg-white rounded-lg p-4 border border-slate-200">
|
|
||||||
<div className="flex items-center gap-2 mb-2">
|
|
||||||
<Clock className="w-4 h-4 text-blue-600" />
|
|
||||||
<p className="text-xs font-semibold text-slate-600">On-Time Order</p>
|
|
||||||
</div>
|
|
||||||
<p className="text-3xl font-bold text-blue-600 mb-2">{performance.onTimeRate}%</p>
|
|
||||||
<div className="w-full h-2 bg-blue-100 rounded-full overflow-hidden">
|
|
||||||
<div className="h-full bg-blue-600 rounded-full transition-all" style={{ width: `${performance.onTimeRate}%` }}></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Rapid Orders */}
|
|
||||||
<div className="bg-white rounded-lg p-4 border border-slate-200">
|
|
||||||
<div className="flex items-center gap-2 mb-2">
|
|
||||||
<Award className="w-4 h-4 text-purple-600" />
|
|
||||||
<p className="text-xs font-semibold text-slate-600">Rapid Orders</p>
|
|
||||||
</div>
|
|
||||||
<p className="text-3xl font-bold text-purple-600 mb-2">{performance.rapidOrders}</p>
|
|
||||||
<p className="text-xs text-slate-500">Last 30 days</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Main Position */}
|
|
||||||
<div className="bg-white rounded-lg p-4 border border-slate-200">
|
|
||||||
<div className="flex items-center gap-2 mb-2">
|
|
||||||
<Users className="w-4 h-4 text-green-600" />
|
|
||||||
<p className="text-xs font-semibold text-slate-600">Main Position</p>
|
|
||||||
</div>
|
|
||||||
<p className="text-lg font-bold text-green-600">{performance.mainPosition}</p>
|
|
||||||
<p className="text-xs text-slate-500">Most requested</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Footer */}
|
|
||||||
<button
|
|
||||||
onClick={onView}
|
|
||||||
className="w-full bg-blue-50 hover:bg-blue-100 rounded-lg p-3 text-center transition-colors cursor-pointer"
|
|
||||||
>
|
|
||||||
<p className="text-xs text-blue-700 font-medium">
|
|
||||||
Click to view full profile and detailed analytics
|
|
||||||
</p>
|
|
||||||
</button>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Input } from "@/components/ui/input";
|
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from "@/components/ui/select";
|
|
||||||
import { Save, X } from "lucide-react";
|
|
||||||
|
|
||||||
export default function CreateBusinessModal({ open, onOpenChange, onSubmit, isSubmitting }) {
|
|
||||||
const [formData, setFormData] = useState({
|
|
||||||
business_name: "",
|
|
||||||
company_logo: "", // Added company_logo field
|
|
||||||
contact_name: "",
|
|
||||||
phone: "",
|
|
||||||
email: "",
|
|
||||||
hub_building: "",
|
|
||||||
address: "",
|
|
||||||
city: "",
|
|
||||||
area: "Bay Area",
|
|
||||||
sector: "",
|
|
||||||
rate_group: "",
|
|
||||||
status: "Active",
|
|
||||||
notes: ""
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleChange = (field, value) => {
|
|
||||||
setFormData(prev => ({ ...prev, [field]: value }));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
onSubmit(formData);
|
|
||||||
// Reset form after submission
|
|
||||||
setFormData({
|
|
||||||
business_name: "",
|
|
||||||
company_logo: "", // Reset company_logo field
|
|
||||||
contact_name: "",
|
|
||||||
phone: "",
|
|
||||||
email: "",
|
|
||||||
hub_building: "",
|
|
||||||
address: "",
|
|
||||||
city: "",
|
|
||||||
area: "Bay Area",
|
|
||||||
sector: "",
|
|
||||||
rate_group: "",
|
|
||||||
status: "Active",
|
|
||||||
notes: ""
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
||||||
<DialogContent className="max-w-3xl max-h-[90vh] overflow-y-auto">
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle className="text-2xl font-bold text-[#1C323E]">
|
|
||||||
Create New Business
|
|
||||||
</DialogTitle>
|
|
||||||
</DialogHeader>
|
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="space-y-6 mt-4">
|
|
||||||
{/* Business Name & Company Logo */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="business_name" className="text-slate-700 font-medium">
|
|
||||||
Business Name <span className="text-red-500">*</span>
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="business_name"
|
|
||||||
value={formData.business_name}
|
|
||||||
onChange={(e) => handleChange('business_name', e.target.value)}
|
|
||||||
placeholder="Enter business name"
|
|
||||||
required
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="company_logo" className="text-slate-700 font-medium">
|
|
||||||
Company Logo URL
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="company_logo"
|
|
||||||
value={formData.company_logo}
|
|
||||||
onChange={(e) => handleChange('company_logo', e.target.value)}
|
|
||||||
placeholder="https://example.com/logo.png"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-slate-500">Optional: URL to company logo image</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Primary Contact (Moved from first grid to its own section) */}
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="contact_name" className="text-slate-700 font-medium">
|
|
||||||
Primary Contact <span className="text-red-500">*</span>
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="contact_name"
|
|
||||||
value={formData.contact_name}
|
|
||||||
onChange={(e) => handleChange('contact_name', e.target.value)}
|
|
||||||
placeholder="Contact name"
|
|
||||||
required
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Contact Number & Email */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="phone" className="text-slate-700 font-medium">
|
|
||||||
Contact Number
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="phone"
|
|
||||||
type="tel"
|
|
||||||
value={formData.phone}
|
|
||||||
onChange={(e) => handleChange('phone', e.target.value)}
|
|
||||||
placeholder="(555) 123-4567"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="email" className="text-slate-700 font-medium">
|
|
||||||
Email
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="email"
|
|
||||||
type="email"
|
|
||||||
value={formData.email}
|
|
||||||
onChange={(e) => handleChange('email', e.target.value)}
|
|
||||||
placeholder="business@example.com"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Hub / Building */}
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="hub_building" className="text-slate-700 font-medium">
|
|
||||||
Hub / Building
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="hub_building"
|
|
||||||
value={formData.hub_building}
|
|
||||||
onChange={(e) => handleChange('hub_building', e.target.value)}
|
|
||||||
placeholder="Building name or location"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Address */}
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="address" className="text-slate-700 font-medium">
|
|
||||||
Address
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="address"
|
|
||||||
value={formData.address}
|
|
||||||
onChange={(e) => handleChange('address', e.target.value)}
|
|
||||||
placeholder="Street address"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* City & Area */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="city" className="text-slate-700 font-medium">
|
|
||||||
City
|
|
||||||
</Label>
|
|
||||||
<Input
|
|
||||||
id="city"
|
|
||||||
value={formData.city}
|
|
||||||
onChange={(e) => handleChange('city', e.target.value)}
|
|
||||||
placeholder="City"
|
|
||||||
className="border-slate-300"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="area" className="text-slate-700 font-medium">
|
|
||||||
Area
|
|
||||||
</Label>
|
|
||||||
<Select value={formData.area} onValueChange={(value) => handleChange('area', value)}>
|
|
||||||
<SelectTrigger className="border-slate-300">
|
|
||||||
<SelectValue placeholder="Select area" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="Bay Area">Bay Area</SelectItem>
|
|
||||||
<SelectItem value="Southern California">Southern California</SelectItem>
|
|
||||||
<SelectItem value="Northern California">Northern California</SelectItem>
|
|
||||||
<SelectItem value="Central Valley">Central Valley</SelectItem>
|
|
||||||
<SelectItem value="Other">Other</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Sector & Rate Group */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="sector" className="text-slate-700 font-medium">
|
|
||||||
Sector
|
|
||||||
</Label>
|
|
||||||
<Select value={formData.sector} onValueChange={(value) => handleChange('sector', value)}>
|
|
||||||
<SelectTrigger className="border-slate-300">
|
|
||||||
<SelectValue placeholder="Select sector" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="Bon Appétit">Bon Appétit</SelectItem>
|
|
||||||
<SelectItem value="Eurest">Eurest</SelectItem>
|
|
||||||
<SelectItem value="Aramark">Aramark</SelectItem>
|
|
||||||
<SelectItem value="Epicurean Group">Epicurean Group</SelectItem>
|
|
||||||
<SelectItem value="Chartwells">Chartwells</SelectItem>
|
|
||||||
<SelectItem value="Other">Other</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="rate_group" className="text-slate-700 font-medium">
|
|
||||||
Rate Group <span className="text-red-500">*</span>
|
|
||||||
</Label>
|
|
||||||
<Select value={formData.rate_group} onValueChange={(value) => handleChange('rate_group', value)} required>
|
|
||||||
<SelectTrigger className="border-slate-300">
|
|
||||||
<SelectValue placeholder="Select pricing tier" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="Standard">Standard</SelectItem>
|
|
||||||
<SelectItem value="Premium">Premium</SelectItem>
|
|
||||||
<SelectItem value="Enterprise">Enterprise</SelectItem>
|
|
||||||
<SelectItem value="Custom">Custom</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Status */}
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="status" className="text-slate-700 font-medium">
|
|
||||||
Status
|
|
||||||
</Label>
|
|
||||||
<Select value={formData.status} onValueChange={(value) => handleChange('status', value)}>
|
|
||||||
<SelectTrigger className="border-slate-300">
|
|
||||||
<SelectValue placeholder="Select status" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="Active">Active</SelectItem>
|
|
||||||
<SelectItem value="Inactive">Inactive</SelectItem>
|
|
||||||
<SelectItem value="Pending">Pending</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Action Buttons */}
|
|
||||||
<div className="flex justify-end gap-3 pt-4 border-t border-slate-200">
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="outline"
|
|
||||||
onClick={() => onOpenChange(false)}
|
|
||||||
className="border-slate-300"
|
|
||||||
disabled={isSubmitting}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
disabled={isSubmitting}
|
|
||||||
className="bg-[#0A39DF] hover:bg-[#0A39DF]/90 text-white"
|
|
||||||
>
|
|
||||||
<Save className="w-4 h-4 mr-2" />
|
|
||||||
{isSubmitting ? "Creating..." : "Create Business"}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user