-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
850 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
package main; | ||
|
||
import "firebase_rules_options.proto"; | ||
|
||
option (google.firebase.rules.firebase_rules).full_package_names = true; | ||
|
||
message AutoOrderChange { | ||
string id = 1; | ||
string student_account_id = 2; | ||
bool enabled = 3; | ||
} |
25 changes: 25 additions & 0 deletions
25
common/src/entities/auto-order-changes/auto-order-change.firestore.ts
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,25 @@ | ||
import { FirestoreDataConverter } from 'firebase/firestore'; | ||
import { AutoOrderChange } from './auto-order-change'; | ||
|
||
|
||
export class AutoOrderChangeFirestore { | ||
static collectionID = 'auto_order_changes'; | ||
static documentID = 'auto_order_change_id'; | ||
static virtualPath = `${AutoOrderChangeFirestore.collectionID}/{${AutoOrderChangeFirestore.documentID}}`; | ||
|
||
static converter: FirestoreDataConverter<AutoOrderChange> = { | ||
toFirestore: (data) => ({ ...data }), | ||
fromFirestore: (snapshot, options) => { | ||
const data = snapshot.data(options)!; | ||
return new AutoOrderChange(data, data.created_at, data.updated_at); | ||
} | ||
}; | ||
|
||
static collectionPath() { | ||
return `${AutoOrderChangeFirestore.collectionID}`; | ||
} | ||
|
||
static documentPath(id: string) { | ||
return `${AutoOrderChangeFirestore.collectionPath()}/${id}`; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
common/src/entities/auto-order-changes/auto-order-change.ts
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,12 @@ | ||
import { proto } from '../..'; | ||
import { FieldValue, Timestamp } from 'firebase/firestore'; | ||
|
||
export class AutoOrderChange extends proto.main.AutoOrderChange { | ||
constructor(iAutoOrderChange: proto.main.IAutoOrderChange, public created_at?: FieldValue | Timestamp, public updated_at?: FieldValue | Timestamp) { | ||
super(iAutoOrderChange); | ||
} | ||
|
||
validate() { | ||
return false; | ||
} | ||
} |
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,2 @@ | ||
export * from './auto-order-change.firestore'; | ||
export * from './auto-order-change'; |
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
Oops, something went wrong.