Skip to content

Commit

Permalink
Merge branch 'release/v1.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
namnhce committed Sep 19, 2024
2 parents d36c1cf + 9d271f7 commit e5db5f0
Show file tree
Hide file tree
Showing 23 changed files with 587 additions and 13 deletions.
107 changes: 107 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,64 @@ const docTemplate = `{
}
}
},
"/discords/office-checkin": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "OfficeCheckIn for employee",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Employee"
],
"summary": "OfficeCheckIn for employee",
"operationId": "OfficeCheckIn",
"parameters": [
{
"description": "OfficeCheckIn Request",
"name": "Body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CheckInRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CheckInResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/discords/research-topics": {
"get": {
"description": "Get list of research topics on discord",
Expand Down Expand Up @@ -7696,6 +7754,40 @@ const docTemplate = `{
}
}
},
"CheckInRequest": {
"type": "object",
"required": [
"check_ins"
],
"properties": {
"check_ins": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn"
}
}
}
},
"CheckInResponse": {
"type": "object",
"properties": {
"discordID": {
"type": "string"
},
"err": {
"type": "string"
},
"icyAmount": {
"type": "number"
},
"transactionHash": {
"type": "string"
},
"transactionID": {
"type": "string"
}
}
},
"CheckSalaryAdvance": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -13244,6 +13336,21 @@ const docTemplate = `{
"WorkingStatusContractor"
]
},
"github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn": {
"type": "object",
"required": [
"discord_id",
"time"
],
"properties": {
"discord_id": {
"type": "string"
},
"time": {
"type": "string"
}
}
},
"github_com_dwarvesf_fortress-api_pkg_model.SortOrder": {
"type": "string",
"enum": [
Expand Down
107 changes: 107 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,64 @@
}
}
},
"/discords/office-checkin": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "OfficeCheckIn for employee",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Employee"
],
"summary": "OfficeCheckIn for employee",
"operationId": "OfficeCheckIn",
"parameters": [
{
"description": "OfficeCheckIn Request",
"name": "Body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CheckInRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CheckInResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/discords/research-topics": {
"get": {
"description": "Get list of research topics on discord",
Expand Down Expand Up @@ -7689,6 +7747,40 @@
}
}
},
"CheckInRequest": {
"type": "object",
"required": [
"check_ins"
],
"properties": {
"check_ins": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn"
}
}
}
},
"CheckInResponse": {
"type": "object",
"properties": {
"discordID": {
"type": "string"
},
"err": {
"type": "string"
},
"icyAmount": {
"type": "number"
},
"transactionHash": {
"type": "string"
},
"transactionID": {
"type": "string"
}
}
},
"CheckSalaryAdvance": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -13237,6 +13329,21 @@
"WorkingStatusContractor"
]
},
"github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn": {
"type": "object",
"required": [
"discord_id",
"time"
],
"properties": {
"discord_id": {
"type": "string"
},
"time": {
"type": "string"
}
}
},
"github_com_dwarvesf_fortress-api_pkg_model.SortOrder": {
"type": "string",
"enum": [
Expand Down
69 changes: 69 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,28 @@ definitions:
$ref: '#/definitions/Chapter'
type: array
type: object
CheckInRequest:
properties:
check_ins:
items:
$ref: '#/definitions/github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn'
type: array
required:
- check_ins
type: object
CheckInResponse:
properties:
discordID:
type: string
err:
type: string
icyAmount:
type: number
transactionHash:
type: string
transactionID:
type: string
type: object
CheckSalaryAdvance:
properties:
amountICY:
Expand Down Expand Up @@ -4266,6 +4288,16 @@ definitions:
- WorkingStatusProbation
- WorkingStatusFullTime
- WorkingStatusContractor
github_com_dwarvesf_fortress-api_pkg_handler_employee_request.CheckIn:
properties:
discord_id:
type: string
time:
type: string
required:
- discord_id
- time
type: object
github_com_dwarvesf_fortress-api_pkg_model.SortOrder:
enum:
- asc
Expand Down Expand Up @@ -5381,6 +5413,43 @@ paths:
summary: List earn transactions of employee
tags:
- Employee
/discords/office-checkin:
post:
consumes:
- application/json
description: OfficeCheckIn for employee
operationId: OfficeCheckIn
parameters:
- description: OfficeCheckIn Request
in: body
name: Body
required: true
schema:
$ref: '#/definitions/CheckInRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/CheckInResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ErrorResponse'
security:
- BearerAuth: []
summary: OfficeCheckIn for employee
tags:
- Employee
/discords/research-topics:
get:
consumes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

-- +migrate Up
CREATE TABLE physical_checkin_transactions (
id uuid PRIMARY KEY DEFAULT (uuid()),
employee_id UUID REFERENCES employees(id) NOT NULL,
date DATE NOT NULL,
icy_amount FLOAT8 DEFAULT 0.0,
mochi_tx_id INTEGER
);
-- add unique constraint
CREATE UNIQUE INDEX physical_checkin_transactions_employee_id_date_idx ON physical_checkin_transactions(employee_id, date);


-- +migrate Down
DROP TABLE physical_checkin_transactions;


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

-- +migrate Up
ALTER TABLE physical_checkins DROP CONSTRAINT physical_checkins_pkey;
ALTER TABLE physical_checkins DROP COLUMN id;
ALTER TABLE physical_checkins ADD COLUMN id uuid PRIMARY KEY DEFAULT (uuid());
ALTER TABLE discord_checkins DROP CONSTRAINT discord_checkins_pkey;
ALTER TABLE discord_checkins DROP COLUMN id;
ALTER TABLE discord_checkins ADD COLUMN id uuid PRIMARY KEY DEFAULT (uuid());

-- +migrate Down
ALTER TABLE physical_checkins DROP CONSTRAINT physical_checkins_pkey;
ALTER TABLE physical_checkins ADD COLUMN id SERIAL PRIMARY KEY;
ALTER TABLE discord_checkins DROP CONSTRAINT discord_checkins_pkey;
ALTER TABLE discord_checkins ADD COLUMN id SERIAL PRIMARY KEY;
3 changes: 2 additions & 1 deletion migrations/seed/permissions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ INSERT INTO public.permissions (id, deleted_at, created_at, updated_at, name, co
('fea2497c-694d-43d7-82cd-764d622a6706', null, '2023-07-26 16:35:12.475872', '2023-07-26 16:35:12.475872', 'Delivery Metrics Sync', 'deliveryMetrics.sync'),
('b4edad19-3e30-4e86-bd6e-07f535011aaf', null, '2023-07-26 16:35:12.475872', '2023-07-26 16:35:12.475872', 'Employee Discord Read', 'employees.discord.read'),
('1641106e-9a94-42fa-80e0-9d6978cd3596', null, '2024-05-29 15:41:12.475872', '2024-05-29 15:41:12.475872', 'Employee Discord Edit','employees.discord.edit'),
('b069e35c-1144-4554-9854-ff529506d4e5', null, '2024-05-29 15:41:12.475872', '2024-05-29 15:41:12.475872', 'Employee Discord Create','employees.discord.create');
('b069e35c-1144-4554-9854-ff529506d4e5', null, '2024-05-29 15:41:12.475872', '2024-05-29 15:41:12.475872', 'Employee Discord Create','employees.discord.create'),
('f84e4e32-b104-4e9c-9694-b1a86e90ec25', null, '2024-09-19 15:41:12.475872', '2024-09-19 15:41:12.475872', 'Transfer Check-in Icy','employees.transferCheckinIcy.fullAccess');
Loading

0 comments on commit e5db5f0

Please sign in to comment.