bcgov / bcgov/SIMS

CAS Integration 3C - Update CAS with Changed SIMS Info

Open
#3,602 1 comment 0 reactions 0 assignees View on GitHub
Business Integration
Dominant language
TypeScript
Stars
29
Forks
15
PR merge metrics
No merged PRs in 30d

Description

### **User Story:**
As a Ministry user (Finance team), I want to keep supplier/site information in CAS up to date with the information we have in SIMS. When a student who has a Supplier/Site assigned to them, we need to update the address in CAS if they update their address with us. We also need to prevent duplication, so will need to look at any existing Sites that may have the new address.

## **Acceptance Criteria:**
- [ ] Based on the snapshots of student profile data that populate the Supplier Maintenance Report, we need to automate some scenarios into an UpdateSite call to CAS (See Onboarding Doc in Additional Context)
- [ ] Identify students who can be updated through `UpdateSite`:
- [ ] Have a supplier `isValid=true`
- [ ] Based on snapshot of student profile data that populates Supplier Maintenance Report, there has been a change in student profile data and the profile data from valid CAS record.
- [ ] If there is an update to any of these fields we CAN update via CAS API: Addressline 1, City, Province, Postal Code
- [ ] If there is an update to any of these fields we CANNOT update via CAS API: Last Name, Given Name, SIN
- [ ] If any of the fields we cannot update are changed,

- [ ] Students who can be updated through `UpdateSite` should have a new record created with the status "Pending address update".
- [ ] Students with "Pending address update" status should still have their most recent verified supplier record be considered their valid supplier until the new record is resolved (Verified or Error).

---
These are only for students that have a CAS record that is **Verified** or **Verified Manually**:
- [ ] Identify if a student has a Last Name or SIN change and check current CAS status.
- [ ] Current CAS status is Verified or Verified Manually:
- [ ] Manual Intervention: "Name and SIN changes cannot be processed."
- [ ] Current CAS status is Pending supplier verification or Pending address verification.
- [ ]
- [ ] Identify if a student updates their address (Addressline 1, City, Province, Postal Code, Country) case insensitive
- [ ] For students that have `verified manually` or `verified` statuses:
- [ ] If Country = Canada: new `pending address verification` status `isValid=False`, proceed with doing the UPDATE process
- [ ] If Country != Canada: new `manual intervention` status `isValid=False`, manual intervention is required "Manual Intervention: Out of Country address" request type "Update".

- [ ] For students that are `pending supplier verification` or `pending address verification`:
- [ ] If Country = Canada: new `pending address verification` status `isValid=False`, proceed with doing the UPDATE process
- [ ] If Country != Canada: new `manual intervention` status `isValid=False`, manual intervention is required "Manual Intervention: Out of Country address" request type "Update".

- [ ] If Country != Canada, set to `pending address verification`, ke
- [ ] If Country != Canada,

- [ ] If `pending supplier verification` or `pending address verification` update any queued requests with the new address.
- [ ] NO Supplier/Site number yet (`pending supplier verification`) Update to the latest information and requeue.
- [ ] NO Site number yet (`pending address verification`) Update to the latest information and reque
- [ ] Has Supplier/Site number and the SITE is "Protected" an update may be required. "Manual intervention" flag
- [ ] Has a Supplier/Site number and the SITE is NOT "Protected" proceed with the Update process:
- If AddressCountry != CANADA or GivenNames = null: isValid=False and status=Manual Intervention (same as normal process before GetSupplier calls)
- Get Supplier by Supplier Number (See business context `Get by Supplier Number`)
- If Error response, or Supplier=INACTIVE: isValid=False and status=Manual Intervention
- Check Response for an ACTIVE Site with Matching Address to new address (same Address rules CAS)
### **Get Supplier Response - Found & Active**
- [ ] Save Supplier Number, Supplier Status, and if it's protected.
- [ ] Create New Site: `https://< webserviceURL >:/ords/cas/cfs/supplier/:snum/site`
```
{
"SupplierNumber":"2002492",
"SupplierAddress":[
{
"AddressLine1":"3350 CLEARBROOK RD",
"City":"ABBOTSFORD",
"Province":"BC",
"Country":"CA",
"PostalCode":"V2T4T4",
"EmailAddress":"abc@xyz.com",
"EftAdvicePref":"E"
}]}
```
- [ ] Address: Only use Address Line 1. 2 & 3 are optional. Remove special characters including periods.
- [ ] Country code: Use CA for Canada and US for USA. Any other countries leave blank, expected error for manual entry (error handling)
- [ ] Postal code: No spaces, can use zip code
- [ ] **Successful Create Site Response:** Save Site Number, Set to Valid, Save all other site details attached to it.
- [ ] **UnSuccessful Create Site Response:** Will be done as part of error handling

### **Get Supplier Response - Not Found OR Not Active**
- Should be addressed with regular Create Supplier & Site on CAS 3A

### **Update Existing Supplier Site**
When a student updates their address (address line 1, city, postal code, or country) or email address:
- [ ] **Site status is Protected:** Do nothing, will be manually addressed through error handling (Refer to ticket #3258)
- [ ] **Site status is NOT Protected:** Execute the "Update Existing Supplier Site" transaction
- [ ] UPDATE using `https://< webserviceURL >:/ords/cas/cfs/supplier/:snum/site/update` :
```
{
"SupplierNumber":"2002492",
"SupplierAddress":[
{
"SupplierSiteCode":"001",
"AddressLine1":"3350 CLEARBROOK RD",
"City":"ABBOTSFORD",
"Province":"BC",
"Country":"CA",
"PostalCode":"V2T4T4",
"EmailAddress":"abc@xyz.com",
"EftAdvicePref":"E"
} ]}
```
- [ ] The same Address Line 1, Province, Country, and Postal Code rules from the "Create Supplier Site" information above apply.

---

***Technical Context***

Sample CURL to create
```console
curl --location '${BASEURL}/cfs/supplier/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${TOKEN}' \
--data-raw '{
SupplierName: '\''Skywalker, Leia'\'',
SubCategory: '\''Individual'\'',
Sin: '\''422233197'\'',
SupplierAddress: [
{
AddressLine1: '\''1012 Douglas St'\'',
City: '\''Victoria'\'',
Province: '\''BC'\'',
Postalcode: '\''V8W 2C3'\'',
Country: '\''Canada'\'',
EmailAddress: '\''stephen.laws@gov.bc.ca'\'',
}]
}'
```

Response:
```console
{"SUPPLIER_NUMBER":"2007638","SUPPLIER_SITE_CODE":"[001] ","CAS-Returned-Messages":"SUCCEEDED"}
```

***Business Context***
[Supplier Web Service RESTful Client Onboarding v02_01.pdf](https://api.zenhub.com/attachedFiles/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBOXpWQkE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--361bbb0afd9232c66288a57ce767a1a8d478f535/Supplier%20Web%20Service%20RESTful%20Client%20Onboarding%20v02_01.pdf)
[Individual Supplier Web Service Field Requirements (All Requests) JAN2023.xlsx](https://api.zenhub.com/attachedFiles/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBeFc2Qmc9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--6c980538dbf0e88b47517adaaded29fefb98d7ff/Individual%20Supplier%20Web%20Service%20Field%20Requirements%20%28All%20Requests%29%20JAN2023.xlsx)

---
### **Update Existing Supplier Site**
**Command 2**
{
"SupplierNumber":"2002492",
"SupplierAddress":[
{
"SupplierSiteCode":"001",
"AddressLine1":"3350 CLEARBROOK RD",
"AddressLine2":"",
"AddressLine3":"",
"City":"ABBOTSFORD",
"Province":"BC",
"Country":"CA",
"PostalCode":"V2T4T4",
"EmailAddress":"abc@xyz.com",
"EftAdvicePref":"E"
}
]
}

**Success Response:**
{
"Supplier_Number":"123456789",
"Supplier_Site_Code":"001",
"CAS-Returned-Messages":"SUCCESS"
}

**Error Response**
{
"Supplier_Number":"123456789",
"Supplier_Site_Code":"001",
"CAS-Returned-Messages":"Error Message"
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.