-
Notifications
You must be signed in to change notification settings - Fork 3
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 #70 from QuanMPhm/52.3/refactor_HU_BU
Refactored the HU-BU invoice
- Loading branch information
Showing
2 changed files
with
39 additions
and
25 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,23 @@ | ||
from dataclasses import dataclass | ||
|
||
import process_report.invoices.invoice as invoice | ||
import process_report.util as util | ||
|
||
|
||
@dataclass | ||
class HUBUInvoice(invoice.Invoice): | ||
@property | ||
def output_s3_key(self) -> str: | ||
return ( | ||
f"Invoices/{self.invoice_month}/NERC-{self.invoice_month}-Total-Invoice.csv" | ||
) | ||
|
||
@property | ||
def output_s3_archive_key(self): | ||
return f"Invoices/{self.invoice_month}/Archive/NERC-{self.invoice_month}-Total-Invoice {util.get_iso8601_time()}.csv" | ||
|
||
def _prepare_export(self): | ||
self.data = self.data[ | ||
(self.data[invoice.INSTITUTION_FIELD] == "Harvard University") | ||
| (self.data[invoice.INSTITUTION_FIELD] == "Boston University") | ||
].copy() |
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