Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ sqlfile.dbml
report_summary
migration-results
streamlit


apps/docs/build/*
apps/backend/report.xlsx
31 changes: 29 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ drop:
@docker exec -it $(PROJECT)-db psql -U postgres -d pcc -c "DROP SCHEMA public CASCADE;"
@docker exec -it $(PROJECT)-db psql -U postgres -d pcc -c "CREATE SCHEMA public;"

dev-docs:
@docker exec -it $(PROJECT)-backend yarn run compodoc


# ===================================
Expand Down Expand Up @@ -424,3 +422,32 @@ version-minor:

version-patch:
@yarn run version:patch
aws ec2-instance-connect send-ssh-public-key --instance-id $(BASTION_INSTANCE_ID) --instance-os-user ec2-user --ssh-public-key file://ssh-keypair.pub
ssh -i ssh-keypair ec2-user@$(BASTION_INSTANCE_ID) -L 5454:$(DB_HOST):5432 -o ProxyCommand="aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"


# ===================================
# Project Documentation
# ===================================

update-docs:
@echo "+\n++ Updating docs: ...\n+"
@./apps/docs/docs.sh

build-docs:
@docker-compose up -d --build docs
@echo "docs: http://localhost:3001"

run-docs:
@docker-compose up -d docs
@echo "docs: http://localhost:3001"


# ===================================
# Developer Documentation
# ===================================

dev-docs:
@echo "Wait for 1 minute, then visit: http://localhost:8081"
@docker exec -it $(PROJECT)-backend yarn run compodoc

4 changes: 2 additions & 2 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"typeorm:generate-migration": "yarn run typeorm migration:generate -d ./src/database/datasource.ts ./src/database/migrations/migration",
"typeorm:create-migration": "yarn run typeorm migration:create ./src/database/migrations/migration",
"typeorm:revert-migration": "yarn run typeorm -d ./src/database/datasource.ts migration:revert",
"docs": "npx @compodoc/compodoc -c compodoc.yaml",
"docs": "npx @compodoc/compodoc -o -c compodoc.yaml",
"version:major": "yarn version major",
"version:minor": "yarn version minor",
"version:patch": "yarn version patch"
Expand Down Expand Up @@ -66,7 +66,7 @@
"winston": "3.10.0"
},
"devDependencies": {
"@compodoc/compodoc": "1.1.21",
"@compodoc/compodoc": "1.1.22",
"@faker-js/faker": "8.0.2",
"@golevelup/ts-jest": "0.4.0",
"@nestjs/cli": "10.1.11",
Expand Down
1 change: 1 addition & 0 deletions apps/docs/api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"openapi":"3.0.0","paths":{"/api/v1/version":{"get":{"operationId":"AppController_getVersion","parameters":[],"responses":{"200":{"description":""}},"tags":["Health API"],"security":[{"basic":[]}]}},"/api/v1/error":{"get":{"operationId":"AppController_getError","parameters":[],"responses":{"200":{"description":""}},"tags":["Health API"],"security":[{"basic":[]}]}},"/api/v1/health":{"get":{"operationId":"AppController_getHealth","summary":"","parameters":[],"responses":{"200":{"description":""}},"tags":["Health API"],"security":[{"basic":[]}]}},"/api/v1/transaction":{"post":{"operationId":"TransactionController_saveTransactionEvent","summary":"Post Sales Event","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"example":[{"transaction_id":"72cbe1da-b08e-49d4-9a87-69afd660d14b","transaction_date":"2023-01-01","transaction_time":"13.33.31.875973","fiscal_close_date":"2023-01-02","total_transaction_amount":30.2,"void_indicator":false,"miscellaneous":{"employee_id":"SC61350"},"source":{"source_id":"SBC","location_id":61,"accepted_payment_methods":["CASH","CHQ","P","M","V"]},"payments":[{"amount":20,"foreign_currency_amount":15,"currency":"USD","exchange_rate":1.34,"payment_method":"CASH","payment_channel":"in-person"},{"amount":10.2,"currency":"CAD","payment_method":"V","payment_channel":"in-person","terminal":{"card_no":"5253","merchant_id":"20777441","device_id":"GA2077744108","invoice_no":""},"online":{"tran_id":"","order_no":""},"pos":{"approval_code":"ASWQD24342"}}],"accounting":[{"sequence":"001","details":{"code":"1234","description":"passport photocopy"},"distributions":[{"line_number":"00001","line_description":"passport photocopy","line_dollar_amount":10,"disbursment_gl_account":{"dist_client_code":"074","dist_resp_code":"66020","dist_service_line_code":"44275","dist_stob_code":"1278","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000","EFT":{"vendor":"xxx"}},"revenue_gl_account":{"dist_client_code":"074","dist_resp_code":"66020","dist_service_line_code":"44275","dist_stob_code":"1474","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"}},{"line_number":"00002","line_description":"PST G/L ","line_dollar_amount":0.7,"disbursment_gl_account":{"dist_client_code":"022","dist_resp_code":"12345","dist_service_line_code":"66123","dist_stob_code":"4123","dist_project_code":"3200000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"},"revenue_gl_account":{"dist_client_code":"074","dist_resp_code":"66020","dist_service_line_code":"44275","dist_stob_code":"1474","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"}},{"line_number":"00003","line_dollar_amount":0.5,"line_description":"GST G/L ","disbursment_gl_account":{"dist_client_code":"022","dist_resp_code":"4567","dist_service_line_code":"88123","dist_stob_code":"4123","dist_project_code":"3200000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"},"revenue_gl_account":{"dist_client_code":"074","dist_resp_code":"66020","dist_service_line_code":"44275","dist_stob_code":"1474","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"}}]},{"sequence":"002","details":{"code":"1234","description":"driving lic renewal"},"distributions":[{"line_number":"00001","line_description":"driving lic renewal","line_dollar_amount":14,"disbursment_gl_account":{"dist_client_code":"010","dist_resp_code":"66213","dist_service_line_code":"44275","dist_stob_code":"1278","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000","EFT":{"vendor":"xxx"}},"revenue_gl_account":{"dist_client_code":"074","dist_resp_code":"66020","dist_service_line_code":"44275","dist_stob_code":"1474","dist_project_code":"6600000","dist_location_code":"000000","dist_future_code":"0000","supplier_code":"000000"}}]}]}]}}}},"responses":{"default":{"description":"Returns the parsed sales reconciliation data","content":{"application/json":{"schema":{"example":{"data":[]}}}}}},"tags":["Transaction API"],"security":[{"basic":[]}]}},"/api/v1/parse/upload":{"post":{"operationId":"ParseController_uploadFile","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"program":{"type":"string","enum":["SBC","LABOUR"],"nullable":false},"source":{"type":"string","enum":["bcm","sbc"],"nullable":false},"fileType":{"type":"string","enum":["TDI17","TDI34","SBC_SALES"],"nullable":false},"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":""}},"tags":["Parser API"],"security":[{"basic":[]}]}}},"info":{"title":"PayCoCo API Docs","description":"Payment Common Component API Documentation","version":"1.0.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}},"schemas":{}}}
22 changes: 22 additions & 0 deletions apps/docs/docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/bash

REQUIRED_PKG="widdershins"
PKG_OK=$(widdershins --version)

echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG"
read -p "Would you like to install $REQUIRED_PKG ? (y/n) " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
npm i -g widdershins
else
curl --location --request GET '[::1]:3000/api-json' > ./apps/docs/api.json;
widdershins --omit-header --environment ./apps/docs/env.json ./apps/docs/api.json -o ./apps/docs/source/includes/_api.md


fi


3 changes: 3 additions & 0 deletions apps/docs/env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"language_tabs": [{ "typescript": "Typescript" }]
}
20 changes: 20 additions & 0 deletions apps/docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Payment Common Component Docs

### Technical Setup

- Run `make update-docs` to get the latest API spec and to install widdershins, if required.

- Run `make build-docs` to build the docs in a docker container.

- Run `make run-docs` to run.

- Click [HERE](http://localhost:3001) to view docs

#### Updating Docs

When you run `make update-docs` the api section of the documentation will update automatically, based on the Swagger API tags from the running application.

To update the written content, images, and other sources, you can make changes to the "source files"

Visit [Slate Docs](https://github.com/slatedocs/slate) for detailed information

Binary file added apps/docs/source/fonts/BCSans-Bold.woff
Binary file not shown.
Binary file added apps/docs/source/fonts/BCSans-BoldItalic.woff
Binary file not shown.
Binary file added apps/docs/source/fonts/BCSans-Italic.woff
Binary file not shown.
Binary file added apps/docs/source/fonts/BCSans-Regular.woff
Binary file not shown.
30 changes: 30 additions & 0 deletions apps/docs/source/fonts/FONTLOG_README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FONTLOG for the BC Sans font

This file provides detailed information on the BC Sans font software.

This information should be distributed along with the BC Sans fonts and any derivative works.

Basic Font Information

BC Sans is a Unicode typeface family that supports languages that use the Latin and syllabic scripts, and it's variants.

BC Sans is a modified version of Noto Sans, developed by Google. Modifications have been done to provide support for Indigenous languages unique to British Columbia.

BC Sans comes in four styles: regular, bold, italic, and bold italic

ChangeLog

20 July 2019 (B.C Government) BCSansFontFamily Version 1.0
- Initial release
- Combined NotoSans font with NotoSansCanadianAboriginal font into single font file
- Renamed Noto Sans to BC Sans
- Fixed combining position of "combining lowline" (U+0332) for dz and ts combinations
- Added right spacing to the "combining comma above right" (U+0315)
- Added syllabic variant positioning for the Dakelh syllabics

Acknowledgements

N: Chris Harvey
E: languagegeek@gmail.com
W: http://www.languagegeek.com
D: Contributor
94 changes: 94 additions & 0 deletions apps/docs/source/fonts/LICENSE_OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Copyright (c) 2015, Google Inc., copyright (c) 2019, Province of B.C. 2019

This Font Software is licensed under the SIL Open Font License,
Version 1.1.

This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added apps/docs/source/fonts/slate.eot
Binary file not shown.
14 changes: 14 additions & 0 deletions apps/docs/source/fonts/slate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/fonts/slate.ttf
Binary file not shown.
Binary file added apps/docs/source/fonts/slate.woff
Binary file not shown.
Binary file added apps/docs/source/fonts/slate.woff2
Binary file not shown.
Binary file added apps/docs/source/images/HTTPerrors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/logo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/method.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/navbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/pa7.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/pay.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/pay3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/pay5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/pay6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/placeholder.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/recon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/recon2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/source/images/step9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading