Skip to main content

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 NameTypeDescription
capital_rangestringhow much money the company has in capital
representative_person_namestringthe name of the company representative
establishment_datedatethe date the company was founded
organization_summarystringa summary of the company
industrystringthe industry the company is in
industry_categorystringthe category of the industry the company is in
business_operationsstringoperation details about the company
upcoming_hiring_positionsstringa list of job titles the company is looking for
application_user_infoobjectthe information of the user who created the organization application
company_registration_form_completedbooleanhas the company completed the registration form
application_approval_datestringthe date the organization was approved
payment_customer_idstringthe id of the stripe customer
needs_payment_method_setupbooleanif the organization has up to date payment
subscription_statusstringthe status of the stripe subscription
subscription_idstringthe 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.

EndpointValidator NameDescription
createOrganizationvalid_capital_range_updatechecks if the capital range send is correctly formatted
updateOrganizationvalid_capital_range_updatechecks if the capital range send is correctly formatted
createOrganizationduplicate_applications_updatechecks if there is already an application by this organization
updateOrganizationduplicate_applications_updatechecks if there is already an application by this organization
updateOrganizationprevent_updating_status_updatevalidates how the status of the application is updated
createOrganizationapplication_required_fields_createchecks if the values of contact_name,contact_email_address, contact_phone_number and agree_to_terms_of_use have been completed

Custom Validators

EndpointsValidator NameDescription
webhookcreateIsWebHookAuthenticateValidatorchecks 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

EndpointsTemplatesDescription
updateOrganizationapproved-application.htmlsent when a organization is approved
updateOrganizationrejected-application.htmlsent when an organization is rejected
createOrganizationnew-application-to-admins.htmlsent when a new organization application is created
createOrganizationnew-application.htmlsent to a new organization applicant
updateOrganizationpayment-complete.htmlsent when you are charged in the payment api
webhookpayment-details-needed.htmlsent when a organization has 3 days left in their free trial
webhookpayment-failed.htmlsent when stripe was not able to charge the user

Custom Side Effect

The organization has 3 custom side effects.

EndpointsSide Effect NameDescription
updateOrganizationsetApplicationApprovalDatestores the date of when the organization was approved inside application_approval_date
updateOrganizationsetSubscriptionDataThe 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.
updateOrganizationcreatePaymentCustomerwe 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',
]);