Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/src/@types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ declare module '@env' {
export const FIREBASE_appId: string
export const FIREBASE_measurementId: string
export const FIREBASE_databaseURL: string
export const FIREBASE_smas_databaseURL: string
export const FIREBASE_CLOUD_URL: string
export const MAPS_API: string
export const IOS_MAPS_API_KEY: string
Expand All @@ -26,7 +25,6 @@ declare module '@env' {
export const PROD_FIREBASE_appId: string
export const PROD_FIREBASE_measurementId: string
export const PROD_FIREBASE_CLOUD_URL: string
export const PROD_FIREBASE_smas_databaseURL: string
export const PROD_ALGOLIA_ID: string
export const PROD_ALGOLIA_KEY: string
export const PROD_AUTH_ANDROID_CLIENT_ID: string
Expand Down
55 changes: 0 additions & 55 deletions app/src/contexts/SmasContext/index.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/contexts/SmasContext/types.ts

This file was deleted.

2 changes: 0 additions & 2 deletions app/src/data/shared/storageKeys/localStorageKeys.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const LOCAL_USER_REPOSITORY_KEY = 'corre.user'
const LOCAL_SMAS_REPOSITORY_KEY = 'corre.smas'
const LOCAL_OFFLINE_POSTS_REPOSITORY_KEY = 'corre.offlinePosts'
const LOCAL_CACHE_IMAGE_CONTROL_KEY = 'corre.cacheImage'
const LOCAL_OFFLINE_CITIZEN_REGISTERS_KEY = 'corre.citizenRegisters'
const LOCAL_OFFLINE_CITIZEN_REGISTRATION_PROGRESS_KEY = 'corre.citizenRegisterInProgress'

export {
LOCAL_USER_REPOSITORY_KEY,
LOCAL_SMAS_REPOSITORY_KEY,
LOCAL_OFFLINE_POSTS_REPOSITORY_KEY,
LOCAL_CACHE_IMAGE_CONTROL_KEY,
LOCAL_OFFLINE_CITIZEN_REGISTERS_KEY,
Expand Down
13 changes: 0 additions & 13 deletions app/src/data/smas/SmasRepositoryInterface.ts

This file was deleted.

42 changes: 0 additions & 42 deletions app/src/data/smas/localRepository/methods.ts

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/data/smas/remoteRepository/getNotificationTokenByNis.ts

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/data/smas/remoteRepository/updateSmasTokenNotification.ts

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/data/smas/useSmasRepository.ts

This file was deleted.

6 changes: 1 addition & 5 deletions app/src/domain/post/PostDomainInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { PostRepositoryInterface } from '@data/post/PostRepositoryInterface'

import { PostEntity } from './entity/types'

import { CloudFunctionServiceInterface } from '@services/cloudFunctions/CloudFunctionServiceInterface'

import { PostRangeLocation } from './core/updatePostsLocation'

interface PostDomainInterface {
Expand All @@ -27,12 +25,10 @@ interface PostDomainInterface {
updateLocationDataOnPosts(userId: string, newPostRangeLocation: PostRangeLocation, subscriptionDowngrade?: boolean): Promise<PostEntity[]>
savePost(
usePostRepository: () => PostRepositoryInterface,
useCloudFunctionService: () => CloudFunctionServiceInterface,
userSubscriptionRange: UserSubscription['subscriptionRange'],
storedPostData: PostEntity,
newPostData: PostEntity,
unsavedPostPictures: string[],
notifyUsersByLocation?: boolean
unsavedPostPictures: string[]
): Promise<{ newPost: PostEntity }>
approvePost(usePostRepository: () => PostRepositoryInterface, postData: PostEntity): Promise<PostEntity | void>
rejectPost(usePostRepository: () => PostRepositoryInterface, postData: PostEntity): Promise<PostEntity | void>
Expand Down
23 changes: 1 addition & 22 deletions app/src/domain/post/methods/savePostDM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,20 @@ import { UserSubscription } from '@domain/user/entity/types'
import { PostRepositoryInterface } from '@data/post/PostRepositoryInterface'

import { PostEntity } from '../entity/types'
import { NotifyUsersByLocationParams } from '@services/cloudFunctions/types/types'

import { CloudFunctionServiceInterface } from '@services/cloudFunctions/CloudFunctionServiceInterface'

import { mediaUrlUpdatedDM } from '../core/editPostValidationDM'
import { postLocationChangedDM } from '../core/postLocationChangedDM'
import { updateLocationDataOnPostsDM } from './updateLocationDataOnPostsDM'

async function savePostDM(
usePostRepository: () => PostRepositoryInterface,
useCloudFunctionService: () => CloudFunctionServiceInterface,
userSubscriptionRange: UserSubscription['subscriptionRange'], // REFACTOR Validar internamente com nova consulta de user
storedPostData: PostEntity,
newPostData: PostEntity,
unsavedPostPictures: string[],
notifyUsersByLocation?: boolean
unsavedPostPictures: string[]
) {
const { notifyUsersOnLocation } = useCloudFunctionService()
const { remoteStorage } = usePostRepository()

const owner = { ...newPostData.owner }

const postLocationIsOutsideSubscriptionRange = await postLocationChangedDM(
userSubscriptionRange,
storedPostData,
Expand Down Expand Up @@ -88,19 +80,6 @@ async function savePostDM(

const newStoredPost = await remoteStorage.createPost(newPostWithUploadedPictures as PostEntity)

if (notifyUsersByLocation) {
await notifyUsersOnLocation({
state: newPostData.unapprovedData?.location?.state as string,
city: newPostData.unapprovedData?.location?.city as string,
district: newPostData.unapprovedData?.location?.district as string,
postRange: newPostData.unapprovedData?.range as NotifyUsersByLocationParams['postRange']
}, {
postDescription: newPostData.unapprovedData?.description || 'Nova postagem',
userId: owner.userId,
userName: owner.name
})
}

return { newPost: { ...newStoredPost } as PostEntity }
}

Expand Down
16 changes: 0 additions & 16 deletions app/src/domain/smas/SmasDomainInterface.ts

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/domain/smas/core/checkSmasApiResponseStatus.ts

This file was deleted.

55 changes: 0 additions & 55 deletions app/src/domain/smas/core/structureBeeObject.ts

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/domain/smas/core/structureCadunicoObject.ts

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/domain/smas/core/structurePbfObject.ts

This file was deleted.

Loading