Skip to content

Commit 05665d9

Browse files
authored
Merge pull request #203 from QuanMPhm/167/ocp-test_invoice
Implemented ocp-test invoice
2 parents 0a8b862 + 51fb8ad commit 05665d9

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from dataclasses import dataclass
2+
3+
import process_report.invoices.invoice as invoice
4+
5+
6+
@dataclass
7+
class OcpTestInvoice(invoice.Invoice):
8+
export_columns_list = [
9+
invoice.INVOICE_DATE_FIELD,
10+
invoice.PROJECT_FIELD,
11+
invoice.PROJECT_ID_FIELD,
12+
invoice.PI_FIELD,
13+
invoice.INVOICE_EMAIL_FIELD,
14+
invoice.INVOICE_ADDRESS_FIELD,
15+
invoice.INSTITUTION_FIELD,
16+
invoice.INSTITUTION_ID_FIELD,
17+
invoice.SU_HOURS_FIELD,
18+
invoice.SU_TYPE_FIELD,
19+
invoice.RATE_FIELD,
20+
invoice.COST_FIELD,
21+
]
22+
23+
def _prepare_export(self):
24+
self.export_data = self.data[
25+
self.data[invoice.CLUSTER_NAME_FIELD] == "ocp-test"
26+
]

process_report/process_report.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
pi_specific_invoice,
2020
MOCA_prepaid_invoice,
2121
prepay_credits_snapshot,
22+
ocp_test_invoice,
2223
)
2324
from process_report.processors import (
2425
coldfront_fetch_processor,
@@ -201,6 +202,12 @@ def main():
201202
default="Lenovo",
202203
help="Name of output csv for Lenovo SU Types invoice",
203204
)
205+
parser.add_argument(
206+
"--ocp-test-file",
207+
required=False,
208+
default="OCP-TEST",
209+
help="Name of output csv for Openshift test cluster invoice",
210+
)
204211
parser.add_argument(
205212
"--old-pi-file",
206213
required=False,
@@ -384,6 +391,10 @@ def main():
384391
prepay_contacts=prepay_info,
385392
)
386393

394+
ocp_test_inv = ocp_test_invoice.OcpTestInvoice(
395+
name="", invoice_month=invoice_month, data=processed_data.copy()
396+
)
397+
387398
util.process_and_export_invoices(
388399
[
389400
lenovo_inv,
@@ -394,6 +405,7 @@ def main():
394405
pi_inv,
395406
moca_prepaid_inv,
396407
prepay_credits_snap,
408+
ocp_test_inv,
397409
],
398410
args.upload_to_s3,
399411
)

0 commit comments

Comments
 (0)