Last active
July 13, 2020 11:55
-
-
Save anatoliyfedorenko/513972b8ef185e871a7fdbabc9b462b3 to your computer and use it in GitHub Desktop.
Heavy Interface for Database interactions
This file contains hidden or 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
| // IStorage represents database methods | |
| type IStorage interface { | |
| IfUserCanBeDeleted(ctx context.Context, userID int64) (bool, error) | |
| CreateUser(ctx context.Context, u *model.User) (model.User, error) | |
| CreateProfile(ctx context.Context, item *model.Profile) (*model.Profile, error) | |
| DeleteUser(ctx context.Context, id int64) error | |
| MarkUserAsDeleted(ctx context.Context, id int64, reason string) error | |
| ListProfiles(ctx context.Context) ([]model.Profile, error) | |
| UpdateProfile(ctx context.Context, item *model.Profile) error | |
| GetUserByID(ctx context.Context, id int64) (model.User, error) | |
| GetPinCodeByUserID(ctx context.Context, id int64) (string, error) | |
| GetShortUserByID(ctx context.Context, id int64) (model.ShortUser, error) | |
| UpdateProfilePersonID(ctx context.Context, accID, personID string) error | |
| GetUserProfileByID(ctx context.Context, id int64) (*model.Profile, error) | |
| GetUserProfileByStripeAccountID(ctx context.Context, stripeAccountID string) (*model.Profile, error) | |
| GetUserProfileByStripeCustomerID(ctx context.Context, stripeCustomerID string) (*model.Profile, error) | |
| GetUserIDByStripeAccount(ctx context.Context, stripeAccount string) (int64, error) | |
| GetAgreementIDByPaymentIntentID(ctx context.Context, paymentIntentID string) (int64, error) | |
| GetUserByPhone(ctx context.Context, phone string) (model.User, error) | |
| CheckUserExists(ctx context.Context, phone string) (bool, error) | |
| CheckUserExistsDeprecated(ctx context.Context, phones []string) (bool, error) | |
| CreateAgreement(ctx context.Context, a *model.Agreement) (model.Agreement, error) | |
| GetAgreementByPaymentIntentID(ctx context.Context, paymentIntentID string) (model.Agreement, error) | |
| GetAgreementByResolutionServicesPaymentIntentID(ctx context.Context, paymentIntentClientSecret string) (model.Agreement, error) | |
| UpdateAgreementResolutionServicePI(ctx context.Context, id int64, piClientSecret string) error | |
| DeleteAgreement(ctx context.Context, id int64) error | |
| GetPaidAgreementsForBuyer(ctx context.Context, buyerID int64) ([]model.Agreement, error) | |
| UpdateAgreementStatus(ctx context.Context, a *model.Agreement) error | |
| GetAgreementByID(ctx context.Context, id int64) (model.Agreement, error) | |
| GetUserAgreements(ctx context.Context, filter *model.AgreementFilter) ([]model.Agreement, error) | |
| GetAgreementMilestones(ctx context.Context, agreementID int64) ([]model.Milestone, error) | |
| ConfirmAgreement(ctx context.Context, agreement model.Agreement) error | |
| RejectChangesOnAgreement(ctx context.Context, a *model.Agreement) error | |
| AcceptChangesOnAgreement(ctx context.Context, initialAgreement *model.Agreement, newAgreement model.Agreement, updatedMstList, deletedMstList, newAddedMstList []model.Milestone) error | |
| UpdateMilestone(ctx context.Context, m model.Milestone) (model.Milestone, error) | |
| UpdateAgreement(ctx context.Context, a *model.Agreement, updatedMstList, deletedMstList, newAddedMstList []model.Milestone) error | |
| ContactsList(ctx context.Context, id int64) (model.ContactListForUser, error) | |
| ContactsCreate(ctx context.Context, contact model.ContactPairShort) error | |
| ContactsDelete(ctx context.Context, userID int64) error | |
| ContactsListFriends(ctx context.Context, id int64) (model.ContactListForUser, error) | |
| GetContactShort(ctx context.Context, id1, id2 int64) (model.ContactPairShort, error) | |
| GetContactShortByChatID(ctx context.Context, chatID string) (model.ContactPairShort, error) | |
| GetContactFullByChatID(ctx context.Context, chatID string) (model.ContactPairFull, error) | |
| GetContactPartialInfoSecond(ctx context.Context, id1, id2 int64) (model.ContactPartialInfoSecond, error) | |
| GetContactFull(ctx context.Context, id1, id2 int64) (model.ContactPairFull, error) | |
| ContactsCreateAddRequest(ctx context.Context, idFrom, idTo int64) (model.ContactPairShort, error) | |
| ContactsUpdateLastMessageTime(ctx context.Context, contact *model.ContactPairShort) error | |
| ContactExists(ctx context.Context, id1, id2 int64) (bool, error) | |
| GetUsersReferralCode(ctx context.Context, userID int64) (string, error) | |
| ContactsUpdate(ctx context.Context, contact model.ContactPairShort) error | |
| GetMilestoneByID(ctx context.Context, id int64) (model.Milestone, error) | |
| UpdateMilestoneStatus(ctx context.Context, m *model.Milestone) error | |
| GetShortAgreement(ctx context.Context, id int64) (model.Agreement, error) | |
| UpdateUser(ctx context.Context, u *model.User) error | |
| UpdateUserPinCode(ctx context.Context, u *model.User) error | |
| SaveConfirmationCode(ctx context.Context, c model.ConfirmationCode) error | |
| GetConfirmationCodeInfo(ctx context.Context, phone string) (model.ConfirmationCode, error) | |
| AgreementMilestonesClosed(ctx context.Context, agreementID int64) (bool, error) | |
| CreateUserDeviceToken(ctx context.Context, dt *model.UserDeviceToken) error | |
| RemoveUserToken(ctx context.Context, userID int64) error | |
| GetNotification(ctx context.Context, id int64) (model.Notification, error) | |
| ListNotification(ctx context.Context, userID int64) ([]model.Notification, error) | |
| CreateNotification(ctx context.Context, n *model.Notification) (model.Notification, error) | |
| GetUserFCMToken(ctx context.Context, userID int64) (string, error) | |
| SubmitAgreementForInternalResolution(ctx context.Context, id int64, piClientSecret string) error | |
| SetAgreementResolution(ctx context.Context, id int64, resolution string) error | |
| DenyAgreement(ctx context.Context, a model.Agreement) error | |
| GetAgreementOfMilestone(ctx context.Context, milestoneID int64) (model.Agreement, error) | |
| SoftDeleteMilestone(ctx context.Context, agreementID, milestoneID int64) error | |
| SetMilestoneToDelete(ctx context.Context, agreementID, milestoneID int64) error | |
| SetMilestoneToUpdate(ctx context.Context, milestoneID int64) error | |
| ConfirmPhone(ctx context.Context, phone string) error | |
| IsPhoneVerified(ctx context.Context, phone string) (bool, error) | |
| RemoveConfirmationCode(ctx context.Context, phone string) error | |
| GetAllShortUsers(ctx context.Context) ([]model.ShortUser, error) | |
| SetNotificationAsRead(ctx context.Context, id int64) error | |
| GetUnreadNotificationsCount(ctx context.Context, receiverID int64) (int, error) | |
| ResetUnreadNotifications(ctx context.Context, receiverID int64) error | |
| SaveWebhookEvent(ctx context.Context, item *model.WebhookEvent) (model.WebhookEvent, error) | |
| UpdateWebhookEvent(ctx context.Context, item *model.WebhookEvent) error | |
| FindWebhookEventBy(ctx context.Context, source, externalID string) (model.WebhookEvent, error) | |
| GetFullAgreementByID(ctx context.Context, id, tokenUserID int64) (model.Agreement, error) | |
| ReferralGetBonusByUserID(ctx context.Context, userID int64) (int64, error) | |
| ReferralAddBonusToUsersBonuses(ctx context.Context, userID, bonus int64) error | |
| ReferralExists(ctx context.Context, refCode string) (bool, error) | |
| GetReferral(ctx context.Context, code string) (model.Referral, error) | |
| AddReferralProgram(ctx context.Context, rp model.ReferralProgram) error | |
| DeleteReferralPrograms(ctx context.Context) error | |
| GetReferralProgram(ctx context.Context, code string) (*model.ReferralProgram, error) | |
| ListReferralPrograms(ctx context.Context) ([]model.ReferralProgram, error) | |
| ListAgreementsApplicableForReferral(ctx context.Context, code string) ([]model.Agreement, error) | |
| ReferralUserAlreadyUsedRefferalCode(ctx context.Context, userID int64) (bool, error) | |
| IfMilestoneWasUsedInReferral(ctx context.Context, milestoneID int64, code string) (bool, error) | |
| MarkMilestoneAsUsedInReferral(ctx context.Context, milestoneID int64, code string) error | |
| GetReferralByUserID(ctx context.Context, userID int64) (model.Referral, error) | |
| CreateMilestoneChanges(ctx context.Context, milestone *model.Milestone) error | |
| GetMilestoneChanges(ctx context.Context, milestoneID int64) (*model.Milestone, error) | |
| DeleteMilestoneChanges(ctx context.Context, milestoneID int64) error | |
| ReferralGetUserIDByCode(ctx context.Context, code string) (int64, error) | |
| CreatePayout(ctx context.Context, item model.Payout) (model.Payout, error) | |
| DeletePayout(ctx context.Context, id int64) error | |
| ListPayouts(ctx context.Context, userID int64) ([]model.Payout, error) | |
| ListPayoutsWithStatus(ctx context.Context, status model.PayoutStatus) ([]model.Payout, error) | |
| UpdatePayoutStripeID(ctx context.Context, item model.Payout) error | |
| UpdatePayoutStatus(ctx context.Context, item model.Payout) (model.Payout, error) | |
| GetPayoutByMilestoneID(ctx context.Context, milestoneID int64) (model.Payout, error) | |
| GetPayoutByStripeID(ctx context.Context, payout string) (model.Payout, error) | |
| CreateFeedback(ctx context.Context, f *feedback.Feedback) (*feedback.Feedback, error) | |
| GetUserIDByEmail(ctx context.Context, email string) (int64, error) | |
| CreatePlatformTransfer(ctx context.Context, item model.PlatformTransfer) (model.PlatformTransfer, error) | |
| ListAgreementPlatformTransfers(ctx context.Context, agreementID int64) ([]model.PlatformTransfer, error) | |
| DisputeAgreement(ctx context.Context, agreementID int64, milestoneIDs []int64) error | |
| CreateBlockedUser(ctx context.Context, item model.BlockedUser) (model.BlockedUser, error) | |
| CheckIfUserIsBlocked(ctx context.Context, userID int64) (bool, error) | |
| UnblockUser(ctx context.Context, stripeAccountID string) error | |
| CreateUserRefreshToken(ctx context.Context, rt model.UserRefreshToken) error | |
| GetUserRefreshToken(ctx context.Context, userID int64) (string, error) | |
| UpdateUserRefreshToken(ctx context.Context, rt model.UserRefreshToken) error | |
| UpdateUserDeviceToken(ctx context.Context, dt model.UserDeviceToken) error | |
| GetConfirmedMilestones(ctx context.Context) ([]model.Milestone, error) | |
| CollaboratorsGetAllPhonesWithContactStatus(ctx context.Context, callerID int64) ([]model.PhoneWithContactStatus, error) | |
| SetShowRejectedChangesFalse(ctx context.Context, changesID int64) error | |
| CreateAgreementChanges(ctx context.Context, item model.ChangesOnAgreement) (model.ChangesOnAgreement, error) | |
| GetLatestAgreementChanges(ctx context.Context, agreementID int64) (model.ChangesOnAgreement, error) | |
| DeleteAgreementChanges(ctx context.Context, id int64) error | |
| DeleteAgreementChangesByAgreementID(ctx context.Context, id int64) error | |
| CancelAgreementChanges(ctx context.Context, agreement model.Agreement, changesID int64) error | |
| GetAgreementChangesByID(ctx context.Context, id int64) (model.ChangesOnAgreement, error) | |
| SetChangesViewed(ctx context.Context, changesOnAgrID int64) error | |
| CheckIfAgreementHasPendingChanges(ctx context.Context, agreementID int64) (bool, error) | |
| GetDataOfMilestoneToInspect(ctx context.Context, previousRunTime time.Time) ([]model.MilestoneToInpect, error) | |
| CreateMilestone(ctx context.Context, m *model.Milestone) (model.Milestone, error) | |
| SetLatestLoggedUserDevice(ctx context.Context, u model.LatestLoggedUserDevice) (model.LatestLoggedUserDevice, error) | |
| GetLatestLoggedUserDevice(ctx context.Context, userID int64) (model.LatestLoggedUserDevice, error) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment