Skip to content

Commit

Permalink
Merge branch 'release/v0.0.110'
Browse files Browse the repository at this point in the history
* release/v0.0.110:
  chore: fix update onboarding form
  feat: get icy distribution weekly
  feat: get icy distribution weekly
  feat: get icy distribution weekly
  fix: remove env restriction when add/remove discord role
  fix: assign discord id when submit onboarding form
  chore: fix lint
  chore: add wg to fetch expense
  fix: updatr query get payroll and update expense
  fix: comment basecamp message
  fix: send invoice without cc list err
  chore: seed discord template data
  chore: clean up seed data
  chore: add migration down to migrate file without down script
  feat: allow using discord in dev
  feat: allow using discord in dev
  chore: clean up the code
  • Loading branch information
namnhce committed Jun 2, 2023
2 parents 04c5d1e + b1b1f35 commit 71ff0f0
Show file tree
Hide file tree
Showing 47 changed files with 747 additions and 633 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cronjob:
go run ./cmd/cronjob/main.go

test:
golangci-lint run
make lint
docker rm --volumes -f ${POSTGRES_TEST_CONTAINER}
docker-compose up -d ${POSTGRES_TEST_SERVICE}
@while ! docker exec $(POSTGRES_TEST_CONTAINER) pg_isready > /dev/null; do \
Expand Down Expand Up @@ -107,4 +107,4 @@ ci: init

WD := $(shell pwd)
lint:
docker run -t --rm -v $(WD):/app -w /app golangci/golangci-lint:v1.52.2 golangci-lint run -v
docker run -t --rm -v $(WD):/app -w /app golangci/golangci-lint:v1.52.2 golangci-lint run -v
38 changes: 38 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4360,6 +4360,44 @@ const docTemplate = `{
}
}
},
"/projects/icy-weekly-distribution": {
"get": {
"description": "Get Icy Weekly Distribution",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Project"
],
"summary": "Get Icy Weekly Distribution",
"parameters": [
{
"type": "string",
"description": "jwt token",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/view.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/view.ErrorResponse"
}
}
}
}
},
"/projects/{id}": {
"get": {
"description": "Get details of a project",
Expand Down
38 changes: 38 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4352,6 +4352,44 @@
}
}
},
"/projects/icy-weekly-distribution": {
"get": {
"description": "Get Icy Weekly Distribution",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Project"
],
"summary": "Get Icy Weekly Distribution",
"parameters": [
{
"type": "string",
"description": "jwt token",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/view.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/view.ErrorResponse"
}
}
}
}
},
"/projects/{id}": {
"get": {
"description": "Get details of a project",
Expand Down
25 changes: 25 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7802,6 +7802,31 @@ paths:
summary: Unarchive an archive work unit of a project
tags:
- Project
/projects/icy-weekly-distribution:
get:
consumes:
- application/json
description: Get Icy Weekly Distribution
parameters:
- description: jwt token
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"400":
description: Bad Request
schema:
$ref: '#/definitions/view.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/view.ErrorResponse'
summary: Get Icy Weekly Distribution
tags:
- Project
/surveys:
get:
consumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ ALTER TABLE invoices
-- +migrate Down
DROP TABLE IF EXISTS invoices;
DROP TABLE IF EXISTS bank_accounts;
DROP TABLE IF EXISTS base_salaries;
DROP TABLE IF EXISTS currencies;
DROP TYPE IF EXISTS invoice_statuses;
9 changes: 9 additions & 0 deletions migrations/schemas/20230307184910-create_payroll_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,12 @@ CREATE TABLE IF NOT EXISTS "cached_payrolls" (
ALTER TABLE "cached_payrolls" ADD CONSTRAINT "cached_payrolls_month_year_batch_key" UNIQUE ("month", "year", "batch");

-- +migrate Down
DROP TABLE IF EXISTS "base_salaries";
DROP TABLE IF EXISTS "accounting_transactions";
DROP TABLE IF EXISTS "accounting_categories";
DROP TABLE IF EXISTS "employee_commissions";
DROP TABLE IF EXISTS "employee_bonuses";
DROP TABLE IF EXISTS "payrolls";
DROP TABLE IF EXISTS "project_commission_configs";
DROP TABLE IF EXISTS "cached_payrolls";
DROP TABLE IF EXISTS "base_salaries";
12 changes: 12 additions & 0 deletions migrations/seed/discord_log_templates.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
INSERT INTO public.discord_log_templates (id, deleted_at, created_at, updated_at, type, content) VALUES
('d511ac81-e098-44a3-8712-3e0cbfa57386', null, '2023-05-09 06:25:33.019333', '2023-05-09 06:25:33.019333', 'employee_update_base_salary', '{{ employee_id }} update {{ updated_employee_id }} salary to new one: {{ new_salary }}.'),
('3fc86aaf-32ed-4c44-a100-69c6d1c43db5', null, '2023-05-09 06:25:18.021158', '2023-05-09 06:25:18.021158', 'employee_update_working_status', '{{ employee_id }} update {{ updated_employee_id }} working status to {{ working_status }}.'),
('a1de8a0a-4e91-45c4-b093-5f525b1adbda', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_add', '{{ employee_id }} add {{ updated_employee_id }} to project {{ project_name }} as {{ deployment_type }} deployment'),
('3ced7070-959f-408b-9155-00cdab019fab', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_remove', '{{ employee_id }} remove {{ updated_employee_id }} to project {{ project_name }}'),
('f6ed892e-5c3c-4bca-a738-9805e767084c', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'invoice_send', '{{ employee_id }} just sent invoice #{{ invoice_number }}.'),
('15bc0057-42df-4bca-9749-9e1a3a07970d', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'invoice_paid', 'Invoice #{{ invoice_number }} paid.'),
('9616d2bd-22d7-43b4-8a2a-067927b0d875', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_status', '{{ employee_id }} update {{ updated_employee_id }} project member status in {{ project_name }} to {{ status }}.'),
('a427c903-2932-408c-8f55-f7e0213a1432', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_charge_rate', '{{ employee_id }} update {{ updated_employee_id }} charge rate in {{ project_name }} to {{ rate }}.'),
('4a0c264a-0b90-48d7-b217-19d9a5d66bc7', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'payroll_commit', 'payroll batch.{{ batch_number }}-{{ month }}-{{ year }} is committed.'),
('b15fd037-ffac-407d-b878-10809236868f', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'employee_submit_onboarding_form', '{{ employee_id }} submit new employee onboarding form. '),
('cb2610ac-5c7d-45f7-8d71-50c815526a75', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_end_date', '{{ employee_id }} update {{ updated_employee_id }} end date in {{ project_name }} to {{ end_date }}.');
7 changes: 5 additions & 2 deletions migrations/seed/metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ INSERT INTO public.company_infos (id, deleted_at, created_at, updated_at, name,
-- ('25938962-611b-45ad-b6be-c0a1365ea1de', null, '2023-02-07 18:57:47.312554', '2023-02-07 18:57:47.312554', 'year_invoice_2023', 1),
-- ('10fa5046-199d-4d9a-bbf9-44345127be79', null, '2023-02-07 18:59:45.024935', '2023-02-07 18:59:45.024935', 'project_invoice_fortress_2023', 1);

INSERT INTO public.bank_accounts (id, deleted_at, created_at, updated_at, account_number, bank_name, currency_id, owner_name, address, swift_code, routing_number, name, uk_sort_code) VALUES
('fc6b1743-05c5-4152-9340-1d20d96d8fc0', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0999999888', 'ACB', '7037bdb6-584e-4e35-996d-ef28a243f48a', 'Dwarves Foundation', 'Hado Centrosa', 'AVBWFPW', null, 'DF Bank Account', null);
INSERT INTO public.bank_accounts (id, deleted_at, created_at, updated_at, account_number, bank_name, currency_id, owner_name, address, swift_code, routing_number, name, uk_sort_code, intermediary_bank_address, intermediary_bank_name) VALUES
('e447d23b-2786-4463-82e1-bbe139dd939f', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0394882818', 'Bank of America', 'f00498e4-7a4c-4f61-b126-b84b5faeee06', 'Lorem Ipsum Inc', '3629 Riverside Drive, Menlo, GA, 30731', 'DAKJFKSJD', '98149281', 'Lorem Ipsum Inc', '198249-231', 'Intermediary Bank Address', 'Intermediary Bank Name'),
('fc6b1743-05c5-4152-9340-1d20d96d8fc0', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0999999888', 'ACB', 'bf256e69-28b0-4d9f-bf48-3662854157a9', 'Dwarves Foundation', 'Hado Centrosa', 'AVBWFPW', null, 'DF Bank Account', null, 'Intermediary Bank Address', 'Intermediary Bank Name');




Loading

0 comments on commit 71ff0f0

Please sign in to comment.