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
/* | |
* Class mapped to the the contacts table in db.ts by the line: | |
* db.contacts.mapToClass(Contact) | |
*/ | |
export class Contact extends AbstractEntity { | |
emails: EmailAddress[] | |
phones: PhoneNumber[] | |
constructor( | |
public firstName: string, |
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
import Dexie from 'dexie'; | |
import { EmailAddress, | |
PhoneNumber, | |
Contact } from './model'; | |
export class AppDatabase extends Dexie { | |
public contacts: Dexie.Table<Contact, string> | |
public emails: Dexie.Table<EmailAddress, number> |
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
import { Contact, EmailAddress, PhoneNumber } from './model' | |
import cuid from 'cuid' | |
/** | |
* Delete the entire database | |
*/ | |
export async function deleteDatabase(db) { | |
await db.delete() | |
} |
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
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { MatSnackBar, MatSnackBarConfig} from '@angular/material' | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class NotificationService { | |
constructor(public snackBar: MatSnackBar ) {} |
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
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { MatSnackBar, MatSnackBarConfig} from '@angular/material' | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class NotificationService { | |
constructor(public snackBar: MatSnackBar ) {} |
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
// material.module.ts | |
import { ModuleWithProviders, NgModule} from "@angular/core"; | |
import { MatNativeDateModule, MAT_DATE_LOCALE } from '@angular/material/core'; | |
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; | |
import { MatIconRegistry } from '@angular/material/icon'; | |
import { MatAutocompleteModule } from '@angular/material/autocomplete'; | |
import { MatBadgeModule } from '@angular/material/badge'; | |
import { MatButtonModule } from '@angular/material/button'; | |
import { MatButtonToggleModule } from '@angular/material/button-toggle'; | |
import { MatCardModule } from '@angular/material/card'; |
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
{ | |
"name": "fs-base", | |
"version": "1.0.0", | |
"publishConfig":{ | |
"access": "restricted", | |
"registry":"http://localhost:4873" | |
}, | |
"description": "Typescript base project", | |
"main": "target/index.js", | |
"typings": "target/index.d.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
import { cuid, cuidSlug as slug } from '@fireflysemantics/cuid' | |
/** | |
* Abstract Entity containing `gid` and `id` parameters | |
* for use with Slice. | |
*/ | |
export abstract class Entity { | |
public gid?:string; | |
public id?:string; |
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
/** | |
* Observe the active entity. | |
* @example | |
<pre> | |
let active$ = source.observeActive(); | |
</pre> | |
Note that this obverable piped through | |
`takeWhile(v->v, true), such that it will | |
complete when the store is done loading. |
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 16 columns, instead of 11. in line 3.
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
stockingLevel,annualDemandLevel,leadTimeDemand,unitsFulfilled,marginalUnitsFulfilled,serviceLevel,marginalServiceLevel,averageInventoryLevel,marginalAverageInventoryLevel,inventoryCarryingCost,marginalInventoryCarryingCost,cycleTimeDays,marginalCycleTimeDays,profit,marginalProfit,marginalNetProfit | |
1,5,9.615384615384615,0.0026239506631956237,0.0026239506631956237,0.0002728908689723449,0.0002728908689723449,0.09420289855072464,0.09420289855072464,434.78260869565213,434.78260869565213,6.857971014492754,6.857971014492754,52.47901326391248,52.47901326391248,-382.30359543173967 | |
2,5,9.615384615384615,0.048988955182987584,0.04636500451979196,0.005094851339030709,0.004821960470058364,0.18840579710144928,0.09420289855072464,869.5652173913043,434.78260869565213,13.715942028985507,6.857971014492754,979.7791036597516,927.3000903958391,492.51748170018703 | |
3,5,9.615384615384615,0.23081004185594023,0.18182108667295266,0.024004244353017786,0.01890939301398708,0.28260869565217395,0.09420289855072467,1304.3478260869567,434.78260 |