-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stub the invoice manager and invoice command
- Loading branch information
Showing
3 changed files
with
57 additions
and
24 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,20 @@ | ||
export class InvoiceManager { | ||
public static async CreateAsync(projectId: string) { | ||
// take all shifts for project and user config and create an invoice, create an invoice number | ||
// keep an index of all invoices and whether or not they're paid (INVOICES file) | ||
} | ||
|
||
public static async PaidAsync(projectId: string, invoiceNumber: number) { | ||
// mark a specific invoice as paid | ||
} | ||
|
||
public static async StatusAsync(projectId: string | null) { | ||
// see all unpaid invoices for | ||
if (projectId) { | ||
// specific project | ||
} | ||
else { | ||
// all projects | ||
} | ||
} | ||
} |
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 @@ | ||
import { PUNCHFILE as punchFile } from "./files/punchfile.ts"; | ||
|
||
export class ShiftManager { | ||
public static async PunchAsync(projectId: string, rate: number) { | ||
const PUNCHFILE = await punchFile.readFileAsync(); | ||
if (PUNCHFILE) { | ||
// create the shift | ||
await PUNCHFILE.deleteAsync(); | ||
} | ||
else { | ||
const punchId = ""; // generate a GUID | ||
await punchFile.createAsync(projectId, punchId, new Date(), rate); | ||
} | ||
} | ||
} |
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