Billing Agreement
Billing::Agreement will contain the contract_service_filename migrated from JodGig::Company, the file associated with contract_service_filename is stored in JodGig S3 while the file stored in Billing::Agreement needs to be stored in JodApp S3.
For JodGig::Company to Org::Company sync, Billing::Agreement should be created immediately after Billing::Account is created
JodGig::Company mapping to Billing Agreement
| Billing:: Agreement | JodGig::Company (or other source) |
|---|---|
| id | PK, increment |
| billing_account_id | from Billing::Account |
| uuid | SecureRandom.uuid |
| code | generate_document_code based on convention |
| document_url | use document url from JodApp S3, see the flow |
| effective_from | null |
| effective_to | null |
| admin_created_by | set to System's identities_admins id |
| admin_updated_by | set to System's identities_admins id |
| created_at | timestamp |
| updated_at | timestamp |
Document Code Convention (date: 9 March 2026)
We will generate the document code based on this rule
{Country}-{service}-{Year}-{ID padded to 4 digits}
- country: ISO2 country code
- service: type of service agreed on, example:
GIG(finalized list of service are not listed as of now, based on the design it will beGIG,CAREERS,ADS), follow up on this to ensure the current-non-exhaustive-list are correct, we'll useGIGfor JodGig::Company to Org::Company sync - year: 4 digit year, eg: 2026
- ID: the PK, padded to 4 digit
document url (dated: 9 March 2026)
jodgig_companies.contract_service_filename is stored in JodGig S3, we should move file into JodApp S3 so we don't need to keep track on which files are migrated and which are not migrated
can try to use .copy_object to move the file to new path path structure will be org/companies/:org-company-uuid/* (private), referenced in s3-setup
To copy the file from can look at JodApp Api Aws::S3::CopyService, need to find out whether it's more difficult to move file between bucket