Skip to content

Commit

Permalink
Merge pull request #545 from canyongbs/feature/advapp-327-api-develop…
Browse files Browse the repository at this point in the history
…ment-authorization-core-modules

[ADVAPP-327]: API Development for Authorization and Core Modules
  • Loading branch information
Orrison authored Feb 19, 2024
2 parents 3c72a26 + 550a01d commit 67d9560
Show file tree
Hide file tree
Showing 55 changed files with 1,805 additions and 136 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ public/api-docs/*
frankenphp
frankenphp-worker.php
/rr
_temp_graphql_parse_ide_helper_models.php
18 changes: 11 additions & 7 deletions _ide_helper_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ class IdeHelperAssistantChatMessage {}
* @property array $metadata
* @property string $user_id
* @property array $request
* @property int $sent_at
* @property \Illuminate\Support\Carbon $sent_at
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\User $user
Expand Down Expand Up @@ -1495,6 +1495,8 @@ class IdeHelperConsentAgreement {}
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read \AdvisingApp\Consent\Models\ConsentAgreement $consentAgreement
* @property-read \App\Models\User $user
* @method static \Illuminate\Database\Eloquent\Builder|UserConsentAgreement newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|UserConsentAgreement newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|UserConsentAgreement onlyTrashed()
Expand Down Expand Up @@ -4128,12 +4130,13 @@ class IdeHelperSla {}
* @property string $subject
* @property string $catalog_nbr
* @property string $enrl_status_reason
* @property string $enrl_add_dt
* @property string $enrl_drop_dt
* @property \Illuminate\Support\Carbon $enrl_add_dt
* @property \Illuminate\Support\Carbon $enrl_drop_dt
* @property string $crse_grade_off
* @property int $unt_taken
* @property int $unt_earned
* @property string $last_upd_dt_stmp
* @property \Illuminate\Support\Carbon $last_upd_dt_stmp
* @property-read \AdvisingApp\StudentDataModel\Models\Student|null $student
* @method static \AdvisingApp\StudentDataModel\Database\Factories\EnrollmentFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|Enrollment newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Enrollment newQuery()
Expand Down Expand Up @@ -4170,7 +4173,7 @@ class IdeHelperEnrollment {}
* @property int $cum_ern
* @property int $pct_ern
* @property string $cum_gpa
* @property string $max_dt
* @property \Illuminate\Support\Carbon $max_dt
* @property-read \AdvisingApp\StudentDataModel\Models\Student|null $student
* @method static \AdvisingApp\StudentDataModel\Database\Factories\PerformanceFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|Performance newModelQuery()
Expand Down Expand Up @@ -4205,8 +4208,9 @@ class IdeHelperPerformance {}
* @property string $semester
* @property string $descr
* @property string $foi
* @property string $change_dt
* @property string $declare_dt
* @property \Illuminate\Support\Carbon $change_dt
* @property \Illuminate\Support\Carbon $declare_dt
* @property-read \AdvisingApp\StudentDataModel\Models\Student|null $student
* @method static \AdvisingApp\StudentDataModel\Database\Factories\ProgramFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|Program newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Program newQuery()
Expand Down
4 changes: 2 additions & 2 deletions app-modules/alert/src/Providers/AlertServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
use Filament\Panel;
use AdvisingApp\Alert\AlertPlugin;
use AdvisingApp\Alert\Models\Alert;
use App\Concerns\ImplementsGraphQL;
use Illuminate\Support\Facades\Event;
use App\Concerns\GraphSchemaDiscovery;
use Illuminate\Support\ServiceProvider;
use AdvisingApp\Alert\Enums\AlertStatus;
use AdvisingApp\Alert\Enums\AlertSeverity;
Expand All @@ -53,7 +53,7 @@

class AlertServiceProvider extends ServiceProvider
{
use GraphSchemaDiscovery;
use ImplementsGraphQL;

public function register(): void
{
Expand Down
110 changes: 110 additions & 0 deletions app-modules/assistant/graphql/assistant-chat-folder.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
type AssistantChatFolder
@model(class: "AdvisingApp\\Assistant\\Models\\AssistantChatFolder") {
id: UUID!

name: String!

created_at: DateTime

updated_at: DateTime

user: User! @belongsTo

chats: [AssistantChat!] @hasMany

chats_count: Int! @count(relation: "chats")
}

input AssistantChatFoldersQuery {
id: UUID

name: String

created_at: DateTime

updated_at: DateTime

user: UsersQuery

chats: AssistantChatsQuery
}

type AssistantChatFolderQueries {
"Get a specific assistant chat folder by ID."
find(
id: UUID!
@whereKey
@rules(apply: ["required", "uuid", "exists:assistant_chat_folders"])
): AssistantChatFolder @find

"List multiple assistant chat folders."
list(
"Filter by the assistant chat folders attributes and relations."
where: AssistantChatFoldersQuery @searchBy
order: AssistantChatFoldersQuery @sortBy
): [AssistantChatFolder!]! @paginate
}

extend type Query {
assistantChatFolder: AssistantChatFolderQueries! @namespaced
}

input CreateAssistantChatFolderInput {
"The name of the assistant chat folder."
name: String!
@rules(
apply: [
"required"
"string"
"max:255"
"AdvisingApp\\Assistant\\Rules\\UniqueAssistantChatFolderRule"
]
)

"The ID of the user that the assistant chat folder belongs to."
user_id: UUID! @rules(apply: ["required", "uuid", "exists:users,id"])
}

input UpdateAssistantChatFolderInput {
"The name of the assistant chat folder."
name: String
@rules(
apply: [
"nullable"
"string"
"max:255"
"AdvisingApp\\Assistant\\Rules\\UniqueAssistantChatFolderRule"
]
)
}

type AssistantChatFolderMutations {
"Create a new assistant chat folder."
create(
"The attributes to create the assistant chat folder with."
input: CreateAssistantChatFolderInput! @spread
): AssistantChatFolder @create

"Update an existing assistant chat folder."
update(
"The ID of the assistant chat folder to update."
id: UUID!
@whereKey
@rules(apply: ["required", "uuid", "exists:assistant_chat_folders"])

"The attributes to update the assistant chat folder with."
input: UpdateAssistantChatFolderInput! @spread
): AssistantChatFolder @update

"Delete an existing assistant chat folder."
delete(
"The ID of the assistant chat folder to delete."
id: UUID!
@whereKey
@rules(apply: ["required", "uuid", "exists:assistant_chat_folders"])
): AssistantChatFolder @delete
}

extend type Mutation {
assistantChatFolder: AssistantChatFolderMutations! @namespaced
}
62 changes: 62 additions & 0 deletions app-modules/assistant/graphql/assistant-chat-message-log.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
type AssistantChatMessageLog
@model(class: "AdvisingApp\\Assistant\\Models\\AssistantChatMessageLog") {
id: UUID!

message: String!

metadata: JSON!

request: JSON!

sent_at: DateTime!

created_at: DateTime

updated_at: DateTime

user: User! @belongsTo
}

input AssistantChatMessageLogsQuery {
id: UUID

message: String

metadata: JSON

request: JSON

sent_at: DateTime

created_at: DateTime

updated_at: DateTime

user: UsersQuery
}

type AssistantChatMessageLogQueries {
"Get a specific assistant chat message log by ID."
find(
id: UUID!
@whereKey
@rules(
apply: [
"required"
"uuid"
"exists:assistant_chat_message_logs"
]
)
): AssistantChatMessageLog @find @canResolved(ability: "view")

"List multiple assistant chat message logs."
list(
"Filter by the assistant chat message logs attributes and relations."
where: AssistantChatMessageLogsQuery @searchBy
order: AssistantChatMessageLogsQuery @sortBy
): [AssistantChatMessageLog!]! @paginate @canModel(ability: "viewAny")
}

extend type Query {
assistantChatMessageLog: AssistantChatMessageLogQueries! @namespaced
}
50 changes: 50 additions & 0 deletions app-modules/assistant/graphql/assistant-chat-message.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
type AssistantChatMessage
@model(class: "AdvisingApp\\Assistant\\Models\\AssistantChatMessage") {
id: UUID!

message: String!

from: AIChatMessageFrom!

created_at: DateTime

updated_at: DateTime

chat: AssistantChat! @belongsTo
}

input AssistantChatMessagesQuery {
id: UUID

message: String

from: AIChatMessageFrom

created_at: DateTime

updated_at: DateTime

chat: AssistantChatsQuery
}

type AssistantChatMessageQueries {
"Get a specific assistant chat message by ID."
find(
id: UUID!
@whereKey
@rules(
apply: ["required", "uuid", "exists:assistant_chat_messages"]
)
): AssistantChatMessage @find @canResolved(ability: "view")

"List multiple assistant chat messages."
list(
"Filter by the assistant chat messages attributes and relations."
where: AssistantChatMessagesQuery @searchBy
order: AssistantChatMessagesQuery @sortBy
): [AssistantChatMessage!]! @paginate @canModel(ability: "viewAny")
}

extend type Query {
assistantChatMessage: AssistantChatMessageQueries! @namespaced
}
Loading

0 comments on commit 67d9560

Please sign in to comment.