geekle-organization-service
This service handles organization for supply users.
Custom Fields
Inside the src/custom-fields/organization.ts
file, additional fields have been added to make it easier to list jobs using the product entity.
Field Name | Type | Description |
---|---|---|
capital_range | string | how much money the company has in capital |
representative_person_name | string | the name of the company representative |
establishment_date | date | the date the company was founded |
organization_summary | string | a summary of the company |
industry | string | the industry the company is in |
industry_category | string | the category of the industry the company is in |
business_operations | string | operation details about the company |
upcoming_hiring_positions | string | a list of job titles the company is looking for |
application_user_info | object | the information of the user who created the organization application |
company_registration_form_completed | boolean | has the company completed the registration form |
application_approval_date | string | the date the organization was approved |
payment_customer_id | string | the id of the stripe customer |
needs_payment_method_setup | boolean | if the organization has up to date payment |
subscription_status | string | the status of the stripe subscription |
subscription_id | string | the id of the stripe subscription |
Custom Field Validators
Inside the src/validators
additional validators have been added to validate the values in the new custom fields.
Endpoint | Validator Name | Description |
---|---|---|
createOrganization | valid_capital_range_update | checks if the capital range send is correctly formatted |
updateOrganization | valid_capital_range_update | checks if the capital range send is correctly formatted |
createOrganization | duplicate_applications_update | checks if there is already an application by this organization |
updateOrganization | duplicate_applications_update | checks if there is already an application by this organization |
updateOrganization | prevent_updating_status_update | validates how the status of the application is updated |
createOrganization | application_required_fields_create | checks if the values of contact_name,contact_email_address, contact_phone_number and agree_to_terms_of_use have been completed |
Custom Validators
Endpoints | Validator Name | Description |
---|---|---|
webhook | createIsWebHookAuthenticateValidator | checks if the checksum stored in the header of the event can be decoded on the server and matches the same buffer of event body to make sure it hasn't been altered |
Custom Emails
The custom emails are stored inside src/emails
and enabled from the src/index.ts
file.
Templates are stored in src/emails/templates/approved-application.html
Endpoints | Templates | Description |
---|---|---|
updateOrganization | approved-application.html | sent when a organization is approved |
updateOrganization | rejected-application.html | sent when an organization is rejected |
createOrganization | new-application-to-admins.html | sent when a new organization application is created |
createOrganization | new-application.html | sent to a new organization applicant |
updateOrganization | payment-complete.html | sent when you are charged in the payment api |
webhook | payment-details-needed.html | sent when a organization has 3 days left in their free trial |
webhook | payment-failed.html | sent when stripe was not able to charge the user |
Custom Side Effect
The organization has 3 custom side effects.
Endpoints | Side Effect Name | Description |
---|---|---|
updateOrganization | setApplicationApprovalDate | stores the date of when the organization was approved inside application_approval_date |
updateOrganization | setSubscriptionData | The function validates when it should only run on approved organization requests and now it has all the information it can create the subscription using the customer id attached to the organizations store the subscription id on the org and the org id on the subscription. |
updateOrganization | createPaymentCustomer | we make a create customer call to the stripe backend. Once the customer is created, we can update the organization with the customer information as well, linking them from both platforms. |
Disabled Endpoints
Some endpoints are disabled because they are unused.
adapter = sdkAdapter.setEnabledAdapterMethods(adapter, [
'getOrganization',
'createOrganization',
'listOrganizationsForUser',
'listOrgUsersForOrganization',
'updateOrganization',
'listOrganizations',
'createUpdateManyOrgUsers',
'getOrgUserExistence',
'getOrgUserRole',
]);