-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
183 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,127 @@ | ||
type Alert @model(class: "AdvisingApp\\Alert\\Models\\Alert") { | ||
"Unique primary key." | ||
id: UUID! | ||
"Unique primary key." | ||
id: UUID! | ||
|
||
"The Concern of the alert." | ||
concern: Educatable! @morphTo | ||
"The Concern of the alert." | ||
concern: Educatable! @morphTo | ||
|
||
"The description of the alert." | ||
description: String! | ||
"The description of the alert." | ||
description: String! | ||
|
||
"The severity of the alert." | ||
severity: AlertSeverity! | ||
"The severity of the alert." | ||
severity: AlertSeverity! | ||
|
||
"The status of the alert." | ||
status: AlertStatus! | ||
"The status of the alert." | ||
status: AlertStatus! | ||
|
||
"The suggested intervention for the alert." | ||
suggested_intervention: String! | ||
"The suggested intervention for the alert." | ||
suggested_intervention: String! | ||
|
||
"The created datetime of the alert." | ||
created_at: DateTime | ||
"The created datetime of the alert." | ||
created_at: DateTime | ||
|
||
"The updated datetime of the alert." | ||
updated_at: DateTime | ||
"The updated datetime of the alert." | ||
updated_at: DateTime | ||
|
||
"The deleted datetime of the alert." | ||
deleted_at: DateTime | ||
"The deleted datetime of the alert." | ||
deleted_at: DateTime | ||
} | ||
|
||
input AlertConcernsQuery { | ||
student: StudentsQuery | ||
contact: ContactsQuery | ||
contact: ContactsQuery | ||
} | ||
|
||
input AlertsQuery { | ||
id: UUID | ||
concern: AlertConcernsQuery @morphToRelation | ||
concern_id: EducatableId | ||
concern_type: EducatableType | ||
description: String | ||
severity: AlertSeverity | ||
status: AlertStatus | ||
suggested_intervention: String | ||
created_at: DateTime | ||
updated_at: DateTime | ||
deleted_at: DateTime | ||
id: UUID | ||
concern: AlertConcernsQuery @morphToRelation | ||
concern_id: EducatableId | ||
concern_type: EducatableType | ||
description: String | ||
severity: AlertSeverity | ||
status: AlertStatus | ||
suggested_intervention: String | ||
created_at: DateTime | ||
updated_at: DateTime | ||
deleted_at: DateTime | ||
} | ||
|
||
type AlertQueries { | ||
"Find a single alert by an identifying attribute." | ||
find( | ||
"The value of the attribute to match." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
): Alert @find @softDeletes @canResolved(ability: "view") | ||
|
||
"List multiple alerts." | ||
list(where: AlertsQuery @searchBy): [Alert!]! | ||
@paginate | ||
@softDeletes | ||
@canModel(ability: "viewAny") | ||
"Find a single alert by an identifying attribute." | ||
find( | ||
"The value of the attribute to match." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
): Alert @find @softDeletes @canResolved(ability: "view") | ||
|
||
"List multiple alerts." | ||
list(where: AlertsQuery @searchBy): [Alert!]! | ||
@paginate | ||
@softDeletes | ||
@canModel(ability: "viewAny") | ||
} | ||
|
||
extend type Query { | ||
alert: AlertQueries! @namespaced | ||
alert: AlertQueries! @namespaced | ||
} | ||
|
||
input CreateAlertInput { | ||
"The Concern related to the alert." | ||
concern_id: EducatableId! | ||
@rules( | ||
apply: [ | ||
"required" | ||
"AdvisingApp\\Alert\\Rules\\ConcernIdExistsRule" | ||
] | ||
) | ||
|
||
"The type of Concern related to the alert." | ||
concern_type: EducatableType! | ||
@rules(apply: ["required", "in:student,contact"]) | ||
|
||
"The description of the alert." | ||
description: String! @rules(apply: ["required", "string"]) | ||
|
||
"The severity of the alert." | ||
severity: AlertSeverity! @rules(apply: ["required"]) | ||
|
||
"The status of the alert." | ||
status: AlertStatus! @rules(apply: ["required"]) | ||
|
||
"The suggested intervention for the alert." | ||
suggested_intervention: String! @rules(apply: ["required", "string"]) | ||
"The Concern related to the alert." | ||
concern_id: EducatableId! | ||
@rules( | ||
apply: ["required", "AdvisingApp\\Alert\\Rules\\ConcernIdExistsRule"] | ||
) | ||
|
||
"The type of Concern related to the alert." | ||
concern_type: EducatableType! @rules(apply: ["required", "in:contact"]) | ||
|
||
"The description of the alert." | ||
description: String! @rules(apply: ["required", "string"]) | ||
|
||
"The severity of the alert." | ||
severity: AlertSeverity! @rules(apply: ["required"]) | ||
|
||
"The status of the alert." | ||
status: AlertStatus! @rules(apply: ["required"]) | ||
|
||
"The suggested intervention for the alert." | ||
suggested_intervention: String! @rules(apply: ["required", "string"]) | ||
} | ||
|
||
input UpdateAlertInput { | ||
"The description of the alert." | ||
description: String @rules(apply: ["filled", "string"]) | ||
"The description of the alert." | ||
description: String @rules(apply: ["filled", "string"]) | ||
|
||
"The severity of the alert." | ||
severity: AlertSeverity @rules(apply: ["filled"]) | ||
"The severity of the alert." | ||
severity: AlertSeverity @rules(apply: ["filled"]) | ||
|
||
"The status of the alert." | ||
status: AlertStatus @rules(apply: ["filled"]) | ||
"The status of the alert." | ||
status: AlertStatus @rules(apply: ["filled"]) | ||
|
||
"The suggested intervention for the alert." | ||
suggested_intervention: String @rules(apply: ["filled", "string"]) | ||
"The suggested intervention for the alert." | ||
suggested_intervention: String @rules(apply: ["filled", "string"]) | ||
} | ||
|
||
type AlertMutations { | ||
"Create an alert." | ||
create(input: CreateAlertInput! @spread): Alert! | ||
@create | ||
@canModel(ability: "create") | ||
|
||
"Update an alert." | ||
update( | ||
"The identifier of the alert you would like to update." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
|
||
"The fields you would like to update." | ||
input: UpdateAlertInput! @spread | ||
): Alert! @update @canFind(ability: "update", find: "id") | ||
|
||
"Delete an alert." | ||
delete( | ||
"The identifier of the alert you would like to delete." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
): Alert @delete @canFind(ability: "delete", find: "id") | ||
"Create an alert." | ||
create(input: CreateAlertInput! @spread): Alert! | ||
@create | ||
@canModel(ability: "create") | ||
|
||
"Update an alert." | ||
update( | ||
"The identifier of the alert you would like to update." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
|
||
"The fields you would like to update." | ||
input: UpdateAlertInput! @spread | ||
): Alert! @update @canFind(ability: "update", find: "id") | ||
|
||
"Delete an alert." | ||
delete( | ||
"The identifier of the alert you would like to delete." | ||
id: UUID! @whereKey @rules(apply: ["required", "uuid", "exists:alerts"]) | ||
): Alert @delete @canFind(ability: "delete", find: "id") | ||
} | ||
|
||
extend type Mutation { | ||
alert: AlertMutations! @namespaced | ||
alert: AlertMutations! @namespaced | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.