Skip to content

Commit

Permalink
update prayer time schema relation
Browse files Browse the repository at this point in the history
  • Loading branch information
zxcvbnmmohd committed Jun 5, 2024
1 parent 8476b9d commit 2ab57b1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 53 deletions.
68 changes: 23 additions & 45 deletions amplify/backend/api/RukuAPI/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -189,40 +189,6 @@ type Like
owner: String @auth(rules: [{ allow: owner, operations: [read, delete] }])
}

type PrayerTime
@model(
queries: null
)
@auth(
rules: [
{ allow: owner, ownerField: "owners"}
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
{
id: ID!
fajr: FardPrayer!
dhuhr: FardPrayer!
asr: FardPrayer!
maghrib: FardPrayer!
isha: FardPrayer!
jummah: [FardPrayer]!
taraweeh: SunnahPrayer
eid: [FardPrayer]
startDate: AWSDateTime!
timeZone: String!
createdByUserID: ID! @index(name: "byCreatedByUser")
createdByUser: User! @belongsTo(fields: ["createdByUserID"])
updatedByUserID: ID! @index(name: "byUpdatedByUser")
updatedByUser: User! @belongsTo(fields: ["updatedByUserID"])
mosqueID: ID! @index(name: "byMosque")
mosque: Mosque! @belongsTo(fields: ["mosqueID"])
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
owners: [String] @auth(rules: [{ allow: owner }])
}

type Mosque
@model
@auth(
Expand All @@ -244,6 +210,7 @@ type Mosque
email: AWSEmail
website: String
socialMedia: SocialMedia
prayerTimes: PrayerTimes
isVerified: Boolean @default(value: "false") @auth(
rules: [
{ allow: owner, ownerField: "owners", operations: [create, read]}
Expand All @@ -269,7 +236,6 @@ type Mosque
followers: [User]! @manyToMany(relationName: "MosqueFollower")
announcements: [Announcement]! @hasMany(indexName: "byMosque", fields: ["id"])
fundraisingCampaigns: [FundraisingCampaign]! @hasMany(indexName: "byMosque", fields: ["id"])
prayerTimes: [PrayerTime]! @hasMany(indexName: "byMosque", fields: ["id"])
bookmarks: [Bookmark]! @hasMany(indexName: "byMosque", fields: ["id"])
likes: [Like]! @hasMany(indexName: "byMosque", fields: ["id"])
comments: [Comment]! @hasMany(indexName: "byMosque", fields: ["id"])
Expand Down Expand Up @@ -382,14 +348,12 @@ type User
comments: [Comment]! @hasMany(indexName: "byCreator", fields: ["id"])
createdAnnouncements: [Announcement]! @hasMany(indexName: "byCreator", fields: ["id"])
createdFundraisingCampaigns: [FundraisingCampaign]! @hasMany(indexName: "byCreator", fields: ["id"])
createdPrayerTimes: [PrayerTime]! @hasMany(indexName: "byCreatedByUser", fields: ["id"])
createdOrganizations: [Organization]! @hasMany(indexName: "byCreator", fields: ["id"])
createdMosques: [Mosque]! @hasMany(indexName: "byCreator", fields: ["id"])
donations: [Donation]! @hasMany(indexName: "byDonor", fields: ["id"])
mosques: [Mosque]! @manyToMany(relationName: "MosqueFollower")
organizations: [OrganizationMember]! @hasMany(indexName: "byMember", fields: ["id"])
likes: [Like]! @hasMany(indexName: "byCreator", fields: ["id"])
updatedPrayerTimes: [PrayerTime]! @hasMany(indexName: "byUpdatedByUser", fields: ["id"])
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
owner: String @auth(rules: [{ allow: owner, operations: [read, delete] }])
Expand All @@ -402,6 +366,11 @@ type Day {
operatingHours: [OperatingHours!]!
}

type FardPrayer {
athan: AWSTime!
iqamah: AWSTime!
}

type Hours {
monday: Day
tuesday: Day
Expand All @@ -417,14 +386,18 @@ type OperatingHours {
close: AWSTime!
}

type FardPrayer {
athan: AWSTime!
iqamah: AWSTime!
}

type SunnahPrayer {
start: AWSTime!
end: AWSTime
type PrayerTimes {
timeZone: String!
fajr: FardPrayer
dhuhr: FardPrayer
asr: FardPrayer
maghrib: FardPrayer
isha: FardPrayer
jummah: [FardPrayer!]
tahajjud: SunnahPrayer
taraweeh: SunnahPrayer
eidAlAdha: [SunnahPrayer!]
eidAlFitr: [SunnahPrayer!]
}

type SocialMedia {
Expand All @@ -434,6 +407,11 @@ type SocialMedia {
youtube: String
}

type SunnahPrayer {
start: AWSTime!
end: AWSTime
}

# ------------------------------------------------------------------------------------- ENUMS

enum AnnouncementType {
Expand Down
16 changes: 8 additions & 8 deletions amplify/team-provider-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@
"EMAILSUBJECT": "Confirm your account",
"EMAILMESSAGE": "Tap the link to confirm your account.",
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAuthCustomMessage-384e4f5a627756556330-build.zip"
"s3Key": "amplify-builds/RukuAuthCustomMessage-682f536b59536b6f434c-build.zip"
},
"RukuAuthPostAuthentication": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAuthPostAuthentication-65394843726e55563567-build.zip"
"s3Key": "amplify-builds/RukuAuthPostAuthentication-48736847394c42483869-build.zip"
},
"RukuAuthPostConfirmation": {
"GROUP": "Jamaah",
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAuthPostConfirmation-4e4977376c5239624a4d-build.zip"
"s3Key": "amplify-builds/RukuAuthPostConfirmation-3435777a5a3273526c55-build.zip"
},
"RukuAuthPreAuthentication": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAuthPreAuthentication-4547305539374d2f6963-build.zip"
"s3Key": "amplify-builds/RukuAuthPreAuthentication-43586f4765564553772b-build.zip"
},
"RukuAuthPreSignup": {
"DOMAINALLOWLIST": " ",
"DOMAINDENYLIST": " ",
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAuthPreSignup-56595434695343744f35-build.zip"
"s3Key": "amplify-builds/RukuAuthPreSignup-4b596b6e31713332346a-build.zip"
},
"RukuAPILambdaAuthorizer": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuAPILambdaAuthorizer-56573263637a4a71676e-build.zip"
"s3Key": "amplify-builds/RukuAPILambdaAuthorizer-47334c4f7a68492f666e-build.zip"
},
"RukuStorageTrigger": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/RukuStorageTrigger-51585637397a38523834-build.zip"
"s3Key": "amplify-builds/RukuStorageTrigger-584a706f7368714b6343-build.zip"
},
"AdminQueriesa8865030": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
"s3Key": "amplify-builds/AdminQueriesa8865030-3847424c66312b617361-build.zip"
"s3Key": "amplify-builds/AdminQueriesa8865030-4475636f386b61426833-build.zip"
},
"rukuCommonLayerTs": {
"deploymentBucketName": "amplify-ruku-dev-192339-deployment",
Expand Down

0 comments on commit 2ab57b1

Please sign in to comment.