Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Implement application deletion #315

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

leogjhuang
Copy link
Collaborator

@leogjhuang leogjhuang commented Sep 22, 2023

Notion ticket link

Implement application deletion

Implementation description

Notes

  • Database schema changes will need to be enabled to allow for on delete cascade

Testing

Before deleting Application 3

rcd=# select * from replacement_applications where application_id = 3;
 application_id | reason |     lost_timestamp     | lost_location | stolen_police_file_number | stolen_jurisdiction | stolen_police_officer_name |                      event_description                      |         created_at         |         updated_at         
----------------+--------+------------------------+---------------+---------------------------+---------------------+----------------------------+-------------------------------------------------------------+----------------------------+----------------------------
              3 | LOST   | 2020-01-03 00:00:00+00 | DC Library    |                           |                     |                            | I left my APP on the table and when I came back it was gone | 2023-09-03 09:26:59.326+00 | 2023-09-03 09:26:59.326+00
(1 row)

rcd=# select * from permits where application_id = 3;
 rcd_permit_id |   type    | expiry_date | active | application_id | applicant_id |         created_at         |         updated_at         
---------------+-----------+-------------+--------+----------------+--------------+----------------------------+----------------------------
             2 | PERMANENT | 2025-01-01  | t      |              3 |            3 | 2023-09-03 09:26:59.377+00 | 2023-09-03 09:26:59.377+00
(1 row)

rcd=# select * from application_processing where id = 3;
 id | status  | rejected_reason | app_number | app_number_employee_id |   app_number_updated_at    | app_holepunched | app_holepunched_employee_id | app_holepunched_updated_at | wallet_card_created | wallet_card_created_employee_id | wallet_card_created_updated_at | review_request_completed | review_request_completed_employee_id | review_request_completed_updated_at | invoice_number | documents_s3_object_key | documents_url_employee_id |  documents_url_updated_at  | app_mailed | app_mailed_employee_id |   app_mailed_updated_at    | payment_refunded | payment_refunded_employee_id | payment_refunded_updated_at |         created_at         |         updated_at         
----+---------+-----------------+------------+------------------------+----------------------------+-----------------+-----------------------------+----------------------------+---------------------+---------------------------------+--------------------------------+--------------------------+--------------------------------------+-------------------------------------+----------------+-------------------------+---------------------------+----------------------------+------------+------------------------+----------------------------+------------------+------------------------------+-----------------------------+----------------------------+----------------------------
  3 | PENDING |                 |            |                        | 2023-09-03 09:26:59.326+00 | f               |                             | 2023-09-03 09:26:59.326+00 | f                   |                                 | 2023-09-03 09:26:59.326+00     | f                        |                                      | 2023-09-03 09:26:59.326+00          |                |                         |                           | 2023-09-03 09:26:59.326+00 | f          |                        | 2023-09-03 09:26:59.326+00 | f                |                              | 2023-09-03 09:26:59.326+00  | 2023-09-03 09:26:59.326+00 | 2023-09-03 09:26:59.326+00
(1 row)

rcd=# select * from applications where id = 3;
 id | first_name | middle_name | last_name |   phone    |          email           | receive_email_updates |  address_line_1   | address_line_2 |   city    | province | country | postal_code | permit_type | payment_method | processing_fee | donation_amount | paid_through_shopify | shopify_payment_status | shopify_confirmation_number | shopify_order_number | shipping_address_same_as_home_address | shipping_full_name | shipping_address_line_1 | shipping_address_line_2 | shipping_city | shipping_province | shipping_country | shipping_postal_code | billing_address_same_as_home_address | billing_full_name | billing_address_line_1 | billing_address_line_2 | billing_city | billing_province | billing_country | billing_postal_code |    type     | notes | applicant_id | application_processing_id |         created_at         |         updated_at         
----+------------+-------------+-----------+------------+--------------------------+-----------------------+-------------------+----------------+-----------+----------+---------+-------------+-------------+----------------+----------------+-----------------+----------------------+------------------------+-----------------------------+----------------------+---------------------------------------+--------------------+-------------------------+-------------------------+---------------+-------------------+------------------+----------------------+--------------------------------------+-------------------+------------------------+------------------------+--------------+------------------+-----------------+---------------------+-------------+-------+--------------+---------------------------+----------------------------+----------------------------
  3 | Applicant  |             | Three     | 0987654321 | applicantthree@gmail.com | f                     | 789 Vancouver Rd. |                | Vancouver | BC       | Canada  | B1C2D3      | PERMANENT   | CHEQUE         |         $31.00 |         $100.00 | f                    |                        |                             |                      | t                                     |                    |                         |                         |               |                   |                  |                      | t                                    |                   |                        |                        |              |                  |                 |                     | REPLACEMENT |       |            3 |                         3 | 2023-09-03 09:26:59.326+00 | 2023-09-03 09:26:59.326+00
(1 row)

Demo

application.deletion.demo.mov

After deleting Application 3

rcd=# select * from replacement_applications where application_id = 3;
tion_id = 3;
select * from application_processing  application_id | reason | lost_timestamp | lost_location | stolen_police_file_number | stolen_jurisdiction | stolen_police_officer_name | event_description | created_at | updated_at 
----------------+--------+----------------+---------------+---------------------------+---------------------+----------------------------+-------------------+------------+------------
(0 rows)

rcd=# select * from permits where application_id = 3;
 rcd_permit_id | type | expiry_date | active | application_id | applicant_id | created_at | updated_at 
---------------+------+-------------+--------+----------------+--------------+------------+------------
(0 rows)

rcd=# select * from application_processing where id = 3;
 id | status | rejected_reason | app_number | app_number_employee_id | app_number_updated_at | app_holepunched | app_holepunched_employee_id | app_holepunched_updated_at | wallet_card_created | wallet_card_created_employee_id | wallet_card_created_updated_at | review_request_completed | review_request_completed_employee_id | review_request_completed_updated_at | invoice_number | documents_s3_object_key | documents_url_employee_id | documents_url_updated_at | app_mailed | app_mailed_employee_id | app_mailed_updated_at | payment_refunded | payment_refunded_employee_id | payment_refunded_updated_at | created_at | updated_at 
----+--------+-----------------+------------+------------------------+-----------------------+-----------------+-----------------------------+----------------------------+---------------------+---------------------------------+--------------------------------+--------------------------+--------------------------------------+-------------------------------------+----------------+-------------------------+---------------------------+--------------------------+------------+------------------------+-----------------------+------------------+------------------------------+-----------------------------+------------+------------
(0 rows)

rcd=# select * from applications where id = 3;
 id | first_name | middle_name | last_name | phone | email | receive_email_updates | address_line_1 | address_line_2 | city | province | country | postal_code | permit_type | payment_method | processing_fee | donation_amount | paid_through_shopify | shopify_payment_status | shopify_confirmation_number | shopify_order_number | shipping_address_same_as_home_address | shipping_full_name | shipping_address_line_1 | shipping_address_line_2 | shipping_city | shipping_province | shipping_country | shipping_postal_code | billing_address_same_as_home_address | billing_full_name | billing_address_line_1 | billing_address_line_2 | billing_city | billing_province | billing_country | billing_postal_code | type | notes | applicant_id | application_processing_id | created_at | updated_at 
----+------------+-------------+-----------+-------+-------+-----------------------+----------------+----------------+------+----------+---------+-------------+-------------+----------------+----------------+-----------------+----------------------+------------------------+-----------------------------+----------------------+---------------------------------------+--------------------+-------------------------+-------------------------+---------------+-------------------+------------------+----------------------+--------------------------------------+-------------------+------------------------+------------------------+--------------+------------------+-----------------+---------------------+------+-------+--------------+---------------------------+------------+------------
(0 rows)

Checklist

  • My PR name is descriptive, is in imperative tense and starts with one of the following: [Feature],[Improvement] or [Fix],
  • I have run the appropriate linter(s)
  • I have requested a review from the RCD team on GitHub, or specific people who are associated with this ticket

@leogjhuang leogjhuang merged commit f8f1a2e into staging Sep 30, 2023
1 check passed
@leogjhuang leogjhuang deleted the lh/application-deletion branch September 30, 2023 19:32
@leogjhuang leogjhuang mentioned this pull request Oct 4, 2023
3 tasks
leogjhuang added a commit that referenced this pull request Oct 4, 2023
* [Fix] Save poaFormS3ObjectKey when updating guardian information in permit holders page (#319)
* [Fix] Postal Code Space Issue (#316)
* Set other gender field on permit holders page (#318)
* Add .nvmrc file (#317)
* [Feature] Implement applicant deletion (#310)
* [Feature] Implement application deletion (#315)
* Display other gender field on permit holders page (#314)
* Move wallet card task in application processing (#313)
* [Feature] Tax receipt (#311)
* [Fix] Fix expiry date for in-progress replacement applications (#274)
* [Fix] Fix APP history permit type badge (#273)
* [Improvement] Adjust spacing of address in invoice (#272)
* [Fix] Show validation error messages on form mount (#271)
@leogjhuang leogjhuang mentioned this pull request Oct 10, 2023
3 tasks
@leogjhuang leogjhuang mentioned this pull request Oct 10, 2023
3 tasks
leogjhuang added a commit that referenced this pull request Oct 10, 2023
* [Feature] Create setEmployeeAsActive GraphQL endpoint (#322)
* [Fix] Save poaFormS3ObjectKey when updating guardian information in permit holders page (#319)
* [Fix] Postal Code Space Issue (#316)
* Set other gender field on permit holders page (#318)
* Add .nvmrc file (#317)
* [Feature] Implement applicant deletion (#310)
* [Feature] Implement application deletion (#315)
* Display other gender field on permit holders page (#314)
* Move wallet card task in application processing (#313)
* [Feature] Tax receipt (#311)
* [Fix] Fix expiry date for in-progress replacement applications (#274)
* [Fix] Fix APP history permit type badge (#273)
* [Improvement] Adjust spacing of address in invoice (#272)
* [Fix] Show validation error messages on form mount (#271)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants