Skip to content

Commit

Permalink
[Release] Version 0.0.7 (#294)
Browse files Browse the repository at this point in the history
* [Fix] Change renewal report to most recent expiring permits (#293)
* [Feature] Allow processing fee field to be manually edited (#291)
* [Fix] Fix the GraphQL delete employee mutation (#286)
* [Fix] Add refunds to accountant report (#292)
* Add note field for permit holder’s old user ID (#290)
* Update User ID copy (#289)
* [Fix] Pin GitHub CI runner image to ubuntu-20.04 (#285)
* Update README (#284)
* Fix time zone bug in requests header (#281)
* [Fix] Fix time zone for requests and reports (#278)
* [Chore] Add BSF contributors to employee database (#277)
* [Chore] Create docker-compose.yml file for local PostgreSQL instance (#276)
* [Docs] BSF CONTRIBUTING.md (#275)
  • Loading branch information
leogjhuang committed Apr 29, 2023
1 parent 5047a6c commit 723f256
Show file tree
Hide file tree
Showing 23 changed files with 339 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-20.04]
node: [14.17.0]

steps:
Expand Down
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributions

## New Contributors

Thank you for taking the time to contribute to this repo! This project is actively in use with our
clients and requires the help of volunteers like yourself to maintain and continue to foster this
project’s growth. Every contribution helps and credit is always given!

To get started contributing to this project, please email <bpsf@gmail.com>. An exec on the team will
send you a Slack invite and will onboard you onto our project.

# Roles

We have two roles on the maintenance team: Blueprint Software Foundation (BSF) executive and
contributors.

## Blueprint Software Foundation executive member

BSF is an overarching organization responsible for the upkeep of projects shipped by UW Blueprint.
As of writing, BSF is composed of 3 executives: 2 alumni and a UW Blueprint president.

Executives are responsible for maintaining communications with clients and with UW Blueprint
regarding maintenance projects and onboarding new projects onto BSF. They are also responsible for
coordinating work on tasks/issues and onboarding contributors.

## Contributors

Much of the fruitful maintenance and upkeep work on projects will be due to our wonderful
contributors! Contributors will work with execs in prioritizing and planning maintenance work and
shipping the work to our clients. As of writing, **contributors will be sourced from UW Blueprint
alumni** but we are planning on opening up contributions to those not part of UW Blueprint.

# Contribution workflow

Please follow the following steps in order to productively contribute to this repository.

## Step 1: Fork the repo

On the repository’s main page, click ‘Fork Repo’ at the top of the page.

## Step 2: Configure your environment

Once you have Notion access, take a look at the README.md file,
[development guidelines](https://www.notion.so/uwblueprintexecs/Development-processes-a0313f2bef9941fc8752c8e7b5be5e70)
and
[engineering best practices](https://www.notion.so/uwblueprintexecs/READ-Best-Practices-Engineering-3174edea363b4d4896af8dfc461cfd9c)
to set up your environment.

## Step 3: Connect with people

As mentioned above, if you are not already on our Slack, please email <bpsf@gmail.com>. Once added,
please talk to the execs on which issues or features are highest priority. This will be available as
a Notion board as well.

Once an issue is chosen, discuss with fellow contributors and execs on Slack on how you plan on
approaching the issues. We will subsequently assign you the issue and you can get cracking!

## Step 4: Prepare PR

Clone your fork locally and start to make your changes. Small changes are always greater than huge,
breaking changes! Make sure that you test a variety of situations before you push your change to
your fork!

## Step 5: Pass PR review

Once you feel confident that your change addresses the issue/feature spec, sync your fork with the
main repository and open up a PR on the main repo from your fork. Please provide a detailed
description of your change and ask for the reviews of an exec/designated contributor.

Please be cognizant of an executive’s relatively limited time. Reviews may take longer than you
would expect! Use Slack wisely to ensure that you can get a review in a timely manner.

# Thank you!

We want to thank the following individuals for their tireless contributions:

- Oustan Ding
- Carelynn Tsai
- Vedant Patel
- Angela Dietz
- Anish Aggarwal
- Christian Chan
- Emilio Mena
- Jihad Bunkheila
- Bonnie Chin
- Anthea Tawiah
- Charmaine Wang
- Jeffrey Zhang
- Amanda Guo
- Andy Lee
- Jennifer Tsai
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,40 @@ applicant-facing application portal and an internal user/APP management portal.

## Run locally

1. Start database

```bash
docker-compose up --build
```

2. Run the application

```bash
yarn install
npx prisma generate
yarn dev
```

3. Deploy prisma schema

```bash
npx prisma db push
```

4. Seed database

```bash
npx prisma db seed --preview-feature
```

5. Verify database

```bash
docker exec -it rcd_db /bin/bash -c "psql -U postgres -d rcd"
```

## Run locally (Heroku)

Duplicate `.env.sample` to `.env` and configure environment variables.

To deploy your database schema, run:
Expand Down
59 changes: 36 additions & 23 deletions components/admin/permit-holders/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
MenuItem,
MenuList,
Text,
Spacer,
useDisclosure,
VStack,
Wrap,
Expand Down Expand Up @@ -71,30 +72,42 @@ export default function PermitHolderHeader({
</Wrap>
</HStack>
<HStack spacing="20px">
<Text textStyle="caption" as="p">
ID: #{id}
</Text>
<Menu>
<MenuButton
as={Button}
rightIcon={<ChevronDownIcon />}
height="30px"
bg="background.gray"
_hover={{ bg: 'background.grayHover' }}
color="black"
>
<Text textStyle="caption">More Actions</Text>
</MenuButton>
<MenuList>
<MenuItem
color={status === 'ACTIVE' ? 'text.critical' : 'text.success'}
textStyle="button-regular"
onClick={onOpenSetPermitHolderStatusModal}
<Box>
<Text textStyle="caption" as="p">
ID: #{id}
</Text>
</Box>
<Box>
<Menu>
<MenuButton
as={Button}
rightIcon={<ChevronDownIcon />}
height="30px"
bg="background.gray"
_hover={{ bg: 'background.grayHover' }}
color="black"
>
{`Set as ${status === 'ACTIVE' ? 'Inactive' : 'Active'}`}
</MenuItem>
</MenuList>
</Menu>
<Text textStyle="caption">More Actions</Text>
</MenuButton>
<MenuList>
<MenuItem
color={status === 'ACTIVE' ? 'text.critical' : 'text.success'}
textStyle="button-regular"
onClick={onOpenSetPermitHolderStatusModal}
>
{`Set as ${status === 'ACTIVE' ? 'Inactive' : 'Active'}`}
</MenuItem>
</MenuList>
</Menu>
</Box>
<Box>
{notes && (
<Text noOfLines={1}>
<b>Note:</b> {notes}
</Text>
)}
</Box>
<Spacer />
</HStack>
</VStack>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions components/admin/requests/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ShopifyBadge from '@components/admin/ShopifyBadge';
import PermitTypeBadge from '@components/admin/PermitTypeBadge';
import { ApplicationStatus, ApplicationType, PermitType } from '@lib/graphql/types';
import { titlecase } from '@tools/string';
import { formatDateYYYYMMDD } from '@lib/utils/date';
import { formatDateYYYYMMDD, formatDateYYYYMMDDLocal } from '@lib/utils/date';
import { getPermanentPermitExpiryDate } from '@lib/utils/permit-expiry';

type RequestHeaderProps = {
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function RequestHeader({
</Flex>
<HStack spacing={3} marginTop={3}>
<Text textStyle="caption" as="p">
Received on {formatDateYYYYMMDD(createdAt)} at{' '}
Received on {formatDateYYYYMMDDLocal(createdAt)} at{' '}
{createdAt.toLocaleTimeString('en-CA')}
</Text>
</HStack>
Expand Down
3 changes: 2 additions & 1 deletion components/admin/requests/payment-information/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const Card: FC<Props> = props => {
paymentInformation={{
paymentMethod,
donationAmount,
processingFee,
shippingAddressSameAsHomeAddress,
shippingFullName,
shippingAddressLine1,
Expand Down Expand Up @@ -135,7 +136,7 @@ const Card: FC<Props> = props => {
<SimpleGrid columns={2} spacingX="70px" spacingY="12px">
<Box>
<Text as="p" textStyle="body-regular" textAlign="left">
Permit Fee (fixed)
Permit Fee
</Text>
</Box>
<Box>
Expand Down
31 changes: 2 additions & 29 deletions components/admin/requests/payment-information/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import { PaymentInformationFormData } from '@tools/admin/requests/payment-information';
import {
FormControl,
FormLabel,
Input,
Text,
Stack,
FormHelperText,
Radio,
Box,
InputGroup,
InputLeftElement,
Grid,
GridItem,
Divider,
} from '@chakra-ui/react'; // Chakra UI
import { Text, Stack, FormHelperText, Radio, Box, Grid, GridItem, Divider } from '@chakra-ui/react'; // Chakra UI
import { PaymentType } from '@lib/graphql/types';
import TextField from '@components/form/TextField';
import RadioGroupField from '@components/form/RadioGroupField';
Expand Down Expand Up @@ -52,20 +38,7 @@ export default function PaymentDetailsForm({ paymentInformation }: PaymentDetail
</GridItem>

<GridItem>
<FormControl isRequired isDisabled>
<FormLabel>
{'Permit fee '}
<Box as="span" textStyle="body-regular">
{'(fixed cost)'}
</Box>
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none" color="texticon.filler" fontSize="1.2em">
{'$'}
</InputLeftElement>
<Input placeholder="26" />
</InputGroup>
</FormControl>
<TextField name="paymentInformation.processingFee" label="Permit fee" monetaryInput />
</GridItem>

<GridItem colSpan={1}>
Expand Down
4 changes: 2 additions & 2 deletions components/admin/requests/reason-for-replacement/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, Text, SimpleGrid, Button } from '@chakra-ui/react'; // Chakra UI
import PermitHolderInfoCard from '@components/admin/LayoutCard'; // Custom Card Component
import EditReasonForReplacementModal from '@components/admin/requests/reason-for-replacement/EditModal'; // Edit modal
import { reasonForReplacementFormSchema } from '@lib/applications/validation';
import { formatDateYYYYMMDD } from '@lib/utils/date';
import { formatDateYYYYMMDDLocal } from '@lib/utils/date';
import {
GetReasonForReplacementRequest,
GetReasonForReplacementResponse,
Expand Down Expand Up @@ -97,7 +97,7 @@ export default function ReasonForReplacementCard(props: ReplacementProps) {
<InfoSection title={`Cause`}>{titlecase(reason)}</InfoSection>
{lostTimestamp && (
<InfoSection title={`Event Timestamp`}>
{formatDateYYYYMMDD(new Date(lostTimestamp), true)}
{formatDateYYYYMMDDLocal(new Date(lostTimestamp), true)}
</InfoSection>
)}
{lostLocation && <InfoSection title={`Location Lost`}>{lostLocation}</InfoSection>}
Expand Down
2 changes: 1 addition & 1 deletion components/applicant/renewals/IdentityVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const IdentityVerification: FC = () => {
</PopoverContent>
</Popover>
<FormHelperText>
{`You can find your user ID on the back of your wallet card. If you cannot find your
{`You can find your user ID on the back of your wallet card as well as on the renewal notice. If you cannot find your
wallet card, please call RCD at 604-232-2404.`}
</FormHelperText>
</Flex>
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.7"

services:
db:
container_name: rcd_db
image: postgres:12-alpine
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5

volumes:
postgres_data:
11 changes: 8 additions & 3 deletions lib/applications/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export const createNewApplication: Resolver<

const paymentInformation = {
paymentMethod: input.paymentMethod,
processingFee: input.processingFee,
donationAmount,
shippingAddressSameAsHomeAddress: input.shippingAddressSameAsHomeAddress,
shippingFullName: input.shippingFullName,
Expand Down Expand Up @@ -382,7 +383,6 @@ export const createNewApplication: Resolver<
application = await prisma.application.create({
data: {
type: 'NEW',
processingFee: process.env.PROCESSING_FEE,
donationAmount: donationAmount || 0,
// Connect to applicant if applicant exists in DB
...(applicantId && {
Expand Down Expand Up @@ -557,8 +557,11 @@ export const createRenewalApplication: Resolver<
otherRequiresWiderParkingSpaceReason,
};

const { processingFee } = input;

const paymentInformation = {
paymentMethod,
processingFee,
donationAmount,
shippingAddressSameAsHomeAddress,
shippingFullName,
Expand Down Expand Up @@ -606,7 +609,6 @@ export const createRenewalApplication: Resolver<
createdRenewalApplication = await prisma.application.create({
data: {
type: 'RENEWAL',
processingFee: process.env.PROCESSING_FEE,
donationAmount: donationAmount || 0,
phone: stripPhoneNumber(phone),
...data,
Expand Down Expand Up @@ -965,8 +967,12 @@ export const createReplacementApplication: Resolver<
city,
postalCode,
};

const { processingFee } = input;

const paymentInformation = {
paymentMethod,
processingFee,
donationAmount,
shippingAddressSameAsHomeAddress,
shippingFullName,
Expand Down Expand Up @@ -1034,7 +1040,6 @@ export const createReplacementApplication: Resolver<
application = await prisma.application.create({
data: {
type: 'REPLACEMENT',
processingFee: process.env.PROCESSING_FEE,
donationAmount: donationAmount || 0,
phone: stripPhoneNumber(phone),
postalCode: stripPostalCode(postalCode),
Expand Down
Loading

0 comments on commit 723f256

Please sign in to comment.