-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from jogboms/develop
feat: 0.1.0
- Loading branch information
Showing
105 changed files
with
832 additions
and
934 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ doc/api/ | |
.atom/ | ||
.dart_tool/ | ||
.idea | ||
.vscode/ | ||
ios/.generated/ | ||
packages | ||
.flutter-plugins | ||
.log |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [{ | ||
"name": "Flutter", | ||
"type": "dart", | ||
"request": "launch", | ||
"args": [ | ||
"--flavor=development" | ||
], | ||
"program": "lib/main.dart" | ||
}] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
/build | ||
/captures | ||
GeneratedPluginRegistrant.java | ||
google-services.json |
This file contains 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
This file was deleted.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Modify this file to customize your launch splash screen --> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@android:color/white" /> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill"> | ||
<!-- You can insert your own image assets here --> | ||
<item android:drawable="@mipmap/pattern" /> | ||
|
||
<!-- You can insert your own image assets here --> | ||
<!-- <item> | ||
<bitmap | ||
android:gravity="center" | ||
android:src="@mipmap/launch_image" /> | ||
</item> --> | ||
<item> | ||
<bitmap android:gravity="center" android:src="@mipmap/logo" /> | ||
</item> | ||
</layer-list> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { firestore as Firestore } from "firebase-admin"; | ||
import { auth, EventContext } from "firebase-functions"; | ||
import { ChangeState } from "../utils"; | ||
|
||
export function _onAuth(onCreate: ChangeState) { | ||
return async (user: auth.UserRecord, context: EventContext) => { | ||
const db = Firestore(); | ||
const batch = db.batch(); | ||
|
||
const account = db.collection("accounts").doc(user.uid); | ||
batch.set(account, { | ||
storeName: user.displayName, | ||
uid: user.uid, | ||
email: user.email, | ||
displayName: user.displayName, | ||
phoneNumber: user.phoneNumber, | ||
photoURL: user.photoURL | ||
}); | ||
|
||
const stats = db.collection("stats").doc(user.uid); | ||
batch.set(stats, { | ||
contacts: { | ||
total: 0 | ||
}, | ||
gallery: { | ||
total: 0 | ||
}, | ||
jobs: { | ||
total: 0, | ||
pending: 0, | ||
completed: 0 | ||
}, | ||
payments: { | ||
total: 0, | ||
pending: 0, | ||
completed: 0 | ||
} | ||
}); | ||
|
||
// Commit the batch | ||
return batch.commit(); | ||
}; | ||
} | ||
|
||
export function onAuthCreate(onCreate: ChangeState) { | ||
const store = auth.user(); | ||
|
||
// return onCreate == ChangeState.Create | ||
// ? store.onCreate(_onAuth(onCreate)) | ||
// : store.onDelete(_onAuth(onCreate)); | ||
return store.onCreate(_onAuth(onCreate)); | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
import { initializeApp } from "firebase-admin"; | ||
import { config } from "firebase-functions"; | ||
import { onAuthCreate } from "./fn/auth"; | ||
import { onContactStats } from "./fn/contact_stats"; | ||
import { onJobPayments } from "./fn/job_payments"; | ||
import { onPaymentGallery } from "./fn/payment_gallery"; | ||
import { onStatsContacts } from "./fn/stats_contacts"; | ||
import { onStatsJob } from "./fn/stats_jobs"; | ||
import { ChangeState } from "./utils"; | ||
|
||
initializeApp(config().firebase); | ||
|
||
export const AuthCreate = onAuthCreate(ChangeState.Created); | ||
|
||
export const PaymentGallery = onPaymentGallery; | ||
|
||
export const JobPayments = onJobPayments; | ||
|
||
export const StatsJobs = onStatsJob; | ||
export const StatsJobsCreate = onStatsJob(ChangeState.Created); | ||
|
||
export const StatsJobsUpdate = onStatsJob(ChangeState.Updated); | ||
|
||
export const StatsJobsDelete = onStatsJob(ChangeState.Deleted); | ||
|
||
export const StatsContactsCreate = onStatsContacts(); | ||
export const StatsContactsCreate = onStatsContacts(ChangeState.Created); | ||
|
||
export const StatsContactsDelete = onStatsContacts(false); | ||
export const StatsContactsDelete = onStatsContacts(ChangeState.Deleted); | ||
|
||
export const ContactStats = onContactStats; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum ChangeState { | ||
Created, | ||
Updated, | ||
Deleted | ||
} |
Oops, something went wrong.