Skip to main content

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:: AgreementJodGig::Company (or other source)
idPK, increment
billing_account_idfrom Billing::Account
uuidSecureRandom.uuid
codegenerate_document_code based on convention
document_urluse document url from JodApp S3, see the flow
effective_fromnull
effective_tonull
admin_created_byset to System's identities_admins id
admin_updated_byset to System's identities_admins id
created_attimestamp
updated_attimestamp

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 be GIG, CAREERS, ADS), follow up on this to ensure the current-non-exhaustive-list are correct, we'll use GIG for 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