64 lines
1.4 KiB
Plaintext
64 lines
1.4 KiB
Plaintext
scalar Money (
|
|
goImport: "example.com/composition/internal/amount"
|
|
goType: Money
|
|
jsonInput: string
|
|
jsonOutput: string
|
|
)
|
|
|
|
type SalaryFields {
|
|
// Employee display name.
|
|
Name *string `json:"name,optional" binding:"max=80"`
|
|
Salary *Money `json:"salary,optional"`
|
|
Employer *Money `json:"employer,optional"`
|
|
Enabled *bool `json:"enabled,optional"`
|
|
Labels []string `json:"labels,optional"`
|
|
}
|
|
|
|
type EnterpriseRequest {
|
|
SalaryFields
|
|
}
|
|
type TenantRequest {
|
|
SalaryFields
|
|
CompanyID string `path:"companyId"`
|
|
}
|
|
type AdminRequest {
|
|
SalaryFields
|
|
CompanyID string `path:"companyId"`
|
|
}
|
|
type EmployeeResponse {
|
|
ID string `json:"id"`
|
|
EmployeeName string `json:"employeeName"`
|
|
Salary Money `json:"salary"`
|
|
Employer *Money `json:"employer"`
|
|
Enabled bool `json:"enabled"`
|
|
Labels []string `json:"labels"`
|
|
}
|
|
|
|
@server (
|
|
group: enterprise
|
|
middleware: Access
|
|
response: raw
|
|
)
|
|
service composition {
|
|
@handler save
|
|
post /enterprise (EnterpriseRequest) returns (EmployeeResponse)
|
|
}
|
|
@server (
|
|
group: tenant
|
|
middleware: Access
|
|
response: raw
|
|
)
|
|
service composition {
|
|
@handler save
|
|
post /tenant/:companyId (TenantRequest) returns (EmployeeResponse)
|
|
}
|
|
@server (
|
|
group: admin
|
|
middleware: Access
|
|
response: raw
|
|
)
|
|
service composition {
|
|
@handler save
|
|
post /admin/:companyId (AdminRequest) returns (EmployeeResponse)
|
|
}
|