SIMS icon indicating copy to clipboard operation
SIMS copied to clipboard

CAS Integration 3C - Update Site Address

Open CarlyCotton opened this issue 1 year ago • 1 comments

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:

If a Student updates their address:

  • [ ] NO Supplier/Site number yet - no update required. (These should be covered by regular Get Supplier on new profile activities)
  • [ ] 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 >:<port_no>/ords/cas/cfs/supplier/:snum/site
{
"SupplierNumber":"2002492", 
"SupplierAddress":[
{
"AddressLine1":"3350 CLEARBROOK RD", 
"City":"ABBOTSFORD", 
"Province":"BC", 
"Country":"CA", 
"PostalCode":"V2T4T4", 
"EmailAddress":"[email protected]", 
"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 >:<port_no>/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":"[email protected]",
        "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

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: '\''[email protected]'\'',
    }]
}'

Response:

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

Business Context Supplier Web Service RESTful Client Onboarding v02_01.pdf Individual Supplier Web Service Field Requirements (All Requests) JAN2023.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":"[email protected]", "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" }

CarlyCotton avatar Aug 01 '24 18:08 CarlyCotton

Takeaways: student change last name image.png multiple supplier/site and address updates from SIMS confirm with CAS re changing last name/sin and multiple supplier numbers for the same person. Can we create new sites/new suppliers?

CarlyCotton avatar Aug 15 '24 17:08 CarlyCotton