200 lines
No EOL
5.4 KiB
Thrift
200 lines
No EOL
5.4 KiB
Thrift
namespace go biz.core.structs
|
|
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
// Please don't mix DTO and DAO !
|
|
// This design is intended to be as-is.
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
|
|
enum RoleType {
|
|
UNKNOWN = 0
|
|
SYSTEM = 1
|
|
USER = 2
|
|
|
|
WP_OWNER = 100
|
|
WP_ADMIN = 110
|
|
}
|
|
|
|
struct Role {
|
|
1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
|
|
5: string displayName (go.tag = "core_v1_dto:\"required\"")
|
|
6: RoleType roleType (go.tag = "core_v1_dto:\"required\"")
|
|
|
|
// user that create this role
|
|
39: optional User creator (go.tag = "gorm:\"foreignKey:id;references:id;\"")
|
|
// users with this role
|
|
40: optional list<User> users (go.tag = "gorm:\"many2many:user_roles;foreignKey:id;references:id;\"")
|
|
// wajib pajak bound with this role
|
|
41: optional list<WajibPajak> wajibPajakList (go.tag = "gorm:\"many2many:wp_roles;foreignKey:id;references:id\"")
|
|
}
|
|
|
|
//@direct
|
|
struct User {
|
|
1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
2: string username (go.tag = "core_v1_dto:\"required\" gorm:\"index\"")
|
|
3: string password (go.tag = "core_v1_dto:\"required\"")
|
|
4: string displayName (go.tag = "core_v1_dto:\"required\"")
|
|
|
|
60: binary privateKey
|
|
61: binary publicKey
|
|
|
|
// system roles
|
|
40: optional list<Role> roles (go.tag = "gorm:\"many2many:user_roles;foreignKey:id;references:id;\"")
|
|
// wp owned by user
|
|
45: optional list<WajibPajak> ownedWajibPajakList (go.tag = "gorm:\"many2many:user_wps;foreignKey:id;references:id;constraint:OnDelete:CASCADE\"")
|
|
// wp roles roles owned by user
|
|
50: optional list<Role> rolesWajibPajakList (go.tag = "gorm:\"many2many:wp_roles;foreignKey:id;references:id;\"")
|
|
|
|
}
|
|
|
|
|
|
//@direct
|
|
// struct JenisPajakXX {
|
|
// 1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
// 2: string displayName (go.tag = "core_v1_dto:\"required\"")
|
|
// }
|
|
|
|
enum JenisPajak {
|
|
UNKNOWN = 0
|
|
PPH_21 = 1
|
|
PPH_23 = 2
|
|
PPH_25 = 3
|
|
PPH_26 = 4
|
|
PPH_4_2 = 5
|
|
PPH_15 = 6
|
|
PPN = 7
|
|
TAHUNAN = 8
|
|
}
|
|
|
|
|
|
struct WajibPajakProfile {
|
|
// 1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
2: string npwp (go.tag = "core_v1_dto:\"required\"")
|
|
3: string displayName (go.tag = "core_v1_dto:\"required\"")
|
|
4: string address (go.tag = "core_v1_dto:\"required\"")
|
|
}
|
|
|
|
struct WajibPajakTaxObligation {
|
|
1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
2: JenisPajak obligation (go.tag = "gorm:\"foreignKey:id;references:id\"")
|
|
3: bool isActive (go.tag = "")
|
|
}
|
|
|
|
//@direct
|
|
struct WajibPajak {
|
|
1: i64 id (go.tag = "gorm:\"primaryKey\"")
|
|
2: WajibPajakProfile profile (go.tag = "gorm:\"embedded;embeddedPrefix:profile_;constraint:OnDelete:CASCADE\" core_v1_dto:\"required\"")
|
|
|
|
// wajib pajak owner
|
|
30: list<User> owners (go.tag = "gorm:\"many2many:wp_roles;foreignKey:id;references:id;\"")
|
|
|
|
// wajib pajak tax obligations
|
|
40: optional list<WajibPajakTaxObligation> taxObligations (go.tag = "gorm:\"many2many:wp_obligations;foreignKey:id;references:id;\"")
|
|
// role bound to this WajibPajak
|
|
45: optional list<Role> roles (go.tag = "gorm:\"many2many:wp_roles;foreignKey:id;references:id;constraint:OnDelete:CASCADE\"")
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
struct Pagination {
|
|
1: i64 page
|
|
2: i64 rowsPerPage
|
|
}
|
|
|
|
struct AlertInfo {
|
|
1: string title
|
|
2: string description
|
|
}
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
struct LoginRequest {
|
|
1: string username (go.tag = "core_v1_dto:\"required\"")
|
|
2: string password (go.tag = "core_v1_dto:\"required\"")
|
|
}
|
|
struct LoginResponse {
|
|
1: string trkToken
|
|
2: string token
|
|
10: optional User profile
|
|
}
|
|
|
|
struct LogoutRequest {
|
|
1: string token (go.tag = "core_v1_dto:\"required\"")
|
|
}
|
|
struct LogoutResponse {
|
|
}
|
|
|
|
struct GetProfileRequest {
|
|
}
|
|
struct GetProfileResponse {
|
|
2: User profile
|
|
}
|
|
|
|
enum WajibPajakOwnership {
|
|
UNKNOWN = 0
|
|
OWNED = 1
|
|
ROLE = 2
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct GetUserListRequest {
|
|
1: Pagination pagination
|
|
3: string searchTerm
|
|
}
|
|
struct GetUserListResponse {
|
|
1: Pagination pagination
|
|
2: i64 totalUsers
|
|
3: list<User> users
|
|
}
|
|
|
|
struct CreateUserRequest {
|
|
1: User user
|
|
}
|
|
struct CreateUserResponse {
|
|
}
|
|
|
|
struct DeleteUsersRequest {
|
|
1: list<i64> userIds
|
|
}
|
|
struct DeleteUsersResponse {
|
|
1: list<i64> success
|
|
2: list<i64> ignored
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct GetWajibPajakListRequest {
|
|
1: Pagination pagination
|
|
2: WajibPajakOwnership ownership
|
|
3: string searchTerm
|
|
}
|
|
struct GetWajibPajakListResponse {
|
|
1: Pagination pagination
|
|
2: i64 totalWajibPajak
|
|
3: list<WajibPajak> wajibPajakList
|
|
}
|
|
|
|
|
|
struct CreateWajibPajakRequest {
|
|
1: WajibPajak wajibPajak (go.tag = "core_v1_dto:\"required\"")
|
|
}
|
|
struct CreateWajibPajakResponse {
|
|
}
|
|
|
|
|
|
struct DeleteWajibpajakListRequest {
|
|
1: list<i64> wpIds
|
|
}
|
|
struct DeleteWajibpajakListResponse {
|
|
1: list<i64> success
|
|
2: list<i64> ignored
|
|
} |