diff --git a/api/internals/domain/buy_repost.go b/api/internals/domain/buy_repost.go new file mode 100644 index 000000000..b66acd45d --- /dev/null +++ b/api/internals/domain/buy_repost.go @@ -0,0 +1,15 @@ +package domain + +import ( + "time" +) + +type BuyReport struct { + ID int `json:"id"` + FestivalItemID int `json:"festivalItemId"` + Amount int `json:"amount"` + Memo string `json:"memo"` + PaidBy string `json:"paidBy"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/buy_status.go b/api/internals/domain/buy_status.go new file mode 100644 index 000000000..752422978 --- /dev/null +++ b/api/internals/domain/buy_status.go @@ -0,0 +1,14 @@ +package domain + +import ( + "time" +) + +type BuyStatus struct { + ID int `json:"id"` + BuyReportID int `json:"buyReportId"` + IsPacked bool `json:"isPacked"` + IsSettled bool `json:"isSettled"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/division.go b/api/internals/domain/division.go new file mode 100644 index 000000000..e7d51198d --- /dev/null +++ b/api/internals/domain/division.go @@ -0,0 +1,13 @@ +package domain + +import ( + "time" +) + +type Division struct { + ID int `json:"id"` + Name string `json:"name"` + FinancialRecordId int `json:"financialRecordId"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/festival_item.go b/api/internals/domain/festival_item.go new file mode 100644 index 000000000..ea25ea61e --- /dev/null +++ b/api/internals/domain/festival_item.go @@ -0,0 +1,14 @@ +package domain + +import ( + "time" +) + +type FestivalItem struct { + ID int `json:"id"` + Name string `json:"name"` + Memo string `json:"memo"` + DivisionID int `json:"divisionId"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/financial_record.go b/api/internals/domain/financial_record.go new file mode 100644 index 000000000..9eeb96df4 --- /dev/null +++ b/api/internals/domain/financial_record.go @@ -0,0 +1,13 @@ +package domain + +import ( + "time" +) + +type FinancialRecord struct { + ID int `json:"id"` + Name string `json:"name"` + YearID int `json:"yearId"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/item_budget.go b/api/internals/domain/item_budget.go new file mode 100644 index 000000000..e8159c7b5 --- /dev/null +++ b/api/internals/domain/item_budget.go @@ -0,0 +1,13 @@ +package domain + +import ( + "time" +) + +type ItemBudget struct { + ID int `json:"id"` + Amount int `json:"amount"` + FestivalItemID int `json:"festivalItemId"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/payment_receipt.go b/api/internals/domain/payment_receipt.go new file mode 100644 index 000000000..c6164f4b3 --- /dev/null +++ b/api/internals/domain/payment_receipt.go @@ -0,0 +1,16 @@ +package domain + +import ( + "time" +) + +type PaymentReceipt struct { + ID int `json:"id"` + BuyReportID int `json:"buyReportId"` + BucketName string `json:"bucketName"` + FileName string `json:"fileName"` + FileType string `json:"fileType"` + Remark string `json:"remark"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/api/internals/domain/user_group.go b/api/internals/domain/user_group.go new file mode 100644 index 000000000..94f218de8 --- /dev/null +++ b/api/internals/domain/user_group.go @@ -0,0 +1,13 @@ +package domain + +import ( + "time" +) + +type UserGroup struct { + ID int `json:"id"` + UserID int `json:"userId"` + GroupID int `json:"groupId"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} diff --git a/mysql/db/years.sql b/mysql/db/01_years.sql similarity index 100% rename from mysql/db/years.sql rename to mysql/db/01_years.sql diff --git a/mysql/db/users.sql b/mysql/db/02_users.sql similarity index 100% rename from mysql/db/users.sql rename to mysql/db/02_users.sql diff --git a/mysql/db/03_financial_records.sql b/mysql/db/03_financial_records.sql new file mode 100644 index 000000000..4b8f18de6 --- /dev/null +++ b/mysql/db/03_financial_records.sql @@ -0,0 +1,11 @@ +USE finansu_db; + +CREATE TABLE financial_records ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + year_id INT(10) UNSIGNED NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY year_id_foreign_key (year_id) REFERENCES years (id) +); diff --git a/mysql/db/04_divisions.sql b/mysql/db/04_divisions.sql new file mode 100644 index 000000000..ddcbb4e79 --- /dev/null +++ b/mysql/db/04_divisions.sql @@ -0,0 +1,11 @@ +USE finansu_db; + +CREATE TABLE divisions ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + financial_record_id INT(10) UNSIGNED NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY financial_record_id_foreign_key (financial_record_id) REFERENCES financial_records (id) +); diff --git a/mysql/db/05_festival_items.sql b/mysql/db/05_festival_items.sql new file mode 100644 index 000000000..395ca18aa --- /dev/null +++ b/mysql/db/05_festival_items.sql @@ -0,0 +1,12 @@ +USE finansu_db; + +CREATE TABLE festival_items ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + memo VARCHAR(255), + division_id INT(10) UNSIGNED NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY division_id_foreign_key (division_id) REFERENCES divisions (id) +); diff --git a/mysql/db/06_item_budgets.sql b/mysql/db/06_item_budgets.sql new file mode 100644 index 000000000..731c004f6 --- /dev/null +++ b/mysql/db/06_item_budgets.sql @@ -0,0 +1,11 @@ +USE finansu_db; + +CREATE TABLE item_budgets ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + amount INT(10) NOT NULL, + festival_item_id INT(10) UNSIGNED NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY festival_item_id_foreign_key (festival_item_id) REFERENCES festival_items (id) +); diff --git a/mysql/db/07_user_groups.sql b/mysql/db/07_user_groups.sql new file mode 100644 index 000000000..a55b3fb00 --- /dev/null +++ b/mysql/db/07_user_groups.sql @@ -0,0 +1,12 @@ +USE finansu_db; + +CREATE TABLE user_groups ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + user_id INT(10) UNSIGNED NOT NULL, + group_id INT(10) UNSIGNED NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY user_id_foreign_key (user_id) REFERENCES users (id), + FOREIGN KEY group_id_foreign_key (group_id) REFERENCES divisions (id) +); diff --git a/mysql/db/08_buy_reports.sql b/mysql/db/08_buy_reports.sql new file mode 100644 index 000000000..b3710f7bc --- /dev/null +++ b/mysql/db/08_buy_reports.sql @@ -0,0 +1,13 @@ +USE finansu_db; + +CREATE TABLE buy_reports ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + festival_item_id INT(10) UNSIGNED NOT NULL, + amount INT(10) NOT NULL, + memo VARCHAR(255) NOT NULL, + paid_by VARCHAR(255) NOT NULL, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY festival_item_id_foreign_key (festival_item_id) REFERENCES festival_items (id) +); diff --git a/mysql/db/09_payment_receipts.sql b/mysql/db/09_payment_receipts.sql new file mode 100644 index 000000000..993b2315b --- /dev/null +++ b/mysql/db/09_payment_receipts.sql @@ -0,0 +1,14 @@ +USE finansu_db; + +CREATE TABLE payment_receipts ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + buy_report_id INT(10) UNSIGNED NOT NULL, + bucket_name VARCHAR(255) NOT NULL, + file_name VARCHAR(255) NOT NULL, + file_type VARCHAR(255) NOT NULL, + remark VARCHAR(255), + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY buy_report_id_foreign_key (buy_report_id) REFERENCES buy_reports (id) +); diff --git a/mysql/db/10_buy_statuses.sql b/mysql/db/10_buy_statuses.sql new file mode 100644 index 000000000..17fc9c0dd --- /dev/null +++ b/mysql/db/10_buy_statuses.sql @@ -0,0 +1,12 @@ +USE finansu_db; + +CREATE TABLE buy_statuses ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + buy_report_id INT(10) UNSIGNED NOT NULL, + is_packed BOOLEAN NOT NULL DEFAULT FALSE, + is_settled BOOLEAN NOT NULL DEFAULT FALSE, + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY buy_report_id_foreign_key (buy_report_id) REFERENCES buy_reports (id) +);