diff --git a/amplify/backend/api/h4ipet/parameters.json b/amplify/backend/api/h4ipet/parameters.json index 1f1894a..b4da1b5 100644 --- a/amplify/backend/api/h4ipet/parameters.json +++ b/amplify/backend/api/h4ipet/parameters.json @@ -4,4 +4,4 @@ "DynamoDBEnableServerSideEncryption": false, "AuthModeLastUpdated": "2023-08-31T23:30:38.551Z", "CreateAPIKey": 1 -} +} \ No newline at end of file diff --git a/amplify/backend/backend-config.json b/amplify/backend/backend-config.json index 36989be..c0a5866 100644 --- a/amplify/backend/backend-config.json +++ b/amplify/backend/backend-config.json @@ -28,7 +28,9 @@ "dependsOn": [], "frontendAuthConfig": { "mfaConfiguration": "OFF", - "mfaTypes": ["SMS"], + "mfaTypes": [ + "SMS" + ], "passwordProtectionSettings": { "passwordPolicyCharacters": [ "REQUIRES_LOWERCASE", @@ -45,8 +47,12 @@ "PHONE_NUMBER" ], "socialProviders": [], - "usernameAttributes": ["EMAIL"], - "verificationMechanisms": ["EMAIL"] + "usernameAttributes": [ + "EMAIL" + ], + "verificationMechanisms": [ + "EMAIL" + ] }, "providerPlugin": "awscloudformation", "service": "Cognito" @@ -57,7 +63,10 @@ "build": true, "dependsOn": [ { - "attributes": ["GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput"], + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput" + ], "category": "api", "resourceName": "h4ipet" } @@ -92,4 +101,4 @@ ] } } -} +} \ No newline at end of file diff --git a/amplify/backend/function/emailUser/emailUser-cloudformation-template.json b/amplify/backend/function/emailUser/emailUser-cloudformation-template.json index db60a40..ac5b47b 100644 --- a/amplify/backend/function/emailUser/emailUser-cloudformation-template.json +++ b/amplify/backend/function/emailUser/emailUser-cloudformation-template.json @@ -87,7 +87,10 @@ } }, "Role": { - "Fn::GetAtt": ["LambdaExecutionRole", "Arn"] + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] }, "Runtime": "nodejs18.x", "Layers": [], @@ -121,16 +124,22 @@ { "Effect": "Allow", "Principal": { - "Service": ["lambda.amazonaws.com"] + "Service": [ + "lambda.amazonaws.com" + ] }, - "Action": ["sts:AssumeRole"] + "Action": [ + "sts:AssumeRole" + ] } ] } } }, "lambdaexecutionpolicy": { - "DependsOn": ["LambdaExecutionRole"], + "DependsOn": [ + "LambdaExecutionRole" + ], "Type": "AWS::IAM::Policy", "Properties": { "PolicyName": "lambda-execution-policy", @@ -167,7 +176,9 @@ } }, { - "Action": ["ses:SendEmail"], + "Action": [ + "ses:SendEmail" + ], "Effect": "Allow", "Resource": "arn:aws:ses:us-west-2:008277987672:identity/chocobora1@gmail.com" } @@ -176,7 +187,9 @@ } }, "LambdaTriggerPolicyBooking": { - "DependsOn": ["LambdaExecutionRole"], + "DependsOn": [ + "LambdaExecutionRole" + ], "Type": "AWS::IAM::Policy", "Properties": { "PolicyName": "amplify-lambda-execution-policy-Booking", @@ -208,7 +221,10 @@ }, "LambdaEventSourceMappingBooking": { "Type": "AWS::Lambda::EventSourceMapping", - "DependsOn": ["LambdaTriggerPolicyBooking", "LambdaExecutionRole"], + "DependsOn": [ + "LambdaTriggerPolicyBooking", + "LambdaExecutionRole" + ], "Properties": { "BatchSize": 100, "Enabled": true, @@ -218,7 +234,10 @@ } }, "FunctionName": { - "Fn::GetAtt": ["LambdaFunction", "Arn"] + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] }, "StartingPosition": "LATEST" } @@ -232,7 +251,10 @@ }, "Arn": { "Value": { - "Fn::GetAtt": ["LambdaFunction", "Arn"] + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] } }, "Region": { @@ -247,8 +269,11 @@ }, "LambdaExecutionRoleArn": { "Value": { - "Fn::GetAtt": ["LambdaExecutionRole", "Arn"] + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] } } } -} +} \ No newline at end of file diff --git a/amplify/backend/types/amplify-dependent-resources-ref.d.ts b/amplify/backend/types/amplify-dependent-resources-ref.d.ts index 237b132..20f9100 100644 --- a/amplify/backend/types/amplify-dependent-resources-ref.d.ts +++ b/amplify/backend/types/amplify-dependent-resources-ref.d.ts @@ -1,30 +1,30 @@ export type AmplifyDependentResourcesAttributes = { - api: { - h4ipet: { - GraphQLAPIEndpointOutput: "string"; - GraphQLAPIIdOutput: "string"; - GraphQLAPIKeyOutput: "string"; - }; - }; - auth: { - equestriantherapy: { - AppClientID: "string"; - AppClientIDWeb: "string"; - CreatedSNSRole: "string"; - IdentityPoolId: "string"; - IdentityPoolName: "string"; - UserPoolArn: "string"; - UserPoolId: "string"; - UserPoolName: "string"; - }; - }; - function: { - emailUser: { - Arn: "string"; - LambdaExecutionRole: "string"; - LambdaExecutionRoleArn: "string"; - Name: "string"; - Region: "string"; - }; - }; -}; + "api": { + "h4ipet": { + "GraphQLAPIEndpointOutput": "string", + "GraphQLAPIIdOutput": "string", + "GraphQLAPIKeyOutput": "string" + } + }, + "auth": { + "equestriantherapy": { + "AppClientID": "string", + "AppClientIDWeb": "string", + "CreatedSNSRole": "string", + "IdentityPoolId": "string", + "IdentityPoolName": "string", + "UserPoolArn": "string", + "UserPoolId": "string", + "UserPoolName": "string" + } + }, + "function": { + "emailUser": { + "Arn": "string", + "LambdaExecutionRole": "string", + "LambdaExecutionRoleArn": "string", + "Name": "string", + "Region": "string" + } + } +} \ No newline at end of file diff --git a/amplify/cli.json b/amplify/cli.json index aa4a09f..45c0381 100644 --- a/amplify/cli.json +++ b/amplify/cli.json @@ -1,62 +1,62 @@ { - "features": { - "graphqltransformer": { - "addmissingownerfields": true, - "improvepluralization": false, - "validatetypenamereservedwords": true, - "useexperimentalpipelinedtransformer": true, - "enableiterativegsiupdates": true, - "secondarykeyasgsi": true, - "skipoverridemutationinputtypes": true, - "transformerversion": 2, - "suppressschemamigrationprompt": true, - "securityenhancementnotification": false, - "showfieldauthnotification": false, - "usesubusernamefordefaultidentityclaim": true, - "usefieldnameforprimarykeyconnectionfield": false, - "enableautoindexquerynames": true, - "respectprimarykeyattributesonconnectionfield": true, - "shoulddeepmergedirectiveconfigdefaults": false, - "populateownerfieldforstaticgroupauth": true + "features": { + "graphqltransformer": { + "addmissingownerfields": true, + "improvepluralization": false, + "validatetypenamereservedwords": true, + "useexperimentalpipelinedtransformer": true, + "enableiterativegsiupdates": true, + "secondarykeyasgsi": true, + "skipoverridemutationinputtypes": true, + "transformerversion": 2, + "suppressschemamigrationprompt": true, + "securityenhancementnotification": false, + "showfieldauthnotification": false, + "usesubusernamefordefaultidentityclaim": true, + "usefieldnameforprimarykeyconnectionfield": false, + "enableautoindexquerynames": true, + "respectprimarykeyattributesonconnectionfield": true, + "shoulddeepmergedirectiveconfigdefaults": false, + "populateownerfieldforstaticgroupauth": true + }, + "frontend-ios": { + "enablexcodeintegration": true + }, + "auth": { + "enablecaseinsensitivity": true, + "useinclusiveterminology": true, + "breakcirculardependency": true, + "forcealiasattributes": false, + "useenabledmfas": true + }, + "codegen": { + "useappsyncmodelgenplugin": true, + "usedocsgeneratorplugin": true, + "usetypesgeneratorplugin": true, + "cleangeneratedmodelsdirectory": true, + "retaincasestyle": true, + "addtimestampfields": true, + "handlelistnullabilitytransparently": true, + "emitauthprovider": true, + "generateindexrules": true, + "enabledartnullsafety": true + }, + "appsync": { + "generategraphqlpermissions": true + }, + "latestregionsupport": { + "pinpoint": 1, + "translate": 1, + "transcribe": 1, + "rekognition": 1, + "textract": 1, + "comprehend": 1 + }, + "project": { + "overrides": true + } }, - "frontend-ios": { - "enablexcodeintegration": true - }, - "auth": { - "enablecaseinsensitivity": true, - "useinclusiveterminology": true, - "breakcirculardependency": true, - "forcealiasattributes": false, - "useenabledmfas": true - }, - "codegen": { - "useappsyncmodelgenplugin": true, - "usedocsgeneratorplugin": true, - "usetypesgeneratorplugin": true, - "cleangeneratedmodelsdirectory": true, - "retaincasestyle": true, - "addtimestampfields": true, - "handlelistnullabilitytransparently": true, - "emitauthprovider": true, - "generateindexrules": true, - "enabledartnullsafety": true - }, - "appsync": { - "generategraphqlpermissions": true - }, - "latestregionsupport": { - "pinpoint": 1, - "translate": 1, - "transcribe": 1, - "rekognition": 1, - "textract": 1, - "comprehend": 1 - }, - "project": { - "overrides": true + "debug": { + "shareProjectConfig": false } - }, - "debug": { - "shareProjectConfig": false - } -} +} \ No newline at end of file diff --git a/amplify/team-provider-info.json b/amplify/team-provider-info.json index 21918be..2d604c5 100644 --- a/amplify/team-provider-info.json +++ b/amplify/team-provider-info.json @@ -27,4 +27,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/images/CaretDown.svg b/src/images/caretDown.svg similarity index 100% rename from src/images/CaretDown.svg rename to src/images/caretDown.svg diff --git a/src/images/Checked.png b/src/images/checked.png similarity index 100% rename from src/images/Checked.png rename to src/images/checked.png diff --git a/src/images/OffSlider.png b/src/images/offSlider.png similarity index 100% rename from src/images/OffSlider.png rename to src/images/offSlider.png diff --git a/src/images/offslider.png b/src/images/offslider.png deleted file mode 100644 index 7515823..0000000 Binary files a/src/images/offslider.png and /dev/null differ diff --git a/src/images/OnSlider.png b/src/images/onSlider.png similarity index 100% rename from src/images/OnSlider.png rename to src/images/onSlider.png diff --git a/src/images/onslider.png b/src/images/onslider.png deleted file mode 100644 index 0a7b53e..0000000 Binary files a/src/images/onslider.png and /dev/null differ diff --git a/src/images/PETlogo.jpg b/src/images/petLogo.jpg similarity index 100% rename from src/images/PETlogo.jpg rename to src/images/petLogo.jpg diff --git a/src/images/PETlogo2.svg b/src/images/petLogo2.svg similarity index 100% rename from src/images/PETlogo2.svg rename to src/images/petLogo2.svg diff --git a/src/images/SignOut.png b/src/images/signOut.png similarity index 100% rename from src/images/SignOut.png rename to src/images/signOut.png diff --git a/src/images/SignOutArrow.png b/src/images/signOutArrow.png similarity index 100% rename from src/images/SignOutArrow.png rename to src/images/signOutArrow.png diff --git a/src/images/Unchecked.png b/src/images/unchecked.png similarity index 100% rename from src/images/Unchecked.png rename to src/images/unchecked.png diff --git a/src/images/X.svg b/src/images/x.svg similarity index 100% rename from src/images/X.svg rename to src/images/x.svg diff --git a/src/models/index.d.ts b/src/models/index.d.ts index 9a644c0..60102f8 100644 --- a/src/models/index.d.ts +++ b/src/models/index.d.ts @@ -1,20 +1,15 @@ -import { - ModelInit, - MutableModel, - __modelMeta__, - ManagedIdentifier, -} from "@aws-amplify/datastore"; +import { ModelInit, MutableModel, __modelMeta__, ManagedIdentifier } from "@aws-amplify/datastore"; // @ts-ignore -import { - LazyLoading, - LazyLoadingDisabled, - AsyncCollection, -} from "@aws-amplify/datastore"; +import { LazyLoading, LazyLoadingDisabled, AsyncCollection } from "@aws-amplify/datastore"; + + + + type EagerTimeslot = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly startTime?: string | null; @@ -25,12 +20,12 @@ type EagerTimeslot = { readonly riderUnavailableDates?: (string | null)[] | null; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} type LazyTimeslot = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly startTime?: string | null; @@ -41,23 +36,18 @@ type LazyTimeslot = { readonly riderUnavailableDates?: (string | null)[] | null; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} -export declare type Timeslot = LazyLoading extends LazyLoadingDisabled - ? EagerTimeslot - : LazyTimeslot; +export declare type Timeslot = LazyLoading extends LazyLoadingDisabled ? EagerTimeslot : LazyTimeslot export declare const Timeslot: (new (init: ModelInit) => Timeslot) & { - copyOf( - source: Timeslot, - mutator: (draft: MutableModel) => MutableModel | void - ): Timeslot; -}; + copyOf(source: Timeslot, mutator: (draft: MutableModel) => MutableModel | void): Timeslot; +} type EagerBooking = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly title?: string | null; @@ -68,12 +58,12 @@ type EagerBooking = { readonly userType?: string | null; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} type LazyBooking = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly title?: string | null; @@ -84,23 +74,18 @@ type LazyBooking = { readonly userType?: string | null; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} -export declare type Booking = LazyLoading extends LazyLoadingDisabled - ? EagerBooking - : LazyBooking; +export declare type Booking = LazyLoading extends LazyLoadingDisabled ? EagerBooking : LazyBooking export declare const Booking: (new (init: ModelInit) => Booking) & { - copyOf( - source: Booking, - mutator: (draft: MutableModel) => MutableModel | void - ): Booking; -}; + copyOf(source: Booking, mutator: (draft: MutableModel) => MutableModel | void): Booking; +} type EagerUser = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly userName?: string | null; @@ -110,12 +95,12 @@ type EagerUser = { readonly bookings?: (Booking | null)[] | null; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} type LazyUser = { readonly [__modelMeta__]: { - identifier: ManagedIdentifier; - readOnlyFields: "createdAt" | "updatedAt"; + identifier: ManagedIdentifier; + readOnlyFields: 'createdAt' | 'updatedAt'; }; readonly id: string; readonly userName?: string | null; @@ -125,15 +110,10 @@ type LazyUser = { readonly bookings: AsyncCollection; readonly createdAt?: string | null; readonly updatedAt?: string | null; -}; +} -export declare type User = LazyLoading extends LazyLoadingDisabled - ? EagerUser - : LazyUser; +export declare type User = LazyLoading extends LazyLoadingDisabled ? EagerUser : LazyUser export declare const User: (new (init: ModelInit) => User) & { - copyOf( - source: User, - mutator: (draft: MutableModel) => MutableModel | void - ): User; -}; + copyOf(source: User, mutator: (draft: MutableModel) => MutableModel | void): User; +} \ No newline at end of file diff --git a/src/models/schema.js b/src/models/schema.js index 5c57c68..62f3c39 100644 --- a/src/models/schema.js +++ b/src/models/schema.js @@ -1,299 +1,322 @@ export const schema = { - models: { - Timeslot: { - name: "Timeslot", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - startTime: { - name: "startTime", - isArray: false, - type: "AWSTime", - isRequired: false, - attributes: [], - }, - endTime: { - name: "endTime", - isArray: false, - type: "AWSTime", - isRequired: false, - attributes: [], - }, - unavailableDates: { - name: "unavailableDates", - isArray: true, - type: "AWSDate", - isRequired: false, - attributes: [], - isArrayNullable: true, - }, - bookings: { - name: "bookings", - isArray: true, - type: { - model: "Booking", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: ["timeslotID"], - }, - }, - availableSundays: { - name: "availableSundays", - isArray: true, - type: "AWSDate", - isRequired: false, - attributes: [], - isArrayNullable: true, - }, - riderUnavailableDates: { - name: "riderUnavailableDates", - isArray: true, - type: "AWSDate", - isRequired: false, - attributes: [], - isArrayNullable: true, - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Timeslots", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Booking: { - name: "Booking", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - title: { - name: "title", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - date: { - name: "date", - isArray: false, - type: "AWSDate", - isRequired: false, - attributes: [], - }, - description: { - name: "description", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - timeslotID: { - name: "timeslotID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - userID: { - name: "userID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - userType: { - name: "userType", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Bookings", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byTimeslot", - fields: ["timeslotID"], - }, - }, - { - type: "key", - properties: { - name: "byUser", - fields: ["userID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - User: { - name: "User", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - userName: { - name: "userName", - isArray: false, - type: "AWSEmail", - isRequired: false, - attributes: [], - }, - firstName: { - name: "firstName", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - lastName: { - name: "lastName", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - userType: { - name: "userType", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - bookings: { - name: "bookings", - isArray: true, - type: { - model: "Booking", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: ["userID"], - }, - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Users", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], + "models": { + "Timeslot": { + "name": "Timeslot", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "startTime": { + "name": "startTime", + "isArray": false, + "type": "AWSTime", + "isRequired": false, + "attributes": [] + }, + "endTime": { + "name": "endTime", + "isArray": false, + "type": "AWSTime", + "isRequired": false, + "attributes": [] + }, + "unavailableDates": { + "name": "unavailableDates", + "isArray": true, + "type": "AWSDate", + "isRequired": false, + "attributes": [], + "isArrayNullable": true + }, + "bookings": { + "name": "bookings", + "isArray": true, + "type": { + "model": "Booking" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": [ + "timeslotID" + ] + } + }, + "availableSundays": { + "name": "availableSundays", + "isArray": true, + "type": "AWSDate", + "isRequired": false, + "attributes": [], + "isArrayNullable": true + }, + "riderUnavailableDates": { + "name": "riderUnavailableDates", + "isArray": true, + "type": "AWSDate", + "isRequired": false, + "attributes": [], + "isArrayNullable": true + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Timeslots", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Booking": { + "name": "Booking", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "title": { + "name": "title", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "date": { + "name": "date", + "isArray": false, + "type": "AWSDate", + "isRequired": false, + "attributes": [] + }, + "description": { + "name": "description", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "timeslotID": { + "name": "timeslotID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "userID": { + "name": "userID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "userType": { + "name": "userType", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Bookings", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byTimeslot", + "fields": [ + "timeslotID" + ] + } + }, + { + "type": "key", + "properties": { + "name": "byUser", + "fields": [ + "userID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "User": { + "name": "User", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "userName": { + "name": "userName", + "isArray": false, + "type": "AWSEmail", + "isRequired": false, + "attributes": [] + }, + "firstName": { + "name": "firstName", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "lastName": { + "name": "lastName", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "userType": { + "name": "userType", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "bookings": { + "name": "bookings", + "isArray": true, + "type": { + "model": "Booking" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": [ + "userID" + ] + } + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Users", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + } }, - }, - enums: {}, - nonModels: {}, - codegenVersion: "3.4.4", - version: "f5f829f0b2781674c4d53fd4c9f77dba", -}; + "enums": {}, + "nonModels": {}, + "codegenVersion": "3.4.4", + "version": "f5f829f0b2781674c4d53fd4c9f77dba" +}; \ No newline at end of file diff --git a/src/ui-components/TimeslotCreateForm.d.ts b/src/ui-components/TimeslotCreateForm.d.ts index 9c593f9..680d954 100644 --- a/src/ui-components/TimeslotCreateForm.d.ts +++ b/src/ui-components/TimeslotCreateForm.d.ts @@ -9,56 +9,41 @@ import { EscapeHatchProps } from "@aws-amplify/ui-react/internal"; import { GridProps, TextFieldProps } from "@aws-amplify/ui-react"; export declare type ValidationResponse = { - hasError: boolean; - errorMessage?: string; + hasError: boolean; + errorMessage?: string; }; -export declare type ValidationFunction = ( - value: T, - validationResponse: ValidationResponse -) => ValidationResponse | Promise; +export declare type ValidationFunction = (value: T, validationResponse: ValidationResponse) => ValidationResponse | Promise; export declare type TimeslotCreateFormInputValues = { - startTime?: string; - endTime?: string; - unavailableDates?: string[]; - availableSundays?: string[]; - riderUnavailableDates?: string[]; + startTime?: string; + endTime?: string; + unavailableDates?: string[]; + availableSundays?: string[]; + riderUnavailableDates?: string[]; }; export declare type TimeslotCreateFormValidationValues = { - startTime?: ValidationFunction; - endTime?: ValidationFunction; - unavailableDates?: ValidationFunction; - availableSundays?: ValidationFunction; - riderUnavailableDates?: ValidationFunction; + startTime?: ValidationFunction; + endTime?: ValidationFunction; + unavailableDates?: ValidationFunction; + availableSundays?: ValidationFunction; + riderUnavailableDates?: ValidationFunction; }; -export declare type PrimitiveOverrideProps = Partial & - React.DOMAttributes; +export declare type PrimitiveOverrideProps = Partial & React.DOMAttributes; export declare type TimeslotCreateFormOverridesProps = { - TimeslotCreateFormGrid?: PrimitiveOverrideProps; - startTime?: PrimitiveOverrideProps; - endTime?: PrimitiveOverrideProps; - unavailableDates?: PrimitiveOverrideProps; - availableSundays?: PrimitiveOverrideProps; - riderUnavailableDates?: PrimitiveOverrideProps; + TimeslotCreateFormGrid?: PrimitiveOverrideProps; + startTime?: PrimitiveOverrideProps; + endTime?: PrimitiveOverrideProps; + unavailableDates?: PrimitiveOverrideProps; + availableSundays?: PrimitiveOverrideProps; + riderUnavailableDates?: PrimitiveOverrideProps; } & EscapeHatchProps; -export declare type TimeslotCreateFormProps = React.PropsWithChildren< - { +export declare type TimeslotCreateFormProps = React.PropsWithChildren<{ overrides?: TimeslotCreateFormOverridesProps | undefined | null; - } & { +} & { clearOnSuccess?: boolean; - onSubmit?: ( - fields: TimeslotCreateFormInputValues - ) => TimeslotCreateFormInputValues; + onSubmit?: (fields: TimeslotCreateFormInputValues) => TimeslotCreateFormInputValues; onSuccess?: (fields: TimeslotCreateFormInputValues) => void; - onError?: ( - fields: TimeslotCreateFormInputValues, - errorMessage: string - ) => void; - onChange?: ( - fields: TimeslotCreateFormInputValues - ) => TimeslotCreateFormInputValues; + onError?: (fields: TimeslotCreateFormInputValues, errorMessage: string) => void; + onChange?: (fields: TimeslotCreateFormInputValues) => TimeslotCreateFormInputValues; onValidate?: TimeslotCreateFormValidationValues; - } & React.CSSProperties ->; -export default function TimeslotCreateForm( - props: TimeslotCreateFormProps -): React.ReactElement; +} & React.CSSProperties>; +export default function TimeslotCreateForm(props: TimeslotCreateFormProps): React.ReactElement; diff --git a/src/ui-components/TimeslotUpdateForm.d.ts b/src/ui-components/TimeslotUpdateForm.d.ts index 3c6f89c..abd393f 100644 --- a/src/ui-components/TimeslotUpdateForm.d.ts +++ b/src/ui-components/TimeslotUpdateForm.d.ts @@ -10,57 +10,42 @@ import { GridProps, TextFieldProps } from "@aws-amplify/ui-react"; import { Timeslot } from "../models"; export declare type ValidationResponse = { - hasError: boolean; - errorMessage?: string; + hasError: boolean; + errorMessage?: string; }; -export declare type ValidationFunction = ( - value: T, - validationResponse: ValidationResponse -) => ValidationResponse | Promise; +export declare type ValidationFunction = (value: T, validationResponse: ValidationResponse) => ValidationResponse | Promise; export declare type TimeslotUpdateFormInputValues = { - startTime?: string; - endTime?: string; - unavailableDates?: string[]; - availableSundays?: string[]; - riderUnavailableDates?: string[]; + startTime?: string; + endTime?: string; + unavailableDates?: string[]; + availableSundays?: string[]; + riderUnavailableDates?: string[]; }; export declare type TimeslotUpdateFormValidationValues = { - startTime?: ValidationFunction; - endTime?: ValidationFunction; - unavailableDates?: ValidationFunction; - availableSundays?: ValidationFunction; - riderUnavailableDates?: ValidationFunction; + startTime?: ValidationFunction; + endTime?: ValidationFunction; + unavailableDates?: ValidationFunction; + availableSundays?: ValidationFunction; + riderUnavailableDates?: ValidationFunction; }; -export declare type PrimitiveOverrideProps = Partial & - React.DOMAttributes; +export declare type PrimitiveOverrideProps = Partial & React.DOMAttributes; export declare type TimeslotUpdateFormOverridesProps = { - TimeslotUpdateFormGrid?: PrimitiveOverrideProps; - startTime?: PrimitiveOverrideProps; - endTime?: PrimitiveOverrideProps; - unavailableDates?: PrimitiveOverrideProps; - availableSundays?: PrimitiveOverrideProps; - riderUnavailableDates?: PrimitiveOverrideProps; + TimeslotUpdateFormGrid?: PrimitiveOverrideProps; + startTime?: PrimitiveOverrideProps; + endTime?: PrimitiveOverrideProps; + unavailableDates?: PrimitiveOverrideProps; + availableSundays?: PrimitiveOverrideProps; + riderUnavailableDates?: PrimitiveOverrideProps; } & EscapeHatchProps; -export declare type TimeslotUpdateFormProps = React.PropsWithChildren< - { +export declare type TimeslotUpdateFormProps = React.PropsWithChildren<{ overrides?: TimeslotUpdateFormOverridesProps | undefined | null; - } & { +} & { id?: string; timeslot?: Timeslot; - onSubmit?: ( - fields: TimeslotUpdateFormInputValues - ) => TimeslotUpdateFormInputValues; + onSubmit?: (fields: TimeslotUpdateFormInputValues) => TimeslotUpdateFormInputValues; onSuccess?: (fields: TimeslotUpdateFormInputValues) => void; - onError?: ( - fields: TimeslotUpdateFormInputValues, - errorMessage: string - ) => void; - onChange?: ( - fields: TimeslotUpdateFormInputValues - ) => TimeslotUpdateFormInputValues; + onError?: (fields: TimeslotUpdateFormInputValues, errorMessage: string) => void; + onChange?: (fields: TimeslotUpdateFormInputValues) => TimeslotUpdateFormInputValues; onValidate?: TimeslotUpdateFormValidationValues; - } & React.CSSProperties ->; -export default function TimeslotUpdateForm( - props: TimeslotUpdateFormProps -): React.ReactElement; +} & React.CSSProperties>; +export default function TimeslotUpdateForm(props: TimeslotUpdateFormProps): React.ReactElement; diff --git a/src/ui-components/index.js b/src/ui-components/index.js index 496ee21..50587b9 100644 --- a/src/ui-components/index.js +++ b/src/ui-components/index.js @@ -1,8 +1,8 @@ -/** ************************************************************************* +/*************************************************************************** * The contents of this file were generated with Amplify Studio. * * Please refrain from making any modifications to this file. * * Any changes to this file will be overwritten when running amplify pull. * - ************************************************************************* */ + **************************************************************************/ export { default as TimeslotCreateForm } from "./TimeslotCreateForm"; export { default as TimeslotUpdateForm } from "./TimeslotUpdateForm"; diff --git a/src/ui-components/utils.js b/src/ui-components/utils.js index 250978d..7625bde 100644 --- a/src/ui-components/utils.js +++ b/src/ui-components/utils.js @@ -1,8 +1,8 @@ -/** ************************************************************************* +/*************************************************************************** * The contents of this file were generated with Amplify Studio. * * Please refrain from making any modifications to this file. * * Any changes to this file will be overwritten when running amplify pull. * - ************************************************************************* */ + **************************************************************************/ /* eslint-disable */ export const validateField = (value, validations) => { @@ -182,18 +182,18 @@ const checkValidation = (value, validation) => { } }; const monthToShortMon = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", + "1": "Jan", + "2": "Feb", + "3": "Mar", + "4": "Apr", + "5": "May", + "6": "Jun", + "7": "Jul", + "8": "Aug", + "9": "Sep", + "10": "Oct", + "11": "Nov", + "12": "Dec", }; const invalidDateStr = "Invalid Date"; export function formatDate(date, dateFormat) {