From 8323fbd9edb61f6eab445d76987be75d07d5c156 Mon Sep 17 00:00:00 2001 From: glennmichael123 Date: Thu, 6 Feb 2025 13:33:20 +0900 Subject: [PATCH] chore: wip --- storage/framework/core/orm/src/generate.ts | 4 +- .../framework/core/types/src/model-names.ts | 2 +- .../framework/core/types/src/table-names.ts | 2 +- storage/framework/orm/routes.ts | 14 +- .../framework/orm/src/models/AccessToken.ts | 4 +- storage/framework/orm/src/models/Activity.ts | 4 +- .../framework/orm/src/models/Deployment.ts | 4 +- storage/framework/orm/src/models/Error.ts | 4 +- storage/framework/orm/src/models/FailedJob.ts | 4 +- storage/framework/orm/src/models/Job.ts | 4 +- .../framework/orm/src/models/PaymentMethod.ts | 4 +- storage/framework/orm/src/models/Post.ts | 4 +- storage/framework/orm/src/models/Product.ts | 4 +- storage/framework/orm/src/models/Project.ts | 4 +- storage/framework/orm/src/models/Release.ts | 4 +- .../framework/orm/src/models/Subscriber.ts | 4 +- .../orm/src/models/SubscriberEmail.ts | 4 +- .../framework/orm/src/models/Subscription.ts | 4 +- storage/framework/orm/src/models/Team.ts | 4 +- .../framework/orm/src/models/Transaction.ts | 6 +- storage/framework/orm/src/models/User.ts | 4 +- storage/framework/orm/src/types.ts | 16 +- .../framework/requests/TransactionRequest.ts | 4 +- storage/framework/types/requests.d.ts | 400 +++++++++--------- 24 files changed, 256 insertions(+), 256 deletions(-) diff --git a/storage/framework/core/orm/src/generate.ts b/storage/framework/core/orm/src/generate.ts index ebf007af8..5fab00c24 100644 --- a/storage/framework/core/orm/src/generate.ts +++ b/storage/framework/core/orm/src/generate.ts @@ -1013,13 +1013,13 @@ export async function generateModelString( } async first(): Promise<${modelName}Model | undefined> { - return await this.first() + return await this.applyFirst() } static async first(): Promise<${modelName}Model | undefined> { const instance = new ${modelName}Model(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise<${modelName}Model | undefined> { diff --git a/storage/framework/core/types/src/model-names.ts b/storage/framework/core/types/src/model-names.ts index ff4fffd7b..11160fb4a 100644 --- a/storage/framework/core/types/src/model-names.ts +++ b/storage/framework/core/types/src/model-names.ts @@ -1 +1 @@ -export type ModelNames = 'Activity' | 'Project' | 'FailedJob' | 'SubscriberEmail' | 'Product' | 'AccessToken' | 'PaymentMethod' | 'Team' | 'Subscriber' | 'Transaction' | 'Job' | 'Subscription' | 'Deployment' | 'Error' | 'Release' | 'User' | 'Post' +export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Activity' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'Product' | 'PaymentMethod' | 'Transaction' | 'Job' | 'Subscription' | 'Error' diff --git a/storage/framework/core/types/src/table-names.ts b/storage/framework/core/types/src/table-names.ts index 289184c2c..890474ae0 100644 --- a/storage/framework/core/types/src/table-names.ts +++ b/storage/framework/core/types/src/table-names.ts @@ -1 +1 @@ -export type TableNames = 'activities' | 'projects' | 'failed_jobs' | 'subscriber_emails' | 'products' | 'personal_access_tokens' | 'payment_methods' | 'team_users' | 'teams' | 'subscribers' | 'transactions' | 'jobs' | 'subscriptions' | 'deployments' | 'errors' | 'releases' | 'team_users' | 'users' | 'posts' +export type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'activities' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'products' | 'payment_methods' | 'transactions' | 'jobs' | 'subscriptions' | 'errors' diff --git a/storage/framework/orm/routes.ts b/storage/framework/orm/routes.ts index 95c8fc2a3..f673198a7 100644 --- a/storage/framework/orm/routes.ts +++ b/storage/framework/orm/routes.ts @@ -1,13 +1,8 @@ import { route } from '@stacksjs/router' +route.get('activities', 'storage/framework/actions/src/ActivityIndexOrmAction.ts') -route.get('users', 'UserIndexOrmAction') - -route.post('users', 'UserStoreOrmAction') - -route.get('users/{id}', 'UserShowOrmAction') - -/actions/src/ActivityShowOrmAction.ts') +route.get('activities/{id}', 'storage/framework/actions/src/ActivityShowOrmAction.ts') route.post('activities', 'storage/framework/actions/src/ActivityStoreOrmAction.ts') @@ -15,3 +10,8 @@ route.patch('activities/{id}', 'storage/framework/actions/src/ActivityUpdateOrmA route.delete('activities/{id}', 'storage/framework/actions/src/ActivityDestroyOrmAction.ts') +route.get('users', 'UserIndexOrmAction') + +route.post('users', 'UserStoreOrmAction') + +route.get('users/{id}', 'UserShowOrmAction') diff --git a/storage/framework/orm/src/models/AccessToken.ts b/storage/framework/orm/src/models/AccessToken.ts index cb33acc73..ea84e5442 100644 --- a/storage/framework/orm/src/models/AccessToken.ts +++ b/storage/framework/orm/src/models/AccessToken.ts @@ -244,13 +244,13 @@ export class AccessTokenModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new AccessTokenModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Activity.ts b/storage/framework/orm/src/models/Activity.ts index 52d29df41..be002b8a7 100644 --- a/storage/framework/orm/src/models/Activity.ts +++ b/storage/framework/orm/src/models/Activity.ts @@ -259,13 +259,13 @@ export class ActivityModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new ActivityModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Deployment.ts b/storage/framework/orm/src/models/Deployment.ts index 6f9a4320e..38c4da7bf 100644 --- a/storage/framework/orm/src/models/Deployment.ts +++ b/storage/framework/orm/src/models/Deployment.ts @@ -281,13 +281,13 @@ export class DeploymentModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new DeploymentModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Error.ts b/storage/framework/orm/src/models/Error.ts index 794ff90bc..86c71e2fe 100644 --- a/storage/framework/orm/src/models/Error.ts +++ b/storage/framework/orm/src/models/Error.ts @@ -240,13 +240,13 @@ export class ErrorModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new ErrorModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/FailedJob.ts b/storage/framework/orm/src/models/FailedJob.ts index f65a67229..a23f1c860 100644 --- a/storage/framework/orm/src/models/FailedJob.ts +++ b/storage/framework/orm/src/models/FailedJob.ts @@ -240,13 +240,13 @@ export class FailedJobModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new FailedJobModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Job.ts b/storage/framework/orm/src/models/Job.ts index 5eef1955b..3f221965b 100644 --- a/storage/framework/orm/src/models/Job.ts +++ b/storage/framework/orm/src/models/Job.ts @@ -240,13 +240,13 @@ export class JobModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new JobModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/PaymentMethod.ts b/storage/framework/orm/src/models/PaymentMethod.ts index 6149b56fa..d2245b75a 100644 --- a/storage/framework/orm/src/models/PaymentMethod.ts +++ b/storage/framework/orm/src/models/PaymentMethod.ts @@ -290,13 +290,13 @@ export class PaymentMethodModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new PaymentMethodModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Post.ts b/storage/framework/orm/src/models/Post.ts index a3b63d2ee..32e03ca41 100644 --- a/storage/framework/orm/src/models/Post.ts +++ b/storage/framework/orm/src/models/Post.ts @@ -226,13 +226,13 @@ export class PostModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new PostModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Product.ts b/storage/framework/orm/src/models/Product.ts index 66fdc9e8f..b44cdf8af 100644 --- a/storage/framework/orm/src/models/Product.ts +++ b/storage/framework/orm/src/models/Product.ts @@ -268,13 +268,13 @@ export class ProductModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new ProductModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Project.ts b/storage/framework/orm/src/models/Project.ts index 925aedc1b..7c5f9a0b4 100644 --- a/storage/framework/orm/src/models/Project.ts +++ b/storage/framework/orm/src/models/Project.ts @@ -231,13 +231,13 @@ export class ProjectModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new ProjectModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Release.ts b/storage/framework/orm/src/models/Release.ts index d831458ad..d06c16bbe 100644 --- a/storage/framework/orm/src/models/Release.ts +++ b/storage/framework/orm/src/models/Release.ts @@ -204,13 +204,13 @@ export class ReleaseModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new ReleaseModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Subscriber.ts b/storage/framework/orm/src/models/Subscriber.ts index 740b0b082..722be115d 100644 --- a/storage/framework/orm/src/models/Subscriber.ts +++ b/storage/framework/orm/src/models/Subscriber.ts @@ -204,13 +204,13 @@ export class SubscriberModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new SubscriberModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/SubscriberEmail.ts b/storage/framework/orm/src/models/SubscriberEmail.ts index 07b4423da..aeeeb765e 100644 --- a/storage/framework/orm/src/models/SubscriberEmail.ts +++ b/storage/framework/orm/src/models/SubscriberEmail.ts @@ -214,13 +214,13 @@ export class SubscriberEmailModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new SubscriberEmailModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Subscription.ts b/storage/framework/orm/src/models/Subscription.ts index 004ee6314..e1be92295 100644 --- a/storage/framework/orm/src/models/Subscription.ts +++ b/storage/framework/orm/src/models/Subscription.ts @@ -308,13 +308,13 @@ export class SubscriptionModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new SubscriptionModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Team.ts b/storage/framework/orm/src/models/Team.ts index d579b8edf..7ebbe5ad2 100644 --- a/storage/framework/orm/src/models/Team.ts +++ b/storage/framework/orm/src/models/Team.ts @@ -277,13 +277,13 @@ export class TeamModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new TeamModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/Transaction.ts b/storage/framework/orm/src/models/Transaction.ts index f48906669..6b9c4c368 100644 --- a/storage/framework/orm/src/models/Transaction.ts +++ b/storage/framework/orm/src/models/Transaction.ts @@ -62,7 +62,7 @@ interface QueryOptions { export class TransactionModel { private readonly hidden: Array = [] - private readonly fillable: Array = ['name', 'description', 'amount', 'type', 'provider_id', 'uuid', 'payment_method_id', 'user_id'] + private readonly fillable: Array = ['name', 'description', 'amount', 'type', 'provider_id', 'uuid', 'user_id', 'payment_method_id'] private readonly guarded: Array = [] protected attributes: Partial = {} protected originalAttributes: Partial = {} @@ -277,13 +277,13 @@ export class TransactionModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new TransactionModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/models/User.ts b/storage/framework/orm/src/models/User.ts index 258ed1336..52b350635 100644 --- a/storage/framework/orm/src/models/User.ts +++ b/storage/framework/orm/src/models/User.ts @@ -302,13 +302,13 @@ export class UserModel { } async first(): Promise { - return await this.first() + return await this.applyFirst() } static async first(): Promise { const instance = new UserModel(null) - return await instance.first() + return await instance.applyFirst() } async firstOrFail(): Promise { diff --git a/storage/framework/orm/src/types.ts b/storage/framework/orm/src/types.ts index 42483b1e5..c19fac810 100644 --- a/storage/framework/orm/src/types.ts +++ b/storage/framework/orm/src/types.ts @@ -48,24 +48,24 @@ export interface PasskeysTable { } export interface Database { - activities: ActivitiesTable projects: ProjectsTable - failed_jobs: FailedJobsTable subscriber_emails: SubscriberEmailsTable - products: ProductsTable personal_access_tokens: PersonalAccessTokensTable - payment_methods: PaymentMethodsTable team_users: TeamUsersTable teams: TeamsTable + activities: ActivitiesTable subscribers: SubscribersTable - transactions: TransactionsTable - jobs: JobsTable - subscriptions: SubscriptionsTable deployments: DeploymentsTable - errors: ErrorsTable releases: ReleasesTable users: UsersTable posts: PostsTable + failed_jobs: FailedJobsTable + products: ProductsTable + payment_methods: PaymentMethodsTable + transactions: TransactionsTable + jobs: JobsTable + subscriptions: SubscriptionsTable + errors: ErrorsTable passkeys: PasskeysTable migrations: MigrationsTable } diff --git a/storage/framework/requests/TransactionRequest.ts b/storage/framework/requests/TransactionRequest.ts index b90a712d5..2f8784beb 100644 --- a/storage/framework/requests/TransactionRequest.ts +++ b/storage/framework/requests/TransactionRequest.ts @@ -17,8 +17,8 @@ interface RequestDataTransaction { amount: number type: string provider_id: string - payment_method_id: number user_id: number + payment_method_id: number created_at?: Date updated_at?: Date } @@ -29,8 +29,8 @@ export class TransactionRequest extends Request implemen public amount = 0 public type = '' public provider_id = '' - public payment_method_id = 0 public user_id = 0 + public payment_method_id = 0 public created_at = new Date() public updated_at = new Date() public uuid = '' diff --git a/storage/framework/types/requests.d.ts b/storage/framework/types/requests.d.ts index 54392927b..1565d0ac9 100644 --- a/storage/framework/types/requests.d.ts +++ b/storage/framework/types/requests.d.ts @@ -10,6 +10,104 @@ interface CustomAttributes { [key: string]: ValidationField } +interface RequestDataProject { + id: number + name: string + description: string + url: string + status: string + created_at?: Date + updated_at?: Date +} +export interface ProjectRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'name' | 'description' | 'url' | 'status') => string) + + all: () => RequestDataProject + id: number + name: string + description: string + url: string + status: string + created_at?: Date + updated_at?: Date +} + +interface RequestDataSubscriberEmail { + id: number + email: string + deleted_at?: Date + created_at?: Date + updated_at?: Date +} +export interface SubscriberEmailRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'email') => string) + + all: () => RequestDataSubscriberEmail + id: number + email: string + deleted_at?: Date + created_at?: Date + updated_at?: Date +} + +interface RequestDataAccessToken { + id: number + name: string + token: string + plain_text_token: string + abilities: string[] + team_id: number + created_at?: Date + updated_at?: Date +} +export interface AccessTokenRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'name' | 'token' | 'plain_text_token') => string) & ((key: 'abilities') => string[]) & ((key: 'team_id') => string) + + all: () => RequestDataAccessToken + id: number + name: string + token: string + plain_text_token: string + abilities: string[] + team_id: number + created_at?: Date + updated_at?: Date +} + +interface RequestDataTeam { + id: number + name: string + company_name: string + email: string + billing_email: string + status: string + description: string + path: string + is_personal: boolean + created_at?: Date + updated_at?: Date +} +export interface TeamRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'name' | 'company_name' | 'email' | 'billing_email' | 'status' | 'description' | 'path') => string) & ((key: 'is_personal') => boolean) + + all: () => RequestDataTeam + id: number + name: string + company_name: string + email: string + billing_email: string + status: string + description: string + path: string + is_personal: boolean + created_at?: Date + updated_at?: Date +} + interface RequestDataActivity { id: number title: string @@ -39,25 +137,113 @@ export interface ActivityRequestType extends Request { updated_at?: Date } -interface RequestDataProject { +interface RequestDataSubscriber { id: number - name: string - description: string - url: string + subscribed: boolean + user_id: number + created_at?: Date + updated_at?: Date +} +export interface SubscriberRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'subscribed') => boolean) & ((key: 'user_id') => string) + + all: () => RequestDataSubscriber + id: number + subscribed: boolean + user_id: number + created_at?: Date + updated_at?: Date +} + +interface RequestDataDeployment { + id: number + commit_sha: string + commit_message: string + branch: string status: string + execution_time: number + deploy_script: string + terminal_output: string + user_id: number created_at?: Date updated_at?: Date } -export interface ProjectRequestType extends Request { +export interface DeploymentRequestType extends Request { validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'name' | 'description' | 'url' | 'status') => string) + get: ((key: 'id') => number) & ((key: 'commit_sha' | 'commit_message' | 'branch' | 'status' | 'deploy_script' | 'terminal_output') => string) & ((key: 'execution_time') => number) & ((key: 'user_id') => string) - all: () => RequestDataProject + all: () => RequestDataDeployment id: number - name: string - description: string - url: string + commit_sha: string + commit_message: string + branch: string status: string + execution_time: number + deploy_script: string + terminal_output: string + user_id: number + created_at?: Date + updated_at?: Date +} + +interface RequestDataRelease { + id: number + version: string + created_at?: Date + updated_at?: Date +} +export interface ReleaseRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'version') => string) + + all: () => RequestDataRelease + id: number + version: string + created_at?: Date + updated_at?: Date +} + +interface RequestDataUser { + id: number + name: string + email: string + job_title: string + password: string + created_at?: Date + updated_at?: Date +} +export interface UserRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'name' | 'email' | 'job_title' | 'password') => string) + + all: () => RequestDataUser + id: number + name: string + email: string + job_title: string + password: string + created_at?: Date + updated_at?: Date +} + +interface RequestDataPost { + id: number + title: string + body: string + user_id: number + created_at?: Date + updated_at?: Date +} +export interface PostRequestType extends Request { + validate: (attributes?: CustomAttributes) => void + get: ((key: 'id') => number) & ((key: 'title' | 'body') => string) & ((key: 'user_id') => string) + + all: () => RequestDataPost + id: number + title: string + body: string + user_id: number created_at?: Date updated_at?: Date } @@ -87,25 +273,6 @@ export interface FailedJobRequestType extends Request { updated_at?: Date } -interface RequestDataSubscriberEmail { - id: number - email: string - deleted_at?: Date - created_at?: Date - updated_at?: Date -} -export interface SubscriberEmailRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'email') => string) - - all: () => RequestDataSubscriberEmail - id: number - email: string - deleted_at?: Date - created_at?: Date - updated_at?: Date -} - interface RequestDataProduct { id: number name: string @@ -135,31 +302,6 @@ export interface ProductRequestType extends Request { updated_at?: Date } -interface RequestDataAccessToken { - id: number - name: string - token: string - plain_text_token: string - abilities: string[] - team_id: number - created_at?: Date - updated_at?: Date -} -export interface AccessTokenRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'name' | 'token' | 'plain_text_token') => string) & ((key: 'abilities') => string[]) & ((key: 'team_id') => string) - - all: () => RequestDataAccessToken - id: number - name: string - token: string - plain_text_token: string - abilities: string[] - team_id: number - created_at?: Date - updated_at?: Date -} - interface RequestDataPaymentMethod { id: number type: string @@ -191,56 +333,6 @@ export interface PaymentMethodRequestType extends Request { updated_at?: Date } -interface RequestDataTeam { - id: number - name: string - company_name: string - email: string - billing_email: string - status: string - description: string - path: string - is_personal: boolean - created_at?: Date - updated_at?: Date -} -export interface TeamRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'name' | 'company_name' | 'email' | 'billing_email' | 'status' | 'description' | 'path') => string) & ((key: 'is_personal') => boolean) - - all: () => RequestDataTeam - id: number - name: string - company_name: string - email: string - billing_email: string - status: string - description: string - path: string - is_personal: boolean - created_at?: Date - updated_at?: Date -} - -interface RequestDataSubscriber { - id: number - subscribed: boolean - user_id: number - created_at?: Date - updated_at?: Date -} -export interface SubscriberRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'subscribed') => boolean) & ((key: 'user_id') => string) - - all: () => RequestDataSubscriber - id: number - subscribed: boolean - user_id: number - created_at?: Date - updated_at?: Date -} - interface RequestDataTransaction { id: number name: string @@ -248,14 +340,14 @@ interface RequestDataTransaction { amount: number type: string provider_id: string - payment_method_id: number user_id: number + payment_method_id: number created_at?: Date updated_at?: Date } export interface TransactionRequestType extends Request { validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'name' | 'description' | 'type' | 'provider_id') => string) & ((key: 'amount') => number) & ((key: 'payment_method_id') => string) & ((key: 'user_id') => string) + get: ((key: 'id') => number) & ((key: 'name' | 'description' | 'type' | 'provider_id') => string) & ((key: 'amount') => number) & ((key: 'user_id') => string) & ((key: 'payment_method_id') => string) all: () => RequestDataTransaction id: number @@ -264,8 +356,8 @@ export interface TransactionRequestType extends Request { amount: number type: string provider_id: string - payment_method_id: number user_id: number + payment_method_id: number created_at?: Date updated_at?: Date } @@ -332,37 +424,6 @@ export interface SubscriptionRequestType extends Request { updated_at?: Date } -interface RequestDataDeployment { - id: number - commit_sha: string - commit_message: string - branch: string - status: string - execution_time: number - deploy_script: string - terminal_output: string - user_id: number - created_at?: Date - updated_at?: Date -} -export interface DeploymentRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'commit_sha' | 'commit_message' | 'branch' | 'status' | 'deploy_script' | 'terminal_output') => string) & ((key: 'execution_time') => number) & ((key: 'user_id') => string) - - all: () => RequestDataDeployment - id: number - commit_sha: string - commit_message: string - branch: string - status: string - execution_time: number - deploy_script: string - terminal_output: string - user_id: number - created_at?: Date - updated_at?: Date -} - interface RequestDataError { id: number type: string @@ -388,65 +449,4 @@ export interface ErrorRequestType extends Request { updated_at?: Date } -interface RequestDataRelease { - id: number - version: string - created_at?: Date - updated_at?: Date -} -export interface ReleaseRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'version') => string) - - all: () => RequestDataRelease - id: number - version: string - created_at?: Date - updated_at?: Date -} - -interface RequestDataUser { - id: number - name: string - email: string - job_title: string - password: string - created_at?: Date - updated_at?: Date -} -export interface UserRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'name' | 'email' | 'job_title' | 'password') => string) - - all: () => RequestDataUser - id: number - name: string - email: string - job_title: string - password: string - created_at?: Date - updated_at?: Date -} - -interface RequestDataPost { - id: number - title: string - body: string - user_id: number - created_at?: Date - updated_at?: Date -} -export interface PostRequestType extends Request { - validate: (attributes?: CustomAttributes) => void - get: ((key: 'id') => number) & ((key: 'title' | 'body') => string) & ((key: 'user_id') => string) - - all: () => RequestDataPost - id: number - title: string - body: string - user_id: number - created_at?: Date - updated_at?: Date -} - -export type ModelRequest = ActivityRequestType | ProjectRequestType | FailedJobRequestType | SubscriberEmailRequestType | ProductRequestType | AccessTokenRequestType | PaymentMethodRequestType | TeamRequestType | SubscriberRequestType | TransactionRequestType | JobRequestType | SubscriptionRequestType | DeploymentRequestType | ErrorRequestType | ReleaseRequestType | UserRequestType | PostRequestType +export type ModelRequest = ProjectRequestType | SubscriberEmailRequestType | AccessTokenRequestType | TeamRequestType | ActivityRequestType | SubscriberRequestType | DeploymentRequestType | ReleaseRequestType | UserRequestType | PostRequestType | FailedJobRequestType | ProductRequestType | PaymentMethodRequestType | TransactionRequestType | JobRequestType | SubscriptionRequestType | ErrorRequestType